[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0906151051240.19931@gentwo.org>
Date: Mon, 15 Jun 2009 10:55:47 -0400 (EDT)
From: Christoph Lameter <cl@...ux-foundation.org>
To: Pekka J Enberg <penberg@...helsinki.fi>
cc: torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, kamezawa.hiroyu@...fujitsu.com,
lizf@...fujitsu.com, mingo@...e.hu, npiggin@...e.de,
yinghai@...nel.org, benh@...nel.crashing.org
Subject: Re: [GIT PULL v2] Early SLAB fixes for 2.6.31
On Sun, 14 Jun 2009, Pekka J Enberg wrote:
> How about something like this? There should be no extra code in fastpaths
> for production configs with this one.
Yes something like that would be good. More comments below.
> index 4d6004c..5e8cea1 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -1613,6 +1613,8 @@ another_slab:
> deactivate_slab(s, c);
>
> new_slab:
> + gfpflags &= slab_gfp_mask;
> +
Move the processing of GFP_RECLAIM_MASK etc up to here from new_slab? Then
the flow is also more logical. The flags handling is concentrated in one
spot in the allocator and its more obvious how we handle gfp flags.
> @@ -1668,13 +1670,14 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
> struct kmem_cache_cpu *c;
> unsigned long flags;
> unsigned int objsize;
> + gfp_t real_gfp;
>
> - gfpflags &= slab_gfp_mask;
> + real_gfp = gfpflags & slab_gfp_mask;
>
> - lockdep_trace_alloc(gfpflags);
> - might_sleep_if(gfpflags & __GFP_WAIT);
> + lockdep_trace_alloc(real_gfp);
> + might_sleep_if(real_gfp & __GFP_WAIT);
>
> - if (should_failslab(s->objsize, gfpflags))
> + if (should_failslab(s->objsize, real_gfp))
> return NULL;
>
> local_irq_save(flags);
Dont do it there. Only modify the slow path.
Look at __might_sleep(). It already has an exception for system_state !=
RUNNING. If it still triggers then add to the condition there.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists