From: Hugh Dickins <hugh@veritas.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: "Olivér Pintér" <oliver.pntr@gmail.com>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Willy Tarreau" <w@1wt.eu>,
linux-kernel@vger.kernel.org, stable@kernel.org
Subject: Re: [PATCH 1/2] slub: fix leakage
Date: Mon, 5 Nov 2007 19:09:41 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.64.0711051901330.28390@blonde.wat.veritas.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0711051036250.13139@schroedinger.engr.sgi.com>
On Mon, 5 Nov 2007, Christoph Lameter wrote:
> On Sun, 4 Nov 2007, Hugh Dickins wrote:
>
> > In a low memory situation, when several tasks pile up to allocate
> > the same resource, we'd usually free back all but the first, rather
> > than depleting free memory even more than necessary. That you were
> > doing before, now you take the simpler way out and don't bother.
>
> Hmmm... But even without the patch: All tasks had to allocate their
> own slabs via the page allocator first. Most of those were then thrown
> away immediately. Now we are flushing the current cpu slab. Which means
> that this is also going back to the page allocator if its empty.
Perfectly possible, but not the likely case.
> It is
> likely that the push back in the situation you mention will put a slab
> with only one object allocated onto the partial lists. This can have two
> beneficial effects:
>
> 1. We can avoid going back to the page allocator for awhile since we will
> find the almost free slab if the current slab is exhausted.
Well, yes, but we don't usually make that argument for allocating
more than we need - especially not when memory is low ;)
>
> 2. If the object that was allocated in the flushed slab was a short lived
> use freed then the slab will go back to the page allocator very fast.
>
> > I've no evidence that this is a significant issue: just mention
> > it in case it gives you second thoughts e.g. was there a concrete
> > scenario, other than instinct, which led you to put in that code
> > originally?
>
> The intend was to use objects that were cache hot as much as possible. Use
> of the newly allocated slab means we are likely accessing a cache cold
> page.
Ah yes. And that's certainly no argument for retaining the code,
I'm sure it's not a case we need to optimize for.
>
> However, given that it took us pretty long to find that issue I would
> think that this is not that of an important code path. So the removal
> seems to be the right way to go.
Okay, I wanted to make the point, but I've no wish to hold up your fix
(and removing code, particularly code that has given trouble, is always
welcome). Please go ahead - thanks.
Hugh
next prev parent reply other threads:[~2007-11-05 19:10 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-03 17:10 Hugh Dickins
2007-11-03 17:11 ` [PATCH 2/2] slub: fix Objects count Hugh Dickins
2007-11-03 18:26 ` Christoph Lameter
2007-11-03 19:09 ` Hugh Dickins
2007-11-03 19:33 ` Christoph Lameter
2007-11-03 20:03 ` Hugh Dickins
2007-11-03 17:27 ` [PATCH 1/2] slub: fix leakage Olivér Pintér
2007-11-03 17:50 ` Hugh Dickins
2007-11-03 18:52 ` Hugh Dickins
2007-11-03 19:39 ` Hugh Dickins
2007-11-03 19:47 ` Christoph Lameter
2007-11-03 19:52 ` Hugh Dickins
2007-11-03 19:54 ` Christoph Lameter
2007-11-03 20:10 ` Hugh Dickins
2007-11-03 20:26 ` Christoph Lameter
2007-11-04 11:18 ` Hugh Dickins
2007-11-05 18:45 ` Christoph Lameter
2007-11-05 19:09 ` Hugh Dickins [this message]
2007-11-05 19:15 ` Christoph Lameter
2007-11-05 19:23 ` Christoph Lameter
2007-11-05 19:26 ` Linus Torvalds
2007-11-05 19:31 ` Christoph Lameter
2007-11-05 19:36 ` Linus Torvalds
2007-11-06 6:15 ` Jeff Chua
2007-11-06 7:58 ` Hugh Dickins
2007-11-03 17:38 ` Willy Tarreau
2007-11-03 17:55 ` Hugh Dickins
2007-11-03 17:59 ` Willy Tarreau
2007-11-03 18:31 ` Christoph Lameter
2007-11-03 18:48 ` Christoph Lameter
2007-11-03 18:51 ` Christoph Lameter
2007-11-03 19:04 ` Hugh Dickins
2007-11-03 19:26 ` Christoph Lameter
2007-11-03 19:35 ` Hugh Dickins
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.0711051901330.28390@blonde.wat.veritas.com \
--to=hugh@veritas.com \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.pntr@gmail.com \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=w@1wt.eu \
/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®