@@ -332,34 +332,23 @@ enum class LFRRequirement : bool {
332332 kMatchingLFR ,
333333};
334334
335- enum class HugePageFillerDenseTrackerType : bool {
336- // Hugepages sorted on longest free range and chunk index. This is currently
337- // the default.
338- kLongestFreeRangeAndChunks ,
339- // Hugepages sorted only on number of spans allocated. As we allocate
340- // single-page many-object spans, we do not sort hugepages on longest free
341- // range when this configuration is used.
342- kSpansAllocated ,
343- };
344-
345335// This tracks a set of unfilled hugepages, and fulfills allocations
346336// with a goal of filling some hugepages as tightly as possible and emptying
347337// out the remainder.
348338template <class TrackerType >
349339class HugePageFiller {
350340 public:
351341 explicit HugePageFiller (
352- HugePageFillerDenseTrackerType dense_tracker_type,
353342 HugePageFillerSparseTrackerType sparse_tracker_type,
354343 MemoryModifyFunction& unback ABSL_ATTRIBUTE_LIFETIME_BOUND,
355344 MemoryModifyFunction& unback_without_lock ABSL_ATTRIBUTE_LIFETIME_BOUND,
356345 MemoryModifyFunction& collapse ABSL_ATTRIBUTE_LIFETIME_BOUND);
357- HugePageFiller (Clock clock, HugePageFillerDenseTrackerType dense_tracker_type,
358- HugePageFillerSparseTrackerType sparse_tracker_type,
359- MemoryModifyFunction& unback ABSL_ATTRIBUTE_LIFETIME_BOUND ,
360- MemoryModifyFunction& unback_without_lock
361- ABSL_ATTRIBUTE_LIFETIME_BOUND,
362- MemoryModifyFunction& collapse ABSL_ATTRIBUTE_LIFETIME_BOUND);
346+
347+ HugePageFiller (
348+ Clock clock, HugePageFillerSparseTrackerType sparse_tracker_type ,
349+ MemoryModifyFunction& unback ABSL_ATTRIBUTE_LIFETIME_BOUND,
350+ MemoryModifyFunction& unback_without_lock ABSL_ATTRIBUTE_LIFETIME_BOUND,
351+ MemoryModifyFunction& collapse ABSL_ATTRIBUTE_LIFETIME_BOUND);
363352
364353 typedef TrackerType Tracker;
365354
@@ -580,7 +569,6 @@ class HugePageFiller {
580569 // n_used_partial_released_ is the number of pages which have been allocated
581570 // from the hugepages in the set regular_alloc_partial_released.
582571 Length n_used_partial_released_[AccessDensityPrediction::kPredictionCounts ];
583- const HugePageFillerDenseTrackerType dense_tracker_type_;
584572 const HugePageFillerSparseTrackerType sparse_tracker_type_;
585573
586574 // RemoveFromFillerList pt from the appropriate PageTrackerList.
@@ -797,24 +785,21 @@ inline Length PageTracker::free_pages() const {
797785
798786template <class TrackerType >
799787inline HugePageFiller<TrackerType>::HugePageFiller(
800- HugePageFillerDenseTrackerType dense_tracker_type,
801788 HugePageFillerSparseTrackerType sparse_tracker_type,
802789 MemoryModifyFunction& unback, MemoryModifyFunction& unback_without_lock,
803790 MemoryModifyFunction& collapse)
804791 : HugePageFiller(Clock{.now = absl::base_internal::CycleClock::Now,
805792 .freq = absl::base_internal::CycleClock::Frequency},
806- dense_tracker_type, sparse_tracker_type, unback,
807- unback_without_lock, collapse) {}
793+ sparse_tracker_type, unback, unback_without_lock ,
794+ collapse) {}
808795
809796// For testing with mock clock
810797template <class TrackerType >
811798inline HugePageFiller<TrackerType>::HugePageFiller(
812- Clock clock, HugePageFillerDenseTrackerType dense_tracker_type,
813- HugePageFillerSparseTrackerType sparse_tracker_type,
799+ Clock clock, HugePageFillerSparseTrackerType sparse_tracker_type,
814800 MemoryModifyFunction& unback, MemoryModifyFunction& unback_without_lock,
815801 MemoryModifyFunction& collapse)
816- : dense_tracker_type_(dense_tracker_type),
817- sparse_tracker_type_ (sparse_tracker_type),
802+ : sparse_tracker_type_(sparse_tracker_type),
818803 size_ (NHugePages(0 )),
819804 fillerstats_tracker_(clock, absl::Minutes(10 ), absl::Minutes(5 )),
820805 clock_(clock),
@@ -826,9 +811,7 @@ template <class TrackerType>
826811inline typename HugePageFiller<TrackerType>::TryGetResult
827812HugePageFiller<TrackerType>::TryGet(Length n, SpanAllocInfo span_alloc_info) {
828813 TC_ASSERT_GT (n, Length (0 ));
829- TC_ASSERT (dense_tracker_type_ ==
830- HugePageFillerDenseTrackerType::kLongestFreeRangeAndChunks ||
831- span_alloc_info.density == AccessDensityPrediction::kSparse ||
814+ TC_ASSERT (span_alloc_info.density == AccessDensityPrediction::kSparse ||
832815 n == Length (1 ));
833816
834817 // How do we choose which hugepage to allocate from (among those with
@@ -2311,14 +2294,6 @@ template <class TrackerType>
23112294inline size_t HugePageFiller<TrackerType>::DenseListFor(const Length longest,
23122295 const size_t chunk,
23132296 size_t nallocs) const {
2314- if (ABSL_PREDICT_TRUE (
2315- dense_tracker_type_ ==
2316- HugePageFillerDenseTrackerType::kLongestFreeRangeAndChunks )) {
2317- TC_ASSERT_LT (longest, kPagesPerHugePage );
2318- return longest.raw_num () * kChunks + chunk;
2319- }
2320- TC_ASSERT (dense_tracker_type_ ==
2321- HugePageFillerDenseTrackerType::kSpansAllocated );
23222297 TC_ASSERT_LE (nallocs, kPagesPerHugePage .raw_num ());
23232298 // For the dense tracker with hugepages sorted on allocs, the hugepages are
23242299 // placed only in lists that are multiples of kChunks. The in-between lists
0 commit comments