[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ce26f59c-8938-4896-aaf9-ed94723466eb@redhat.com>
Date: Wed, 22 Oct 2025 10:42:17 +0200
From: David Hildenbrand <david@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linuxppc-dev@...ts.ozlabs.org,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>, linux-doc@...r.kernel.org,
virtualization@...ts.linux.dev, Andrew Morton <akpm@...ux-foundation.org>,
Oscar Salvador <osalvador@...e.de>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>, Vlastimil Babka
<vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
Jonathan Corbet <corbet@....net>, Madhavan Srinivasan <maddy@...ux.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>, Arnd Bergmann
<arnd@...db.de>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jerrin Shaji George <jerrin.shaji-george@...adcom.com>,
Jason Wang <jasowang@...hat.com>, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Eugenio Pérez <eperezma@...hat.com>, Zi Yan <ziy@...dia.com>
Subject: Re: [PATCH v1 07/23] mm/balloon_compaction: use a device-independent
balloon (list) lock
On 21.10.25 22:52, Michael S. Tsirkin wrote:
> On Tue, Oct 21, 2025 at 02:59:12PM +0200, David Hildenbrand wrote:
>> In order to remove the dependency on the page lock for balloon
>> pages, we need a lock that is independent of the page.
>>
>> It's crucial that we can handle the scenario where balloon deflation
>> (clearing page->private) can race with page isolation (using
>> page->private to obtain the balloon_dev_info where the lock currently
>> resides).
>>
>> The current lock in balloon_dev_info is therefore not suitable.
>>
>> Fortunately, we never really have more than a single balloon device
>> per VM, so we can just keep it simple and use a static lock to protect
>> all balloon devices.
>>
>> Based on this change we will remove the dependency on the page lock
>> next.
>>
>> Signed-off-by: David Hildenbrand <david@...hat.com>
>> ---
>> include/linux/balloon_compaction.h | 6 ++---
>> mm/balloon_compaction.c | 36 +++++++++++++++++-------------
>> 2 files changed, 23 insertions(+), 19 deletions(-)
>>
>> diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_compaction.h
>> index 3109d3c43d306..e2d9eb40e1fbb 100644
>> --- a/include/linux/balloon_compaction.h
>> +++ b/include/linux/balloon_compaction.h
>> @@ -21,10 +21,10 @@
>> * i. Setting the PG_movable_ops flag and page->private with the following
>> * lock order
>> * +-page_lock(page);
>> - * +--spin_lock_irq(&b_dev_info->pages_lock);
>> + * +--spin_lock_irq(&balloon_pages_lock);
>> *
>> * ii. isolation or dequeueing procedure must remove the page from balloon
>> - * device page list under b_dev_info->pages_lock.
>> + * device page list under &balloon_pages_lock
>
> Using &balloon_pages_lock with an & is kinda weird here.
Indeed, fixed, thanks!
--
Cheers
David / dhildenb
Powered by blists - more mailing lists