Thread (16 messages) flat view 16 messages, 6 authors, 2017-12-10

Re: [PATCH v2] mmap.2: MAP_FIXED updated documentation

From: Pavel Machek <hidden>
Date: 2017-12-09 17:19:55
Also in: linux-arch, linux-man, linux-mm, lkml

On Thu 2017-12-07 15:02:21, Michal Hocko wrote:
On Thu 07-12-17 13:58:05, Cyril Hrubis wrote:
quoted
Hi!
quoted
quoted
quoted
(It does seem unfortunate that the man page cannot help the programmer
actually write correct code here. He or she is forced to read the kernel
implementation, in order to figure out the true alignment rules. I was
hoping we could avoid that.)
It would be nice if we had this information exported somehere so that we
do not have to rely on per-architecture ifdefs.

What about adding MapAligment or something similar to the /proc/meminfo?
What's the use case you envision for that? I don't see how that would be
better than using SHMLBA, which is available at compiler time. Because 
unless someone expects to be able to run an app that was compiled for 
Arch X, on Arch Y (surely that's not requirement here?), I don't see how
the run-time check is any better.
I guess that some kind of compile time constant in uapi headers will do
as well, I'm really open to any solution that would expose this constant
as some kind of official API.
I am not sure this is really feasible. It is not only a simple alignment
thing. Look at ppc for example (slice_get_unmapped_area). Other
architectures might have even more complicated rules e.g. arm and its
cache_is_vipt_aliasing. Also this applies only on MAP_SHARED || file
backed mappings.

I would really leave dogs sleeping... Trying to document all this in the
man page has chances to confuse more people than it has chances to help
those who already know all these nasty details.
You don't have to provide all the details, but warning that there's arch-
specific magic would be nice...
								Pavel

(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help