Re: [rfc][patch 1/2] mnt_want_write speedup 1

Nick Piggin
2008-12-19T06:54:37Z

On Fri, Dec 19, 2008 at 07:52:42AM +0100, Nick Piggin wrote:
> On Thu, Dec 18, 2008 at 10:34:52PM -0800, Dave Hansen wrote:
> > Yes, I think it can tolerate it. There's a lot of work to do, and we
> > already have to go touch all the other per-cpu objects. There also
> > tends to be writeout when this happens, so I don't think a few seconds,
> > even, will be noticed.
>
> That would be good. After the first patch, mnt_want_write still shows up
> on profiles and almost oall the hits come right after the msync from
> the smp_mb there.
>
> It would be really nice to use RCU here. I think it might allow us to
> eliminate the memory barriers.

Actually we might be able to use a seqcounter to eliminate the most
expensive (smp_mb()) barrier. But that's more code and adds a couple
of smp_rmb()s which would be slower on some architectures.... Not to
mention more code and branches.

But I'll investigate that option if RCU is ruled out.