Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp990146iog; Fri, 17 Jun 2022 20:02:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v1g/wyOZIp8dhaqz5mhpQbY9LCCQH9rzBiRYEdxWQBYDuSqvb4uOKdjY8NwUfIuU/Wz1I2 X-Received: by 2002:a17:902:f710:b0:15f:165f:b50b with SMTP id h16-20020a170902f71000b0015f165fb50bmr12966072plo.158.1655521361669; Fri, 17 Jun 2022 20:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655521361; cv=none; d=google.com; s=arc-20160816; b=HqQ3NQumGlusQ0Q1t5q4SfSZJUtl+qeoTB9VvH5RDvPE5Ccr974w2zPVlSbYz/cKJe 45zza1lE/4Jwptv2M/LnN/uII019PFEPCUgMmyZgquYQZ5DCEJv5YAgrUrIQxEP3Ttta hg1Ex/Ge4UOA5m4iWuaT/JQQydaIVwVbscdVGWaJza1NpfFjDJdUmzS+RAwTz0rzcs0E zNWqsDKh6m9IvJhHZT4DeJ34EduRH5F9G5oOIOZx+dBHFgd0QRbk1krAxdmSbZ3Pvizn VrLr3A9pmNtEmxEK/Qr/TKC3is+g7hSnn3wcyLmozgdjEjuempUsnmuXhJUokgnHFU4o Xy0Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=D+Mhfs1Xl6AOTBF8yPEFsly4LkOK3eHdQoZJ0aA89Ck=; b=akHCzgqekbXu5GW9Fd1st0pmu6si53wRQ/KFjzY/hccxLx8bJqLi92uPkjMSc1PEBU k4ocb5w37Fb0mp90C503LfJe5TEKX7R59BMQYi/zD7V80+oGaHqP3ykSTSlB0PORj4Hw Vj7NUxlKUrjnzeyU84Zi9F3yNsYI50v8Sk58M/dDy5711vuuPBpOgKOxVCtERAIOiwse jZedVzO98myvjyL2iCe+0iAU+iepcFIjknV4tyu9sBI+zPr7Ej2srSRYaWQds1U8Hcnx nJo04NG5ZTZffYwQ70uFW6xNfpaUVWTj8dKHcy8BTKB8Vnq0B+zY41i6MDG3ydI+I66m aNTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iULMVlFX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v2-20020a63b642000000b003ab358a4d44si8020174pgt.199.2022.06.17.20.02.28; Fri, 17 Jun 2022 20:02:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iULMVlFX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239947AbiFRCXS (ORCPT + 99 others); Fri, 17 Jun 2022 22:23:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbiFRCXR (ORCPT ); Fri, 17 Jun 2022 22:23:17 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BADA4DF73; Fri, 17 Jun 2022 19:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655518995; x=1687054995; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Vw65PlxxPIXKSdQhfZecw4qu+4AdMh2WHr1f09bz/k8=; b=iULMVlFXbq0a2kqwviDbaKQ+xp6xhKedcolfeoQtH8Pa4PLeZtRe653g MDmCQhZiJiWsHrgbSqJaJkPW+pVsXRz8z3NNro3R2D5grZG+FTB3AFdhg xv4BsIMg+4XYcXDu0TmTo80/YiU3RrExy58SmdpcBVobUB2q0ZTb/1tj5 PtMRQvhLmygK23aZAkQJHBhwEGuI6JqAtPkjundresR+Q+gaIgHIKqWNy kk+TJzy1snwmZZyskTuw/sZk5TrRbJNzX/o7E8me+YlNmmlpyoTd8cZHO qVbVTFEDDBctJYQVWeMaABb3fbxYWDaXDMEOUH5HqNJpnHxlVTJIy5Ju4 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="262662854" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="262662854" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2022 19:23:14 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="642268395" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.125]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2022 19:23:13 -0700 From: Zqiang To: paulmck@kernel.org, frederic@kernel.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcu: Avoid strict QS reporting in NMI context Date: Sat, 18 Jun 2022 10:22:55 +0800 Message-Id: <20220618022255.1697816-1-qiang1.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid invoke rcu_report_qs_rdp() in NMI handlers, in NMI handlers, acquiring raw_spinlocks should be avoided, prevent NMI handlers from blocking(spin) unnecessarily. This commit make rcu_read_unlock_strict() early return when in NMI context. Signed-off-by: Zqiang --- kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index dc78726b993f..e7a36e248a8a 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -821,7 +821,7 @@ void rcu_read_unlock_strict(void) { struct rcu_data *rdp; - if (irqs_disabled() || preempt_count() || !rcu_state.gp_kthread) + if (in_nmi() || irqs_disabled() || preempt_count() || !rcu_state.gp_kthread) return; rdp = this_cpu_ptr(&rcu_data); rdp->cpu_no_qs.b.norm = false; -- 2.25.1