[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1236185363.5330.8121.camel@laptop>
Date:	Wed, 04 Mar 2009 17:49:23 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Tejun Heo <tj@...nel.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
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.
--
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
 
