Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3102711imc; Wed, 13 Mar 2019 08:54:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8bWg7xulOZ+KpHXNloy/yu9PGqUiJRTwhgzgSY54T32WBzXU9L0kCrlvaa5kKy854VcnO X-Received: by 2002:a62:445a:: with SMTP id r87mr44060388pfa.13.1552492469110; Wed, 13 Mar 2019 08:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552492469; cv=none; d=google.com; s=arc-20160816; b=QvH9RHtJbndc3zx9yIZqGl7i2E6Xc2g6jHsHiiCZQGs/qkh7WusIFAPs3+mB3JQf+j 3UGkDToeYbS71CRKlhghLXLn3uCMFG0kVSSIZDrB2sHK9NG7B6GUVhrvEVxRBzIfVXq3 /OuLUbv6XmUrS54huYl8LAUbWuqV0NIKfNpEfS4fcEQIcf2662qZsg2zutVKTWCjYJv0 6d0kWFXw3XlwZMMvPVzzKt3jlVtzm3tWGM8kQDzn6EW4PXEmJcPqHn/bi5owP6TVPXfj GOEluwpk/DaV/E9Gl/c1Zsjd7wAVA6WCMNJhDc0313Za+hEAQZ2ZNI3U2tcsmawbJ5I6 S5HQ== 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; bh=LyInNdL+jlvloBAVwKx9JdjYCZOv+tnkDmuZxdSCCJc=; b=gCkIYr+/AdOe7a1e0Wg0hZsQXDwBwxjRH5P14lm7CVfn6Y227Fx58y5Fsd1iZjRg6x kNPQgfk0bB9a8orvm6Wjqbs4b/HO62Iw7yqt1xZ8RGr07LG3SZJBjp2uCxYvuouKgAbC 970yVmGmD7mb14Cys8HK8kOs0JyXuUcSyqc5phte2dzPJenku9t9rnzbx4f9EHc8UbFL WE+4cnwvsyhEHP7lA1/1/3IaWqmArMOlk+kuuN3g4GnPwCWB8kcdWF5uhG1Rlu69m+eO oEdEHteUFIre764/WsFwlrOUBOV3wKh6ODokoqk7T1U0rluxYDamB6xUPWr17wJzj88G Ea+Q== 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 h21si7592371plr.229.2019.03.13.08.54.13; Wed, 13 Mar 2019 08:54:29 -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 S1725883AbfCMPwB (ORCPT + 99 others); Wed, 13 Mar 2019 11:52:01 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51974 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725868AbfCMPv7 (ORCPT ); Wed, 13 Mar 2019 11:51:59 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2DFj3Ka033958 for ; Wed, 13 Mar 2019 11:51:57 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2r749a9w7a-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Mar 2019 11:51:57 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Mar 2019 15:51:57 -0000 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 13 Mar 2019 15:51:53 -0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x2DFpqJa24051758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Mar 2019 15:51:52 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0ED67B2067; Wed, 13 Mar 2019 15:51:52 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E57B3B2064; Wed, 13 Mar 2019 15:51:51 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.188]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 13 Mar 2019 15:51:51 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id E99F816C196D; Wed, 13 Mar 2019 08:51:55 -0700 (PDT) Date: Wed, 13 Mar 2019 08:51:55 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Joel Fernandes , linux-kernel@vger.kernel.org, rcu@vger.kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, luto@kernel.org, byungchul.park@lge.com Subject: Re: [PATCH tip/core/rcu 06/19] rcu: Add warning to detect half-interrupts Reply-To: paulmck@linux.ibm.com References: <20180829222021.GA29944@linux.vnet.ibm.com> <20180829222047.319-6-paulmck@linux.vnet.ibm.com> <20190311133939.GA29747@google.com> <20190311222903.GR13351@linux.ibm.com> <20190312150514.GB249405@google.com> <20190312152034.GZ13351@linux.ibm.com> <20190313150948.GA84821@google.com> <20190313112726.01d974fc@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313112726.01d974fc@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 19031315-0060-0000-0000-0000031BB8D4 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010751; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000281; SDB=6.01173822; UDB=6.00613753; IPR=6.00954486; MB=3.00025961; MTD=3.00000008; XFM=3.00000015; UTC=2019-03-13 15:51:56 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19031315-0061-0000-0000-00004898D22E Message-Id: <20190313155155.GN13351@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-13_09:,, 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-1810050000 definitions=main-1903130112 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 13, 2019 at 11:27:26AM -0400, Steven Rostedt wrote: > On Wed, 13 Mar 2019 11:09:48 -0400 > Joel Fernandes wrote: > > > AFAICS, lockdep does not specifically track when we enter an interrupt, but > > rather only tracks when interrupts are enabled/disabled. > > It does: > > #define __irq_enter() \ > do { \ > account_irq_enter_time(current); \ > preempt_count_add(HARDIRQ_OFFSET); \ > trace_hardirq_enter(); \ > } while (0) > > # define trace_hardirq_enter() \ > do { \ > current->hardirq_context++; \ > } while (0) > > > And if the hardirq_context ever does not match "in_irq()" lockdep will > complain loudly. Good to know, thank you! Does this mean that there is a better approach that Joel's suggestion? I believe he would end up with something like this: WARN_ON_ONCE(IS_ENABLED(CONFIG_PROVE_RCU) && !in_irq()); It would be nice if there is something like this: lockdep_assert_in_irq_handler(); But I haven't seen this. (Not that I have looked particularly hard for such a thing, mind you!) Thanx, Paul