Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1524795pxb; Wed, 30 Mar 2022 05:38:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPkXeapMNAruBHMiSyWHIjim5r3tPYYIlXe1psASOWxkbozeEXSNOMjUrx5417XO47lOoZ X-Received: by 2002:a50:ab16:0:b0:414:39b0:7fc1 with SMTP id s22-20020a50ab16000000b0041439b07fc1mr10216860edc.214.1648643883208; Wed, 30 Mar 2022 05:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648643883; cv=none; d=google.com; s=arc-20160816; b=UnnXNLT1cylRBekCe9By0W3vugtViJBkN1vafppfFfYr927yEKoly2at4T5XEja0KI Hno9M6NdgTsNnMhTl8Y4h9KPU9TNm/Qb2DnBJG7u4qpCLQ2HXqdewBWMyU8l/n30TQT/ Gr3HxjuCwRyK/4eB/+UQzUBWemnqmChjmZ0nv6RdHCzOmyl53XGvMui1A7p7ZZXQnKDC /SNDexlceKJJ2tZxz55zf6JJEc174rlumZVazmqalCJbyGPT3C+HVBZmO6kdRXTiERi6 MQe2l10IkUiUZ9PjyqklrLbTHj48c2GpJsRAxitxhPBX5D0w0t+6RfgI4J5TJs/jOXv6 T1jA== 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=Rq9OlAmTxFnT7M+xSWVbz3I86ew4oSIuYRpT6jlttIM=; b=V93FY6h5eX2ZQ1Qw3WBb9QmvGWEC+CYoyu5k4f8XDzrMsP23VCAF1AKgi/kD3YL7qE 8FwC+W+IBjI1sHNAhqhp5sZgXuS+A1VS0prF+jfDTvmr3VTYdrrjL/8fmhFBnGl+O0xD 9l6yOUcB6BvomrTUpd20jyIUyJP770W/J8l8CxQNMxlUxOZI0efbY4BONeYJUcLSAlRF 3LBHJvEP1N9hWG+6Pbx9ULqHsTh315lV6yJ6c0u12xGghZxTiPZiethfwTlAGAGuqNoP M7fO7QNtEvK0dmkQPVHIrZGTWuOjw5UalC1bAZyT3xGTuWU4VYvN2bcHXD4IfIrUroNQ ZUwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=G3kgL2k0; 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 ji4-20020a170907980400b006df76385eb8si26096947ejc.856.2022.03.30.05.37.36; Wed, 30 Mar 2022 05:38:03 -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=G3kgL2k0; 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 S1343581AbiC3LVb (ORCPT + 99 others); Wed, 30 Mar 2022 07:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235372AbiC3LV3 (ORCPT ); Wed, 30 Mar 2022 07:21:29 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AADE109A4A; Wed, 30 Mar 2022 04:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648639184; x=1680175184; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=hNn5VlT2gG+pVF4p+g9iABCXPtmNiVuS8fWlHnCJL5s=; b=G3kgL2k0Gk+C4Zt1XDedP5SqrptKJthosK8psreKas2IfUHA2Odg4jXN 83HjoySbHB8qZ5owdXSmPuFpxheflLumeOc9fCec8mMoKmirKTTjmt66L 9FLX9cOqfacLDllNiEdtbghwVrpQjTiapzuwvN2AzC+MjDhJpR05WkEMW adsD70/eyv5rBKeWgecTeM/V2h3MvydRMziURWSeIsjmi1w8UfW8QcM/M 264wcBMBW7imRnQWzb9ySdDtpDkY0ryRObSXG/1XI9Pcm+oGlA9xd28lG G6f/zLcU3nLqUUsjp7BaMeHt9n/7ndnesrNjfHcx9Kwy8tKIbxtfxSH7V g==; X-IronPort-AV: E=McAfee;i="6200,9189,10301"; a="345954414" X-IronPort-AV: E=Sophos;i="5.90,222,1643702400"; d="scan'208";a="345954414" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 04:19:44 -0700 X-IronPort-AV: E=Sophos;i="5.90,222,1643702400"; d="scan'208";a="565495185" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.125]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 04:19:42 -0700 From: Zqiang To: paulmck@kernel.org, frederic@kernel.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcu-tasks: Check the atomic variable trc_n_readers_need_end again when wait timeout Date: Wed, 30 Mar 2022 19:20:14 +0800 Message-Id: <20220330112014.2587148-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=-4.4 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 the trc_wait waitqueue timeout, the atomic variable trc_n_readers_need_end need to be checked again, perhaps the conditions have been established at this time, avoid invalid stall information output. Signed-off-by: Zqiang --- kernel/rcu/tasks.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 65d6e21a607a..b73a2b362d6b 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -1544,7 +1544,7 @@ static void rcu_tasks_trace_postgp(struct rcu_tasks *rtp) trc_wait, atomic_read(&trc_n_readers_need_end) == 0, READ_ONCE(rcu_task_stall_timeout)); - if (ret) + if (ret || !atomic_read(&trc_n_readers_need_end)) break; // Count reached zero. // Stall warning time, so make a list of the offenders. rcu_read_lock(); -- 2.25.1