Re: [PATCH] hugetlbfs: lockdep annotate root inode properly

From: Andrew Morton
Date: Thu Mar 08 2012 - 17:45:28 EST


On Thu, 8 Mar 2012 17:33:34 -0500
Dave Jones <davej@xxxxxxxxxx> wrote:

> On Thu, Mar 08, 2012 at 02:19:38PM -0800, Andrew Morton wrote:
> > On Thu, 8 Mar 2012 21:49:52 +0000
> > Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > > > So we need to pull the i_mutex out of hugetlbfs_file_mmap().
> > >
> > > IIRC, you have a patch in your tree doing just that...
> >
> > Nope.
> >
> > But it seems that you've recently seen such a patch - can you recall
> > where?
>
> this ? https://lkml.org/lkml/2012/2/23/64
>

Thanks, yes, probably that. Needs the i_size_read()/write() changes.

I worry a bit about the region handling code in mm/hugetlb.c.

* The region data structures are protected by a combination of the mmap_sem
* and the hugetlb_instantion_mutex. To access or modify a region the caller
* must either hold the mmap_sem for write, or the mmap_sem for read and
* the hugetlb_instantiation mutex:

I hope that's true - it would be nice to have some debug assertions in
the various region_foo() functions to verify that the required locks are
held.

But if that code is all nice and tight, I guess that removing that
i_mutex acquisition will be pretty simple.

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