Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp898902imm; Wed, 8 Aug 2018 07:34:43 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx0R48HKHQ30TG/9shkqRjzbSkFgvtoODDVS/pd4tT/U24VJz/g7t7vHwi7RXL0nvjELMv1 X-Received: by 2002:a62:8559:: with SMTP id u86-v6mr3319000pfd.32.1533738883197; Wed, 08 Aug 2018 07:34:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533738883; cv=none; d=google.com; s=arc-20160816; b=nXk/rbsoenE+BtipG4BJ5hn8tUE54oKA55bAlLmlU6VgYmyuCNiMSbQ05BJwAi7mYs 2DizF1/v9eW5A/PEIbRr0ugcIT0uqISnfSVqKRMa5Px2/2JpnCf60JL+ip/gq5L72+de GU184Y1bODgUf5NOe2Ie+Fh7CoqbnsLzbDs2F725jcpNsU00vrHCoulNH1J5xC2dhZYl FUyU6O6gsYM6fPHj0BbarRiDq2YZd3TgcKkj6pb3asmAPk5XvxAmosfv0LWSDCKa+FGr XkUFGEVqAegvloLmRu7BPrSMjt2d6OBnNtvvt5r91ev2Ljgxik7whxwFpTa2kCOKrngE vl7w== 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=hzfoozKRB3bAma/Gv3+9T3EAXKtooReAxudRMt2NcI8=; b=tUTkCBaNIDRlOUOpe9hj5ZdNSqUtXUNrTQamZRPe57D6qOoEWW5JYxoeRBuiaAoOEQ M8IBywBHfP8hYtheTGrD8AgYdMnsfG0g2YJAuHPVc7W2W7m7x+vIpql5p6vqFiGlb5eJ CKWXQYPIJl2oOa7j1dWr0mSQmYzvCdXAA0/FV2ryWCws5HGlmBczw0919ab8RSqUVCBi uIU+FSWwkEOvhOisXmeSVyN8otrF7yivRJaZIlxo4wkirZX3Q78V664A+j1hqo4vrJAi 2fRWYslLh/4WGJdc4Lno3Rr9D4aeuqLQ8tRKlLwYDXJpyxQT0wBRBmekEqa4sgbpx6bm sEQg== 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 j6-v6si3650122plk.438.2018.08.08.07.34.28; Wed, 08 Aug 2018 07:34:43 -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 S1727420AbeHHQxN (ORCPT + 99 others); Wed, 8 Aug 2018 12:53:13 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:35452 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726875AbeHHQxN (ORCPT ); Wed, 8 Aug 2018 12:53:13 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w78ESouk104146 for ; Wed, 8 Aug 2018 10:33:16 -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 2kr26r0j9j-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 08 Aug 2018 10:33:15 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 8 Aug 2018 10:33:15 -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) Wed, 8 Aug 2018 10:33:10 -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 w78EX9Y012517798 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 8 Aug 2018 14:33:09 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4F683B2064; Wed, 8 Aug 2018 10:32:33 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2F53DB205F; Wed, 8 Aug 2018 10:32:33 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.159]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 8 Aug 2018 10:32:33 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 287B516C0727; Wed, 8 Aug 2018 07:33:10 -0700 (PDT) Date: Wed, 8 Aug 2018 07:33:10 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Joel Fernandes , Joel Fernandes , LKML , "Cc: Android Kernel" , Boqun Feng , Byungchul Park , Ingo Molnar , Masami Hiramatsu , Mathieu Desnoyers , Namhyung Kim , Peter Zijlstra , Thomas Glexiner , Tom Zanussi Subject: Re: [PATCH v12 3/3] tracing: Centralize preemptirq tracepoints and unify their usage Reply-To: paulmck@linux.vnet.ibm.com References: <20180807204820.50b83c6d@vmware.local.home> <20180807215522.04114097@vmware.local.home> <20180807222856.3ede96e7@vmware.local.home> <20180808084629.3290d1d6@gandalf.local.home> <20180808130302.GJ24813@linux.vnet.ibm.com> <20180808090724.41677176@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180808090724.41677176@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18080814-0072-0000-0000-0000038D73C8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009507; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01070981; UDB=6.00551364; IPR=6.00850510; MB=3.00022589; MTD=3.00000008; XFM=3.00000015; UTC=2018-08-08 14:33:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080814-0073-0000-0000-00004902630E Message-Id: <20180808143310.GL24813@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-08_05:,, 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=482 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808080150 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 08, 2018 at 09:07:24AM -0400, Steven Rostedt wrote: > On Wed, 8 Aug 2018 06:03:02 -0700 > "Paul E. McKenney" wrote: > > > What's wrong with a this_cpu_inc()? It's atomic for the CPU. Although > > > it wont be atomic for the capture of the idx. But I also don't see > > > interrupts being disabled, thus an NMI is no different than any > > > interrupt doing the same thing, right? > > > > On architectures without increment-memory instructions, if you take an NMI > > between the load from sp->sda->srcu_lock_count and the later store, you > > lose a count. Note that both __srcu_read_lock() and __srcu_read_unlock() > > do increments of different locations, so you cannot rely on the usual > > "NMI fixes up before exit" semantics you get when incrementing and > > decrementing the same location. > > And how is this handled in the interrupt case? Interrupts are not > disabled here. Actually, on most architectures interrupts are in fact disabled: #define this_cpu_generic_to_op(pcp, val, op) \ do { \ unsigned long __flags; \ raw_local_irq_save(__flags); \ raw_cpu_generic_to_op(pcp, val, op); \ raw_local_irq_restore(__flags); \ } while (0) NMIs, not so much. > I would also argue that architectures without increment-memory > instructions shouldn't have NMIs ;-) I would also argue a lot of things, but objective reality does not take my opinions into account all that often. Which might be a good thing. ;-) Thanx, Paul