Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4462317imm; Mon, 25 Jun 2018 16:33:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL/JFeMhzc5P6Hm7od6PJoNTrX2kHGimyPjLwUBS7D7oPADnWYMaoy79lw/xEs9v5FRUVso X-Received: by 2002:a63:6d8b:: with SMTP id i133-v6mr6962212pgc.215.1529969606562; Mon, 25 Jun 2018 16:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529969606; cv=none; d=google.com; s=arc-20160816; b=GEs9cXJfbqcNp+AskkOzHC6E4w9VBNaQgWeZKLEFU91/T+Y16OzsodeUdTzbt+ShY1 cHZcPe92KFuoDZOP6M4ki/6r8aVmjXUgpwwuRU5kOQZ/n1AYTjbHjCEAmJXP0iYcZdlC bU/gNETMKqL1W7kJEa4LH52sOnTqsdznVIMKrYZeFSdeRW23/7xVpNigEjwDhTpsqrDd yV6bw+eXAX20MIntPhpijc4TzEQoDqRBt8ATJ95w/w3ViVCX3ThUENk6joWQq8QZjXzy tesTqvZR3T2qLISAGie8WrwSaly0JQs8YTrfRKfZpuOwxUJJxtGl0OwKLYscV6+UK3H6 gpMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=XX7lHpuCZa7nOjGHaadQtqR16f7C0DvND47FuTVccWg=; b=kyliWG5BmzoM38jw9g8TotyewjlBU9PKNuCxiRA+4ngwJN0m2Hh0KftM98UxNJHizl HUoHER5B4cfq5JDalUzlx9M2k47tIngGtWNnFkNwvCsGVrgTp1ui6EMzXhOOsD973BXv 3pzdkrU0B3U0CvDk3R7sFDq1rbN7twKAMygiL+AjifOA8yeQv8Hokt5AONyhG0hdvoAH 5+7Hwg8TjzoUEFMxdCfs8nkpCzq5AeTMPMJP7DvGY0hF05BA/dM+c/qwJP2aQYglRmOk 2jY3o24L5xry2hGkZFGHcZqVoE0k3/VwmDpxVZuwQT0RwFemu9Rs3+Ys5cIEHAYlXrcz 7obA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yexXemgv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10-v6si128750pgf.225.2018.06.25.16.33.12; Mon, 25 Jun 2018 16:33:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=yexXemgv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755244AbeFYXc3 (ORCPT + 99 others); Mon, 25 Jun 2018 19:32:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:35648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752998AbeFYXc1 (ORCPT ); Mon, 25 Jun 2018 19:32:27 -0400 Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 21066262BE for ; Mon, 25 Jun 2018 23:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1529969547; bh=9HRry7LWVFImHNvpLSVVmGzYeQdnNnK4yMiqVv9UAOY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=yexXemgvKyWmwh/9QfhAUTVyvJ2ZJkNvg4mkyWfN3z1E0UyiydKaY6JR5p0SmgghR zf870uYD9AXtIdQR3xjV4QsRbvB+7ZqUfXCM2lmIPozjL5EKj/n7DvXrRoPVHKsoaA pKOmlzAUQ5s83VvyN5IRgRxqDf0EoTEg3yFcR998= Received: by mail-wm0-f42.google.com with SMTP id i139-v6so4080171wmf.4 for ; Mon, 25 Jun 2018 16:32:27 -0700 (PDT) X-Gm-Message-State: APt69E1T01RwVOrsiwOEBYVQ7q2hIXWFERVgtmSHyz54Vy1bkZzdlqYd csa2u/3tWyXU6sUZG7vrLTTWQbnHub6UB5p48LjRfg== X-Received: by 2002:a1c:f902:: with SMTP id x2-v6mr2258221wmh.116.1529969545658; Mon, 25 Jun 2018 16:32:25 -0700 (PDT) MIME-Version: 1.0 References: <20180620164902.GW3593@linux.vnet.ibm.com> <20180622055659.GA255098@joelaf.mtv.corp.google.com> <20180622132843.GN3593@linux.vnet.ibm.com> <20180622181916.GA13628@joelaf.mtv.corp.google.com> <20180622143247.781028b1@gandalf.local.home> <20180622200548.GA114655@joelaf.mtv.corp.google.com> <20180625082824.GB21377@X58A-UD3R> <20180625163951.GA52646@joelaf.mtv.corp.google.com> <20180625162557.7140664c@gandalf.local.home> <20180625204708.GS3593@linux.vnet.ibm.com> <20180625181522.53b5d296@gandalf.local.home> In-Reply-To: <20180625181522.53b5d296@gandalf.local.home> From: Andy Lutomirski Date: Mon, 25 Jun 2018 16:32:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks To: Steven Rostedt Cc: "Paul E. McKenney" , joel@joelfernandes.org, Byungchul Park , byungchul park , Lai Jiangshan , Josh Triplett , Mathieu Desnoyers , LKML , kernel-team@lge.com, Andrew Lutomirski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 25, 2018 at 3:15 PM Steven Rostedt wrote: > > On Mon, 25 Jun 2018 13:47:08 -0700 > "Paul E. McKenney" wrote: > > > On Mon, Jun 25, 2018 at 04:25:57PM -0400, Steven Rostedt wrote: > > > On Mon, 25 Jun 2018 09:39:51 -0700 > > > Joel Fernandes wrote: > > > > > > > For whatever its worth, I made some notes of what I understood from reading > > > > the code and old posts because I was sure I would otherwise forget > > > > everything: > > > > http://www.joelfernandes.org/linuxinternals/2018/06/15/rcu-dynticks.html > > > > > > Nice write up. I may point some people to this ;-) > > > > > > Anyway "complications due to nested NMIs (yes NMIs can nest!)" > > > > > > What arch allows for NMIs to nest. Because we don't let that happen on > > > x86, and there's code that I know of that is called by NMIs that is not > > > re-entrant, and can crash if we allow for NMIs to nest. For example > > > "in_nmi()" will not show that we are in_nmi() if we allow for nesting > > > of NMIs. It has a single bit that gets incremented when we enter NMI > > > code, and cleared when we leave it. > > > > Last I checked with Andy Lutomirski, there are a number of things that, > > though not NMIs, act like NMIs and that can interrupt each others' > > handlers. This is on x86. > > > > Perhaps things like MCEs, but they don't call nmi_enter(). And usually > when something does, it probably puts the machine into an unstable > state. Getting RCU right, may be the least of the worries. > > You may want to ask Andy if there's legitimate interruptions of NMIs > that doesn't mean "please reboot as soon as possible"? > Yes, sadly. CPU A gets an NMI. While processing it, CPU B has user code access a faulty NVDIMM address, causing CPU B to generate a machine check. CPU A also gets a machine check because someone at Intel thought it was a good idea. CPU A will mostly ignore the machine check, but it still happens. I think it's reasonable to say that nmi_enter() won't nest, but I don't see how we can avoid rcu_nmi_enter() nesting.