Thread (5 messages) flat view 5 messages, 3 authors, 2020-02-14

Re: [PATCH v2 1/4] mm/memremap_pages: Introduce memremap_compat_align()

From: Dan Williams <hidden>
Date: 2020-02-14 23:05:24
Also in: lkml, nvdimm

On Fri, Feb 14, 2020 at 12:59 PM Jeff Moyer [off-list ref] wrote:
Dan Williams [off-list ref] writes:
quoted
On Thu, Feb 13, 2020 at 8:58 AM Jeff Moyer [off-list ref] wrote:
quoted
quoted
I have just a couple of questions.

First, can you please add a comment above the generic implementation of
memremap_compat_align describing its purpose, and why a platform might
want to override it?
Sure, how about:

/*
 * The memremap() and memremap_pages() interfaces are alternately used
 * to map persistent memory namespaces. These interfaces place different
 * constraints on the alignment and size of the mapping (namespace).
 * memremap() can map individual PAGE_SIZE pages. memremap_pages() can
 * only map subsections (2MB), and at least one architecture (PowerPC)
 * the minimum mapping granularity of memremap_pages() is 16MB.
 *
 * The role of memremap_compat_align() is to communicate the minimum
 * arch supported alignment of a namespace such that it can freely
 * switch modes without violating the arch constraint. Namely, do not
 * allow a namespace to be PAGE_SIZE aligned since that namespace may be
 * reconfigured into a mode that requires SUBSECTION_SIZE alignment.
 */
Well, if we modify the x86 variant to be PAGE_SIZE, I think that text
won't work.  How about:
...but I'm not looking to change it to PAGE_SIZE, I'm going to fix the
alignment check to skip if the namespace has "inner" alignment
padding, i.e. "start_pad" and/or "end_trunc" are non-zero.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help