Skip to content

Commit 2516a87

Browse files
committed
Merge tag 'mm-stable-2025-12-11-11-39' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull more MM updates from Andrew Morton: - "powerpc/pseries/cmm: two smaller fixes" (David Hildenbrand) fixes a couple of minor things in ppc land - "Improve folio split related functions" (Zi Yan) some cleanups and minorish fixes in the folio splitting code * tag 'mm-stable-2025-12-11-11-39' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm/damon/tests/core-kunit: avoid damos_test_commit stack warning mm: vmscan: correct nr_requested tracing in scan_folios MAINTAINERS: add idr core-api doc file to XARRAY mm/hugetlb: fix incorrect error return from hugetlb_reserve_pages() mm: fix CONFIG_STACK_GROWSUP typo in mm.h mm/huge_memory: fix folio split stats counting mm/huge_memory: make min_order_for_split() always return an order mm/huge_memory: replace can_split_folio() with direct refcount calculation mm/huge_memory: change folio_split_supported() to folio_check_splittable() mm/sparse: fix sparse_vmemmap_init_nid_early definition without CONFIG_SPARSEMEM powerpc/pseries/cmm: adjust BALLOON_MIGRATE when migrating pages powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION
2 parents d2ea4d2 + dafdba0 commit 2516a87

9 files changed

Lines changed: 131 additions & 97 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28321,6 +28321,7 @@ M: Matthew Wilcox <willy@infradead.org>
2832128321
L: linux-fsdevel@vger.kernel.org
2832228322
L: linux-mm@kvack.org
2832328323
S: Supported
28324+
F: Documentation/core-api/idr.rst
2832428325
F: Documentation/core-api/xarray.rst
2832528326
F: include/linux/idr.h
2832628327
F: include/linux/xarray.h

