Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1463731iog; Thu, 16 Jun 2022 06:57:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tu9ZRv0aGe+l1GIwdpYYh9CRJseHPx+IKHawQTuWf6SO5LDp/xURjyJKsgMrlkjDOKGUoi X-Received: by 2002:a17:906:1109:b0:711:d8fe:fe56 with SMTP id h9-20020a170906110900b00711d8fefe56mr4681332eja.261.1655387875301; Thu, 16 Jun 2022 06:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655387875; cv=none; d=google.com; s=arc-20160816; b=amKgz4xpPAZOGM3aAT3+JufyR7uGI4p0yYHQniklkJxzGqHl8sO5F+uVP6u3PEc2xy mMN5PZq45na34FfDhWg7FKkIPpl20OFfcJRRI5lGFJqXUCVttD2nmlXJHvHVFHYczzY6 +ZwrXf7hl+Kp4XYx2/6pyIn6/x565kiQEdfWNmMmW3Ie4zsSebB5BTYvBE10Jumx4CBW 3th8YDyK/Le99Nm/63uy7FYXc3Ejoj3lSRPIAxIkKzrqbW4nNzQhdJvKrJY896B3WEkW mot4bwmaAtnQO72Xu/odZ01xBH8pomInUIpVqQzAnOzSkX2FgjruYhzIT+pHKEsFzp7/ AY1g== 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=fv18ytLwmWKwx00b570dyOJGBh97K6sTd/Px9pk6JE8=; b=JxKmjVVgFOgO0FKjS+i+akLwxBDENV7WRH1igKailoQ4mPgduvqPJpuTY2Lem/Re07 NoWlZpd707a9lOn40CqSx8cRz3DeVX3/8WRAmATRVGWB/rZa5IZWvoe0LQlJjigFME1f I2n+s35lNQe3+jRX83B3dQ0ed5eB7eKeZmt1/6qJrPvsfOtwkmPD3WSzLovBQNKBUVJq zsJ6NDbdyKAKXmmkxIxSLPI2htbArBS8lWiv5in71mKWCgnGHXdZvgHNXYQkXeRSC5US J6BJgYlla4BvpEnVYF+4WDOSe+pxOQMqk8DRQdhDHZsEVS7Y9JfSNoM+33E9aMsaymVQ kk1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="HdRg/IFm"; 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 bc18-20020a056402205200b0042e0fac8bbbsi2330118edb.372.2022.06.16.06.57.29; Thu, 16 Jun 2022 06:57:55 -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="HdRg/IFm"; 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 S1377297AbiFPNyH (ORCPT + 99 others); Thu, 16 Jun 2022 09:54:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376717AbiFPNyG (ORCPT ); Thu, 16 Jun 2022 09:54:06 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFF99344DD; Thu, 16 Jun 2022 06:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655387645; x=1686923645; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=8DBLbS3wVl/9ObJhboDBWvo7NIEiATgLdaJKo4so8Xc=; b=HdRg/IFmDEUntWqG/BMRiMWtKpeR+t91m9KWknExv1oJ91eW9/DcIdRM bXwvlaMnhBd0q4x5RlzqPbOHySTLbUz5X5lEdPYfMdZIi1FoCFGjwDSp1 iCwklxdz/2YhzckOafF3fjTDWjXHYqv5vrj8jw5WWtoET6MVYG8XbCBQx g/lWAFZLz/qo2l397h19Y9H3OEp0SVLTCf9nI04sRTZ5L4edh/uwBtEaF JpgBU7Tx0ib6YBbTSY0B2cV+PhzME9BqyQ8xFUJ2XHcy/L0oTPX0sS2H5 pQGruU/me4EFQT5+YwiTLGaJ+znmzK8Dkvb56faiR6n4kKE7gRxdu0fSi A==; X-IronPort-AV: E=McAfee;i="6400,9594,10379"; a="278048124" X-IronPort-AV: E=Sophos;i="5.92,305,1650956400"; d="scan'208";a="278048124" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 06:54:05 -0700 X-IronPort-AV: E=Sophos;i="5.92,305,1650956400"; d="scan'208";a="641549582" 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; 16 Jun 2022 06:54:04 -0700 From: Zqiang To: paulmck@kernel.org, frederic@kernel.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcu: Fix rcu_read_unlock_strict() strict QS reporting Date: Thu, 16 Jun 2022 21:53:47 +0800 Message-Id: <20220616135347.1351441-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=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 When running a kerenl with CONFIG_PREEMPT=n and CONFIG_RCU_STRICT_GRACE_PERIOD=y, the QS state will be reported directly after exiting the last level of RCU critical section and in non irqs-disable context, but maybe the CPU's rcu_data structure's ->cpu_no_qs.b.norm is not cleared, as a result the rcu_report_qs_rdp() will exit early, and not report QS state. This commit will clear CPU's rcu_data structure's ->cpu_no_qs.b.norm before invoke rcu_report_qs_rdp(). Signed-off-by: Zqiang --- kernel/rcu/tree_plugin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index b2c01919b92c..dc78726b993f 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -824,6 +824,7 @@ void rcu_read_unlock_strict(void) if (irqs_disabled() || preempt_count() || !rcu_state.gp_kthread) return; rdp = this_cpu_ptr(&rcu_data); + rdp->cpu_no_qs.b.norm = false; rcu_report_qs_rdp(rdp); udelay(rcu_unlock_delay); } -- 2.25.1