[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411123204.GS5383@nvidia.com>
Date: Thu, 11 Apr 2024 09:32:04 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Alistair Popple <apopple@...dia.com>
Cc: linux-mm@...ck.org, david@...morbit.com, dan.j.williams@...el.com,
jhubbard@...dia.com, rcampbell@...dia.com, willy@...radead.org,
linux-fsdevel@...r.kernel.org, jack@...e.cz, djwong@...nel.org,
hch@....de, david@...hat.com, ruansy.fnst@...itsu.com,
nvdimm@...ts.linux.dev, linux-xfs@...r.kernel.org,
linux-ext4@...r.kernel.org, jglisse@...hat.com
Subject: Re: [RFC 07/10] mm: Allow compound zone device pages
On Thu, Apr 11, 2024 at 10:57:28AM +1000, Alistair Popple wrote:
> Zone device pages are used to represent various type of device memory
> managed by device drivers. Currently compound zone device pages are
> not supported. This is because MEMORY_DEVICE_FS_DAX pages are the only
> user of higher order zone device pages and have their own page
> reference counting.
>
> A future change will unify FS DAX reference counting with normal page
> reference counting rules and remove the special FS DAX reference
> counting. Supporting that requires compound zone device pages.
>
> Supporting compound zone device pages requires compound_head() to
> distinguish between head and tail pages whilst still preserving the
> special struct page fields that are specific to zone device pages.
>
> A tail page is distinguished by having bit zero being set in
> page->compound_head, with the remaining bits pointing to the head
> page. For zone device pages page->compound_head is shared with
> page->pgmap.
>
> The page->pgmap field is common to all pages within a memory section.
> Therefore pgmap is the same for both head and tail pages and we can
> use the same scheme to distinguish tail pages. To obtain the pgmap for
> a tail page a new accessor is introduced to fetch it from
> compound_head.
>
> Signed-off-by: Alistair Popple <apopple@...dia.com>
> ---
> drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +-
> drivers/pci/p2pdma.c | 2 +-
> include/linux/memremap.h | 12 +++++++++---
> include/linux/migrate.h | 2 +-
> lib/test_hmm.c | 2 +-
> mm/hmm.c | 2 +-
> mm/memory.c | 2 +-
> mm/memremap.c | 6 +++---
> mm/migrate_device.c | 4 ++--
> 9 files changed, 20 insertions(+), 14 deletions(-)
Makes sense to me
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Jason
Powered by blists - more mailing lists