lkml.org 
[lkml]   [2009]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [BUGFIX][PATCH] memcg: fix deadlock between lock_page_cgroupand mapping tree_lock
* Andrew Morton <akpm@linux-foundation.org> [2009-05-13 11:56:26]:

> On Wed, 13 May 2009 13:30:31 +0900
> Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:
>
> > mapping->tree_lock can be aquired from interrupt context.
> > Then, following dead lock can occur.
> >
> > Assume "A" as a page.
> >
> > CPU0:
> > lock_page_cgroup(A)
> > interrupted
> > -> take mapping->tree_lock.
> > CPU1:
> > take mapping->tree_lock
> > -> lock_page_cgroup(A)
>
> And we didn't find out about this because lock_page_cgroup() uses
> bit_spin_lock(), and lockdep doesn't handle bit_spin_lock().
>
> It would perhaps be useful if one of you guys were to add a spinlock to
> struct page, convert lock_page_cgroup() to use that spinlock then run a
> full set of tests under lockdep, see if it can shake out any other bugs.
>

May be under DEBUG_VM we could do that. Good suggestion!

--
Balbir


\
 
 \ /
  Last update: 2009-05-14 05:01    [W:0.048 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site