arch/powerpc/platforms/pseries/cmm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ static int cmm_migratepage(struct balloon_dev_info *b_dev_info,
532532

533533
spin_lock_irqsave(&b_dev_info->pages_lock, flags);
534534
balloon_page_insert(b_dev_info, newpage);
535+
__count_vm_event(BALLOON_MIGRATE);
535536
b_dev_info->isolated_pages--;
536537
spin_unlock_irqrestore(&b_dev_info->pages_lock, flags);
537538

@@ -550,7 +551,6 @@ static int cmm_migratepage(struct balloon_dev_info *b_dev_info,
550551

551552
static void cmm_balloon_compaction_init(void)
552553
{
553-
balloon_devinfo_init(&b_dev_info);
554554
b_dev_info.migratepage = cmm_migratepage;
555555
}
556556
#else /* CONFIG_BALLOON_COMPACTION */
@@ -572,6 +572,7 @@ static int cmm_init(void)
572572
if (!firmware_has_feature(FW_FEATURE_CMO) && !simulate)
573573
return -EOPNOTSUPP;
574574

575+
balloon_devinfo_init(&b_dev_info);
575576
cmm_balloon_compaction_init();
576577

577578
rc = register_oom_notifier(&cmm_oom_nb);

include/linux/huge_mm.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,13 @@ enum split_type {
369369
SPLIT_TYPE_NON_UNIFORM,
370370
};
371371

372-
bool can_split_folio(struct folio *folio, int caller_pins, int *pextra_pins);
373372
int __split_huge_page_to_list_to_order(struct page *page, struct list_head *list,
374373
unsigned int new_order);
375374
int folio_split_unmapped(struct folio *folio, unsigned int new_order);
376-
int min_order_for_split(struct folio *folio);
375+
unsigned int min_order_for_split(struct folio *folio);
377376
int split_folio_to_list(struct folio *folio, struct list_head *list);
378-
bool folio_split_supported(struct folio *folio, unsigned int new_order,
379-
enum split_type split_type, bool warns);
377+
int folio_check_splittable(struct folio *folio, unsigned int new_order,
378+
enum split_type split_type);
380379
int folio_split(struct folio *folio, unsigned int new_order, struct page *page,
381380
struct list_head *list);
382381

@@ -407,7 +406,7 @@ static inline int split_huge_page_to_order(struct page *page, unsigned int new_o
407406
static inline int try_folio_split_to_order(struct folio *folio,
408407
struct page *page, unsigned int new_order)
409408
{
410-
if (!folio_split_supported(folio, new_order, SPLIT_TYPE_NON_UNIFORM, /* warns= */ false))
409+
if (folio_check_splittable(folio, new_order, SPLIT_TYPE_NON_UNIFORM))
411410
return split_huge_page_to_order(&folio->page, new_order);
412411
return folio_split(folio, new_order, page, NULL);
413412
}
@@ -631,10 +630,10 @@ static inline int split_huge_page(struct page *page)
631630
return -EINVAL;
632631
}
633632

634-
static inline int min_order_for_split(struct folio *folio)
633+
static inline unsigned int min_order_for_split(struct folio *folio)
635634
{
636635
VM_WARN_ON_ONCE_FOLIO(1, folio);
637-
return -EINVAL;
636+
return 0;
638637
}
639638

640639
static inline int split_folio_to_list(struct folio *folio, struct list_head *list)

include/linux/mm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ enum {
438438
#define VM_NOHUGEPAGE INIT_VM_FLAG(NOHUGEPAGE)
439439
#define VM_MERGEABLE INIT_VM_FLAG(MERGEABLE)
440440
#define VM_STACK INIT_VM_FLAG(STACK)
441-
#ifdef CONFIG_STACK_GROWS_UP
441+
#ifdef CONFIG_STACK_GROWSUP
442442
#define VM_STACK_EARLY INIT_VM_FLAG(STACK_EARLY)
443443
#else
444444
#define VM_STACK_EARLY VM_NONE

include/linux/mmzone.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2289,7 +2289,7 @@ void sparse_init(void);
22892289
#else
22902290
#define sparse_init() do {} while (0)
22912291
#define sparse_index_init(_sec, _nid) do {} while (0)
2292-
#define sparse_vmemmap_init_nid_early(_nid, _use) do {} while (0)
2292+
#define sparse_vmemmap_init_nid_early(_nid) do {} while (0)
22932293
#define sparse_vmemmap_init_nid_late(_nid) do {} while (0)
22942294
#define pfn_in_present_section pfn_valid
22952295
#define subsection_map_init(_pfn, _nr_pages) do {} while (0)

mm/damon/tests/core-kunit.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ static void damos_test_commit_for(struct kunit *test, struct damos *dst,
924924
}
925925
}
926926

927-
static void damos_test_commit(struct kunit *test)
927+
static void damos_test_commit_pageout(struct kunit *test)
928928
{
929929
damos_test_commit_for(test,
930930
&(struct damos){
@@ -945,6 +945,10 @@ static void damos_test_commit(struct kunit *test)
945945
DAMOS_WMARK_FREE_MEM_RATE,
946946
800, 50, 30},
947947
});
948+
}
949+
950+
static void damos_test_commit_migrate_hot(struct kunit *test)
951+
{
948952
damos_test_commit_for(test,
949953
&(struct damos){
950954
.pattern = (struct damos_access_pattern){
@@ -1230,7 +1234,8 @@ static struct kunit_case damon_test_cases[] = {
12301234
KUNIT_CASE(damos_test_commit_quota),
12311235
KUNIT_CASE(damos_test_commit_dests),
12321236
KUNIT_CASE(damos_test_commit_filter),
1233-
KUNIT_CASE(damos_test_commit),
1237+
KUNIT_CASE(damos_test_commit_pageout),
1238+
KUNIT_CASE(damos_test_commit_migrate_hot),
12341239
KUNIT_CASE(damon_test_commit_target_regions),
12351240
KUNIT_CASE(damos_test_filter_out),
12361241
KUNIT_CASE(damon_test_feed_loop_next_input),

0 commit comments

Comments
 (0)