[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <49AF891A.30200@kernel.org>
Date:	Thu, 05 Mar 2009 17:11:06 +0900
From:	Tejun Heo <tj@...nel.org>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
	Nick Piggin <npiggin@...e.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: percpu allocator vs reclaim
Peter Zijlstra wrote:
> On Thu, 2009-03-05 at 01:40 +0900, Tejun Heo wrote:
>> Peter Zijlstra wrote:
>>> Hi Tejun,
>>>
>>> Thomas hit the below on recent -tip kernels.
>>>
>>> Which basically states that we could deadlock due to reclaim lock
>>> recursion.
>>>
>>> Looking at the code I don't see a quick solution, other than using
>>> GFP_NOFS, which is a bit of a bother (as I suspect it might easily grow
>>> __GFP_IO inversion too, if it doesn't already have it).
>> Ah... maybe percpu allocator should just swallow @gfp.  Any better
>> ideas? :-(
> 
> Could you somehow break that lock so that you get something like:
> 
>   alloc_lock
>     kmalloc(GFP_KERNEL)
>     free_lock
> 
> Where
> 
>  percpu_free()
>    lock(free_lock)
>      put area on free list
> 
>  percpu_alloc()
>    lock(free_list)
>      collect free list
>    kmalloc()
> 
> Then the free code can be used from reclaim, because there's never an
> allocation done while holding it, and the alloc path can first
> check/cleanup whatever mess the last free left behind before trying an
> allocation.
Yeap, I think I can do that.  Will work on it.
Thanks.
-- 
tejun
--
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
 
