On Sat, 28 Apr 2007 06:13:39 +0100 (BST) Hugh Dickins <[email protected]> wrote:
> On Fri, 27 Apr 2007, Andrew Morton wrote:
> >
> > hm, could do. might_sleep() is intertwined with preempt in complex ways,
> > but we did decouple that at the config level. no_mmap_sem() will dtrt for
> > all preempt settings.
> >
> > But I'll be keeping this as a -mm-only debug patch (which brings us up to
> > about thirty of 'em), so I think it's best to make it unconfigurable so we
> > get maximum coverage.
> >
> > That's if it actually works. I haven't tried running it yet, and I have a
> > feeling that running it might cause a big "doh" moment. We'll see.
>
> Yes, I'm expecting the crucial
>
> > + WARN_ON(rwsem_is_locked(&mm->mmap_sem))
>
> to give a bogus warning every time another thread (or /proc,
> or swapoff, or whatever) happens to have this mmap_sem locked.
> might_sleep() is quite different, works on our thread's info.
>
Yes. lockdep has a way of working out if this task already has a
particular lock for reading or writing, but it isn't immediately obvious
how to extract that.
I guess a simple hack would be do do a down_read() on it. If it's already
held for reading, lockdep should warn. If it's already held for writing
someone will notice.
Oh well, it's not my top priority.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]