Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp915903imm; Wed, 8 Aug 2018 07:50:49 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzeg9lNVXeaNDBA4ptOXbSgGpIiVc/JKxVWus8ZDkeKfp25k0zIYawBBaFtAJePStCgPQBD X-Received: by 2002:a63:d946:: with SMTP id e6-v6mr2952201pgj.24.1533739849211; Wed, 08 Aug 2018 07:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533739849; cv=none; d=google.com; s=arc-20160816; b=Vi2bnM0EJ7LeK6s0PtWCo3wmlkF0tcYbaeNtc6n6Mn7cJk2otc8lAkZYbXAo3rsCmJ zznB/JtJf8xmJ+5Udfxgd9ONEftgMwQBScr9Ntrq6K3HGWL8YsqDD1a3RW5vx1XQFyyl APOJ3QPbQvp84Qn1MqcjDGIeYergxnG+zwGZRmV5A3WVTftVyTw2c4MRHG/74p+yISH0 kHVgCN81KmemG7VoFpXe6QdTHC1T/UYKz2h7p1u6h+EsIGxFAz+/3cEQFNZR16klbJ7e UhPzuZR+DgxLiFKWEVBO9GR4125Y+5Vwr3hCqJA0Jm6ZZQomc9aRNAlDxzVEaoBJ3qL6 CupQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=ZrQJgpsW6OdM8VYamLTzoyrmfkxR4XAoGIhp7PE4wI4=; b=ODihD80iYimJ/9aHh0fzJRtWthkk0jvJSgQ0iw7KvSbq7itrjuThKfv2NlPTDg5qDA xYCFanriuE6lFeqEgmyHo7N01vOa25Xg/z4SPxGjgHyEAfzBgYRWyhbhug/NKmP45B1N UYIpIeN6fdtM7T/QeW2TFEdHfc4NI33avnHjyAI9UI6DpMUrzuxIPBFJV4Jchl81E78L 9hY3lZBgfpXymZ1+OYAQKHu3g2G9P5K9qqUQ00hHmjKwVJ6caHrWx7PNbkXO7nkIA9kE FBdwlSShJfImo4+5kjiEWoFRK6p1M0mfOAkk4ZKFgtLaDmf17PqJKSItjzq5/GXuGjRf G0IQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m76-v6si4578889pfg.323.2018.08.08.07.50.34; Wed, 08 Aug 2018 07:50:49 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727989AbeHHRJO (ORCPT + 99 others); Wed, 8 Aug 2018 13:09:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:45240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727146AbeHHRJO (ORCPT ); Wed, 8 Aug 2018 13:09:14 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC252219E8; Wed, 8 Aug 2018 14:49:12 +0000 (UTC) Date: Wed, 8 Aug 2018 10:49:10 -0400 From: Steven Rostedt To: "Paul E. McKenney" 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 Message-ID: <20180808104910.2ced5e51@gandalf.local.home> In-Reply-To: <20180808143310.GL24813@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> <20180808143310.GL24813@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Aug 2018 07:33:10 -0700 "Paul E. McKenney" wrote: > 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. And do these archs have NMIs? -- Steve > > > 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