[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181218172714.fa3zpoyqndarqgd3@linux-r8p5>
Date: Tue, 18 Dec 2018 09:27:14 -0800
From: Davidlohr Bueso <dave@...olabs.net>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Yongji Xie <elohimes@...il.com>, mingo@...hat.com,
will.deacon@....com, linux-kernel@...r.kernel.org,
Xie Yongji <xieyongji@...du.com>, zhangyu31@...du.com,
liuqi16@...du.com, yuanlinsi01@...du.com, nixun@...du.com,
lilin24@...du.com, longman@...hat.com,
andrea.parri@...rulasolutions.com
Subject: Re: [RFC] locking/rwsem: Avoid issuing wakeup before setting the
reader waiter to nil
On Tue, 18 Dec 2018, Peter Zijlstra wrote:
>> I'd rather do it like so, except I'm still conflicted on the naming.
>
>> +void wake_q_add(struct wake_q_head *head, struct task_struct *task)
>> +{
>> + if (__wake_q_add(head, task))
>> + get_task_struct(task);
>> +}
>> +
>> +void wake_q_add_safe(struct wake_q_head *head, struct task_struct *task)
>> +{
>> + if (!__wake_a_add(head, task))
>> + put_task_struct(task);
>> }
>
>That is, in the one case it has internal reference counting, in the
>other case it consumes the reference counting.
Yeah I like that better for an interface. Also no concurrency in head
so delaying the get() should be ok.
Thanks,
Davidlohr
Powered by blists - more mailing lists