linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes
@ 2025-10-21 10:06 David Hildenbrand
  2025-10-21 10:06 ` [PATCH v1 1/2] powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION David Hildenbrand
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: David Hildenbrand @ 2025-10-21 10:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, linuxppc-dev, David Hildenbrand, Andrew Morton,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy

Two smaller fixes identified while doing a bigger rework.

Compile-tested only as I don't have an easy way to test right now.

I would prefer for these patches to go through the MM tree as I will
be sending out a bigger version soon that is based on this series --
I split of the fixes from the other stuff.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>

David Hildenbrand (2):
  powerpc/pseries/cmm: call balloon_devinfo_init() also without
    CONFIG_BALLOON_COMPACTION
  powerpc/pseries/cmm: adjust BALLOON_MIGRATE when migrating pages

 arch/powerpc/platforms/pseries/cmm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


base-commit: 8841ba63f874d5dc05fc4beb47788406be96fd5c
-- 
2.51.0



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v1 1/2] powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION
  2025-10-21 10:06 [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes David Hildenbrand
@ 2025-10-21 10:06 ` David Hildenbrand
  2025-11-28  9:07   ` Ritesh Harjani
  2025-10-21 10:06 ` [PATCH v1 2/2] powerpc/pseries/cmm: adjust BALLOON_MIGRATE when migrating pages David Hildenbrand
  2025-11-26 15:40 ` [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes David Hildenbrand (Red Hat)
  2 siblings, 1 reply; 13+ messages in thread
From: David Hildenbrand @ 2025-10-21 10:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, linuxppc-dev, David Hildenbrand, Andrew Morton,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, stable

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.

Fixes: fe030c9b85e6 ("powerpc/pseries/cmm: Implement balloon compaction")
Cc: <stable@vger.kernel.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 arch/powerpc/platforms/pseries/cmm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
index 0823fa2da1516..688f5fa1c7245 100644
--- a/arch/powerpc/platforms/pseries/cmm.c
+++ b/arch/powerpc/platforms/pseries/cmm.c
@@ -550,7 +550,6 @@ static int cmm_migratepage(struct balloon_dev_info *b_dev_info,
 
 static void cmm_balloon_compaction_init(void)
 {
-	balloon_devinfo_init(&b_dev_info);
 	b_dev_info.migratepage = cmm_migratepage;
 }
 #else /* CONFIG_BALLOON_COMPACTION */
@@ -572,6 +571,7 @@ static int cmm_init(void)
 	if (!firmware_has_feature(FW_FEATURE_CMO) && !simulate)
 		return -EOPNOTSUPP;
 
+	balloon_devinfo_init(&b_dev_info);
 	cmm_balloon_compaction_init();
 
 	rc = register_oom_notifier(&cmm_oom_nb);
-- 
2.51.0



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v1 2/2] powerpc/pseries/cmm: adjust BALLOON_MIGRATE when migrating pages
  2025-10-21 10:06 [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes David Hildenbrand
  2025-10-21 10:06 ` [PATCH v1 1/2] powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION David Hildenbrand
