Re: Possible lock-less list race in scheduler_ipi()

2015-03-06 Thread Mathieu Desnoyers
Zijlstra pet...@infradead.org, LKML linux-kernel@vger.kernel.org, Ingo Molnar mi...@kernel.org, Steven Rostedt rost...@goodmis.org Sent: Thursday, March 5, 2015 8:02:06 PM Subject: Re: Possible lock-less list race in scheduler_ipi() On Thu, Mar 5, 2015 at 3:48 PM, Mathieu Desnoyers

Re: Possible lock-less list race in scheduler_ipi()

2015-03-06 Thread Paul E. McKenney
On Thu, Mar 05, 2015 at 11:48:51PM +, Mathieu Desnoyers wrote: Hi, I recently reviewed the scheduler_ipi() code by coincidence, and noticed that the use of llist.h in there seemed a bit odd. So I'd like to have more eyes to help me look into this. I've been told that there has been

Re: Possible lock-less list race in scheduler_ipi()

2015-03-06 Thread Steven Rostedt
On Fri, 6 Mar 2015 14:35:23 + (UTC) Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: Indeed, the compiler should never reorder loads/stores from/to same memory location from a program order POV. What I had in mind is a bit more far-fetched though: it would involve having the

Re: Possible lock-less list race in scheduler_ipi()

2015-03-06 Thread Mathieu Desnoyers
Jiangshan eag0...@gmail.com, Peter Zijlstra pet...@infradead.org, LKML linux-kernel@vger.kernel.org, Ingo Molnar mi...@kernel.org Sent: Friday, March 6, 2015 2:03:47 PM Subject: Re: Possible lock-less list race in scheduler_ipi() On Fri, 6 Mar 2015 14:35:23 + (UTC) Mathieu Desnoyers

Re: Possible lock-less list race in scheduler_ipi()

2015-03-06 Thread Steven Rostedt
On Fri, 6 Mar 2015 15:38:21 -0500 Steven Rostedt rost...@goodmis.org wrote: On Fri, 6 Mar 2015 19:39:44 + (UTC) Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: ask concurrently with the llist iteration within sched_ttwu_pending(). AFAIU, ttwu_queue_remote() is called from

Re: Possible lock-less list race in scheduler_ipi()

2015-03-06 Thread Steven Rostedt
On Fri, 6 Mar 2015 19:39:44 + (UTC) Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: ask concurrently with the llist iteration within sched_ttwu_pending(). AFAIU, ttwu_queue_remote() is called from ttwu_queue() without holding the rq lock. So I'm wondering what prevents corruption

Re: Possible lock-less list race in scheduler_ipi()

2015-03-06 Thread Mathieu Desnoyers
Jiangshan eag0...@gmail.com, Peter Zijlstra pet...@infradead.org, LKML linux-kernel@vger.kernel.org, Ingo Molnar mi...@kernel.org Sent: Friday, March 6, 2015 3:39:25 PM Subject: Re: Possible lock-less list race in scheduler_ipi() On Fri, 6 Mar 2015 15:38:21 -0500 Steven Rostedt rost

Possible lock-less list race in scheduler_ipi()

2015-03-05 Thread Mathieu Desnoyers
Hi, I recently reviewed the scheduler_ipi() code by coincidence, and noticed that the use of llist.h in there seemed a bit odd. So I'd like to have more eyes to help me look into this. I've been told that there has been issues with IPIs lately, so here is one possible scenario I think might be

Re: Possible lock-less list race in scheduler_ipi()

2015-03-05 Thread Linus Torvalds
On Thu, Mar 5, 2015 at 3:48 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: llist_next() is pretty simple: static inline struct llist_node *llist_next(struct llist_node *node) { return node-next; } It is so simple that I wonder if the compiler would be within its