lkml.org 
[lkml]   [2015]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] ipc/msg: Implement lockless pipelined wakeups
On Tue, Nov 03, 2015 at 04:03:29PM +0100, Sebastian Andrzej Siewior wrote:
> @@ -932,58 +924,26 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
> rcu_read_lock();
>
> /* Lockless receive, part 2:

This is a broken comment style, please fix that while you're there
anyway.

Also, the comment above ("Lockless receive, part 1:") is broken
too, not only in style, but it refers to rcu_read_unlock() as disabling
preemption, and avoiding preemption, which is false.

> + * The work in pipelined_send() and expunge_all():
> + * - Set pointer to message
> + * - Queue the receiver task for later wakeup
> + * - Wake up the process after the lock is dropped.
> *
> + * Should the process wake up before this wakeup (due to a
> + * signal) it will either see the message and continue ...
> */
>
> + msg = msr_d.r_msg;

Since this is a lockless read, it should very much be READ_ONCE(), esp.
since you killed the volatile on its type.


\
 
 \ /
  Last update: 2015-11-04 13:21    [W:0.104 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site