Re: [PATCH v4 1/3] qrwlock: A queue read/write lock implementation

From: Tim Chen
Date: Thu Oct 24 2013 - 12:24:55 EST


On Thu, 2013-10-24 at 10:12 -0400, Waiman Long wrote:
> On 10/24/2013 06:14 AM, Thomas Gleixner wrote:
> > On Wed, 23 Oct 2013, Waiman Long wrote:
> >> On 10/23/2013 08:00 AM, walken@xxxxxxxxxx wrote:
> >>>> + /*
> >>>> + * Wait until the next one in queue set up the next field
> >>>> + */
> >>>> + while (likely(!(next = ACCESS_ONCE(node->next))))
> >>>> + cpu_relax();
> >>>> + /*
> >>>> + * The next one in queue is now at the head
> >>>> + */
> >>>> +notify_next:
> >>>> + barrier();
> >>>> + ACCESS_ONCE(next->wait) = false;
> >>>> + smp_wmb();
> >>>> +}
> >>> I believe this could be unified with mspin_lock() / mspin_unlock() in
> >>> kernel/mutex.c ? (there is already talk of extending these functions
> >>> to be used by rwsem for adaptive spinning as well...)
> >> It probably can, but the unification can wait until the code are in.
> > The unification has to be done as a part of this series. Cleanups are
> > part of the development process of new code and not an optional
> > feature.
> >
> > Thanks,
> >
> > tglx
> >
>
> There is an outstanding rwsem patch series that is doing the
> unification. I am waiting for that patch series to be at least in a tip
> or linux-next branch before doing the unification. Otherwise, it will
> cause merge conflict.

We can merge the 3 MCS patches of the rwsem patch series first
while we continue to work on other rwsem patches. These 3
patches are independent of the other rwsem patches.
They separate out the MCS locking into its own file and clean up
the code.

MCS Lock: Restructure the MCS lock defines and locking
https://lkml.org/lkml/2013/10/2/647
MCS Lock: optimizations and extra comments
https://lkml.org/lkml/2013/10/2/644
MCS Lock: Barrier corrections
https://lkml.org/lkml/2013/10/2/650

Thanks.

Tim



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