Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION

Patch series "powerpc/pseries/cmm: two smaller fixes".

Two smaller fixes identified while doing a bigger rework.


This patch (of 2):

We always have to initialize the balloon_dev_info, even when compaction is
not configured in: otherwise the containing list and the lock are left
uninitialized.

Likely not many such configs exist in practice, but let's CC stable to
be sure.

This was found by code inspection.

Link: https://lkml.kernel.org/r/20251021100606.148294-1-david@redhat.com
Link: https://lkml.kernel.org/r/20251021100606.148294-2-david@redhat.com
Fixes: fe030c9b85e6 ("powerpc/pseries/cmm: Implement balloon compaction")
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

David Hildenbrand and committed by
Andrew Morton
fc6bcf9a faf3c923

+1 -1
+1 -1
arch/powerpc/platforms/pseries/cmm.c
··· 550 550 551 551 static void cmm_balloon_compaction_init(void) 552 552 { 553 - balloon_devinfo_init(&b_dev_info); 554 553 b_dev_info.migratepage = cmm_migratepage; 555 554 } 556 555 #else /* CONFIG_BALLOON_COMPACTION */ ··· 571 572 if (!firmware_has_feature(FW_FEATURE_CMO) && !simulate) 572 573 return -EOPNOTSUPP; 573 574 575 + balloon_devinfo_init(&b_dev_info); 574 576 cmm_balloon_compaction_init(); 575 577 576 578 rc = register_oom_notifier(&cmm_oom_nb);