Re: [PATCH] lockdep: lock_set_subclass - reset a held lock's subclass

From: Hugh Dickins
Date: Fri Aug 01 2008 - 16:34:22 EST


On Fri, 1 Aug 2008, Jeremy Fitzhardinge wrote:
> Hugh Dickins wrote:
> > Please check the spin_lock_nested() in move_ptes() in mm/mremap.c.
> >
> > If you have down_write(&mm->mmap_sem) then you should be safe,
> > but may need to do something to placate lockdep. If you don't
> > have down_write(&mm->mmap_sem), then I think you're in trouble?
> >
> > Not a big deal, the move_ptes() locking can be adjusted to suit
> > your rule, it was just easier to do it the way it is at the time.
>
> Ah, yes, I did look at that. I think it isn't an issue, because my code is
> called from dup_mmap(), activate_mm() or exit_mmap().
>
> dup_mmap() already holds mmap_sem.
>
> activate_mm() in exec doesn't hold the sem, but I don't think it's possible
> for anyone to be racing against it.
> activate_mm() in unshare doesn't seem to get used.
>
> exit_mmap() gets called when there are no other users, so we'd better not be
> racing...

All safe against mremap, agreed.

Hugh
--
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/