Thread (48 messages) 48 messages, 6 authors, 2021-11-05

Re: [PATCH v4 04/14] mm/memremap: add ZONE_DEVICE support for compound pages

flat view

From: Christoph Hellwig <hch@lst.de>
Date: 2021-09-01 09:44:53
Also in: linux-mm, nvdimm

On Fri, Aug 27, 2021 at 05:00:11PM +0100, Joao Martins wrote:
So felt like doing it inline straight away inline when calling percpu_ref_get_many():
	
	(pfn_end(pgmap, range_id) - pfn_first(pgmap, range_id)) / pgmap_geometry(pgmap);

I can switch to a shift if you prefer:

	(pfn_end(pgmap, range_id) - pfn_first(pgmap, range_id))
		<< pgmap_geometry_order(pgmap);
Yes.  A shift is less overhead than a branch.
quoted
Also geometry sounds a bit strange, even if I can't really
offer anything better offhand.
We started with @align (like in device dax core), and then we switched
to @geometry because these are slightly different things (one relates
to vmemmap metadata structure (number of pages) and the other is how
the mmap is aligned to a page size. I couldn't suggest anything else,
besides a more verbose name like vmemmap_align maybe.
It for sure isn't an alignment.  I think the term that comes closest
is a granularity.  But something like vmemmap_shift if switching to
a shift might be descriptive enough for the struct member name.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help