Re: [PATCH v2] ipc/msg: Implement lockless pipelined wakeups

From: Davidlohr Bueso
Date: Wed Nov 04 2015 - 13:11:52 EST


On Tue, 03 Nov 2015, Sebastian Andrzej Siewior wrote:

In pipelined_receive() (mqueue) there is the wake_q_add() with the
implicit cmpxchg barrier. The matching barrier pairing should be in
wq_sleep() but there is none. Why is it okay to have none there and I
need one here?

So the pairing in mqueue is done in wq_sleep() as we unlock info->lock,
so there's an implied barrier there.

Also, considering Peter's suggestion to wrap around READ/WRITE_ONCE
for sysv queues (specially since you got rid of the volatile tag),
it seems we also need them for mqueues.

Thanks,
Davidlohr
--
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/