mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <cutaway@bellsouth.net>
To: "Rik van Riel" <riel@redhat.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] do_execve() perf improvement opportunity?
Date: Tue, 21 Jun 2005 13:06:53 -0400	[thread overview]
Message-ID: <027401c57683$a261a9f0$2800000a@pc365dualp2> (raw)
In-Reply-To: <Pine.LNX.4.61.0506210954090.14739@chimarrao.boston.redhat.com>

Rik, it would certainly fail miserably on any architecture where different
CPU's have any CPU local memory under kernel managment.

Anything resembling the old homogeneous Hydra scheme should be fine though I
would think.

NUMA is odd enough that the kernel is littered with conditionals for it, one
more wouldn't be a big deal ;->

I'll try to code this up and benchmark it and see if there's anything
measurable.  If there is, this sort of simple minded "cache the last one"
scheme might be applicable elsewhere too - pipes, maybe net packets, etc.
It looks like Slab already sort of "caches the last one" on the different
granularities, but it takes a bit more code to get to the point where it
finally figures out it can give you back a cached one.

Maybe there's something to be gained by having an internal special case
allocator for limited numbers of small things (like 32, 64, 128, 256 maybe
where a bit scan instruction or two can trivially find you an empty slot)?
Where the allocator degenerates to just setting a flag byte on the smaller
slices and generating the pointer from a bit index.


----- Original Message ----- 
From: "Rik van Riel" <riel@redhat.com>
To: <cutaway@bellsouth.net>
Cc: <linux-kernel@vger.kernel.org>
Sent: Tuesday, June 21, 2005 09:56
Subject: Re: [RFC] do_execve() perf improvement opportunity?


> On Tue, 21 Jun 2005 cutaway@bellsouth.net wrote:
>
> > I'm thinking it may be possible to very cheaply cache a pointer to the
> > last allocation here rather than freeing it and just recycle it for the
> > next exec saving a trip through the slab machanism.
>
> Note that the slab mechanism can do allocations locally
> on each CPU in an SMP system, while your pointer would
> need some cross-CPU synchronisation.  Also, you could
> end up using the bprm from a CPU on a remote NUMA node,
> instead of a local piece of memory.
>
> Still, it would be interesting/educational to know if your
> optimisation makes a difference on single CPU systems.


  reply	other threads:[~2005-06-21 16:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-21  6:42 cutaway
2005-06-21 13:56 ` Rik van Riel
2005-06-21 17:06   ` cutaway [this message]
2005-06-21 17:15     ` Rik van Riel

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='027401c57683$a261a9f0$2800000a@pc365dualp2' \
    --to=cutaway@bellsouth.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@redhat.com \
    /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®