Re: 3.8-rc2: lockdep is complaining about mm_take_all_locks()

From: Jiri Kosina
Date: Fri Jan 04 2013 - 10:39:45 EST


On Fri, 4 Jan 2013, Jiri Kosina wrote:

> This is almost certainly because
>
> commit 5a505085f043e8380f83610f79642853c051e2f1
> Author: Ingo Molnar <mingo@xxxxxxxxxx>
> Date: Sun Dec 2 19:56:46 2012 +0000
>
> mm/rmap: Convert the struct anon_vma::mutex to an rwsem
>
> did this to mm_take_all_locks():
>
> - mutex_lock_nest_lock(&anon_vma->root->mutex, &mm->mmap_sem);
> + down_write(&anon_vma->root->rwsem);
>
> killing the lockdep annotation that has been there since
>
> commit 454ed842d55740160334efc9ad56cfef54ed37bc
> Author: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> Date: Mon Aug 11 09:30:25 2008 +0200
>
> lockdep: annotate mm_take_all_locks()
>
> The locking is obviously correct due to mmap_sem being held throughout the
> whole operation, but I am not completely sure how to annotate this
> properly for lockdep in down_write() case though. Ingo, please?

OK, I think the only solution is to introduce down_read_nest_lock(). I
will prepare a patch.

--
Jiri Kosina
SUSE Labs
--
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/