summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-11-25 12:21:13 +0000
committerGeir Storli <geirst@yahooinc.com>2022-11-25 12:21:13 +0000
commit2e758530c2dfc2bc665a980da7b5c60d778e8a52 (patch)
tree399f3bede2ba3f39867e38306fff2812ded8324c /searchlib
parentc671a36ae0cd655c2efc38ee9882baa8354d660b (diff)
Add shared constant for PAGE_SIZE.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp3
-rw-r--r--searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp16
-rw-r--r--searchlib/src/vespa/searchlib/tensor/hnsw_nodeid_mapping.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/tensor/tensor_buffer_store.cpp4
4 files changed, 15 insertions, 11 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp
index 2456c57140c..aea7e57897f 100644
--- a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.hpp
@@ -16,7 +16,6 @@ namespace search {
namespace multivalueattribute {
-constexpr size_t SMALL_MEMORY_PAGE_SIZE = 4 * 1024;
constexpr bool enable_free_lists = true;
}
@@ -28,7 +27,7 @@ MultiValueAttribute(const vespalib::string &baseFileName,
: B(baseFileName, cfg),
_mvMapping(MultiValueMapping::optimizedConfigForHugePage(1023,
vespalib::alloc::MemoryAllocator::HUGEPAGE_SIZE,
- multivalueattribute::SMALL_MEMORY_PAGE_SIZE,
+ vespalib::alloc::MemoryAllocator::PAGE_SIZE,
8 * 1024,
cfg.getGrowStrategy().getMultiValueAllocGrowFactor(),
multivalueattribute::enable_free_lists),
diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp b/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp
index d6ad501391a..32087e0e731 100644
--- a/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp
@@ -33,8 +33,6 @@ using vespalib::datastore::EntryRef;
namespace {
-// TODO: Move this to MemoryAllocator, with name PAGE_SIZE.
-constexpr size_t small_page_size = 4_Ki;
constexpr size_t min_num_arrays_for_new_buffer = 512_Ki;
constexpr float alloc_grow_factor = 0.3;
// TODO: Adjust these numbers to what we accept as max in config.
@@ -67,16 +65,22 @@ template <HnswIndexType type>
vespalib::datastore::ArrayStoreConfig
HnswIndex<type>::make_default_node_store_config()
{
- return NodeStore::optimizedConfigForHugePage(max_level_array_size, vespalib::alloc::MemoryAllocator::HUGEPAGE_SIZE,
- small_page_size, min_num_arrays_for_new_buffer, alloc_grow_factor).enable_free_lists(true);
+ return NodeStore::optimizedConfigForHugePage(max_level_array_size,
+ vespalib::alloc::MemoryAllocator::HUGEPAGE_SIZE,
+ vespalib::alloc::MemoryAllocator::PAGE_SIZE,
+ min_num_arrays_for_new_buffer,
+ alloc_grow_factor).enable_free_lists(true);
}
template <HnswIndexType type>
vespalib::datastore::ArrayStoreConfig
HnswIndex<type>::make_default_link_store_config()
{
- return LinkStore::optimizedConfigForHugePage(max_link_array_size, vespalib::alloc::MemoryAllocator::HUGEPAGE_SIZE,
- small_page_size, min_num_arrays_for_new_buffer, alloc_grow_factor).enable_free_lists(true);
+ return LinkStore::optimizedConfigForHugePage(max_link_array_size,
+ vespalib::alloc::MemoryAllocator::HUGEPAGE_SIZE,
+ vespalib::alloc::MemoryAllocator::PAGE_SIZE,
+ min_num_arrays_for_new_buffer,
+ alloc_grow_factor).enable_free_lists(true);
}
template <HnswIndexType type>
diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_nodeid_mapping.cpp b/searchlib/src/vespa/searchlib/tensor/hnsw_nodeid_mapping.cpp
index 494bad79b8a..9983bf6d97b 100644
--- a/searchlib/src/vespa/searchlib/tensor/hnsw_nodeid_mapping.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/hnsw_nodeid_mapping.cpp
@@ -12,7 +12,6 @@ using vespalib::datastore::EntryRef;
namespace {
constexpr uint32_t max_small_array_type_id = 64;
-constexpr size_t small_page_size = 4_Ki;
constexpr size_t min_num_arrays_for_new_buffer = 512_Ki;
constexpr float alloc_grow_factor = 0.3;
@@ -48,7 +47,7 @@ HnswNodeidMapping::HnswNodeidMapping()
_nodeid_limit(1), // Starting with nodeid=1 matches that we also start with docid=1.
_nodeids(NodeidStore::optimizedConfigForHugePage(max_small_array_type_id,
vespalib::alloc::MemoryAllocator::HUGEPAGE_SIZE,
- small_page_size,
+ vespalib::alloc::MemoryAllocator::PAGE_SIZE,
min_num_arrays_for_new_buffer,
alloc_grow_factor).enable_free_lists(true), {}),
_hold_list(),
diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_buffer_store.cpp b/searchlib/src/vespa/searchlib/tensor/tensor_buffer_store.cpp
index 09d9ac7dd31..6c2ef698dc0 100644
--- a/searchlib/src/vespa/searchlib/tensor/tensor_buffer_store.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/tensor_buffer_store.cpp
@@ -34,7 +34,9 @@ TensorBufferStore::TensorBufferStore(const ValueType& tensor_type, std::shared_p
_ops(_tensor_type),
_array_store(ArrayStoreType::optimizedConfigForHugePage(max_small_subspaces_type_id,
TensorBufferTypeMapper(max_small_subspaces_type_id, &_ops),
- MemoryAllocator::HUGEPAGE_SIZE, 4_Ki, 8_Ki, ALLOC_GROW_FACTOR),
+ MemoryAllocator::HUGEPAGE_SIZE,
+ MemoryAllocator::PAGE_SIZE,
+ 8_Ki, ALLOC_GROW_FACTOR),
std::move(allocator), TensorBufferTypeMapper(max_small_subspaces_type_id, &_ops))
{
}