[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120919164411.GP1560@cmpxchg.org>
Date: Wed, 19 Sep 2012 12:44:11 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: Hugh Dickins <hughd@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Sasha Levin <levinsasha928@...il.com>,
Mel Gorman <mel@....ul.ie>, Rik van Riel <riel@...hat.com>,
Michel Lespinasse <walken@...gle.com>,
Ying Han <yinghan@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] mm: fix invalidate_complete_page2 lock ordering
On Tue, Sep 18, 2012 at 08:51:47PM -0700, Hugh Dickins wrote:
> In fuzzing with trinity, lockdep protested "possible irq lock inversion
> dependency detected" when isolate_lru_page() reenabled interrupts while
> still holding the supposedly irq-safe tree_lock:
>
> invalidate_inode_pages2
> invalidate_complete_page2
> spin_lock_irq(&mapping->tree_lock)
> clear_page_mlock
> isolate_lru_page
> spin_unlock_irq(&zone->lru_lock)
>
> isolate_lru_page() is correct to enable interrupts unconditionally:
> invalidate_complete_page2() is incorrect to call clear_page_mlock()
> while holding tree_lock, which is supposed to nest inside lru_lock.
>
> Both truncate_complete_page() and invalidate_complete_page() call
> clear_page_mlock() before taking tree_lock to remove page from
> radix_tree. I guess invalidate_complete_page2() preferred to test
> PageDirty (again) under tree_lock before committing to the munlock;
> but since the page has already been unmapped, its state is already
> somewhat inconsistent, and no worse if clear_page_mlock() moved up.
>
> Reported-by: Sasha Levin <levinsasha928@...il.com>
> Deciphered-by: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Hugh Dickins <hughd@...gle.com>
> Cc: Mel Gorman <mel@....ul.ie>
> Cc: Rik van Riel <riel@...hat.com>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: Michel Lespinasse <walken@...gle.com>
> Cc: Ying Han <yinghan@...gle.com>
> Cc: stable@...r.kernel.org
Acked-by: Johannes Weiner <hannes@...xchg.org>
--
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