Thread (53 messages) 53 messages, 9 authors, 2024-10-30

Re: [PATCH 04/12] mm: Allow compound zone device pages

From: Matthew Wilcox <willy@infradead.org>
Date: 2024-09-10 13:42:04
Also in: linux-arm-kernel, linux-cxl, linux-doc, linux-fsdevel, linux-mm, linux-xfs, linuxppc-dev, lkml, nvdimm

On Tue, Sep 10, 2024 at 04:57:41PM +1000, Alistair Popple wrote:
Matthew Wilcox [off-list ref] writes:
quoted
On Tue, Sep 10, 2024 at 02:14:29PM +1000, Alistair Popple wrote:
quoted
@@ -337,6 +341,7 @@ struct folio {
 	/* private: */
 				};
 	/* public: */
+			struct dev_pagemap *pgmap;
Shouldn't that be indented by one more tab stop?

And for ease of reading, perhaps it should be placed either immediately
before or after 'struct list_head lru;'?
quoted
+++ b/include/linux/mmzone.h
@@ -1134,6 +1134,12 @@ static inline bool is_zone_device_page(const struct page *page)
 	return page_zonenum(page) == ZONE_DEVICE;
 }
 
+static inline struct dev_pagemap *page_dev_pagemap(const struct page *page)
+{
+	WARN_ON(!is_zone_device_page(page));
+	return page_folio(page)->pgmap;
+}
I haven't read to the end yet, but presumably we'll eventually want:

static inline struct dev_pagemap *folio_dev_pagemap(const struct folio *folio)
{
	WARN_ON(!folio_is_zone_device(folio))
	return folio->pgmap;
}

and since we'll want it eventually, maybe now is the time to add it,
and make page_dev_pagemap() simply call it?
Sounds reasonable. I had open-coded folio->pgmap where it's needed
because at those points it's "obviously" a ZONE_DEVICE folio. Will add
it.
Oh, if it's obvious then just do the dereference.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help