Skip to content

Commit 7cce2c6

Browse files
Panky-codeskawasaki
authored andcommitted
mm: rename huge_zero_page to huge_zero_folio
As we already moved from exposing huge_zero_page to huge_zero_folio, change the name of the shrinker and the other helper function to reflect that. No functional changes. Reviewed-by: Lorenzo Stoakes <[email protected]> Suggested-by: David Hildenbrand <[email protected]> Acked-by: David Hildenbrand <[email protected]> Signed-off-by: Pankaj Raghav <[email protected]>
1 parent 4c26e9a commit 7cce2c6

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

mm/huge_memory.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ unsigned long __thp_vma_allowable_orders(struct vm_area_struct *vma,
207207
return orders;
208208
}
209209

210-
static bool get_huge_zero_page(void)
210+
static bool get_huge_zero_folio(void)
211211
{
212212
struct folio *zero_folio;
213213
retry:
@@ -237,7 +237,7 @@ static bool get_huge_zero_page(void)
237237
return true;
238238
}
239239

240-
static void put_huge_zero_page(void)
240+
static void put_huge_zero_folio(void)
241241
{
242242
/*
243243
* Counter should never go to zero here. Only shrinker can put
@@ -251,30 +251,30 @@ struct folio *mm_get_huge_zero_folio(struct mm_struct *mm)
251251
if (test_bit(MMF_HUGE_ZERO_PAGE, &mm->flags))
252252
return READ_ONCE(huge_zero_folio);
253253

254-
if (!get_huge_zero_page())
254+
if (!get_huge_zero_folio())
255255
return NULL;
256256

257257
if (test_and_set_bit(MMF_HUGE_ZERO_PAGE, &mm->flags))
258-
put_huge_zero_page();
258+
put_huge_zero_folio();
259259

260260
return READ_ONCE(huge_zero_folio);
261261
}
262262

263263
void mm_put_huge_zero_folio(struct mm_struct *mm)
264264
{
265265
if (test_bit(MMF_HUGE_ZERO_PAGE, &mm->flags))
266-
put_huge_zero_page();
266+
put_huge_zero_folio();
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)