All of lore.kernel.org
 help / color / mirror / Atom feed
* mmap address alignment when mmaping MAP_SHARED | MAP_FIXED
@ 2009-06-15 14:58 CHIKAMA Masaki
  2009-06-15 17:48 ` Paul Mundt
  0 siblings, 1 reply; 2+ messages in thread
From: CHIKAMA Masaki @ 2009-06-15 14:58 UTC (permalink / raw)
  To: linux-sh

Hello all.

On current sh kernel,  mmaped  address must be aligned 16KB boundary
instead of getpagesize()
when mmaping MAP_SHARED|MAP_FIXED. Can you removed this limitation ?

Please look at this.
 http://sourceware.org/bugzilla/show_bug.cgi?id\x10283

Best regards.
-- 
CHIKAMA Masaki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mmap address alignment when mmaping MAP_SHARED | MAP_FIXED
  2009-06-15 14:58 mmap address alignment when mmaping MAP_SHARED | MAP_FIXED CHIKAMA Masaki
@ 2009-06-15 17:48 ` Paul Mundt
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2009-06-15 17:48 UTC (permalink / raw)
  To: linux-sh

On Mon, Jun 15, 2009 at 11:58:47PM +0900, CHIKAMA Masaki wrote:
> Hello all.
> 
> On current sh kernel,  mmaped  address must be aligned 16KB boundary
> instead of getpagesize()
> when mmaping MAP_SHARED|MAP_FIXED. Can you removed this limitation ?
> 
> Please look at this.
>  http://sourceware.org/bugzilla/show_bug.cgi?id\x10283
> 
The assertion that PAGE_SIZE is sufficient is utter nonsense. If the
dcache way size exceeds the page size then we have hard cache aliasing
constraints that shared mappings simply can not violate. SHMLBA has
exactly the same problem, and is likewise similarly defined on the
platforms that have to deal with these issues.

16kB is just an arbitrary size that avoids aliasing on all shared
mappings given the current cache architecture. However, it can of course
be compacted by calculating the shm alignment mask from the L1 dcache
shape information available through the ELF auxvt.

In any event, SH is not the only platform that has to deal with this, you
can grep the kernel for non-PAGE_SIZE SHMLBA definitions to see which
other architectures are similarly impacted. glibc has never dealt with
this effectively.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-15 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-15 14:58 mmap address alignment when mmaping MAP_SHARED | MAP_FIXED CHIKAMA Masaki
2009-06-15 17:48 ` Paul Mundt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.