Skip to content

Commit c79a0b1

Browse files
Panky-codeskawasaki
authored andcommitted
mm: rename huge_zero_page_shrinker to huge_zero_folio_shrinker
As we already moved from exposing huge_zero_page to huge_zero_folio, change the name of the shrinker to reflect that. No functional changes. Suggested-by: David Hildenbrand <[email protected]> Acked-by: David Hildenbrand <[email protected]> Signed-off-by: Pankaj Raghav <[email protected]>
1 parent 28b3384 commit c79a0b1

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

mm/huge_memory.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,15 @@ void mm_put_huge_zero_folio(struct mm_struct *mm)
266266
put_huge_zero_page();
267267
}
268268

269-
static unsigned long shrink_huge_zero_page_count(struct shrinker *shrink,
270-
struct shrink_control *sc)
269+
static unsigned long shrink_huge_zero_folio_count(struct shrinker *shrink,
270+
struct shrink_control *sc)
271271
{
272272
/* we can free zero page only if last reference remains */
273273
return atomic_read(&huge_zero_refcount) == 1 ? HPAGE_PMD_NR : 0;
274274
}
275275

276-
static unsigned long shrink_huge_zero_page_scan(struct shrinker *shrink,
277-
struct shrink_control *sc)
276+
static unsigned long shrink_huge_zero_folio_scan(struct shrinker *shrink,
277+
struct shrink_control *sc)
278278
{
279279
if (atomic_cmpxchg(&huge_zero_refcount, 1, 0) == 1) {
280280
struct folio *zero_folio = xchg(&huge_zero_folio, NULL);
@@ -287,7 +287,7 @@ static unsigned long shrink_huge_zero_page_scan(struct shrinker *shrink,
287287
return 0;
288288
}
289289

290-
static struct shrinker *huge_zero_page_shrinker;
290+
static struct shrinker *huge_zero_folio_shrinker;
291291

292292
#ifdef CONFIG_SYSFS
293293
static ssize_t enabled_show(struct kobject *kobj,
@@ -849,22 +849,22 @@ static inline void hugepage_exit_sysfs(struct kobject *hugepage_kobj)
849849

850850
static int __init thp_shrinker_init(void)
851851
{
852-
huge_zero_page_shrinker = shrinker_alloc(0, "thp-zero");
853-
if (!huge_zero_page_shrinker)
852+
huge_zero_folio_shrinker = shrinker_alloc(0, "thp-zero");
853+
if (!huge_zero_folio_shrinker)
854854
return -ENOMEM;
855855

856856
deferred_split_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE |
857857
SHRINKER_MEMCG_AWARE |
858858
SHRINKER_NONSLAB,
859859
"thp-deferred_split");
860860
if (!deferred_split_shrinker) {
861-
shrinker_free(huge_zero_page_shrinker);
861+
shrinker_free(huge_zero_folio_shrinker);
862862
return -ENOMEM;
863863
}
864864

865-
huge_zero_page_shrinker->count_objects = shrink_huge_zero_page_count;
866-
huge_zero_page_shrinker->scan_objects = shrink_huge_zero_page_scan;
867-
shrinker_register(huge_zero_page_shrinker);
865+
huge_zero_folio_shrinker->count_objects = shrink_huge_zero_folio_count;
866+
huge_zero_folio_shrinker->scan_objects = shrink_huge_zero_folio_scan;
867+
shrinker_register(huge_zero_folio_shrinker);
868868

869869
deferred_split_shrinker->count_objects = deferred_split_count;
870870
deferred_split_shrinker->scan_objects = deferred_split_scan;
@@ -875,7 +875,7 @@ static int __init thp_shrinker_init(void)
875875

876876
static void __init thp_shrinker_exit(void)
877877
{
878-
shrinker_free(huge_zero_page_shrinker);
878+
shrinker_free(huge_zero_folio_shrinker);
879879
shrinker_free(deferred_split_shrinker);
880880
}
881881

0 commit comments

Comments
 (0)