lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B7FCC74-EAB2-426B-AFE0-4250FE4F7480@nvidia.com>
Date: Wed, 14 May 2025 09:45:52 -0400
From: Zi Yan <ziy@...dia.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
 virtualization@...ts.linux.dev, "Michael S. Tsirkin" <mst@...hat.com>,
 Jason Wang <jasowang@...hat.com>, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
 Eugenio Pérez <eperezma@...hat.com>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Oscar Salvador <osalvador@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
 Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
 Brendan Jackman <jackmanb@...gle.com>, Johannes Weiner <hannes@...xchg.org>,
 "Matthew Wilcox (Oracle)" <willy@...radead.org>
Subject: Re: [PATCH v1 0/2] mm/memory_hotplug: introduce and use
 PG_offline_skippable

On 14 May 2025, at 7:15, David Hildenbrand wrote:

> This is a requirement for making PageOffline pages not have a refcount
> in the long future ("frozen"), and for reworking non-folio page migration
> in the near future.
>
> I have patches mostly ready to go to handle the latter. For turning all
> PageOffline() pages frozen, the non-folio page migration and memory
> ballooning drivers will have to be reworked first, to no longer rely on
> the refcount of PageOffline pages.
>
> Introduce PG_offline_skippable that only applies to PageOffline() pages --
> of course, reusing one of the existing PG_ flags for now -- and convert
> virtio-mem to make use of the new way: to allow for skipping PageOffline
> pages during memory offlining, treating them as if they would not be
> allocated.

IIUC, based on Documentation/admin-guide/mm/memory-hotplug.rst,
to offline a page, the page first needs to be set PageOffline() to be
removed from page allocator. Next, the page is removed from its memory
block. When will PG_offline_skippable be used? The second phase when
the page is being removed from its memory block?

Thanks.

>
> Note that the existing mechanism relied on the driver (virtio-mem)
> dropping its reference during MEM_GOING_OFFLINE, which is complicated and
> not compatible with the concept of frozen pages (no refcount).
>
> Tested with virtio-mem on x86, including  partially hotplugging a memory
> block (hotplugging 64MiB with a 128 MiB memory block size), and repeatedly
> onlining+offlining the memory block.
>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: "Michael S. Tsirkin" <mst@...hat.com>
> Cc: Jason Wang <jasowang@...hat.com>
> Cc: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
> Cc: "Eugenio Pérez" <eperezma@...hat.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Oscar Salvador <osalvador@...e.de>
> Cc: Vlastimil Babka <vbabka@...e.cz>
> Cc: Suren Baghdasaryan <surenb@...gle.com>
> Cc: Michal Hocko <mhocko@...e.com>
> Cc: Brendan Jackman <jackmanb@...gle.com>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: Zi Yan <ziy@...dia.com>
> Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>
>
> David Hildenbrand (2):
>   mm/memory_hotplug: PG_offline_skippable for offlining memory blocks
>     with PageOffline pages
>   mm/memory_hotplug: remove -EBUSY handling from scan_movable_pages()
>
>  drivers/virtio/virtio_mem.c | 111 +-----------------------------------
>  include/linux/page-flags.h  |  29 +++++++---
>  mm/memory_hotplug.c         |  22 ++-----
>  mm/page_alloc.c             |   8 +--
>  mm/page_isolation.c         |  21 +++----
>  5 files changed, 40 insertions(+), 151 deletions(-)
>
>
> base-commit: 2f6baf8dadecc2bec7d6bc931f7e0d58d8443d76
> -- 
> 2.49.0


--
Best Regards,
Yan, Zi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