Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1366803imn; Sun, 31 Jul 2022 04:23:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v+XSuj5WTAuOkRYPCJcDl/1OFVwitplKS5Spk2OrAk3IpxWH3RmFQhUj1ir9CO4p7Q/YRI X-Received: by 2002:a17:907:9710:b0:72b:3271:c9f with SMTP id jg16-20020a170907971000b0072b32710c9fmr8641221ejc.91.1659266602781; Sun, 31 Jul 2022 04:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659266602; cv=none; d=google.com; s=arc-20160816; b=acVf9ieiKBUBFSfcyxkXECsDOK7qhLKSmL1YgZVcvpsvgxYJkQ6LWhbHCNJNe2Vklm c0TBMWlk2i4nzZOvQ4j2cpxzrGy13kRN8o40/P9V5gVJehhoahpe5y7Auwg9lPfhT35/ dEchNE0JjwoCRH0knQcVsrSK73GcaAIcgg+BBdfdzxuZX2p1WO1i6ciDP63mrj1H+Wz5 ulRC0OQx4zVQJLpKRNC2BymDzaL4mm+xW5BwDeyaHxIqrOVq5e9tkBSYTKo4FflqObhN MykEuRhC9N+tcemNK8zvD1PKWuw58wDCaSSoflcAIQDiDY1nce0KSV//m2AqURSOBlbT gwrQ== 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=EZ+9X3okf137hCcH/DFYzaoND3B4lSCSr8BOrUsVXMQ=; b=p94/u5xOyMkjasycCykXPhx3uqrt/ctEGD4Co5dsVBWYWYe/OL9FucL98SeSuQSnuR DHQlaOJsDL6zgNqpOL3GNEAyQKjP5zxL6+N7xzPkVyKvoCMfrQ8R0ivd+SU69bqG4PMA BfJxcjzuyoVNR7g1G4z8F38BbkQDyK8sMhmyiyaYH3KmhUGwoTjZRZqTFuqQ6fBaRbDj fsNoJ+dpuUy9TvgsDiT3DY/MYE/JhfUOamBu7J5TS7VMD4pwpr+i4EwARama1W/x5wJG oEZ7rIdE4ftu6/8RQsAnSPv34NsXtI7ygjukWopMFdJM4FTiUrAGq/cpX3KAaxVg5M/l 6g9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ewe8r6P+; 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 c16-20020a0564021f9000b0043cf66ca11fsi7436797edc.76.2022.07.31.04.22.55; Sun, 31 Jul 2022 04:23:22 -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=ewe8r6P+; 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 S231239AbiGaKtO (ORCPT + 99 others); Sun, 31 Jul 2022 06:49:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiGaKtN (ORCPT ); Sun, 31 Jul 2022 06:49:13 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E979E9FC8; Sun, 31 Jul 2022 03:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659264552; x=1690800552; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=lT72Bexrs57W84BZaeIkvJnQF4eTQDr/RDyvUrHL/v4=; b=ewe8r6P+gFQNExb8UgYA1tgLQRCcHVGqNVarIwmsWPHo5AZl8itpRxVz 0kks3fCm0LVmUyLjKA28Gr3iinTMXQrEiH/TJ/ZMrBVdaLgOqIJOpgxo+ fIF5VK4UgXZ57pqZiKyDPs5jMm6pTmy0W0ynD5L3vNnm9Vu6eHw/wuSGU KdZiPn4VohKBU4FoGJFShzkAG3eEP/IIWVZ77fA+QqNKta7s/Ib1ivR6d Vihr8Mh/zunDPV8vxC406X3yO8nhg4PiAIWY1Fj2SX6j3AR+NrPGrbrOD 3rW2fV3fK6zf172ts7yWpXjBQ7cY76Sm/GAif8iliQv+4VNacEA3GY5r5 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10424"; a="375289126" X-IronPort-AV: E=Sophos;i="5.93,206,1654585200"; d="scan'208";a="375289126" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2022 03:49:12 -0700 X-IronPort-AV: E=Sophos;i="5.93,206,1654585200"; d="scan'208";a="660799595" 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; 31 Jul 2022 03:49:11 -0700 From: Zqiang To: paulmck@kernel.org, frederic@kernel.org, quic_neeraju@quicinc.com Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcutorture: Use the barrier operation corresponding to rcutorture.torture_type Date: Sun, 31 Jul 2022 18:53:56 +0800 Message-Id: <20220731105356.1741086-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 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 rcutorture.torture_type value is 'rcu', this is correct for invoke rcu_barrier() to wait all in-flight call_rcu() callbacks (rcu_torture_fwd_cb_cr()) complete in rcutorture_oom_notify(). but when the rcutorture.torture_type value is 'tasks-tracing', invoke rcu_barrier() won't wait all in-flight call_rcu_tasks_trace() callbacks complete, the rcu_barrier_tasks_trace() should be invoked. This commit fix it by using barrier operation corresponding to rcutorture.torture_type to wait all in-flight rcu_torture_fwd_cb_cr() complete. Signed-off-by: Zqiang --- kernel/rcu/rcutorture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 7f13f2e5ed62..7e7d54841613 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -2638,12 +2638,12 @@ static int rcutorture_oom_notify(struct notifier_block *self, for (i = 0; i < fwd_progress; i++) ncbs += rcu_torture_fwd_prog_cbfree(&rfp[i]); pr_info("%s: Freed %lu RCU callbacks.\n", __func__, ncbs); - rcu_barrier(); + cur_ops->cb_barrier(); ncbs = 0; for (i = 0; i < fwd_progress; i++) ncbs += rcu_torture_fwd_prog_cbfree(&rfp[i]); pr_info("%s: Freed %lu RCU callbacks.\n", __func__, ncbs); - rcu_barrier(); + cur_ops->cb_barrier(); ncbs = 0; for (i = 0; i < fwd_progress; i++) ncbs += rcu_torture_fwd_prog_cbfree(&rfp[i]); -- 2.25.1