@ 2025-10-21 10:06 ` David Hildenbrand
  2025-11-28 10:12   ` Ritesh Harjani
  2025-11-26 15:40 ` [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes David Hildenbrand (Red Hat)
  2 siblings, 1 reply; 13+ messages in thread
From: David Hildenbrand @ 2025-10-21 10:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, linuxppc-dev, David Hildenbrand, Andrew Morton,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, stable

Let's properly adjust BALLOON_MIGRATE like the other drivers.

Note that the INFLATE/DEFLATE events are triggered from the core when
enqueueing/dequeueing pages.

Not completely sure whether really is stable material, but the fix is
trivial so let's just CC stable.

This was found by code inspection.

Fixes: fe030c9b85e6 ("powerpc/pseries/cmm: Implement balloon compaction")
Cc: <stable@vger.kernel.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 arch/powerpc/platforms/pseries/cmm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
index 688f5fa1c7245..310dab4bc8679 100644
--- a/arch/powerpc/platforms/pseries/cmm.c
+++ b/arch/powerpc/platforms/pseries/cmm.c
@@ -532,6 +532,7 @@ static int cmm_migratepage(struct balloon_dev_info *b_dev_info,
 
 	spin_lock_irqsave(&b_dev_info->pages_lock, flags);
 	balloon_page_insert(b_dev_info, newpage);
+	__count_vm_event(BALLOON_MIGRATE);
 	b_dev_info->isolated_pages--;
 	spin_unlock_irqrestore(&b_dev_info->pages_lock, flags);
 
-- 
2.51.0



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes
  2025-10-21 10:06 [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes David Hildenbrand
  2025-10-21 10:06 ` [PATCH v1 1/2] powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION David Hildenbrand
  2025-10-21 10:06 ` [PATCH v1 2/2] powerpc/pseries/cmm: adjust BALLOON_MIGRATE when migrating pages David Hildenbrand
@ 2025-11-26 15:40 ` David Hildenbrand (Red Hat)
  2025-11-28  5:05   ` Ritesh Harjani
  2 siblings, 1 reply; 13+ messages in thread
From: David Hildenbrand (Red Hat) @ 2025-11-26 15:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, linuxppc-dev, Andrew Morton, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy

On 10/21/25 12:06, David Hildenbrand wrote:
> Two smaller fixes identified while doing a bigger rework.
> 
> Compile-tested only as I don't have an easy way to test right now.
> 
> I would prefer for these patches to go through the MM tree as I will
> be sending out a bigger version soon that is based on this series --
> I split of the fixes from the other stuff.
> 

Ping,

I tried to get CMM running again (using the simulation mode I introduced 
a while back), but so far my attempts to get a reasonable powernv VM 
booted in QEMU failed :(

(e.g., Fedora qcow2 images use xfs, but the open powernv loader is based 
on a 5.10 kernel without some mystical XFS feature ...)

-- 
Cheers

David


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes
  2025-11-26 15:40 ` [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes David Hildenbrand (Red Hat)
@ 2025-11-28  5:05   ` Ritesh Harjani
  2025-11-28  7:36     ` David Hildenbrand (Red Hat)
  0 siblings, 1 reply; 13+ messages in thread
From: Ritesh Harjani @ 2025-11-28  5:05 UTC (permalink / raw)
  To: David Hildenbrand (Red Hat), linux-kernel
  Cc: linux-mm, linuxppc-dev, Andrew Morton, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy

"David Hildenbrand (Red Hat)" <david@kernel.org> writes:

> On 10/21/25 12:06, David Hildenbrand wrote:
>> Two smaller fixes identified while doing a bigger rework.
>> 
>> Compile-tested only as I don't have an easy way to test right now.
>> 
>> I would prefer for these patches to go through the MM tree as I will
>> be sending out a bigger version soon that is based on this series --
>> I split of the fixes from the other stuff.
>> 
>
> Ping,
>
> I tried to get CMM running again (using the simulation mode I introduced 
> a while back), but so far my attempts to get a reasonable powernv VM 
> booted in QEMU failed :(
>
> (e.g., Fedora qcow2 images use xfs, but the open powernv loader is based 
> on a 5.10 kernel without some mystical XFS feature ...)
>

Sorry, I missed seeing this earlier.

Do you have the link to simulation mode which you are referring above
please? So far I didn't find the support of this beyond Linux LPAR
(pseries), but maybe I missed it.

-ritesh


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes
  2025-11-28  5:05   ` Ritesh Harjani
@ 2025-11-28  7:36     ` David Hildenbrand (Red Hat)
  2025-11-28  7:49       ` Ritesh Harjani
  0 siblings, 1 reply; 13+ messages in thread
From: David Hildenbrand (Red Hat) @ 2025-11-28  7:36 UTC (permalink / raw)
  To: Ritesh Harjani (IBM), linux-kernel
  Cc: linux-mm, linuxppc-dev, Andrew Morton, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy

On 11/28/25 06:05, Ritesh Harjani (IBM) wrote:
> "David Hildenbrand (Red Hat)" <david@kernel.org> writes:
> 
>> On 10/21/25 12:06, David Hildenbrand wrote:
>>> Two smaller fixes identified while doing a bigger rework.
>>>
>>> Compile-tested only as I don't have an easy way to test right now.
>>>
>>> I would prefer for these patches to go through the MM tree as I will
>>> be sending out a bigger version soon that is based on this series --
>>> I split of the fixes from the other stuff.
>>>
>>
>> Ping,
>>
>> I tried to get CMM running again (using the simulation mode I introduced
>> a while back), but so far my attempts to get a reasonable powernv VM
>> booted in QEMU failed :(
>>
>> (e.g., Fedora qcow2 images use xfs, but the open powernv loader is based
>> on a 5.10 kernel without some mystical XFS feature ...)
>>
> 

Hi Ritesh,

> Sorry, I missed seeing this earlier.
> 
> Do you have the link to simulation mode which you are referring above
> please? So far I didn't find the support of this beyond Linux LPAR
> (pseries), but maybe I missed it.

When I did a rework of the CMM balloon in 2019, I needed a way to test
it. So I added

commit b1713975c31ae20ecc40fd00191ee3fa51445d4a
Author: David Hildenbrand <david@kernel.org>
Date:   Thu Oct 31 15:29:31 2019 +0100

     powerpc/pseries/cmm: Simulation mode
     
     Let's allow to test the implementation without needing HW support.
     When "simulate=1" is specified when loading the module, we bypass all
     HW checks and HW calls. The sysfs file "simulate_loan_target_kb" can
     be used to simulate HW requests.
     
     The simualtion mode can be activated using:
       modprobe cmm debug=1 simulate=1
     
     And the requested loan target can be changed using:
       echo X > /sys/devices/system/cmm/cmm0/simulate_loan_target_kb


I allows for bypassing the absence of FW_FEATURE_CMO.

Back in the days I was able to test it with a pseries (or was it powernv?)
machine we had here at RH. So far my attempts failed to test it in a
similar fashion in QEMU.

-- 
Cheers

David


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes
  2025-11-28  7:36     ` David Hildenbrand (Red Hat)
@ 2025-11-28  7:49       ` Ritesh Harjani
  2025-11-28  8:10         ` David Hildenbrand (Red Hat)
  0 siblings, 1 reply; 13+ messages in thread
From: Ritesh Harjani @ 2025-11-28  7:49 UTC (permalink / raw)
  To: David Hildenbrand (Red Hat), linux-kernel
  Cc: linux-mm, linuxppc-dev, Andrew Morton, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy

"David Hildenbrand (Red Hat)" <david@kernel.org> writes:

> On 11/28/25 06:05, Ritesh Harjani (IBM) wrote:
>> "David Hildenbrand (Red Hat)" <david@kernel.org> writes:
>> 
>>> On 10/21/25 12:06, David Hildenbrand wrote:
>>>> Two smaller fixes identified while doing a bigger rework.
>>>>
>>>> Compile-tested only as I don't have an easy way to test right now.
>>>>
>>>> I would prefer for these patches to go through the MM tree as I will
>>>> be sending out a bigger version soon that is based on this series --
>>>> I split of the fixes from the other stuff.
>>>>
>>>
>>> Ping,
>>>
>>> I tried to get CMM running again (using the simulation mode I introduced
>>> a while back), but so far my attempts to get a reasonable powernv VM
>>> booted in QEMU failed :(
>>>
>>> (e.g., Fedora qcow2 images use xfs, but the open powernv loader is based
>>> on a 5.10 kernel without some mystical XFS feature ...)
>>>
>> 
>
> Hi Ritesh,
>
>> Sorry, I missed seeing this earlier.
>> 
>> Do you have the link to simulation mode which you are referring above
>> please? So far I didn't find the support of this beyond Linux LPAR
>> (pseries), but maybe I missed it.
>
> When I did a rework of the CMM balloon in 2019, I needed a way to test
> it. So I added
>
> commit b1713975c31ae20ecc40fd00191ee3fa51445d4a
> Author: David Hildenbrand <david@kernel.org>
> Date:   Thu Oct 31 15:29:31 2019 +0100
>
>      powerpc/pseries/cmm: Simulation mode

aah right. I should have looked closely. I was thinking you meant
somewhere in Qemu, so I was only looking there.

>      
>      Let's allow to test the implementation without needing HW support.
>      When "simulate=1" is specified when loading the module, we bypass all
>      HW checks and HW calls. The sysfs file "simulate_loan_target_kb" can
>      be used to simulate HW requests.
>      
>      The simualtion mode can be activated using:
>        modprobe cmm debug=1 simulate=1
>      
>      And the requested loan target can be changed using:
>        echo X > /sys/devices/system/cmm/cmm0/simulate_loan_target_kb
>
>
> I allows for bypassing the absence of FW_FEATURE_CMO.
>

Right. Let me give it a try first with pseries Qemu. Otherwise I have an
access to pseries LPAR too. I can verify it there. 

> Back in the days I was able to test it with a pseries (or was it powernv?)

Agree the name can be a bit confusing. So 
powernv == Power Non-Virtualized that's the baremetal Power box.
pseries == is basically the Linux LPAR on PowerVM. Qemu/KVM also has
support for booting Linux pseries guest.

> machine we had here at RH. So far my attempts failed to test it in a
> similar fashion in QEMU.
>

Let me give it a try and I will update how it goes.

Thanks!
-ritesh


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes
  2025-11-28  7:49       ` Ritesh Harjani
@ 2025-11-28  8:10         ` David Hildenbrand (Red Hat)
  2025-11-28  8:24           ` David Hildenbrand (Red Hat)
  0 siblings, 1 reply; 13+ messages in thread
From: David Hildenbrand (Red Hat) @ 2025-11-28  8:10 UTC (permalink / raw)
  To: Ritesh Harjani (IBM), linux-kernel
  Cc: linux-mm, linuxppc-dev, Andrew Morton, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy

On 11/28/25 08:49, Ritesh Harjani (IBM) wrote:
> "David Hildenbrand (Red Hat)" <david@kernel.org> writes:
> 
>> On 11/28/25 06:05, Ritesh Harjani (IBM) wrote:
>>> "David Hildenbrand (Red Hat)" <david@kernel.org> writes:
>>>
>>>> On 10/21/25 12:06, David Hildenbrand wrote:
>>>>> Two smaller fixes identified while doing a bigger rework.
>>>>>
>>>>> Compile-tested only as I don't have an easy way to test right now.
>>>>>
>>>>> I would prefer for these patches to go through the MM tree as I will
>>>>> be sending out a bigger version soon that is based on this series --
>>>>> I split of the fixes from the other stuff.
>>>>>
>>>>
>>>> Ping,
>>>>
>>>> I tried to get CMM running again (using the simulation mode I introduced
>>>> a while back), but so far my attempts to get a reasonable powernv VM
>>>> booted in QEMU failed :(
>>>>
>>>> (e.g., Fedora qcow2 images use xfs, but the open powernv loader is based
>>>> on a 5.10 kernel without some mystical XFS feature ...)
>>>>
>>>
>>
>> Hi Ritesh,
>>
>>> Sorry, I missed seeing this earlier.
>>>
>>> Do you have the link to simulation mode which you are referring above
>>> please? So far I didn't find the support of this beyond Linux LPAR
>>> (pseries), but maybe I missed it.
>>
>> When I did a rework of the CMM balloon in 2019, I needed a way to test
>> it. So I added
>>
>> commit b1713975c31ae20ecc40fd00191ee3fa51445d4a
>> Author: David Hildenbrand <david@kernel.org>
>> Date:   Thu Oct 31 15:29:31 2019 +0100
>>
>>       powerpc/pseries/cmm: Simulation mode
> 
> aah right. I should have looked closely. I was thinking you meant
> somewhere in Qemu, so I was only looking there.
> 
>>       
>>       Let's allow to test the implementation without needing HW support.
>>       When "simulate=1" is specified when loading the module, we bypass all
>>       HW checks and HW calls. The sysfs file "simulate_loan_target_kb" can
>>       be used to simulate HW requests.
>>       
>>       The simualtion mode can be activated using:
>>         modprobe cmm debug=1 simulate=1
>>       
>>       And the requested loan target can be changed using:
>>         echo X > /sys/devices/system/cmm/cmm0/simulate_loan_target_kb
>>
>>
>> I allows for bypassing the absence of FW_FEATURE_CMO.
>>
> 
> Right. Let me give it a try first with pseries Qemu. Otherwise I have an
> access to pseries LPAR too. I can verify it there.

Ah, now I realize my problem: I tried with Fedora 43 in a powerpc VM but 
the modprobe didn't do anything.

Looking again:

# grep CONFIG_CMM /boot/config-6.17.1-300.fc43.ppc64le
CONFIG_CMM=y

So modprob'ing won't do as the module is built in.

Anyhow, compiling a kernel inside a QEMU VM might take a while, so if 
you can beat me to it I wouldn't be mad :)


Re powernv vs. powerpc: yeah, it's confusing. For some reason I thought 
I tested it in the days on powernv. Maybe that's simply because I was 
only able to get my hands on such a machine. Looking again, it should 
indeed be able to be simulated on a simple powerpc VM.

-- 
Cheers

David


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes
  2025-11-28  8:10         ` David Hildenbrand (Red Hat)
@ 2025-11-28  8:24           ` David Hildenbrand (Red Hat)
  2025-11-28 10:40             ` Ritesh Harjani
  0 siblings, 1 reply; 13+ messages in thread
From: David Hildenbrand (Red Hat) @ 2025-11-28  8:24 UTC (permalink / raw)
  To: Ritesh Harjani (IBM), linux-kernel
  Cc: linux-mm, linuxppc-dev, Andrew Morton, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy

>>
>> Right. Let me give it a try first with pseries Qemu. Otherwise I have an
>> access to pseries LPAR too. I can verify it there.
> 
> Ah, now I realize my problem: I tried with Fedora 43 in a powerpc VM but
> the modprobe didn't do anything.
> 
> Looking again:
> 
> # grep CONFIG_CMM /boot/config-6.17.1-300.fc43.ppc64le
> CONFIG_CMM=y
> 
> So modprob'ing won't do as the module is built in.

Right, so doing "cmm.simulate=1" on the cmdline in a Fedora 43 VMs 
properly creates the CMM device.

-- 
Cheers

David


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v1 1/2] powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION
  2025-10-21 10:06 ` [PATCH v1 1/2] powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION David Hildenbrand
@ 2025-11-28  9:07   ` Ritesh Harjani
  0 siblings, 0 replies; 13+ messages in thread
From: Ritesh Harjani @ 2025-11-28  9:07 UTC (permalink / raw)
  To: David Hildenbrand, linux-kernel
  Cc: linux-mm, linuxppc-dev, David Hildenbrand, Andrew Morton,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, stable

David Hildenbrand <david@redhat.com> writes:

> 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.
>

Agreed cmm uses balloon_dev_info infrastructure beyond just
CONFIG_BALLOON_COMPACTION, so it should be initialized by default.

The patch looks good to me. Please feel free to add:

Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v1 2/2] powerpc/pseries/cmm: adjust BALLOON_MIGRATE when migrating pages
  2025-10-21 10:06 ` [PATCH v1 2/2] powerpc/pseries/cmm: adjust BALLOON_MIGRATE when migrating pages David Hildenbrand
@ 2025-11-28 10:12   ` Ritesh Harjani
  0 siblings, 0 replies; 13+ messages in thread
From: Ritesh Harjani @ 2025-11-28 10:12 UTC (permalink / raw)
  To: David Hildenbrand, linux-kernel
  Cc: linux-mm, linuxppc-dev, David Hildenbrand, Andrew Morton,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, stable

David Hildenbrand <david@redhat.com> writes:

> Let's properly adjust BALLOON_MIGRATE like the other drivers.
>
> Note that the INFLATE/DEFLATE events are triggered from the core when
> enqueueing/dequeueing pages.
>
> Not completely sure whether really is stable material, but the fix is
> trivial so let's just CC stable.
>
> This was found by code inspection.
>
> Fixes: fe030c9b85e6 ("powerpc/pseries/cmm: Implement balloon compaction")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  arch/powerpc/platforms/pseries/cmm.c | 1 +
>  1 file changed, 1 insertion(+)

Make sense to add vmstat counter for BALLOON_MIGRATE as well.
The changes looks good to me. Please feel free to add:

Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes
  2025-11-28  8:24           ` David Hildenbrand (Red Hat)
@ 2025-11-28 10:40             ` Ritesh Harjani
  2025-11-28 11:45               ` David Hildenbrand (Red Hat)
  0 siblings, 1 reply; 13+ messages in thread
From: Ritesh Harjani @ 2025-11-28 10:40 UTC (permalink / raw)
  To: David Hildenbrand (Red Hat), linux-kernel
  Cc: linux-mm, linuxppc-dev, Andrew Morton, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy

"David Hildenbrand (Red Hat)" <david@kernel.org> writes:

>>>
>>> Right. Let me give it a try first with pseries Qemu. Otherwise I have an
>>> access to pseries LPAR too. I can verify it there.
>> 
>> Ah, now I realize my problem: I tried with Fedora 43 in a powerpc VM but
>> the modprobe didn't do anything.
>> 
>> Looking again:
>> 
>> # grep CONFIG_CMM /boot/config-6.17.1-300.fc43.ppc64le
>> CONFIG_CMM=y
>> 
>> So modprob'ing won't do as the module is built in.
>
> Right, so doing "cmm.simulate=1" on the cmdline in a Fedora 43 VMs 
> properly creates the CMM device.
>

Right verifying using simulate mode is very straightforward. Thanks for that!
So.. using various random echo X > simulate_loan_target_kb on a VM...

~# cat /proc/vmstat |grep balloon
nr_balloon_pages 16
balloon_inflate 1638
balloon_deflate 1622
balloon_migrate 4

-ritesh


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes
  2025-11-28 10:40             ` Ritesh Harjani
@ 2025-11-28 11:45               ` David Hildenbrand (Red Hat)
  0 siblings, 0 replies; 13+ messages in thread
From: David Hildenbrand (Red Hat) @ 2025-11-28 11:45 UTC (permalink / raw)
  To: Ritesh Harjani (IBM), linux-kernel
  Cc: linux-mm, linuxppc-dev, Andrew Morton, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy

On 11/28/25 11:40, Ritesh Harjani (IBM) wrote:
> "David Hildenbrand (Red Hat)" <david@kernel.org> writes:
> 
>>>>
>>>> Right. Let me give it a try first with pseries Qemu. Otherwise I have an
>>>> access to pseries LPAR too. I can verify it there.
>>>
>>> Ah, now I realize my problem: I tried with Fedora 43 in a powerpc VM but
>>> the modprobe didn't do anything.
>>>
>>> Looking again:
>>>
>>> # grep CONFIG_CMM /boot/config-6.17.1-300.fc43.ppc64le
>>> CONFIG_CMM=y
>>>
>>> So modprob'ing won't do as the module is built in.
>>
>> Right, so doing "cmm.simulate=1" on the cmdline in a Fedora 43 VMs
>> properly creates the CMM device.
>>
> 
> Right verifying using simulate mode is very straightforward. Thanks for that!
> So.. using various random echo X > simulate_loan_target_kb on a VM...
> 
> ~# cat /proc/vmstat |grep balloon
> nr_balloon_pages 16
> balloon_inflate 1638
> balloon_deflate 1622
> balloon_migrate 4

Thanks a bunch for the review and testing!

-- 
Cheers

David


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-11-28 11:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-21 10:06 [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes David Hildenbrand
2025-10-21 10:06 ` [PATCH v1 1/2] powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION David Hildenbrand
2025-11-28  9:07   ` Ritesh Harjani
2025-10-21 10:06 ` [PATCH v1 2/2] powerpc/pseries/cmm: adjust BALLOON_MIGRATE when migrating pages David Hildenbrand
2025-11-28 10:12   ` Ritesh Harjani
2025-11-26 15:40 ` [PATCH v1 0/2] powerpc/pseries/cmm: two smaller fixes David Hildenbrand (Red Hat)
2025-11-28  5:05   ` Ritesh Harjani
2025-11-28  7:36     ` David Hildenbrand (Red Hat)
2025-11-28  7:49       ` Ritesh Harjani
2025-11-28  8:10         ` David Hildenbrand (Red Hat)
2025-11-28  8:24           ` David Hildenbrand (Red Hat)
2025-11-28 10:40             ` Ritesh Harjani
2025-11-28 11:45               ` David Hildenbrand (Red Hat)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox