From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Paul E. McKenney" Subject: Re: [RFC PATCH v2 1/2] membarrier: Provide register expedited private command Date: Thu, 21 Sep 2017 08:27:28 -0700 Message-ID: <20170921152728.GF3521@linux.vnet.ibm.com> References: <20170918223648.31505-1-mathieu.desnoyers@efficios.com> <20170921121344.movkcoj6rm2s23ig@hirez.programming.kicks-ass.net> <196603634.15769.1506006703406.JavaMail.zimbra@efficios.com> Reply-To: paulmck@linux.vnet.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <196603634.15769.1506006703406.JavaMail.zimbra@efficios.com> Sender: linux-kernel-owner@vger.kernel.org To: Mathieu Desnoyers Cc: Peter Zijlstra , linux-kernel , Boqun Feng , Andrew Hunter , maged michael , gromer , Avi Kivity , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Dave Watson , Alan Stern , Will Deacon , Andy Lutomirski , linux-arch List-Id: linux-arch.vger.kernel.org On Thu, Sep 21, 2017 at 03:11:43PM +0000, Mathieu Desnoyers wrote: > ----- On Sep 21, 2017, at 8:13 AM, Peter Zijlstra peterz@infradead.org wrote: > > > On Mon, Sep 18, 2017 at 06:36:47PM -0400, Mathieu Desnoyers wrote: > >> @@ -3373,6 +3362,7 @@ static void __sched notrace __schedule(bool preempt) > >> > >> /* Also unlocks the rq: */ > >> rq = context_switch(rq, prev, next, &rf); > >> + membarrier_arch_sched_in(prev, next); > > > > That's wrong iirc; we just switched stacks, you cannot use @prev and > > @next. > > Yes, it did indeed explode spectacularly at boot in testing. RFC v3 fixes that. Good to hear that there is a useful test. ;-) Thanx, Paul > Thanks, > > Mathieu > > > > > >> } else { > >> rq->clock_update_flags &= ~(RQCF_ACT_SKIP|RQCF_REQ_SKIP); > > > rq_unlock_irq(rq, &rf); > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38772 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751387AbdIUP1f (ORCPT ); Thu, 21 Sep 2017 11:27:35 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8LFPgPr121142 for ; Thu, 21 Sep 2017 11:27:35 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2d4f6231aa-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 21 Sep 2017 11:27:34 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 21 Sep 2017 11:27:34 -0400 Date: Thu, 21 Sep 2017 08:27:28 -0700 From: "Paul E. McKenney" Subject: Re: [RFC PATCH v2 1/2] membarrier: Provide register expedited private command Reply-To: paulmck@linux.vnet.ibm.com References: <20170918223648.31505-1-mathieu.desnoyers@efficios.com> <20170921121344.movkcoj6rm2s23ig@hirez.programming.kicks-ass.net> <196603634.15769.1506006703406.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <196603634.15769.1506006703406.JavaMail.zimbra@efficios.com> Message-ID: <20170921152728.GF3521@linux.vnet.ibm.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Mathieu Desnoyers Cc: Peter Zijlstra , linux-kernel , Boqun Feng , Andrew Hunter , maged michael , gromer , Avi Kivity , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Dave Watson , Alan Stern , Will Deacon , Andy Lutomirski , linux-arch Message-ID: <20170921152728.JWe-GMAr6qWI-sWy7qP2MneKiAe7-kjQMyZnKswZ6wY@z> On Thu, Sep 21, 2017 at 03:11:43PM +0000, Mathieu Desnoyers wrote: > ----- On Sep 21, 2017, at 8:13 AM, Peter Zijlstra peterz@infradead.org wrote: > > > On Mon, Sep 18, 2017 at 06:36:47PM -0400, Mathieu Desnoyers wrote: > >> @@ -3373,6 +3362,7 @@ static void __sched notrace __schedule(bool preempt) > >> > >> /* Also unlocks the rq: */ > >> rq = context_switch(rq, prev, next, &rf); > >> + membarrier_arch_sched_in(prev, next); > > > > That's wrong iirc; we just switched stacks, you cannot use @prev and > > @next. > > Yes, it did indeed explode spectacularly at boot in testing. RFC v3 fixes that. Good to hear that there is a useful test. ;-) Thanx, Paul > Thanks, > > Mathieu > > > > > >> } else { > >> rq->clock_update_flags &= ~(RQCF_ACT_SKIP|RQCF_REQ_SKIP); > > > rq_unlock_irq(rq, &rf); > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com >