linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Christoph Lameter <clameter@sgi.com>
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 07:42:43 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.1.00.0803180737350.3020@woody.linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0803171135420.8746@schroedinger.engr.sgi.com>


On Mon, 17 Mar 2008, Christoph Lameter wrote:
>
> We need to reenable interrupts before calling the page allocator from the
> fallback path for kmalloc. Used to be okay with the alternate fastpath 
> which shifted interrupt enable/disable to the fastpath. But the slowpath
> is always called with interrupts disabled now. So we need this fix.

I think this fix is bogus and inefficient.

The proper fix would seem to be to just not disable the irq's 
unnecessarily!

We don't care what the return state of the interrupts are, since the 
caller will restore the _true_ interrupt state (which we don't even know 
about, so we can't do it). 

So why isn't the patch just doing something like the appended instead of 
disabling and enabling interrupts unnecessarily?

		Linus
---
 mm/slub.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 96d63eb..a082390 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1511,10 +1511,10 @@ new_slab:
 
 	new = new_slab(s, gfpflags, node);
 
-	if (gfpflags & __GFP_WAIT)
-		local_irq_disable();
-
 	if (new) {
+		if (gfpflags & __GFP_WAIT)
+			local_irq_disable();
+
 		c = get_cpu_slab(s, smp_processor_id());
 		stat(c, ALLOC_SLAB);
 		if (c->page)

--
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>

  reply	other threads:[~2008-03-18 14:42 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 [this message]
2008-03-18 17:42   ` Christoph Lameter
2008-03-18 18:25     ` Linus Torvalds
2008-03-18 18:45       ` Christoph Lameter
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=alpine.LFD.1.00.0803180737350.3020@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=linux-mm@kvack.org \
    --cc=mpm@selenic.com \
    --cc=penberg@cs.helsinki.fi \
    /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