Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3323623iog; Mon, 20 Jun 2022 17:15:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tgaVppSUZT5sGNDoiaf2YHu4x9KqWqk5krlzY96/hkKfwO4Pa58+gS+tVTBdJTPZ+owIe9 X-Received: by 2002:a17:902:f683:b0:16a:38ba:a89f with SMTP id l3-20020a170902f68300b0016a38baa89fmr825979plg.64.1655770512909; Mon, 20 Jun 2022 17:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655770512; cv=none; d=google.com; s=arc-20160816; b=Cru67DZ3imJvParKPhTxlrUFafXjF05Q75NIDcCUtq1KdnAS6fyVdfJTiEHDe4EH7z m6fVdbrqrYrovpH4D1b8zulofMxE2kYGfikAElRBgzwWBi018Nz1x9LZoGcZJz4cgEZi df19LM01BziwnFx1EIeYsAnmw1pWlRWDTcXXsVwnYWeXZqipE0MJqhlvDvbHj5aniaM/ kZ5mzlZ95VxZllQz1vZOoCViOmqULFdhi1yQEazq8EkbdAg8gPyKFk4gcqEwsy0nEouC j+mZJ3U2d5ASqzfa+f5LHtCcbqoUxnCzFcyCApLG3nSFXfyk1409umucMCo9OXhONbrI g31w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WF6g7nODr2kfFQ3P+K8Gw3ydZwpJU0H8gzKvr596irk=; b=ODnQojrJWZRea9/YvKcriye0bp4e1Bxo/s4HO9SS9G/FlNYQ0y1zUkffL1ANDDdiAt 5HJjU/xSyKIfOBdukA5uyZNQihH9OMX1j4bI8oX3nV7/2jhXjVd/oduZAd0fMnTUO28Q Mcqtpk0/rSBbjkuWr98cIk8T27bvTJrv6w4buJO8kOwJZg16H1Q4oiM+RdiZfnhpHuOl Ts2o7NZopb9+/D/zTQKzSDehk0xIQzciIC4rj8ZnNOSaw9EpBVL4x91SWcSDrXJpiGfh aAH3kXOqN3nNsssXfqmurChP62IczFiEH47ub3M9TFrr+e5Q+BhmvtGxh1WvBIZXPl74 hbfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QuY9SbaL; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z15-20020a056a00240f00b0051bcab048ecsi19277056pfh.178.2022.06.20.17.15.01; Mon, 20 Jun 2022 17:15:12 -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=@kernel.org header.s=k20201202 header.b=QuY9SbaL; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345323AbiFTWzd (ORCPT + 99 others); Mon, 20 Jun 2022 18:55:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344873AbiFTWy0 (ORCPT ); Mon, 20 Jun 2022 18:54:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18FD61EECB; Mon, 20 Jun 2022 15:54:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B15C8614A1; Mon, 20 Jun 2022 22:54:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38D84C36AFF; Mon, 20 Jun 2022 22:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655765654; bh=oeqjPlwjXE63AEix275I757EvtUPI3KuTQHjdeOt3rc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QuY9SbaL8NzO3lPK63bQn0eFr9sIRkeWHEA1QPThf964NXExo2VU/8eb0z9Eo9KdT KxqeLO7npg+6A7HQU/eMUcG9z7JccQoJrgqNzWtB/zgQvGqrFbM37Tgr6tO8vRrLho XHC7vRUUFQYRrBNvHu/kgH942BK4y2767T2kOIDN1Nki0OP7868lDQbUaGKUWdnyY9 xvnURwlQqyOptaDdK+xFwSSog/L7pNcQbkzHYUnUOB6xcrVbmmcnrCunX1BcmJzmfC Ibc5brAzk3iMR/MA4JZFx+31izJ8UQdpGN8NVgpuw9xXzz6klip/SL/6LGpZ+2EwZJ dIgoIBYT1lsbw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 5BFFE5C164C; Mon, 20 Jun 2022 15:54:13 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" , Neeraj Upadhyay , Eric Dumazet , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , KP Singh Subject: [PATCH rcu 27/32] rcu-tasks: Maintain a count of tasks blocking RCU Tasks Trace grace period Date: Mon, 20 Jun 2022 15:54:06 -0700 Message-Id: <20220620225411.3842519-27-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220620225402.GA3842369@paulmck-ThinkPad-P17-Gen-1> References: <20220620225402.GA3842369@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 This commit maintains a new n_trc_holdouts counter that tracks the number of tasks blocking the RCU Tasks grace period. This counter is useful for debugging, and its value has been added to a diagostic message. Signed-off-by: Paul E. McKenney Cc: Neeraj Upadhyay Cc: Eric Dumazet Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Martin KaFai Lau Cc: KP Singh --- kernel/rcu/tasks.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index fe0552086ccfc..9d7d6fd4b8a79 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -1206,6 +1206,7 @@ static DEFINE_PER_CPU(bool, trc_ipi_to_cpu); static unsigned long n_heavy_reader_attempts; static unsigned long n_heavy_reader_updates; static unsigned long n_heavy_reader_ofl_updates; +static unsigned long n_trc_holdouts; void call_rcu_tasks_trace(struct rcu_head *rhp, rcu_callback_t func); DEFINE_RCU_TASKS(rcu_tasks_trace, rcu_tasks_wait_gp, call_rcu_tasks_trace, @@ -1299,6 +1300,7 @@ static void trc_add_holdout(struct task_struct *t, struct list_head *bhp) if (list_empty(&t->trc_holdout_list)) { get_task_struct(t); list_add(&t->trc_holdout_list, bhp); + n_trc_holdouts++; } } @@ -1308,6 +1310,7 @@ static void trc_del_holdout(struct task_struct *t) if (!list_empty(&t->trc_holdout_list)) { list_del_init(&t->trc_holdout_list); put_task_struct(t); + n_trc_holdouts--; } } @@ -1760,7 +1763,8 @@ void show_rcu_tasks_trace_gp_kthread(void) { char buf[64]; - sprintf(buf, "h:%lu/%lu/%lu", + sprintf(buf, "N%lu h:%lu/%lu/%lu", + data_race(n_trc_holdouts), data_race(n_heavy_reader_ofl_updates), data_race(n_heavy_reader_updates), data_race(n_heavy_reader_attempts)); -- 2.31.1.189.g2e36527f23