public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: mmap address alignment when mmaping MAP_SHARED | MAP_FIXED
Date: Mon, 15 Jun 2009 17:48:31 +0000	[thread overview]
Message-ID: <20090615174831.GA30693@linux-sh.org> (raw)
In-Reply-To: <fd0635d10906150758w4f0c7d01q92d8e31546c976f1@mail.gmail.com>

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.

      reply	other threads:[~2009-06-15 17:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-15 14:58 mmap address alignment when mmaping MAP_SHARED | MAP_FIXED CHIKAMA Masaki
2009-06-15 17:48 ` Paul Mundt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090615174831.GA30693@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox