mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Ulrich Drepper <drepper@gmail.com>
Cc: Davide Libenzi <davidel@xmailserver.org>,
	blaisorblade@yahoo.it,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch 2/3] MAP_NOZERO - implement sys_brk2()
Date: Wed, 27 Jun 2007 18:43:02 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0706271807330.22337@blonde.wat.veritas.com> (raw)
In-Reply-To: <a36005b50706271001o191f3e24n83b25988739429fb@mail.gmail.com>

On Wed, 27 Jun 2007, Ulrich Drepper wrote:
> On 6/27/07, Hugh Dickins <hugh@veritas.com> wrote:
> > Not so: if an mmap can be done by extending either adjacent vma (prot
> > and flags and file and offset all match up), that's what's done and no
> > separate vma is created.  (And adjacent vmas get merged when mprotect
> > removes the difference in protection.)
> 
> mmap return values are randomized.  If they would be mergable
> something would be wrong.

The absolute virtual addresses are randomized, yes; but do a sequence
of mmaps and they come back adjacent to each other, and so mergable.
Or does your distro include a kernel patch to randomize them relative
to each other?

> > I don't think there's any such reason to prefer brk to mmap.
> 
> Talk to the Quadrics people.  Some of their interconnect adapters
> incur significant costs with separate VMAs.
> 
> > Please let me know if you've a test case which shows more vmas than
> > expected.
> 
> Not related to this, but we already have "too many" VMAs for some
> definition of "too many".  Since we split VMA when the protection
> changes each thread stack consists at least of two VMA (three for
> ia64).  There was an approach at some point to push the access flags
> down and allow VMAs to stretch further.  Why was this deemed
> unsuitable?

Blaisorblade's patch, yes.  I disliked it at the time I reviewed
it a couple of years back: it made a system call many of us regret
even nastier, and relied on tiresome per-arch pagetable encodings.
It seemed likely to cause us trouble down the line - though
undoubtedly it provides real benefits too.

I never found time to review it when it came around again recently,
thought Blaisorblade might prefer me to turn a blind eye to it ;)
and let others opine instead.  But I think noone else found time to
review it either.  I expect it's rather nicer now, but doubt it's
actually attractive.

It _might_ turn out to be more attractive, not to rely on that
peculiar sys_remap_file_pages, but make all our vmas independent
of protections, and hang differently protected ranges off them.
Maybe.

> It could have quite a bit with situations with many
> threads (Java).  As I've told back when this came up, we had one
> customer where the VMA lookup actually showed up in profiles.

In honesty, I should add that I dislike and distrust Davide's
MAP_NOZERO very much indeed!  Would much rather leave my cpus
spending a little time in clear_page().  A uid in struct page
(though I'm sure we could find somewhere to tuck it away) -
the horror, the horror!  But I've so far failed to find a killer
argument against it, and am hoping for someone else to do so.

Curmudgeonly,
Hugh

  reply	other threads:[~2007-06-27 17:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-27  2:44 Davide Libenzi
2007-06-27  3:07 ` Rik van Riel
2007-06-27  3:33   ` Davide Libenzi
2007-06-27  3:45   ` Ulrich Drepper
2007-06-27  4:11     ` Rik van Riel
2007-06-27  5:04       ` Ulrich Drepper
2007-06-27  3:48 ` Ulrich Drepper
2007-06-27  3:55   ` Davide Libenzi
2007-06-27  5:02     ` Ulrich Drepper
2007-06-27 12:32       ` Hugh Dickins
2007-06-27 15:59         ` Davide Libenzi
2007-06-27 17:01         ` Ulrich Drepper
2007-06-27 17:43           ` Hugh Dickins [this message]
2007-06-27 18:13             ` Davide Libenzi
2007-06-27 18:32               ` Hugh Dickins
2007-06-27 18:45                 ` Davide Libenzi
2007-06-27 22:11                   ` Nicholas Miell
2007-06-28  0:17                     ` Davide Libenzi
2007-06-28  2:58                       ` Davide Libenzi
2007-06-30  7:52                     ` Andrew Morton
2007-06-27 18:52             ` Ulrich Drepper
2007-06-27 19:32               ` Hugh Dickins
2007-06-27 19:00           ` Rik van Riel
2007-06-27 19:22             ` Davide Libenzi
2007-06-27 16:05       ` Davide Libenzi

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=Pine.LNX.4.64.0706271807330.22337@blonde.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=blaisorblade@yahoo.it \
    --cc=davidel@xmailserver.org \
    --cc=drepper@gmail.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®