Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp805591imm; Wed, 8 Aug 2018 06:08:46 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzYylbH+vDASaMf9uRrKq596Y0a8pYxPhs9xsJPyo+khmoUdYWWp26NQrsMwyQytk5uzMA8 X-Received: by 2002:a63:b504:: with SMTP id y4-v6mr2584959pge.247.1533733726158; Wed, 08 Aug 2018 06:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533733726; cv=none; d=google.com; s=arc-20160816; b=P2NOayvXMGETTnzNrn4q+1C2NWLDOoyvwUj8Yfvl6+bof13HxSYQmxkrB5spjtQuL4 3Fi7pLIN7MfqK6HfZfOYBnAOSXNR4nDm5JcThokTlpkIQqLBoVBCmaBQL+GDhoUS4Qun Mk9/tRAPgnvOpH/vd1KzoeK3geMu0KlGhzm9/TIPSa4OaG2uTAIGQkma5Or+yHcrBhpV bux8agIJcZAM+ycLkYkcYSwr7JDADBHms4MRn/FoHwtCA9lATYw1asMrsvc0QhJlrIOS SFVuLpPaaywJ/NNHXmM6EY6r9C/QajY1a3BZF63T+OYKl9+0RuPffZd7wabgxj7druAO 6KxQ== 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=ioB8YIPXBYRiN7BPlIUVIhGIm0a4B2TiaTSQtW1LeA0=; b=iZzFW7CrM04zWqk8oMLQs39yY9qTdgS2UGkYiOb4WrukYDWMz6xx3fwi9NbkneYfkp 2Q8HBLwfHa8jZW04B5dS6+t82gTbBD75fnDvAcioRrDs2kW9tKJqanuEajtWVHcoXesc 9SdwpW3+yCiuc0RPEuZaAlysgWbZu1PKLpjjJoEIpdE7oIlfaGxOOMixkqOneQYp4vyX Fr5C36D9iMSZJRLlEDotnk/nk2G7OIEXYHmBZJAjy3Ee9NrrJWBctaNSyjsU/zJV/sOl GRZOIBFBIOmaxyf/BsnzVthNpLrH6l883pbaQcmOc51qzpvOj4a7wMVmRTh2k6nIwyNa rIaQ== 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 n184-v6si4266639pga.98.2018.08.08.06.08.31; Wed, 08 Aug 2018 06:08:46 -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 S1727290AbeHHP1F (ORCPT + 99 others); Wed, 8 Aug 2018 11:27:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:38818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727104AbeHHP1F (ORCPT ); Wed, 8 Aug 2018 11:27:05 -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 F06D22175F; Wed, 8 Aug 2018 13:07:26 +0000 (UTC) Date: Wed, 8 Aug 2018 09:07:24 -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: <20180808090724.41677176@gandalf.local.home> In-Reply-To: <20180808130302.GJ24813@linux.vnet.ibm.com> References: <20180807194515.4e549c1a@gandalf.local.home> <6D0A3FD6-2190-4CC0-A3C0-7B3759E73243@google.com> <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> 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 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. I would also argue that architectures without increment-memory instructions shouldn't have NMIs ;-) -- Steve