Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp877991pxb; Thu, 5 Nov 2020 15:51:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxe0aSulLlfmG6hya0yFvbBBluxFEAia4KxE04NZ7BRR4XVBBxZ727FodBdDkobl/AqZaou X-Received: by 2002:a17:906:1989:: with SMTP id g9mr4619258ejd.62.1604620272682; Thu, 05 Nov 2020 15:51:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604620272; cv=none; d=google.com; s=arc-20160816; b=YttYNEuY98I+oqeMBW7H8SP0KeevjJrLE5b0DAPQtU4M8//pt66XyVSZmt6fECyV0Z XG/Ng0XOY1F047dJ5xE/Y4weR9BYzU/8lwYLQn+qO42q5QWWbSVyk8XUcVn/NO91uyvy yhC4NvyWQu0GmsHfvWVkfKMKu6EZ1tegF+MunWeTGCWhCNiiWAh22uGPaniboC4Ub/OF oNwuNDGChmHbIq+DDmG2J2fG3ocQElmIVxIzklSpuC9BO9XbgSsCNyhZ03VxANj5hxLm xkxW/5Xtz03C4zgbEGsBzX/6/8/xF6dxCA6HnjK92RFaMDXzcO8jiqzqAaPbLbeXZew8 fKmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=2VN/n8M4JGvga1bcYK5yCURRWWnwfhv9dUcxj8NG63g=; b=WXZnNYPgGwv09GAUxHoe9WxokuNmC534aQCH6Murqw5C26a4DixhjwwkH1jc8JJ0lP klU4RgRKV0B/lVt8vMLVJWcnsXwAJfJgH6PgahBPH9hyZqbyHHS9Unb1J4F8O6OFQNtO hhJkw6c/uRLiSv5zN9orKX1MgZxDXoM9Of3RRmWnpftuKzCSBP6R2cZlvpY59emQTzNA KjpGV929T9/x5AA5WrGfrMCcyYFFf+AntYudwq50YiEH0chgQijAXzLKZ0DDCHNg21c0 ryn5vOt4Bd2ZFvDNOEUAaG1826o6Cw3mjIr9OKDcZHEOczcGpCeAilv6yCGlD5jVqs9G LYmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EiWkwcCK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si2717176ejj.595.2020.11.05.15.50.46; Thu, 05 Nov 2020 15:51:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EiWkwcCK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1732685AbgKEXr1 (ORCPT + 99 others); Thu, 5 Nov 2020 18:47:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:46124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732636AbgKEXrZ (ORCPT ); Thu, 5 Nov 2020 18:47:25 -0500 Received: from paulmck-ThinkPad-P72.home (50-39-104-11.bvtn.or.frontiernet.net [50.39.104.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 87367221FA; Thu, 5 Nov 2020 23:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604620044; bh=cwCXmKgp/mfMgVtuaXwya+QgwONDg9inMtv9VLEd/ZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EiWkwcCKWuY7YCpbDn1EbF5S2k+RVWOSfuj2uCPjxqA6sE4GKE+jBstdEoZ7KJNoM YkjewLziscooQfBZlXBz8pRl87ufH0kYiEg9yYRc/D6cjujgSLLsPmeW7jAtMOY2Gv ygxtZ9HeBj2JgMqtMZVvdJImB1HS3celG+eLcq8E= From: paulmck@kernel.org To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 07/28] rcuscale: Add RCU Tasks Trace Date: Thu, 5 Nov 2020 15:46:58 -0800 Message-Id: <20201105234719.23307-7-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20201105234658.GA23142@paulmck-ThinkPad-P72> References: <20201105234658.GA23142@paulmck-ThinkPad-P72> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" This commit adds the ability to test performance and scalability of RCU Tasks Trace updaters. Reported-by: Alexei Starovoitov Signed-off-by: Paul E. McKenney --- kernel/rcu/rcuscale.c | 32 +++++++++++++++++++++- .../selftests/rcutorture/configs/rcuscale/CFcommon | 3 ++ .../selftests/rcutorture/configs/rcuscale/TRACE01 | 15 ++++++++++ .../rcutorture/configs/rcuscale/TRACE01.boot | 1 + 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01 create mode 100644 tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01.boot diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c index 2819b95..c42f240 100644 --- a/kernel/rcu/rcuscale.c +++ b/kernel/rcu/rcuscale.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "rcu.h" @@ -294,6 +295,35 @@ static struct rcu_scale_ops tasks_ops = { .name = "tasks" }; +/* + * Definitions for RCU-tasks-trace scalability testing. + */ + +static int tasks_trace_scale_read_lock(void) +{ + rcu_read_lock_trace(); + return 0; +} + +static void tasks_trace_scale_read_unlock(int idx) +{ + rcu_read_unlock_trace(); +} + +static struct rcu_scale_ops tasks_tracing_ops = { + .ptype = RCU_TASKS_FLAVOR, + .init = rcu_sync_scale_init, + .readlock = tasks_trace_scale_read_lock, + .readunlock = tasks_trace_scale_read_unlock, + .get_gp_seq = rcu_no_completed, + .gp_diff = rcu_seq_diff, + .async = call_rcu_tasks_trace, + .gp_barrier = rcu_barrier_tasks_trace, + .sync = synchronize_rcu_tasks_trace, + .exp_sync = synchronize_rcu_tasks_trace, + .name = "tasks-tracing" +}; + static unsigned long rcuscale_seq_diff(unsigned long new, unsigned long old) { if (!cur_ops->gp_diff) @@ -754,7 +784,7 @@ rcu_scale_init(void) long i; int firsterr = 0; static struct rcu_scale_ops *scale_ops[] = { - &rcu_ops, &srcu_ops, &srcud_ops, &tasks_ops, + &rcu_ops, &srcu_ops, &srcud_ops, &tasks_ops, &tasks_tracing_ops }; if (!torture_init_begin(scale_type, verbose)) diff --git a/tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon b/tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon index 87caa0e..90942bb 100644 --- a/tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon +++ b/tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon @@ -1,2 +1,5 @@ CONFIG_RCU_SCALE_TEST=y CONFIG_PRINTK_TIME=y +CONFIG_TASKS_RCU_GENERIC=y +CONFIG_TASKS_RCU=y +CONFIG_TASKS_TRACE_RCU=y diff --git a/tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01 b/tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01 new file mode 100644 index 0000000..e6baa2f --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01 @@ -0,0 +1,15 @@ +CONFIG_SMP=y +CONFIG_PREEMPT_NONE=y +CONFIG_PREEMPT_VOLUNTARY=n +CONFIG_PREEMPT=n +CONFIG_HZ_PERIODIC=n +CONFIG_NO_HZ_IDLE=y +CONFIG_NO_HZ_FULL=n +CONFIG_RCU_FAST_NO_HZ=n +CONFIG_RCU_NOCB_CPU=n +CONFIG_DEBUG_LOCK_ALLOC=n +CONFIG_PROVE_LOCKING=n +CONFIG_RCU_BOOST=n +CONFIG_DEBUG_OBJECTS_RCU_HEAD=n +CONFIG_RCU_EXPERT=y +CONFIG_RCU_TRACE=y diff --git a/tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01.boot b/tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01.boot new file mode 100644 index 0000000..af0aff1 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01.boot @@ -0,0 +1 @@ +rcuscale.scale_type=tasks-tracing -- 2.9.5