From: Christoph Lameter <clameter@sgi.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
Pekka Enberg <penberg@cs.helsinki.fi>,
Matt Mackall <mpm@selenic.com>
Subject: Re: [git pull] slub fallback fix
Date: Tue, 18 Mar 2008 11:45:03 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0803181137250.23639@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <alpine.LFD.1.00.0803181115580.3020@woody.linux-foundation.org>
On Tue, 18 Mar 2008, Linus Torvalds wrote:
> That irq handling in the allocator doesn't "nest" correctly, and it has
> never ever been "good practice" to re-enable interrupts when they've been
> disabled by the caller anyway, so all this code already violates the
> standard rules.
Yes this interupt stuff in the slab allocators is not the nicest thing.
Surely wish we could get rid of it. The realtime folks may be able to get
there by simply not using the slab allocator from interrupt contexts.
> Just look at the patch:
>
> - if (!(gfpflags & __GFP_NORETRY) && (s->flags & __PAGE_ALLOC_FALLBACK))
> - return kmalloc_large(s->objsize, gfpflags);
> -
> + if (!(gfpflags & __GFP_NORETRY) &&
> + (s->flags & __PAGE_ALLOC_FALLBACK)) {
> + if (gfpflags & __GFP_WAIT)
> + local_irq_enable();
> + object = kmalloc_large(s->objsize, gfpflags);
> + if (gfpflags & __GFP_WAIT)
> + local_irq_disable();
> + return object;
> + }
>
> and try to tell me that the new code is more readable? I *really* don't
> agree.
Well it may now have become not so readable anymore. However, this
contains the kmalloc fallback logic in one spot. And that logic is likely
going to be generalized for 2.6.26 removing __PAGE_ALLOC_FALLBACK etc. The
chunk is going away. Either solution is fine with me. Just get it fixed.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-03-18 18:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-17 18:43 Christoph Lameter
2008-03-18 14:42 ` Linus Torvalds
2008-03-18 17:42 ` Christoph Lameter
2008-03-18 18:25 ` Linus Torvalds
2008-03-18 18:45 ` Christoph Lameter [this message]
2008-03-19 4:13 ` Linus Torvalds
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.0803181137250.23639@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=mpm@selenic.com \
--cc=penberg@cs.helsinki.fi \
--cc=torvalds@linux-foundation.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