lkml.org 
[lkml]   [2015]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] ipc/mqueue: remove STATE_PENDING
On Fri, 10 Apr 2015, Sebastian Andrzej Siewior wrote:
> >And: please test it, too. (patch the kernel so that you can trigger
> >this case).
>
> Why patch? Isn't this triggered if you have a reader waiting and you
> send a message?

Manfred referred to the exit race. Though you can spare that exercise
as it is safe by definition if you hold a ref on the task.

Can you please convert that over to Peters lockless wake queues so we
do not reimplement the same thing open coded here.

> +static struct task_struct *pipelined_send(struct mqueue_inode_info *info,
> struct msg_msg *message,
> struct ext_wait_queue *receiver)
> {
> + struct task_struct *r_task;
> +
> receiver->msg = message;
> list_del(&receiver->list);
> - receiver->state = STATE_PENDING;
> - wake_up_process(receiver->task);
> + r_task = receiver->task;
> + get_task_struct(r_task);
> smp_wmb();

While we are at it. The barrier here and the one in pipelined_receive
are not documented and they are missing a proper pairing on the read
side. The comment which you removed was pretty vague about the purpose
of the barrier as well.

Thanks,

tglx













\
 
 \ /
  Last update: 2015-04-24 00:41    [W:0.107 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site