Re: [RFC/PATCH] No get_user/put_user while holding mmap_sem indo_pages_stat?

From: Peter Zijlstra
Date: Tue Dec 09 2008 - 12:46:42 EST


On Tue, 2008-12-09 at 17:47 +0100, Brice Goglin wrote:
> Peter Zijlstra wrote:
> > On Sun, 2008-12-07 at 15:21 +0100, Brice Goglin wrote:
> >
> >> Andrew Morton wrote:
> >>
> >>> Was lockdep able to tell you about this in any way?
> >>>
> >>>
> >> With CONFIG_PROVE_LOCKING (assuming that it's enough), it doesn't detect
> >> the problem for real. It just says "possible recursive locking detected"
> >> between do_page_fault and sys_move_pages.
> >>
> >
> > That is real - how much more real do you need a description of a
> > recursive deadlock to be?
> >
>
> Well, it's a recursive down_read. It could be ok if we had the guarantee
> that nobody else would be doing down_write in the middle. lockdep only
> complained about this recursive down_read when there was a down_write
> actually causing the deadlock, but it didn't say anything about this
> down_write in the log.
>
> It would be great if lockdep could say "recursive read-lock is
> deadlocking because this other guy (with its backtrace) took for write
> in the middle". I needed sysrq-t to get this info.

rwsem does not support recursive read-locks, so irrespective of write
side locks, its a bug.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/