From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965455AbcKQSOc (ORCPT ); Thu, 17 Nov 2016 13:14:32 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43906 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965184AbcKQSO1 (ORCPT ); Thu, 17 Nov 2016 13:14:27 -0500 Date: Thu, 17 Nov 2016 08:02:11 -0800 From: "Paul E. McKenney" To: Steven Rostedt Cc: Mathieu Desnoyers , Lai Jiangshan , linux-kernel , Josh Triplett , stable Subject: Re: [PATCH] Fix: disable sys_membarrier when nohz_full is enabled Reply-To: paulmck@linux.vnet.ibm.com References: <1478190568-5829-1-git-send-email-mathieu.desnoyers@efficios.com> <604945667.4957.1479383194368.JavaMail.zimbra@efficios.com> <20161117134015.GT3612@linux.vnet.ibm.com> <11301812.5114.1479390867218.JavaMail.zimbra@efficios.com> <20161117095011.1857bca5@gandalf.local.home> <1466810760.5394.1479394938124.JavaMail.zimbra@efficios.com> <20161117101725.3abcb413@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161117101725.3abcb413@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16111716-8235-0000-0000-000009A1AA05 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006094; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000189; SDB=6.00781989; UDB=6.00377289; IPR=6.00559493; BA=6.00004889; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013361; XFM=3.00000011; UTC=2016-11-17 16:02:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16111716-8236-0000-0000-0000368AD5C0 Message-Id: <20161117160211.GB3612@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-17_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611170283 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 17, 2016 at 10:17:25AM -0500, Steven Rostedt wrote: > On Thu, 17 Nov 2016 15:02:18 +0000 (UTC) > Mathieu Desnoyers wrote: > > > > That's an interesting approach. I would be tempted to give it a > > per-thread (rather than per-process) scope. > > Sure, per thread, but have it inherit to child processes. > > > > > E.g., a thread could do the following to ask to be > > interrupted by IPIs: > > > > membarrier(MEMBARRIER_CMD_REGISTER_EXPEDITED, 0) > > > > and could unregister with: > > > > membarrier(MEMBARRIER_CMD_UNREGISTER_EXPEDITED, 0) > > Sure why not ;-) Makes a lot of sense to me! > > We can then keep a per-thread refcount internally. > > (not sure the "EXPEDITED" is the right word there... > > do we want it to be "NOHZ_FULL" instead ?) > > No, it shouldn't mention NOHZ_FULL. Perhaps have all tasks do this > regardless, even though it will only affect nohz full ones. But in the > future it may be other tasks as well. > > > > > Then in membarrier(MEMBARRIER_CMD_SHARED, 0), for each > > nohz_full cpu, we grab the rq lock, and only send an IPI > > if the running thread is registered as "expedited". > > Yeah, something like that. That way it wont interrupt tasks that are > running in no-hz-full and don't care about this syscall. And this as well! Thanx, Paul