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.

mm/balloon_compaction: "movable_ops" doc updates

Let's bring the docs up-to-date. Setting PG_movable_ops + page->private
very likely still requires to be performed under documented locks: it's
complicated.

We will rework this in the future, as we will try avoiding using the page
lock.

Link: https://lkml.kernel.org/r/20250704102524.326966-29-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Eugenio Pé rez <eperezma@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Gregory Price <gourry@gourry.net>
Cc: Harry Yoo <harry.yoo@oracle.com>
Cc: "Huang, Ying" <ying.huang@linux.alibaba.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Jerrin Shaji George <jerrin.shaji-george@broadcom.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Mathew Brost <matthew.brost@intel.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: xu xin <xu.xin16@zte.com.cn>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

David Hildenbrand and committed by
Andrew Morton
f5e43012 677e0e35

+6 -7
+6 -7
include/linux/balloon_compaction.h
··· 4 4 * 5 5 * Common interface definitions for making balloon pages movable by compaction. 6 6 * 7 - * Balloon page migration makes use of the general non-lru movable page 7 + * Balloon page migration makes use of the general "movable_ops page migration" 8 8 * feature. 9 9 * 10 10 * page->private is used to reference the responsible balloon device. 11 - * page->mapping is used in context of non-lru page migration to reference 12 - * the address space operations for page isolation/migration/compaction. 11 + * That these pages have movable_ops, and which movable_ops apply, 12 + * is derived from the page type (PageOffline()) combined with the 13 + * PG_movable_ops flag (PageMovableOps()). 13 14 * 14 15 * As the page isolation scanning step a compaction thread does is a lockless 15 16 * procedure (from a page standpoint), it might bring some racy situations while ··· 18 17 * and safely perform balloon's page compaction and migration we must, always, 19 18 * ensure following these simple rules: 20 19 * 21 - * i. when updating a balloon's page ->mapping element, strictly do it under 22 - * the following lock order, independently of the far superior 23 - * locking scheme (lru_lock, balloon_lock): 20 + * i. Setting the PG_movable_ops flag and page->private with the following 21 + * lock order 24 22 * +-page_lock(page); 25 23 * +--spin_lock_irq(&b_dev_info->pages_lock); 26 - * ... page->mapping updates here ... 27 24 * 28 25 * ii. isolation or dequeueing procedure must remove the page from balloon 29 26 * device page list under b_dev_info->pages_lock.