Re: [PATCH v2] membarrier: Document scheduler barrier requirements

2017-09-19 Thread Mathieu Desnoyers
- On Sep 19, 2017, at 5:47 PM, Andrea Parri parri.and...@gmail.com wrote: > On Tue, Sep 19, 2017 at 03:56:31PM -0400, Mathieu Desnoyers wrote: >> Document the membarrier requirement on having a full memory barrier in >> __schedule() after coming from user-space, before storing to rq->curr. >>

Re: [PATCH v2] membarrier: Document scheduler barrier requirements

2017-09-19 Thread Andrea Parri
On Tue, Sep 19, 2017 at 03:56:31PM -0400, Mathieu Desnoyers wrote: > Document the membarrier requirement on having a full memory barrier in > __schedule() after coming from user-space, before storing to rq->curr. > It is provided by smp_mb__before_spinlock() in __schedule(). It is smp_mb__after_sp

[PATCH v2] membarrier: Document scheduler barrier requirements

2017-09-19 Thread Mathieu Desnoyers
Document the membarrier requirement on having a full memory barrier in __schedule() after coming from user-space, before storing to rq->curr. It is provided by smp_mb__before_spinlock() in __schedule(). Document that membarrier requires a full barrier on transition from kernel thread to userspace

Re: [PATCH v2] membarrier: Document scheduler barrier requirements

2017-08-21 Thread Paul E. McKenney
On Mon, Aug 21, 2017 at 10:42:36AM +0200, Peter Zijlstra wrote: > On Fri, Aug 18, 2017 at 09:39:16PM -0700, Mathieu Desnoyers wrote: > > @@ -3295,6 +3301,9 @@ static void __sched notrace __schedule(bool preempt) > > * Make sure that signal_pending_state()->signal_pending() below > > * can

Re: [PATCH v2] membarrier: Document scheduler barrier requirements

2017-08-21 Thread Peter Zijlstra
On Fri, Aug 18, 2017 at 09:39:16PM -0700, Mathieu Desnoyers wrote: > @@ -3295,6 +3301,9 @@ static void __sched notrace __schedule(bool preempt) >* Make sure that signal_pending_state()->signal_pending() below >* can't be reordered with __set_current_state(TASK_INTERRUPTIBLE) >

Re: [PATCH v2] membarrier: Document scheduler barrier requirements

2017-08-19 Thread Paul E. McKenney
On Fri, Aug 18, 2017 at 09:39:16PM -0700, Mathieu Desnoyers wrote: > Document the membarrier requirement on having a full memory barrier in > __schedule() after coming from user-space, before storing to rq->curr. > It is provided by smp_mb__before_spinlock() in __schedule(). > > Document that memb

[PATCH v2] membarrier: Document scheduler barrier requirements

2017-08-18 Thread Mathieu Desnoyers
Document the membarrier requirement on having a full memory barrier in __schedule() after coming from user-space, before storing to rq->curr. It is provided by smp_mb__before_spinlock() in __schedule(). Document that membarrier requires a full barrier on transition from kernel thread to userspace