From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1857C43331 for ; Tue, 24 Mar 2020 15:38:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A127C20774 for ; Tue, 24 Mar 2020 15:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585064281; bh=0orXiZqfiTQ0nzIx4WpHUD4WiuEZt0G9H0JZyzsPBKc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=t21ZyjfglglPne0XSqIAYC6Wy9sjvhCXKNaKoVOy5NEJ4LbGm7x2XlBNSc+W2Qs1k B0YNj9HE7fMPRxDyj38zHxWomjIdAlgTxShtiS0Uz68oqwcqJLPg70BWX8GRRz7GgN Oc2KiO5gyIMvBcg/Z0DKvb95MwE/fFgB3kRs4AOw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728815AbgCXPh6 (ORCPT ); Tue, 24 Mar 2020 11:37:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:32884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727771AbgCXPh6 (ORCPT ); Tue, 24 Mar 2020 11:37:58 -0400 Received: from localhost (lfbn-ncy-1-985-231.w90-101.abo.wanadoo.fr [90.101.63.231]) (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 264E220714; Tue, 24 Mar 2020 15:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585064277; bh=0orXiZqfiTQ0nzIx4WpHUD4WiuEZt0G9H0JZyzsPBKc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ruMaTUcF2yzwekmY93CJzG2BGG4W8nKTZXqNyJRXTUwe42rb0yX/c1nOjMxLUb+Aa vVKctHlID/TWSjuD6M/03AeHT9OPiwqTYR6yMoAetUoU1ADuDdxUjN34zTT2FgZ620 b44giTe0V8GYIUm82txE/NT3ztoS/bnjTP0y7rCw= Date: Tue, 24 Mar 2020 16:37:55 +0100 From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , x86@kernel.org, Paul McKenney , Josh Poimboeuf , "Joel Fernandes (Google)" , "Steven Rostedt (VMware)" , Masami Hiramatsu , Alexei Starovoitov , Mathieu Desnoyers , Brian Gerst , Juergen Gross , Alexandre Chartre , Peter Zijlstra , Tom Lendacky , Paolo Bonzini , kvm@vger.kernel.org Subject: Re: [patch V3 01/23] rcu: Dont acquire lock in NMI handler in rcu_nmi_enter_common() Message-ID: <20200324153754.GA20223@lenoir> References: <20200320175956.033706968@linutronix.de> <20200320180032.523372590@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200320180032.523372590@linutronix.de> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Mar 20, 2020 at 06:59:57PM +0100, Thomas Gleixner wrote: > From: "Paul E. McKenney" > > The rcu_nmi_enter_common() function can be invoked both in interrupt > and NMI handlers. If it is invoked from process context (as opposed > to userspace or idle context) on a nohz_full CPU, it might acquire the > CPU's leaf rcu_node structure's ->lock. Because this lock is held only > with interrupts disabled, this is safe from an interrupt handler, but > doing so from an NMI handler can result in self-deadlock. > > This commit therefore adds "irq" to the "if" condition so as to only > acquire the ->lock from irq handlers or process context, never from > an NMI handler. > > Fixes: 5b14557b073c ("rcu: Avoid tick_dep_set_cpu() misordering") > Reported-by: Thomas Gleixner > Signed-off-by: Paul E. McKenney > Signed-off-by: Thomas Gleixner > Reviewed-by: Joel Fernandes (Google) > Link: https://lkml.kernel.org/r/20200313024046.27622-1-paulmck@kernel.org Reviewed-by: Frederic Weisbecker