Re: sched: softlockups in multi_cpu_stop

Davidlohr Bueso
2015-03-06T19:55:13Z

On Fri, 2015-03-06 at 11:32 -0800, Linus Torvalds wrote:

> IOW, I wonder if we could special-case the common non-IO
> fault-handling path something along the lines of:
>
> - look up the vma in the vma lookup cache

But you'd still need mmap_sem there to at least get the VMA's first
value.

> - look up the page in the page cache
> - get the page table spinlock
> - re-check the vma now (it ends up being stable if it can't be torn
> down due to the page table spinlock)
>
> because I suspect that page faults are the biggest users of that
> mmap_sem, and we could probably handle a fairly large common case
> (making it simpler by special-casing it and punting in any even
> _slightly_ complicated situations) without even getting the semaphore
> at all, since we have to serialize on the actual page table *anyway*.
>
> Basically, to me, the whole "if a lock is so contended that we need to
> play locking games, then we should look at why we *use* the lock,
> rather than at the lock itself" is a religion.
>
> Linus
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/