All of lore.kernel.org
 help / color / mirror / Atom feed
From: John David Anglin <dave.anglin@bell.net>
To: Helge Deller <deller@gmx.de>, Carlos O'Donell <carlos@systemhalted.org>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>,
	Mike Frysinger <vapier@gentoo.org>,
	linux-parisc <linux-parisc@vger.kernel.org>
Subject: Re: parisc: fix mmap(MAP_FIXED|MAP_SHARED) to already mmapped address
Date: Thu, 3 Apr 2014 16:03:14 -0400	[thread overview]
Message-ID: <BLU0-SMTP7204937E7AF88D8736354E976C0@phx.gbl> (raw)
In-Reply-To: <533DB961.9010607@gmx.de>

On 4/3/2014 3:41 PM, Helge Deller wrote:
> On 04/02/2014 11:41 PM, John David Anglin wrote:
>> On 4/2/2014 5:09 PM, Helge Deller wrote:
>>> On 04/02/2014 09:09 PM, Carlos O'Donell wrote:
>>>> On Tue, Apr 1, 2014 at 2:49 PM, Helge Deller <deller@gmx.de> wrote:
>>>>> Yes.
>>>>> But it's not a kernel bug. Kernel 3.14 and previous stable releases are OK.
>>>>>
>>>>> I did proposed a glibc change in my previous mail (http://www.spinics.net/lists/linux-parisc/msg05384.html).
>>>>> Debian bug report with patch is here:
>>>>> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741243
>>>>>
>>>>> And this is what I proposed:
>>>>>
>>>>> A trivial FIX/workaround would be to change libc-mmap.h like this:
>>>>> #ifdef __hppa__
>>>>> #define MAP_FIXED_ALIGNMENT 4096
>>>>> #else
>>>>> #define MAP_FIXED_ALIGNMENT SHMLBA
>>>>> #endif
>>>>>
>>>>> That works because then the new aligned address is then the same as the original
>>>>> (the mmap call returns 4k aligned addresses, so it stays unchanged), but I'm not sure
>>>>> if such a patch would be acceptable.
>>>>> Do you have another idea/proposal?
>>>> The responsibility for fixing this falls to me, but I've been busy.
>>> No problem.
>>>
>>>> If someone wants to propose a patch for glibc please email
>>>> libc-alpha@sourceware.org, TO me, and I'll review and commit the patch
>>>> granted that you show you've done the appropriate testing.
>>>>
>>>> Otherwise I'll get to this at some point in the next couple of weeks :-(
>>> Hi Carlos,
>>>
>>> I'm not really sure if my patch is the best way to go. Technically it's correct
>>> and it's tested since all our debian buildservers currently run with this patch.
>>> But all other options would probably involve more code changes.
>>>
>>> So, I think I'm happy if you can look at it at some point when you find time.
>>> Your input would be very valuable here.
>> I'm wondering if kernel value for SHMLBA shouldn't change to PAGE_SIZE to better
>> reflect that attach addresses are page aligned.  The color alignment for shared maps
>> seems a separate issue which maybe userspace doesn't need to worry about.
> I think this is a very interesting idea and it should be pretty simple!
>
> The attached patch for eglibc should resolve it.
> And the attached patch for kernel isn't necessary, but makes it clear that the colouring is important.
>   
> I did tested the kernel patch - and it seems to work without problems.
>
> I'm not sure if this might introduce userspace compile problems though (although unlikely).
Very nice!  In our current Debian eglibc build, SHMLBA is set to 4096.
So, it should work just fine with the kernel patch.  The buildds have 
been running for some time
and I'm not aware of any mmap issues aside from the pthread_create 
ENOMEM errors.

Do you think this helps the allocation of small maps (perl locale test bug)?

Dave

-- 
John David Anglin    dave.anglin@bell.net


  reply	other threads:[~2014-04-03 20:03 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-19 19:17 parisc: fix mmap(MAP_FIXED|MAP_SHARED) to already mmapped address Aaro Koskinen
2013-12-19 19:44 ` John David Anglin
2013-12-19 20:28   ` Aaro Koskinen
2013-12-19 21:19   ` Mike Frysinger
2013-12-19 22:38     ` John David Anglin
2013-12-19 23:02       ` Mike Frysinger
2013-12-20 22:10         ` Helge Deller
2013-12-23 20:26           ` Aaro Koskinen
2013-12-29 20:50             ` Helge Deller
2013-12-29 21:26               ` Aaro Koskinen
2013-12-21 18:18         ` John David Anglin
2014-03-02 21:22     ` Helge Deller
2014-04-01 18:26       ` Aaro Koskinen
2014-04-01 18:49         ` Helge Deller
2014-04-02 19:09           ` Carlos O'Donell
2014-04-02 21:09             ` Helge Deller
2014-04-02 21:41               ` John David Anglin
2014-04-03 19:41                 ` Helge Deller
2014-04-03 20:03                   ` John David Anglin [this message]
2014-04-03 20:26                     ` Helge Deller
2015-02-20 21:36                       ` Carlos O'Donell
2015-02-21 20:31                         ` John David Anglin
2015-02-21 20:40                           ` John David Anglin
2015-02-21 23:09                             ` James Bottomley
2015-02-21 23:26                               ` Helge Deller
2015-02-21 23:57                                 ` James Bottomley
2015-02-22 16:45                                   ` John David Anglin
2015-02-22 17:17                                     ` James Bottomley
2015-02-22 17:53                                       ` Helge Deller
2015-02-22 17:54                                       ` John David Anglin
2015-02-22 17:58                                         ` James Bottomley
2015-02-22 18:07                                           ` Helge Deller
2015-02-22 19:13                                             ` James Bottomley
2015-02-22 19:16                                               ` Helge Deller
2015-02-22 19:42                                                 ` James Bottomley
2015-03-07 19:05                                                   ` Carlos O'Donell
2015-02-22 18:28                                         ` parisc: fix mmap(MAP_FIXED|MAP_SHARED) to already mmapped address - optimized patches Helge Deller
2015-02-22 17:28                                     ` parisc: fix mmap(MAP_FIXED|MAP_SHARED) to already mmapped address James Bottomley
2015-02-22 18:02                                       ` John David Anglin
2015-02-21 21:04                           ` Helge Deller
2014-04-03 20:12                   ` John David Anglin
2014-04-03 20:27                     ` Helge Deller
2014-04-04 15:45                     ` Jeroen Roovers
2013-12-19 20:28 ` Helge Deller
2013-12-19 20:53   ` Aaro Koskinen
2013-12-23 20:34 ` Rolf Eike Beer
2013-12-24  2:39   ` John David Anglin
2013-12-24  9:32     ` Rolf Eike Beer
2014-01-27 11:23   ` Rolf Eike Beer

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=BLU0-SMTP7204937E7AF88D8736354E976C0@phx.gbl \
    --to=dave.anglin@bell.net \
    --cc=aaro.koskinen@iki.fi \
    --cc=carlos@systemhalted.org \
    --cc=deller@gmx.de \
    --cc=linux-parisc@vger.kernel.org \
    --cc=vapier@gentoo.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 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.