Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9125790pxu; Mon, 28 Dec 2020 07:15:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcGW2dPsqk2Gj2Kvef1WquL+t6BZgkM2g0YTHM3DuogHl6Uz07CpNdY81X/jyZLCXDfLcz X-Received: by 2002:a17:906:adcb:: with SMTP id lb11mr41014529ejb.346.1609168512868; Mon, 28 Dec 2020 07:15:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168512; cv=none; d=google.com; s=arc-20160816; b=nbOmXXoVZDKVrwI06Xzh5J5VnAnx7aM8iYJB+xEX3V0G6qvGfugrg+N238NI+zHm8H N2OmmA+ov2NjmTpEm7CQEMeyKh6nGpF8URj+OKmgJfyfVHkG875HDib38xjvYV32S4RE OJAuE5OBnyRcRGLouoBOAvAv6OY/2plNSMkh2oF924R4/nGUJE0+hhAuHxpD9Us0vKO7 KSkXeGaw6SLKQK7Qd1/yAJgE/Zmftm6oyJkrPE5NNcIy5VR6nPrun7BXZ+eegnXMZXnU N1E0sZdh27U192MLRPtfXzscKOZpF+xj2SD/saleqkgO7AxEAYbzFTAPt2l8VQRePD5p 4mMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vZxYpHtpe32DcWidomwE4n64G1da0ZFRo0832U80ZS8=; b=ZeBwV/Hn5v5v4AYUupXMClgTK4de4lwz/MPw7qUezN71zM+H5/6jDv6Er7NVACuxlc ZBevpEEA0P6+OuUOj/Y4lXW/1O12XANf5vMCKthYwE0lGHLihfCy6IpL0XH6kiHyHUBv gHcIzL2Nhub9RGpyraBpxrnIhtZ8rFvBPRCtArbXBqVFjayLqQhJ4pPyKAPnezf9XvOl azAmvBfi806u2bsykl2dkEa3wRpttDKDsNEsU3qtQ43DvW9JMTXKvd+NqEvC21cPNW/X Hn2aWi7RMuZK3ZIZKEBWHVabDvt8JDBUx7KF0zv2nb2DZE4LCZga+AzzmeQ3xMQRfZrD pVTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jwfa7M23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b27si18310637eje.466.2020.12.28.07.14.48; Mon, 28 Dec 2020 07:15:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jwfa7M23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438852AbgL1PLl (ORCPT + 99 others); Mon, 28 Dec 2020 10:11:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:41682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391671AbgL1OHV (ORCPT ); Mon, 28 Dec 2020 09:07:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AF6C0205CB; Mon, 28 Dec 2020 14:06:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164401; bh=5A1YHev4yUttaWboyuOAyuUP3ydJqYVIcaxoTAd7aqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jwfa7M23S/zz913j599p6f7gwmY4qR5cvqGfkEssABiclYYmlt9x+u8UC8+8J/blS PRgMlJ6+hYbHuKzzNPThoikLeS5I+MbdYdSXoOmxf+bTjyJfe7GDrYXN1SxefSTCjw 1dfJd1NPztc4CkqA1X4vm2xONkefg2ZTP8YoUM7w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Eugenio=20P=C3=A9rez?= , "Peter Zijlstra (Intel)" , Andy Lutomirski , "Paul E. McKenney" , Sasha Levin Subject: [PATCH 5.10 167/717] rcu: Allow rcu_irq_enter_check_tick() from NMI Date: Mon, 28 Dec 2020 13:42:45 +0100 Message-Id: <20201228125028.958686596@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Zijlstra [ Upstream commit 6dbce04d8417ae706596366e16841d77c454ba52 ] Eugenio managed to tickle #PF from NMI context which resulted in hitting a WARN in RCU through irqentry_enter() -> __rcu_irq_enter_check_tick(). However, this situation is perfectly sane and does not warrant an WARN. The #PF will (necessarily) be atomic and not require messing with the tick state, so early return is correct. This commit therefore removes the WARN. Fixes: aaf2bc50df1f ("rcu: Abstract out rcu_irq_enter_check_tick() from rcu_nmi_enter()") Reported-by: "Eugenio PĂ©rez" Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andy Lutomirski Signed-off-by: Paul E. McKenney Signed-off-by: Sasha Levin --- kernel/rcu/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index bd04b09b84b32..655ade095e043 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -928,8 +928,8 @@ void __rcu_irq_enter_check_tick(void) { struct rcu_data *rdp = this_cpu_ptr(&rcu_data); - // Enabling the tick is unsafe in NMI handlers. - if (WARN_ON_ONCE(in_nmi())) + // If we're here from NMI there's nothing to do. + if (in_nmi()) return; RCU_LOCKDEP_WARN(rcu_dynticks_curr_cpu_in_eqs(), -- 2.27.0