On Mon, 2014-02-03 at 20:25 +0100, Peter Zijlstra wrote:

> +void m_spin_unlock(struct m_spinlock **lock)
> +{
> +     struct m_spinlock *node = this_cpu_ptr(&m_node);
> +     struct m_spinlock *next;
> +
> +     if (likely(cmpxchg(lock, node, NULL) == node))
> +             return;

At this current point, (node->next != NULL) is a likely scenario.
Perhaps we can also add the following code here:

        next = xchg(&node->next, NULL);
        if (next) {
                ACCESS_ONCE(next->locked) = 1;
                return;
        }

> +     next = m_spin_wait_next(lock, node, NULL);
> +     if (next)
> +             ACCESS_ONCE(next->locked) = 1;
> +}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to