Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp411938imm; Thu, 28 Jun 2018 23:21:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcElNU/Ch5mZFbyqdAJZAsUy6GBrW7e1PTDASOkwrEnPJ31M0FD0CvqN8xT5fr71vYE36xl X-Received: by 2002:a62:4c88:: with SMTP id e8-v6mr12984040pfj.99.1530253316166; Thu, 28 Jun 2018 23:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530253316; cv=none; d=google.com; s=arc-20160816; b=kpg75Mf3pN4sidl3Fx91vS40/0xzN17wDazXrhZRvU0lCOryw2AgPqKJQPbz7ARM4V 15g4Otdit0gMe+In5ObvsLDaRTsCBchYkzyZe6roDeTTrrdzIn7qBC0YpkzKSGZo3oJp ltByBxX4amGKnK9w1hbKCHQycnV8ix+XSp2+kppUI6GepT0eVw14jsOnrOV6KxiscfpP gvUbiLrZnhbY8OHau3U34j+yKUBGSBpviEWDwm/DeLAym5/Z++SiQ0SoiU0zedPvCUCX ugdDIpU4AnRENn8st+vrJge3DJbKur0LUTSV3IgN8+aqDmRw+Fr/b3n2v3T+xsk6aRyp M57Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=VjCH5z1AQWCp2BUIfnK5Uv5p0/OswEZKt0ItJN1pQPs=; b=Y2hJdN5Ho8pn8OsglNVJe1jQ1reAkVcXe6xjeIJdHfCch2NrBBl/VupUagkE23uwak v7XCbl/3u3EW0XsjYjemkRxy5t4NWubnWvSg8dTUr1JZsyjZyk1p3DovXzYpFCtwjIFd JuxGfQ51KArDkbFdZJ6hy6Rt2rs6zva8wkABb/F1Qhw4pSVy2owJlGlckYzs8P3PaIfF UT2TAroiYlDPlM6KgJyiJg97oTfpjuKeBcsg2Lj3kz3oIqIdDW2uLZJRFEWYY2sHEpjR QwBp0h0RIpTNgp7Gr2srrUBR4MxjrAIvo5LLfUxdvylSa4Sge09lgcuDqSs1LGVaerhy UMDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g80-v6si3792608pfk.53.2018.06.28.23.21.41; Thu, 28 Jun 2018 23:21:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754946AbeF1Vjr (ORCPT + 99 others); Thu, 28 Jun 2018 17:39:47 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59952 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753805AbeF1Vjq (ORCPT ); Thu, 28 Jun 2018 17:39:46 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5SLdjJn096580 for ; Thu, 28 Jun 2018 17:39:45 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jw4sgf44n-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 28 Jun 2018 17:39:45 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 28 Jun 2018 17:39:17 -0400 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 28 Jun 2018 17:39:14 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5SLdDBG14876970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 28 Jun 2018 21:39:13 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 21B61B2067; Thu, 28 Jun 2018 17:39:04 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE719B206E; Thu, 28 Jun 2018 17:39:03 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.159]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 28 Jun 2018 17:39:03 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 8754A16C5F24; Thu, 28 Jun 2018 14:41:20 -0700 (PDT) Date: Thu, 28 Jun 2018 14:41:20 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: Andy Lutomirski , Steven Rostedt , max.byungchul.park@gmail.com, Byungchul Park , Lai Jiangshan , Josh Triplett , Mathieu Desnoyers , LKML , kernel-team@lge.com Subject: Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks Reply-To: paulmck@linux.vnet.ibm.com References: <20180622055659.GA255098@joelaf.mtv.corp.google.com> <20180622132843.GN3593@linux.vnet.ibm.com> <20180622181916.GA13628@joelaf.mtv.corp.google.com> <20180622205813.GV3593@linux.vnet.ibm.com> <20180622170042.4adfbe21@gandalf.local.home> <20180622211600.GX3593@linux.vnet.ibm.com> <20180623175356.GH3593@linux.vnet.ibm.com> <20180628200205.GA6374@linux.vnet.ibm.com> <20180628211315.GA230720@joelaf.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180628211315.GA230720@joelaf.mtv.corp.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18062821-0072-0000-0000-00000376BC0A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009273; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01053718; UDB=6.00540299; IPR=6.00831641; MB=3.00021914; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-28 21:39:16 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062821-0073-0000-0000-00004885DA8C Message-Id: <20180628214120.GQ3593@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-28_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806280239 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 28, 2018 at 02:13:15PM -0700, Joel Fernandes wrote: > On Thu, Jun 28, 2018 at 01:02:05PM -0700, Paul E. McKenney wrote: > > > > wrote: > [..] > > > > > > > > > So why this function-call structure? Well, you see, NMI handlers can > > > > > > > > > take what appear to RCU to be normal interrupts... > > > > > > > > > > > > > > > > > > (And I just added that fun fact to Requirements.html.) > > > > > > > > > > > > > > > > Yes, I'll definitely go through all the interrupt requirements in the doc and > > > > > > > > thanks for referring me to it. > > > > > > > > > > > > > > My concern may well be obsolete. It would be good if it was! ;-) > > > > > > > > > > > > I'd love to mandate that irq_enter() must be paired with irq_exit(). I > > > > > > don't really see any rationale for it to be otherwise. If there is a > > > > > > case, perhaps it needs to be fixed. > > > > > > > > > > Given that the usermode helpers now look to be common code using > > > > > workqueues, kthreads, and calls to do_execve(), it might well be that > > > > > the days of half-interrupts are behind us. > > > > > > > > > > But how to actually validate this? My offer of adding a WARN_ON_ONCE() > > > > > and waiting a few years still stands, but perhaps you have a better > > > > > approach. > > > > > > > > I think you should add a WARN_ON_ONCE(). Let's get the bugs fixed. > > > > > > Or the obscure features identified, as the case may be. ;-) > > > > > > Either way, will do! > > > > And here is a prototype patch. > > > > Thanx, Paul > > > > ------------------------------------------------------------------------ > > > > commit ef544593a7bcad74628fa0537badc49dce1f2d95 > > Author: Paul E. McKenney > > Date: Thu Jun 28 12:45:23 2018 -0700 > > > > rcu: Add warning to detect half-interrupts > > > > RCU's dyntick-idle code is written to tolerate half-interrupts, that it, > > either an interrupt that invokes rcu_irq_enter() but never invokes the > > corresponding rcu_irq_exit() on the one hand, or an interrupt that never > > invokes rcu_irq_enter() but does invoke the "corresponding" rcu_irq_exit() > > on the other. These things really did happen at one time, as evidenced > > by this ca-2011 LKML post: > > > > http://lkml.kernel.org/r/20111014170019.GE2428@linux.vnet.ibm.com > > > > The reason why RCU tolerates half-interrupts is that usermode helpers > > used exceptions to invoke a system call from within the kernel such that > > the system call did a normal return (not a return from exception) to > > the calling context. This caused rcu_irq_enter() to be invoked without > > a matching rcu_irq_exit(). However, usermode helpers have since been > > rewritten to make much more housebroken use of workqueues, kernel threads, > > and do_execve(), and therefore should no longer produce half-interrupts. > > No one knows of any other source of half-interrupts, but then again, > > no one seems insane enough to go audit the entire kernel to verify that > > half-interrupts really are a relic of the past. > > > > This commit therefore adds a pair of WARN_ON_ONCE() calls that will > > trigger in the presence of half interrupts, which the code will continue > > to handle correctly. If neither of these WARN_ON_ONCE() trigger by > > mid-2021, then perhaps RCU can stop handling half-interrupts, which > > would be a considerable simplification. > > > > Reported-by: Steven Rostedt > > Reported-by: Joel Fernandes > > Reported-by: Andy Lutomirski > > Signed-off-by: Paul E. McKenney > > Looks good to me! > > Reviewed-by: Joel Fernandes (Google) Applied, thank you!!! Thanx, Paul