From nobody Mon May 25 01:15:23 2026 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28E5C347FCD for ; Tue, 19 May 2026 19:45:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219930; cv=none; b=WnywV2hi+9/X3bQS7wMfkpYeDxkERjL4/6PN7rL2p5hgl3K//1/fj3GOXd5U2ezL+YK/QdTX3sde9v2Ksf04Z2mrQjkJMM8v/fAVnxRYBKnZJksELRq9TQForxl8PnZWbi0zYMr2aK849Z3Jd7GBcaKO9DW55FBChVQUCoYBQw4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219930; c=relaxed/simple; bh=8U4fZXYxpP9EpOFHCwVetdbSURz8u4Tv2owOwveJqRY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ga2RXzXksVrqHyWT4D+faIICacB1siCv/V1h8ojFfxPoqRQ+5m6tdpmmk+dhbNDozg683j7B/XI6ZPA6N7RmbU+77a1pUx1+yWvwGrKGq7afxPlQ0NfhMgExN3ZVy1R9MUmRbz5WOtqoqCUzVBoX3IsBjBipqgfGd8KXj0NeVbM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D2Alyiku; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D2Alyiku" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-39393ec4ed0so38544761fa.0 for ; Tue, 19 May 2026 12:45:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779219927; x=1779824727; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IT2OSOzkk3PaChfF7Nt8KGAWk9wIlHl4cNM3shxKASk=; b=D2AlyikubquxQqSRzUllPlJEY1lRFweJ8qaADgEi9N0z6su6vLKGHU+zXTy5hvhT8O VM6hwbXEShP6QK9XXbvhtAPImZGxs7fF27K35cPF65nXHKJOwaqtfqT9ZFokxDJhFZ7T TPCQVMGt2O4nYVqx3vk8WaXdoGoK6XL1dKvsLs0qqwITx8lopxWdIJpaDswf2iQWTFhJ xhtiKPsDzQ2VPfwZE6WNG5+tmXqJ9o5AxKKnnNS4eiRZYx+S+tJFhAvoo6BLvJ7QN3/c PBMgMC44P9q/H66MZajiSlQ5EABQGzhHa47cVHwGLieUd7++bntWf2/BG/tunAwigc80 q7Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779219927; x=1779824727; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IT2OSOzkk3PaChfF7Nt8KGAWk9wIlHl4cNM3shxKASk=; b=tWo8vUEureHxYbXlg6pvzvR0nit7wAG2XPmFqeS8bmejYSZNIzp5+HDR7jGhfreSTU /x/pyWbQMyn7t+ge10PSraiFu/+7Dq//vpUWI9J71tRt0QOfVbbdkD1G4tmOSNXjWbNa YKHL9edz/UyUkdSIYRA330s+RDjGmnidic8q6a+8q1BeYkHgc/Oc6IGKn0+Lw/oEV0BY BB40G5pLTFOSLIobuVH+MTNmYkZwNq2v6GVoB44ukVL/M3OvojamwY/D/wWPrv0CXA78 8kJlW8EYKmv0KdgnbrQjxxmoThuGVAVJyv8XQga3pzdGi47F58yt7i7gy/N1tSAgaGN3 aUXw== X-Forwarded-Encrypted: i=1; AFNElJ+YoZ1xlpICZpRzDwV9lgJR47VUmdM7UlAMmbu7JJdBy7zoLYiNqXOnUvFbhFS0qyz1KOM5/b0r3jXmmsU=@vger.kernel.org X-Gm-Message-State: AOJu0Yz4S7RNdwigZftiyRxBoBsbbT6TuTCiMOcs1Z0Hb+HOj2jxSZUy x/0vDtrKwE5DSQKoHOaAQBTtek25b8QfaFstm6NA5cgCiJ78bw4O3d6r X-Gm-Gg: Acq92OEG0MVA9SGsO1nHCWqgRVnsdaIafk4xwoSDzC8hjEPYdTU7LIVcL64vOYtEjgp 76LLBWZ4lFqQ8C2xqdH8K3SJEmg8Hk+UR3lwriD4gqlPp9BNKfdkISZEZRbyJqzLIfTA9pvfAir ouqkL60Zz44mn70RjvVaCE38ipf+91nZd6HRzmuyIBvasbN6e9xTEjLZVortOZzwXFpljNwFp9h 1S+uh6tCPR3yynHByosnhEMrXsT5uc+ggnEjOAwGidHIqKj7HTyi2EHPRe+0obBCrCvnipyt3Xg bmrid7tabj6x8MbAlbiAjp9DHRAZssZryyQ4RbDt257ksaLhck+bWLJ1WvRWZGr36QV7JkNn+wF Nb8Oai8fNzxj6376slT3Zjrfie7XoW7KdI3vXxMSKdKqolLGMbJRDX3ZBV18RPUDqRwxPiL7RK4 vBgi+vpAcA/6WZJUU= X-Received: by 2002:a05:651c:324b:b0:38e:8503:6fb5 with SMTP id 38308e7fff4ca-39561da4fccmr63360581fa.30.1779219927034; Tue, 19 May 2026 12:45:27 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3958827ec3fsm23558761fa.9.2026.05.19.12.45.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 12:45:26 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki , Saravana Kannan Subject: [PATCH -next v2 01/11] rcutorture: Fully test lazy RCU Date: Tue, 19 May 2026 21:45:14 +0200 Message-ID: <20260519194524.158515-2-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260519194524.158515-1-urezki@gmail.com> References: <20260519194524.158515-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Paul E. McKenney" Currently, rcutorture bypasses lazy RCU by using call_rcu_hurry(). This works, avoiding the dreaded rtort_pipe_count WARN(), but fails to fully test lazy RCU. The rtort_pipe_count WARN() splats because lazy RCU could delay the start of an RCU grace period for a full stutter period, which defaults to only three seconds. This commit therefore reverts the call_rcu_hurry() instances back to call_rcu(), but, in kernels built with CONFIG_RCU_LAZY=3Dy, queues a workqueue handler just before the call to stutter_wait() in rcu_torture_writer(). This workqueue handler invokes rcu_barrier(), which motivates any lingering lazy callbacks, thus avoiding the splat. Reported-by: Saravana Kannan Signed-off-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) --- kernel/rcu/rcutorture.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 5f2848b828dc..882a158ada7b 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -572,7 +572,7 @@ static unsigned long rcu_no_completed(void) =20 static void rcu_torture_deferred_free(struct rcu_torture *p) { - call_rcu_hurry(&p->rtort_rcu, rcu_torture_cb); + call_rcu(&p->rtort_rcu, rcu_torture_cb); } =20 static void rcu_sync_torture_init(void) @@ -619,7 +619,7 @@ static struct rcu_torture_ops rcu_ops =3D { .poll_gp_state_exp =3D poll_state_synchronize_rcu, .cond_sync_exp =3D cond_synchronize_rcu_expedited, .cond_sync_exp_full =3D cond_synchronize_rcu_expedited_full, - .call =3D call_rcu_hurry, + .call =3D call_rcu, .cb_barrier =3D rcu_barrier, .fqs =3D rcu_force_quiescent_state, .gp_kthread_dbg =3D show_rcu_gp_kthreads, @@ -1145,7 +1145,7 @@ static void rcu_tasks_torture_deferred_free(struct rc= u_torture *p) =20 static void synchronize_rcu_mult_test(void) { - synchronize_rcu_mult(call_rcu_tasks, call_rcu_hurry); + synchronize_rcu_mult(call_rcu_tasks, call_rcu); } =20 static struct rcu_torture_ops tasks_ops =3D { @@ -1631,6 +1631,17 @@ static void do_rtws_sync(struct torture_random_state= *trsp, void (*sync)(void)) cpus_read_unlock(); } =20 +/* + * Do an rcu_barrier() to motivate lazy callbacks during a stutter + * pause. Without this, we can get false-positives rtort_pipe_count + * splats. + */ +static void rcu_torture_writer_work(struct work_struct *work) +{ + if (cur_ops->cb_barrier) + cur_ops->cb_barrier(); +} + /* * RCU torture writer kthread. Repeatedly substitutes a new structure * for that pointed to by rcu_torture_current, freeing the old structure @@ -1651,6 +1662,7 @@ rcu_torture_writer(void *arg) int i; int idx; unsigned long j; + struct work_struct lazy_work; int oldnice =3D task_nice(current); struct rcu_gp_oldstate *rgo =3D NULL; int rgo_size =3D 0; @@ -1703,6 +1715,9 @@ rcu_torture_writer(void *arg) pr_alert("%s" TORTURE_FLAG " Waited %lu jiffies for boot to complete.\n", torture_type, jiffies - j); =20 + if (IS_ENABLED(CONFIG_RCU_LAZY)) + INIT_WORK_ONSTACK(&lazy_work, rcu_torture_writer_work); + do { rcu_torture_writer_state =3D RTWS_FIXED_DELAY; torture_hrtimeout_us(500, 1000, &rand); @@ -1895,6 +1910,8 @@ rcu_torture_writer(void *arg) !rcu_gp_is_normal(); } rcu_torture_writer_state =3D RTWS_STUTTER; + if (IS_ENABLED(CONFIG_RCU_LAZY)) + queue_work(system_percpu_wq, &lazy_work); stutter_waited =3D stutter_wait("rcu_torture_writer"); if (stutter_waited && !atomic_read(&rcu_fwd_cb_nodelay) && @@ -1925,6 +1942,12 @@ rcu_torture_writer(void *arg) pr_alert("%s" TORTURE_FLAG " Dynamic grace-period expediting was disabled.\n", torture_type); + + if (IS_ENABLED(CONFIG_RCU_LAZY)) { + cancel_work_sync(&lazy_work); + destroy_work_on_stack(&lazy_work); + } + kfree(ulo); kfree(rgo); rcu_torture_writer_state =3D RTWS_STOPPING; --=20 2.47.3 From nobody Mon May 25 01:15:23 2026 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D1B9367B7D for ; Tue, 19 May 2026 19:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219931; cv=none; b=n9VNgbOJSHosAmJ1MpSWP77oTFpfC06KeNT9U2znQ4bdHvE+KzzyunTVP24vCef4/0l/0pFhpIhXX2eX/KByNeFME1P8QghBizckVsoTN6QwsCxK5P7jNi6j666KMwZOPO6csoa45o5anjtYvgqPI2cosLsLP8HFZvWSS5zwRC8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219931; c=relaxed/simple; bh=nf3d6Th/qqcFPA3j+0FA/cKyNhD0kVORFLgt2PalDbc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ee2HR71rTMqPmO6u7km2ASbu8o6ZEvW+6hLJghkwthXXV49mmDpx75gn10FmGw+g/to63h1y3DwIx1fneBUeb+vllr+SwcSvu3BUgXxXEFr9F24DoChjFaW2xFXhiEY7ultDHnmeNHHwebdzmSF8HMq4D71lbw9ryrVHrUH2Qwg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iB+bjYb8; arc=none smtp.client-ip=209.85.208.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iB+bjYb8" Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-38e800deae4so40987981fa.0 for ; Tue, 19 May 2026 12:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779219928; x=1779824728; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i8n4g8DtMbilWmfrS0Iblc6XB8Z+tIb+ktHpUGgo0p4=; b=iB+bjYb8vH7qT64UYpyBHdkiBxhsBeR2vVmkqMoCz9D3IHkpnd4Q+XvSNl0Wc1u63s i9Qj+VYYuB/QQEb2Z8qFQgmcsSxvWmvzC3vJYbfZ4dKRV1n5AdvpAWOQ7foBsCuk/Fjv my7STpRyWTfXLSitSMC1LfLaHJOLGM5sCahIjtaKihG9bd3X+v263MNiHEuIMRVZLhfb CFv9W07mk9vb4tpRyG3rmO/9rd8Zsg/660aL9vZn/u1atRrL90JETRIbOywDTbJv+sc/ n/OZHjVBQ7HVpyFQE3Uphi4chRYeBzu8y6nbFXTlogqLxtb+wLd9lxoA2lHZqlYbQ2kj 6jdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779219928; x=1779824728; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=i8n4g8DtMbilWmfrS0Iblc6XB8Z+tIb+ktHpUGgo0p4=; b=AAGPhUreIIgzgakfQ7ADtceyx5iFUzsqVEZ2+b8W3cLr1jXgl1Pzl9RAuSunXHx9xa Yef8a5XH2xQ09pPf/jD1vDyFlGYyfBVMw7U1TBfQmQWL69f0eMkxzmnmJAmVb2er9NCl 50uzgnzfFbHOorBFG+D59dBEGQnKfz9/icDFjHt2lRsrYunixG+Nqo3ZS+Nm36yDL5JC BYLWEBC9jD4z08UCfYFtGUZic6fcu6dEgP16lJnmCbrIfaB41jCN1JNsU1sL2BT4weA0 q2/H/XDDs9nb8hNAalQ1o2ZPDi92rZP9BWsPgcazKdRNJ83C1J/3jrcB3k7dVy89nGvG OiAQ== X-Forwarded-Encrypted: i=1; AFNElJ8XKiIPuLTFI9VTlhGSZ+gVL1knVzQ1D7M75smIGZ38GBZfMwN6glnHBzI9OR9n3Nzn5MEE9K9DdBITcLA=@vger.kernel.org X-Gm-Message-State: AOJu0YxQD/u1OjUG5+y7bkRrEZiqzOaQa6GC5+u76oEjMrkJ+CIrQIB9 LCrYybqEpR/O6Q6/9zbRqR2lFwWYPf8QE63zeObluRdxtUqlI36RIJ2y X-Gm-Gg: Acq92OGVQS0dzKwg6Q2UsFY+jehxmshYQWYnBgmorvI6jcq+11km7fTSh7Dn89iPxt3 KCGURXlTaVRM+dOOeQLBMlePQ4sMbkVhDoVSOEnJcQb6LuXFENd/i9dDkEqFLxX+HHlPnPQqzzk vCM8pyo/NKaitnfS4VrM7TOdKkSU9yNf8fMZ93w+Dvx1HSkk/rncZYoTJZoNqNX/BqF6RaYzg7i XYUxY2xlJDspowC/+OzkYB0fwqp6QdD6+leAYl9ugYEkc34RkJbsynwjMzVcibJyDXO7sEuZHTa dFhDyjfKsWqcx3+X/nBNDVEAOjhV0WDeeyzLkgs4Macwhw1gCcOishd7Lfhutvj2KfIPw5CjkEi qplSOMUceqnHMTsZ4lK5cPM4TjM0lx+Hmhg4213PoC6yl6qyuhjXpBQRFNto8VhT1QE1obfRrC9 qnMR/UC4fdzhgklFKgmyoFsqZwtA== X-Received: by 2002:a2e:9059:0:b0:38e:58c7:cd1 with SMTP id 38308e7fff4ca-39561dc13c1mr44953141fa.21.1779219927559; Tue, 19 May 2026 12:45:27 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3958827ec3fsm23558761fa.9.2026.05.19.12.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 12:45:27 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v2 02/11] torture: Add torture_sched_set_normal() for user-specified nice values Date: Tue, 19 May 2026 21:45:15 +0200 Message-ID: <20260519194524.158515-3-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260519194524.158515-1-urezki@gmail.com> References: <20260519194524.158515-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Paul E. McKenney" This new torture_sched_set_normal() function clamps the nice value at the MIN_NICE..MAX_NICE limits, splatting it these limits are exceeded. It then invokes sched_set_normal() to set the new value. This prevents more difficult-to-debug failures within the scheduler. Signed-off-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) --- include/linux/torture.h | 1 + kernel/torture.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/linux/torture.h b/include/linux/torture.h index 1b59056c3b18..c9b47d138302 100644 --- a/include/linux/torture.h +++ b/include/linux/torture.h @@ -129,6 +129,7 @@ void _torture_stop_kthread(char *m, struct task_struct = **tp); #else #define torture_preempt_schedule() do { } while (0) #endif +void torture_sched_set_normal(struct task_struct *t, int nice); =20 #if IS_ENABLED(CONFIG_RCU_TORTURE_TEST) || IS_MODULE(CONFIG_RCU_TORTURE_TE= ST) || IS_ENABLED(CONFIG_LOCK_TORTURE_TEST) || IS_MODULE(CONFIG_LOCK_TORTUR= E_TEST) long torture_sched_setaffinity(pid_t pid, const struct cpumask *in_mask, b= ool dowarn); diff --git a/kernel/torture.c b/kernel/torture.c index 62c1ac777694..77cb3589b19f 100644 --- a/kernel/torture.c +++ b/kernel/torture.c @@ -972,3 +972,19 @@ void _torture_stop_kthread(char *m, struct task_struct= **tp) *tp =3D NULL; } EXPORT_SYMBOL_GPL(_torture_stop_kthread); + +/* + * Set the specified task's niceness value, saturating at limits. + * Saturating noisily, but saturating. + */ +void torture_sched_set_normal(struct task_struct *t, int nice) +{ + int realnice =3D nice; + + if (WARN_ON_ONCE(realnice > MAX_NICE)) + realnice =3D MAX_NICE; + if (WARN_ON_ONCE(realnice < MIN_NICE)) + realnice =3D MIN_NICE; + sched_set_normal(t, realnice); +} +EXPORT_SYMBOL_GPL(torture_sched_set_normal); --=20 2.47.3 From nobody Mon May 25 01:15:23 2026 Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1ECFE3B4E98 for ; Tue, 19 May 2026 19:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219931; cv=none; b=bm1SzQ4KNuXFVYtp1uNsRrxxQbSrfrs92fnf7oAW+n+pjITBMbvqf2GJA7pq/zhMTEm++XpXUB8YdD3n1ufl9jcWE7rwVqeETjmdHeiYVdjx/vUn7pTxci/ltp84R6RXHbwJSbTXvKSkvtRG0OAoZDHky4H9MtFxAKaMjF6OU7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219931; c=relaxed/simple; bh=qWh56X7aUC/LYuqv1uyB7V3OeBHhVcVqIZiSpCS54nE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mvhdgX0oYRISwc3s9VHmiDLFG8TAdo0T4FFHEqOnVsr5S1JXUzk3j8h6MZ8TtEGbOpN5cuOm7sAhM63fK9FKsh1S0/feSTBzSOoG1+/b8lfLFd3wNKbR7IAhn33N3UDeKA9125LMPzN2+K5pZYSzgWjDrd3VQZwxhY7y6Xi5MKY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=G7xamMJU; arc=none smtp.client-ip=209.85.208.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G7xamMJU" Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-39378db197aso45065061fa.3 for ; Tue, 19 May 2026 12:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779219928; x=1779824728; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aZbd7C6MnBodJyKouu1P8zuBbO7zFZawe+mPjisSXM4=; b=G7xamMJUI/6M4wCDlpwfmB1cZzF7FnmF8YuvKv+m1Y1g67YH6/iP67W0Tgk7eLmga9 z5k9LTAHpNV34g95RwCfdinHPtcs69kVqeIaMiTQeE+PXJdNisMRMXstHM29FvX+G8V7 6Awsrf2ppHqzuD+CAGmYkj0/WPb+1aSmIBW22lG5W3YajoV9Q+UGW9ndZx/PpUUvQcSf XWfX6IFc7hBBpgo7+7chmnXUOn3T5y1fJSQYdm1pmNcM9bFXxMOAP6kU6EySNcUODo37 Kunt5mhogNkSdKG14z2QU5qX6kRKnPpOXPK/TwG6q0EHMBT6XrmM6BG4FZnV05wjb8T4 lyxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779219928; x=1779824728; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aZbd7C6MnBodJyKouu1P8zuBbO7zFZawe+mPjisSXM4=; b=ZhJ2Ik05XtiTahy3iLknqxEIMpCXKsqxpWp999D65ot/CzINM6UtdyYBveEPsH3i6F B2rHclUFLgv5aP+YumkJpFvw+pbUcbLMlOVCr5TWnYAsoXJJhgK0ieZR7vyAuvz2bPV0 WGgLnvHQQUSf6WIXgNaQCMDjkUgxhlqt1dZJCcvupzRYgdxz8fbJhk+Cy5JuJXBM+ihM GYAAXTSUDWJ6eDUfwalyfFh7kji2OgoQIqpqPL46XKN0/2OAqMSfrT+XXV8Lzegq3PkT /JwdrTKEMntemJv8eRwcq9LYOh497Y0z6mFJ1z+698v98UPkrDUOXCjmVqzMFdxmYVVf dBBw== X-Forwarded-Encrypted: i=1; AFNElJ+0zigMz0aotAnVavRCMA/bJfO/PQK7OrazKnzJUBu41sN4IGpK2h0suQpbCargQIvLwd0lbuZMi4aY8wc=@vger.kernel.org X-Gm-Message-State: AOJu0YwsOuofrgXA/PmEjD4mjVxEKEkaJDtip6iKseEqI0Sw0P9byWU2 i6A4s2cZLeakc8agVIV2HUj3jglJ6sWhXa79LXjgTR3DnrTmhPgy2IPGtaqlY6Q+ X-Gm-Gg: Acq92OHnY3p/CZ4uPVrsJsVN22kVgC6NhqiPbnXxtbRZLRGVx/M44et7Hz9HkUe8rVJ 1kJwzqErN/qyq6YE+9BBWOIetAscRMzqE7QIcHlZOEXT6JLFHrSvb7TNPgW1Lwpq12Yu9H53Ow6 l6re1stikrYxNNmRrhxKOA/C8psfbMwnXrUSgnK4Y45OLxSafHuQnhz9KK5x+EbXxBuHMjH7RGj LtYYqlvvubLJfzJWFtKQKIX6rf+JxNOPf5zfuSbQv6Dlgmn09QIQ/+77AeSNSFQv6LVpQtoGhLo /YnFZVcn2rYYV+EkuQKBUytkPzup3hZfx4TBXVxjr6jyhGaqEa1op36JIMLR2hERhWaLpVy6LTd xKvIy6lvabbdKbm6ooR3avGWfbGyBx2E0cMa3HHzfZApaD5HEr2qO18nAhL0fSZQqr4uLrmgGcw Mc1dTYrFeHj/AYl0KW6RnvmqdVVg== X-Received: by 2002:a05:651c:4203:b0:38e:a181:9e41 with SMTP id 38308e7fff4ca-39561c9484amr56822831fa.12.1779219928177; Tue, 19 May 2026 12:45:28 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3958827ec3fsm23558761fa.9.2026.05.19.12.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 12:45:27 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v2 03/11] torture: Improve kvm-series.sh header comment Date: Tue, 19 May 2026 21:45:16 +0200 Message-ID: <20260519194524.158515-4-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260519194524.158515-1-urezki@gmail.com> References: <20260519194524.158515-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Paul E. McKenney" The constraints on the arguments to kvm-series.sh are easy to forget, so this commit adds examples in the header comment. Signed-off-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) --- tools/testing/selftests/rcutorture/bin/kvm-series.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/rcutorture/bin/kvm-series.sh b/tools/t= esting/selftests/rcutorture/bin/kvm-series.sh index c4ee5f910931..be9412538fb8 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm-series.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm-series.sh @@ -1,12 +1,13 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0+ # -# Usage: kvm-series.sh config-list commit-id-list [ kvm.sh parameters ] +# Usage: kvm-series.sh config-list commit-id-range [ kvm.sh parameters ] # -# Tests the specified list of unadorned configs ("TREE01 SRCU-P" but not -# "CFLIST" or "3*TRACE01") and an indication of a set of commits to test, -# then runs each commit through the specified list of commits using kvm.sh. -# The runs are grouped into a -series/config/commit directory tree. +# Tests the specified list of unadorned configs ("TREE01 SRCU-P" but +# not "CFLIST" or "3*TRACE01") and an indication of a range of commits +# ("v7.0-rc1..rcu/dev", but not "cd0ce7bab0408 ff74db28df623 17c52d7b31a1f= ") +# to test, then runs each commit through the specified list of commits usi= ng +# kvm.sh. The runs are grouped into a -series/config/commit directory tre= e. # Each run defaults to a duration of one minute. # # Run in top-level Linux source directory. Please note that this is in --=20 2.47.3 From nobody Mon May 25 01:15:23 2026 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B126284B37 for ; Tue, 19 May 2026 19:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219932; cv=none; b=JO9gIfAjA1aeV/eucecga0i8ShCQRRN8OW5yQCuZwBu/t0s+zWGEwBUgpDhxjDs0k1lBMzRjYoLU4xT79n5zZmCiQqNenBS84dyPF+ZPZ2Sx5p1TRA+YdEV/06maBltk4zT3eK49XJZhYtOE5B7m61Gedf0FBPZ67FPhjd4bbNs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219932; c=relaxed/simple; bh=AMef3pkMscCEIVOua4C09Swew/rkArkcZrElIxGazHY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RY9UPrIFujDRjK2lOiV+eCIxi+e/17/C3KXdK6Elb29dTLPNQzztF7pHlOYaRKsstVlEeM45shMzRR4o8QYCHcUt4srO15YDfrMiVLbyV72ALZiq649biElPQODsjuEBO8H1nkBvqqsqQXH33QZv3MGLBqigZQ6pslnvOH/jVKU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=oWHDersV; arc=none smtp.client-ip=209.85.208.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oWHDersV" Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-39556b00a85so35858711fa.0 for ; Tue, 19 May 2026 12:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779219929; x=1779824729; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XfW3Hcm6nkWUn/ECmWMffp8Hi+yYbyAl2pZxyKPEktU=; b=oWHDersVRari1kGQKDVzLjvAu6ieWFedprS5Bb6lVnhtFhIy4P8cAimpMH9Ewadb7l 1+WbpTt8wEzKN/QSheMb/Br2VKBTy5GRwGGgQxnH3Dm/Ed1iZBJGKfBoOfRKMhCps4Xm MfY2xCtTewzxN+A2cAu6hyKnWfUMee3e2CWHpY8HhE5dPcuuMNgpViGdpjrghm+fS+yL Ic1TLyQP3OPXNpOGdzlgOzdi03MEw+zFhOvAGi9uYVHzNXKYyJBV2ExJnWG7C79+BFAc nRdyftVNfc1J31vJ0FVCth6MynF838JU5tCrKAL00t86qdbOmZZulbMOV4wSLgyFHeTE kACg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779219929; x=1779824729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XfW3Hcm6nkWUn/ECmWMffp8Hi+yYbyAl2pZxyKPEktU=; b=LAsHYQ1t+TMy8IO2D+jmyahMMYdAeumMpsQ+RGJxaZ7CI0rX8d+90zzdSp5Msx9cVe 8D9sKT7Qp7OBVJxxjC/pqIP2JFFv4vje3yUt2Y1WTh5dBq6L3m2DCZQQyv8YP62/Urpt 9sqOc9c0XPfc81G19IOi6CYZZyugC0KbF9N8uIvQ1SyOc6tBxqTYV4AYfM7CV4MsJg5r IkhRpqOVg6GHYWPUdpEgIVbtz5ngWCH1pC4wOGakpLC37a+TMs9j2qHLlPSGLSMsLHN/ R3HjU8gpfOaN5fPTW9HIkHNzrav/4zk9v0DBkKOTmhPcomu53foOpMjuACz0Pi71dvU3 0WSw== X-Forwarded-Encrypted: i=1; AFNElJ91mWFXfPC2HtJoQ3hqbFkZKugpJLEnhA6j34nf6B+lX0h5DmwE2Suni5TWM0krdJjEWAd+9aNF+U7ALHA=@vger.kernel.org X-Gm-Message-State: AOJu0Yz2JdkCkOM6rW0Hkbg98+RS8D7JRTDfsLm9/ECE6qemKyX/8jMj GHpxzOoRvd3oV4yylWsvwu4kAuYYGEn4mEpTZ6ckHk1U+21uZp6IqPIXTqG+PlcH X-Gm-Gg: Acq92OFz6y8mv7EB62JpIy5U0ooKgLBpq8ErzyEAf9uiDPQ3Atd/nH7GqewrFJKQDZ0 ageYcWjA3yyYUdl8Vz7UMOL2EQwHtjXCl0HuIOzmxOLuGcKXLCRyJ0muAJCgxp/8aoxPzK694JH DNF1+JaRvKQFmbZKoL5KQ9nxSYtOi3qTDSZm8ls9Yl1rM8eYI1hZBVHEmiLW5VYjg+T00BpUTsk FOZFyMVmDWj4SFLC7ehaEwcdwolaxaEB6r08+PLW6GPGq4MXxUbpjRnvaGZwOn/UklrgF6OjqeT YJ3OIsUK0hqKUCJB6jxnyVb179NgyQAhFVm2VLLFpjTDEBIodyFM4d4TY8NOqdElUltmTc5JXAq eGbglfOpqZwRUdqf9GJGYYHMAg5UO00KqMGgsBAOK8VbIsJeTYDOvGPeP1xeFHWH3MxHEclXsyb z52qPq954AdV6xHAGClfppDTi7eQ== X-Received: by 2002:a2e:a5c1:0:b0:394:4e7:9805 with SMTP id 38308e7fff4ca-39561da4af2mr65127131fa.19.1779219928668; Tue, 19 May 2026 12:45:28 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3958827ec3fsm23558761fa.9.2026.05.19.12.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 12:45:28 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v2 04/11] torture: Allow "norm" abbreviation for "normal" Date: Tue, 19 May 2026 21:45:17 +0200 Message-ID: <20260519194524.158515-5-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260519194524.158515-1-urezki@gmail.com> References: <20260519194524.158515-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Paul E. McKenney" This adds "--do-norm", --do-no-norm", and "--no-norm" synonyms for the "--do-normal" group of torture.sh command-line arguments. Signed-off-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) --- tools/testing/selftests/rcutorture/bin/torture.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/rcutorture/bin/torture.sh b/tools/test= ing/selftests/rcutorture/bin/torture.sh index a33ba109ef0b..f0083891ee81 100755 --- a/tools/testing/selftests/rcutorture/bin/torture.sh +++ b/tools/testing/selftests/rcutorture/bin/torture.sh @@ -184,7 +184,7 @@ do do_clocksourcewd=3Dno do_srcu_lockdep=3Dno ;; - --do-normal|--do-no-normal|--no-normal) + --do-normal|--do-norm|--do-no-normal|--do-no-norm|--no-normal|--no-norm) do_normal=3D`doyesno "$1" --do-normal` explicit_normal=3Dyes ;; --=20 2.47.3 From nobody Mon May 25 01:15:23 2026 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 024173B4EB5 for ; Tue, 19 May 2026 19:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219932; cv=none; b=SG7vgzv8s7Vm/yaO7vS0MOf0kFaX2inQ6zgd3OIeW633LDuyYxhMcXJty0bKlE516XlvloAQ9JiyOOs0qf0QQBbkHPQ7vSYYuRF19r7ahrsI1c9slD5Nydyyf9V+4ra1IxEs4P/BIJi7/j+XfF8NG0NWZJWQanZd1uztJX1RP3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219932; c=relaxed/simple; bh=sCzlW8dI0Fhs+cB9tikStcBigUiohJn/nNVBfBD/Z7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q5uqVnlFUQBSugiUxfb8FXQbFfVdhSsBekQGIIioGWyG/PFV6Yu4oUAy42q9eYzXESkLVTeU/XLY/JCd0l8sOKMEHqe3Lh5MsjhuZa+E0pYiLaiuTSjgS5P8aKwzvW8C3Q412/oBm8P2rfNzJ40Z4j3bVl9Drn0xpHRe5yBw6HY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HXosfpvv; arc=none smtp.client-ip=209.85.208.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HXosfpvv" Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-39556b00a85so35858801fa.0 for ; Tue, 19 May 2026 12:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779219929; x=1779824729; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o/RJXFq6LqCe4pPTryrEabmW7igLHdURwee7mxbgIMM=; b=HXosfpvvqjwGGah9LaWiwiTOLDN9y74EgELO4GNA13CIUkaU0wLmjOl7DIBrKvTi+D 0xRBswzU63hju6rKyIUIobmYXIUzcw/oNknqRrG8ANlUHEmBK81pgKcVDwKXYqMTvzGu XY8+cj5J804LZNipLq/S+cyrYrVrg4gwy3WBKTxIcbuXVpyCkeo9oZlhLN/2VP0Zezwl zAYzTOsT7MUSr7y3xAu9ArugTt7ThMb0ufVR6C0M76VxxoUv3Nx5ClEjX7gm+qDRX1+d JXtVbJ1UEaHZ/or43oRr2inE+Tp6bLKu9qPTJzfaKpewzTV1Dhuih5TBEsM1X0FmYzpC eA7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779219929; x=1779824729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=o/RJXFq6LqCe4pPTryrEabmW7igLHdURwee7mxbgIMM=; b=pPKXxZIdmwe3xRMfgBjV5UBZhBW7Vd8ypcuzriD9/Sqvgeqt4mJ20drBoyd89HmByj 5Vt8qz6ZNMqUjC1bTCD9eEWGOgS1r7EX6S7JBOs4bEyOr5gCtThd2nWpwdb+Rba3KP/d RNPocQ6yKQnDUa8DOyRF8rbkTM5MTXQHoacWlRNgjngxeoMKpaONdd+6+1uoK9yfpOxh v6gtcoIKPxM82BfL6phQxSPlSDxZUFKtMUSzFVH2agS7+52rEK6Wpq6qxce+5f/ZvPNI dVcFBKtz4MMQx8+ucVFXfB4WCSJLQNeA5klm9O3Tltu9N04GSO2+q/12hmi+FNV8Sagz t7QQ== X-Forwarded-Encrypted: i=1; AFNElJ/3mH97vuRQ5MULCC+vaF6Cjxrws+VJ+8iWxCY0307ToYTB1aRlRVdxxmvL+USnVAH8kTv6i6n36Lu/rq8=@vger.kernel.org X-Gm-Message-State: AOJu0YzE1+8lNaOt32QOYxeR/deuxX+ZnvStDbK9cJVqE2xtAw6CjjqU uwWtxEbQPf8VNb9lLQCfRp6fO3i7F9Lvyuzo/FFhdYVllzFQj5RWNqzD X-Gm-Gg: Acq92OG+IinunC7284EGlreVSCjR8nbcbIAeYbezzYSB3k+UoYjBUyx0JE1p/B9NqSN wSR9OwPP5agYdeYavz0VKCPP2UGbzHhC3HtVa/gDeaTb/Q8q1CIef4tPoRneK6hEo92WjL7GI46 52oyQhyWqyiuOzywk5ngzHgZyZDU56zpXSVjdLQZ1h9AhD8zDTLDf+LbXWslnfBFyJtvriTS1DV O+j3aTttx1XU68+e5pPZ3+AcpWFECnDx5Goy5nwRhpaQoyKsf3GAjZ6XpMlP9R91SHjPQ6jQl3d clv119JXUvjEO5OOoZN2a08v+DPlfkH3zBhCm77wLEMtA2QhsNyQXJJ8isQB9lbBrMPHcXLBNUP PxvDa/8Uu3urPJhg6STjU6uXMWhs7mTdXV8suprSQFYTOP9eQWJozzTbMSCMWwaqzUvBN0l2Lzf a0jvkMjw5Y+k0U719Psm86TbWJTg== X-Received: by 2002:a05:651c:435c:10b0:38a:2f02:e153 with SMTP id 38308e7fff4ca-39561f67d59mr55038531fa.31.1779219929166; Tue, 19 May 2026 12:45:29 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3958827ec3fsm23558761fa.9.2026.05.19.12.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 12:45:28 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v2 05/11] srcu: Fix kerneldoc header comment typo in srcu_down_read_fast() Date: Tue, 19 May 2026 21:45:18 +0200 Message-ID: <20260519194524.158515-6-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260519194524.158515-1-urezki@gmail.com> References: <20260519194524.158515-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Paul E. McKenney" s/srcu_read_lock_safe()/srcu_read_lock_fast_updown(), there being no such thing as srcu_read_lock_safe(). Signed-off-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) --- include/linux/srcu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 81b1938512d5..a54ce9e808b9 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -397,7 +397,7 @@ static inline struct srcu_ctr __percpu *srcu_read_lock_= fast_notrace(struct srcu_ * * The same srcu_struct may be used concurrently by srcu_down_read_fast() * and srcu_read_lock_fast(). However, the same definition/initialization - * requirements called out for srcu_read_lock_safe() apply. + * requirements called out for srcu_read_lock_fast_updown() apply. */ static inline struct srcu_ctr __percpu *srcu_down_read_fast(struct srcu_st= ruct *ssp) __acquires_shared(ssp) { --=20 2.47.3 From nobody Mon May 25 01:15:23 2026 Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 997ED3B583C for ; Tue, 19 May 2026 19:45:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219933; cv=none; b=DhBWXHIIt44pl5bcEPUdSKC/iQ3QXiDBQ+Y0KdvV7FrF3SMASqoxsU7pTJZjnE/8vs8I45B/unTkgBcGl5PLRpvtPbGfJsfP9WIsjSWpgrnRQ2EmEFCrpG1uSRqJTTVwW7aK7fi1OCdZDk53YBnmkcogN3DSzQBWHxsLf2A88kM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219933; c=relaxed/simple; bh=yg95+jA4OYlmIgo8aira0sfiDymydxJc4HtaxzIjeEY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=byguIUC4spmMunuE72Rk4kPJrlO6qVum+1aoe9C+eIYW8ekV4xOuPS30MttOvnm6bxrWj08qEddmGq77hMuB2vpmhqpVjfYpKtMJMZJWrst7RELCQY+8DphkG/6uxQelh3qcv4AyE47abjow08ZSjQeVwQ7aMIBiNaZDYx0EBXE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GeRou4nT; arc=none smtp.client-ip=209.85.208.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GeRou4nT" Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-3939d2bd7ecso31878681fa.0 for ; Tue, 19 May 2026 12:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779219930; x=1779824730; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AFj4IX7pq0ONh+1KWCITkzOOtXQ9yoQpVR86RbaYawI=; b=GeRou4nTJvMf5XlDAYHVy0+XnuYv5a250c+UAnUKrAPilRIgG8PcwbKcvb4ujlK2nh XhqjYA0EhvHToU29jW9tLzfxQ++AnSxNcb11otRrn5SQDvXVGxaT+FJdeV+YSycvF1nT wcTLZerPVzrujrCaMoOHsE9Li4lEoHF96FwKxUnjwb37SJS1Yvz0X3idTtjYm4JassXj McT4X10dw9n50cadmlJI6I24Za/rUutolUNkFVhxTsOYd7lTgS9MmhH8SnIk0H/b8tOP MS9a3alirydrkoIgiJHcsUwTVNqhN0qFG2scm/ZgkT4zFIPQqf2WbnO77THHhWQjnvWZ rr7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779219930; x=1779824730; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AFj4IX7pq0ONh+1KWCITkzOOtXQ9yoQpVR86RbaYawI=; b=TWu+iXNRNcLK3Wn8i0D4csDN1Xw7b2pN6hA0ixQclOg5XshP2HEd4ePGlRu3KV7m+g gXtqLoo+orRlx10gzgFc2AGaQWPvmpwHcJkVclFmWVa+dcK9gHMxpT/4VkLVsdB8WNSA yobPevE+FzFjrFO2qQAd2uoHRL4P3myZ5Swd5QHiWUXWufkE+xQsUJwpAoFZzr4jxWNX +ANDa1gRICgfGWRN3Hm9Pewlf3zcIxDmnMc+bIYzFwFWul2s6dktIZzBa+hNepTgANh/ +GQRZrH0DUdJb2G9tQyd+Px3H9hp71fMbK9wS9vkFXPzDRS1TYBPgDmJTszJ/cyacE4+ IDOg== X-Forwarded-Encrypted: i=1; AFNElJ8d85njD7CEhJk7O7dfF4w0gVq9h8Wbo137vb3bzirYQnsy14cAqykkJV8v+UJiYQT81X8xtFxReqQMM3s=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3P0tLgsBHJe8B7oqRy2TiYmFg6nbO8FJfJTQewZqxOskVJGq/ 6EnYEJiGpWzGIbUctc0ulF6TKYgolQfER9zZ1Unu+7Ty1Ix/Y0rqPbkQ X-Gm-Gg: Acq92OF0VbWndR1RrzATXNS2g8zh8hDMWES4lkJ9y5p9wjB1EjhPln6iXTjW0IODjne NxcOX3p/hMvPh0ZE/r9HVpdX1pi8Ulo5ncpxDUzSUbKSdkztioJ2M3WfkCT6ATWb4leEHkvwxNX 81u4UZmdUr9ZzXMz2sBDdThKS3uT/I7nvxtX/Fq1a5ZIQCF+CBVv6hlZdORlz6K+l/5olBDyegz oZbL5vDrx3bfHKR3Rl/+wxA97ZiFzxZO2Jj1NHadcWubyCfDfkWICIUnT1f9qJghvouBsxsGwea 31nwBRYEI8z7d1hXBlasAz9YyTExTZ2lRsr3ID0sGCjQPgYdlbqE+nH4GJ58V6bqykvzktdp8a/ TPr7SIhQhrQM21QzeKMqHikvB4r7qq+njk6tXxSb/RCr7xV5gXVDhxX+gaHkepWir+cEoJTWkro qvrxVtfvJLD8I2W74= X-Received: by 2002:a2e:bd03:0:b0:38e:866c:4340 with SMTP id 38308e7fff4ca-395608e83dbmr61040481fa.6.1779219929771; Tue, 19 May 2026 12:45:29 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3958827ec3fsm23558761fa.9.2026.05.19.12.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 12:45:29 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki , Puranjay Mohan , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH -next v2 06/11] checkpatch: Undeprecate rcu_read_lock_trace() and rcu_read_unlock_trace() Date: Tue, 19 May 2026 21:45:19 +0200 Message-ID: <20260519194524.158515-7-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260519194524.158515-1-urezki@gmail.com> References: <20260519194524.158515-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Paul E. McKenney" It turns out that there are BPF use cases that rely on nesting RCU Tasks Trace readers. These use cases are well-served by the old rcu_read_lock_trace() and rcu_read_unlock_trace() functions that maintain a nesting counter in the task_struct structure. But these use cases incur a performance penalty when using the shiny new rcu_read_lock_tasks_trace() and rcu_read_unlock_tasks_trace() functions, which nest in the same way that SRCU does. This means that rcu_read_lock_trace() and rcu_read_unlock_trace() will be with us for some time. Therefore, remove the checkpatch.pl deprecation. Also, the rcu_read_lock_tasks_trace() and rcu_read_unlock_tasks_trace() functions are intended for use only by BPF. Therefore, add them to the list of functions that checkpatch complains about outside of BPF (and of course, RCU). Reported-by: Puranjay Mohan Signed-off-by: Paul E. McKenney Cc: Andy Whitcroft Cc: Joe Perches Cc: Dwaipayan Ray Cc: Lukas Bulwahn Signed-off-by: Uladzislau Rezki (Sony) --- scripts/checkpatch.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 0492d6afc9a1..cc5bbd70cb84 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -865,8 +865,6 @@ our %deprecated_apis =3D ( "DEFINE_IDR" =3D> "DEFINE_XARRAY", "idr_init" =3D> "xa_init", "idr_init_base" =3D> "xa_init_flags", - "rcu_read_lock_trace" =3D> "rcu_read_lock_tasks_trace", - "rcu_read_unlock_trace" =3D> "rcu_read_unlock_tasks_trace", ); =20 #Create a search pattern for all these strings to speed up a loop below @@ -7596,12 +7594,15 @@ sub process { =20 # Complain about RCU Tasks Trace used outside of BPF (and of course, RCU). our $rcu_trace_funcs =3D qr{(?x: + rcu_read_lock_tasks_trace | rcu_read_lock_trace | rcu_read_lock_trace_held | rcu_read_unlock_trace | + rcu_read_unlock_tasks_trace | call_rcu_tasks_trace | synchronize_rcu_tasks_trace | rcu_barrier_tasks_trace | + rcu_tasks_trace_expedite_current | rcu_request_urgent_qs_task )}; our $rcu_trace_paths =3D qr{(?x: --=20 2.47.3 From nobody Mon May 25 01:15:23 2026 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60AA83B7750 for ; Tue, 19 May 2026 19:45:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219934; cv=none; b=ckO0QR2tvl5KndFi/mGUyjLk1bbiczU5Go1eOw2yJghZ7dyLUb7a5NB4FPGTvukuk7Brd0QheBYa3UwskHHIJYN8TbydHf/567CNsarMTnPJA7MV/oHGkWjKNlPCSE8Sf4z0M3jjiV07tTAjxD8RMIlIWnUsyjidiRp4Rkv1YkQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219934; c=relaxed/simple; bh=jofbNNrCF39vcNdNgWy6T1Gh9+EoGuK9YxZyAMEyS4w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l8j/Hv31gB4xzOSru/M2zdS8ppO3LFPS4gsncXyx8LutiAbYY/yvBj6iRykzYtk4e4bT/63732CH1qxdIJJKkNGQvdMIQ+DUsoOt3H+iKA5luWMeU4I2JkZ8EXVIJmrHdFQBMUWW7Gz0TmcDvrsDpvF5XegWa7WXNtdRwGMjtbM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=H17agIDQ; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="H17agIDQ" Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-38eab6cf7d8so32003091fa.1 for ; Tue, 19 May 2026 12:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779219930; x=1779824730; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aK/hKMv3hTEcKQiSOTXGSh/P8Sd/0hfRCspIyE9/oj8=; b=H17agIDQ07Tmn6NxS5ttTrdXdxfih4Q/l+0WMpeity+FLqjoeIpVsVMJxCTfHxAURn AgN7Gp201Y8ZcyEyW8r4+zq7MUeuUUmk5frTBCpWFbYk4y2IyJjsN43MFvJVvz0skO3y 5DUjSoWkk3iNrrcS/HXi2D7aNrQFSbUS4fpWAKIaxba6bz8HVR2pzUnYW9fyZnScQiwc 8RBTEMTTeAB/np8mlExjvgtyB2AlIwaxwllTb7Yul0GqUXLOUMke46pwjIU5+kFjhw5N dW2JHkyd9ezCu7BBVFBkdENGlFnvXKDNRDJIuzo+u2Z+iX0CJe4qCHshRi6PhmGCyyLZ c07A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779219930; x=1779824730; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aK/hKMv3hTEcKQiSOTXGSh/P8Sd/0hfRCspIyE9/oj8=; b=sCpxT100QhF2tWqPpR+n7xshVc3HL8BoA/IyPn3k1ZI7WZ22ia6aAw1g5oRif738pe 8ltAjalk/3Dg1blnBJYZKVZbPHDvib6gwIOGZsv9L/StWdA8m9gK0QUg0tUGLLSKnsaa iQxavvHgzqifd1Ef0gnGBA2Xu92+VRCiCSiIMBHFhaff5Csndb+XK0eM03XgPkNUUX/3 i2RSvE2+2nT7RxAIe4HyvFrJJtYeYk7bDwofmh/kraRLySwdMNnZBQ/iVsYp6L1pO9Tt RK/2+yD1JbIZB4BmgZEIOHeAhw3ql1ef17qOXWR9P2tCSMkXLXHuyU5RasBEHO4x2y1j j5FQ== X-Forwarded-Encrypted: i=1; AFNElJ90kCqXuNMwfHq/GUk99zdmMzt4a6YtnJIef2X3Ao3CmXBUfG/HcOvzEGQvsTqhvbh91QjEoNj0q94Ma2c=@vger.kernel.org X-Gm-Message-State: AOJu0YxLY2pTaNLAIAjwx4Waz3qUATlDl1amC0K0ayMJnWnegFEKuru5 axEaz9d8U5p+vXQcdPAayOVfD4tYSZM0cl7gVgfQd0JRU+mIruAbY0kH X-Gm-Gg: Acq92OG57dYG60RyRCyikFGASsagce9d/Jg4jrAEhHBNiIlFd6jRdqIO7bHmI+00rT7 GhRSuKG03eCIQyphmYBpjAqOrnBUelmZeDFL7KFbwvXXICbkAXcbT9MdFbiSjW4gvldkOIQwW6r AmPOTJZEwVHCnhaQLYJCWILjsmI6kTx1uRl19Mx7T+KqHpUSrNj3ksp7J05/16U1VO/JTrHzIu9 YtIQ4vhUGM9fc1EuEMJoKh0zUl71gA2XoRCxY0Tt4ncPXvsbJCimsZ+pYusBMjkRvc/Eux1qlZy eWhxCLASymiGZ2anHVglS14tKzUnwJxYoe4WqYYbOzqw66H5uJCZg5JFVl6WzttbpUHS9lMhwtE ymHmmFYYy6hhU9NFWHncKRrMvRoFlp//HqyraH0sbEfqw9rHrxuCwHwmKIptUoLDD6bzQEbXti6 BOgiYbCldWwczz54aoaEXez7OdHA== X-Received: by 2002:a05:651c:2353:20b0:389:ddc6:a4fe with SMTP id 38308e7fff4ca-39561f520a7mr43597511fa.24.1779219930276; Tue, 19 May 2026 12:45:30 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3958827ec3fsm23558761fa.9.2026.05.19.12.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 12:45:30 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v2 07/11] rcu: Simplify rcu_do_batch() by applying clamp() Date: Tue, 19 May 2026 21:45:20 +0200 Message-ID: <20260519194524.158515-8-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260519194524.158515-1-urezki@gmail.com> References: <20260519194524.158515-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Paul E. McKenney" This commit replaces a nested ?: sequence with clamp(). This does not reduce the number of lines of code, but it does simplify the line that it modifies. Signed-off-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Frederic Weisbecker --- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 55df6d37145e..e46a5124c3eb 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2584,7 +2584,7 @@ static void rcu_do_batch(struct rcu_data *rdp) const long npj =3D NSEC_PER_SEC / HZ; long rrn =3D READ_ONCE(rcu_resched_ns); =20 - rrn =3D rrn < NSEC_PER_MSEC ? NSEC_PER_MSEC : rrn > NSEC_PER_SEC ? NSEC_= PER_SEC : rrn; + rrn =3D clamp(rrn, NSEC_PER_MSEC, NSEC_PER_SEC); tlimit =3D local_clock() + rrn; jlimit =3D jiffies + (rrn + npj + 1) / npj; jlimit_check =3D true; --=20 2.47.3 From nobody Mon May 25 01:15:23 2026 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BBBA3B7B79 for ; Tue, 19 May 2026 19:45:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219934; cv=none; b=kJzbqSc4fZjIp4AmOapQGJpu3FZdSGNA6OnEYOZZRYqbMFWJSMuRtsEoHsWNz3DN/1YAgORC2DrUuKuxO7BzQcUyIoKcIRifoK9eGH+49DlJvW3P1/7l3IIDfAVi66SfcCSYoXS3bncstn06OxW2Ve+zgxiULUd+0KO4WeI4/f8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219934; c=relaxed/simple; bh=fWM441cbSLZxfDsFxOgkHb2BPMc6Nc/hi4JixQXl/Tg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qhjq8yIBjuZ75Drn0oSnFOp04jA58lNDEmPhSrx3WTFmZeY99RmlHK63FiNpbK0hcoXcP6XJTXRipVqhMponD60kYcG+4QmCjcCBrc72NNqUcFnup5AFnBWAxmwg0TXBXRlNPu04Ccz0yj65R3TXIfVpdPuz005gkvNfFp0XUXg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OIJqkqqz; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OIJqkqqz" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-393c40246afso48589561fa.1 for ; Tue, 19 May 2026 12:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779219931; x=1779824731; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tdtDTcHWPpFzW+rLnvoZdux37/ChPi6ZVsH5L2zj1aY=; b=OIJqkqqzomm21yeOsdDr//XUrJowr1vL6utkGpH8tu9TJX/TJzmunUNi2IJRdusRo1 in5FOmFqBNjS0J4hglcPySN/hmocq6w/qhU9ooJBPJx4wB6ZfwPL9dwrUknqIWs2aJSB nlO4c7wPNHlyCZ1cEnf28wuzdZsd6C3x7pW64rUgk3qrxSub950VMTdruZ/juDPUcuZA EBsfAN4DBYdHQyTfU9yM26VY1Pq2iaZDCszzhQ2xs3Kmv/SMbptxCI7Va+3lFWPDYYb5 hg2nPYv3jj9V6TInnAFZWhrj/Fqqq0IdN/Su85nCC7UQk7gaJ19dMQpDsmx1DQtPHdrx 5qhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779219931; x=1779824731; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tdtDTcHWPpFzW+rLnvoZdux37/ChPi6ZVsH5L2zj1aY=; b=Q2BxLt3MgXgU25aGxyUaUBMzMjamgu61JcdnOv//tsGnpdzFHgrvp5B3xPh3bHGncY uNv7irKkJsO7xtz/Wc2w10mW3a+iO9w8TB8r9BZbObeLG/MCz9ec7rc24iMt7NpJgGKj 7MFUXTDMicKCaCd/mmk8r6gRr9w37X+LpYXshq0iSlzSLZE8aw1CcZkwYQxWUb3YW8gF Br8sb5JGkS1Ygkjh87aH5/jVT89lxsMVOHbEozb79tz6Aid/ZEdOXCd6mX9BLgUvyDME AeDOu1ImzWaLYFs1lgufwHMIyON9IPMe8pJXjCjYnsO65syHLtTI+A3LjNK1uvACea7D mYkw== X-Forwarded-Encrypted: i=1; AFNElJ8IEY2RLZ3kBC4vjmoMi11X1Y/6LuX/saJuElURwuNgX2doBvUTUHplbCrnp1IMyLnp+u0Sz8twdkU2eeY=@vger.kernel.org X-Gm-Message-State: AOJu0YyijX9SiOgmCUEq5QtB/QWX80cVcpSIhkzI2cP2Gry4XYK5c/wC L0YZfm/FiGsKXIEQKw3waJ0MRPwkm1oK6IF9/Jy2IauDwYeZH+7UrJp0 X-Gm-Gg: Acq92OHQVd9QIrpIEVrAY+SKpP8fSypwdXopIDLTxNAMpu9/7THrAijkZk/bmlsRYtO 5XMm1rDiVrOzrL46W2OqZPNGtPj1yK0c0IPKSjYZUgnN59NbMooVR7nt46+bQu6gurFB0vIAIdq +TJHvtZEolgms68vjfU6jbZS8EkGoumI3C/mQmk9atIld3TN2mVEd5/HpCZeXrTJuRkCpejtBF+ hYGxlN7PsaaKERmXa0uKKhggP18Ey2JbWwEtzEuobxNHfM9dv6DwoTbdo3wNpGEDf8BeSDsCSCt SgrRTpdI2pLpPQv/MIPGrJ8+JIAns4QAKS1y/fnLooKlX7kUJ/E/EUpMt7ofqwwnohvli/SLLjz Ln4yzOO4xWlKMyIA+aiLFWc7wYul81/YpVkCZdpCqj0ms+kgJzibwCk9gfdeSQJtQBozI6Fij86 O+qaKFpT3yvO+9oCw= X-Received: by 2002:a2e:bd83:0:b0:38e:96b5:2f45 with SMTP id 38308e7fff4ca-39561a46984mr71465461fa.8.1779219930787; Tue, 19 May 2026 12:45:30 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3958827ec3fsm23558761fa.9.2026.05.19.12.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 12:45:30 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v2 08/11] rcu: Simplify param_set_next_fqs_jiffies() by applying clamp_val() Date: Tue, 19 May 2026 21:45:21 +0200 Message-ID: <20260519194524.158515-9-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260519194524.158515-1-urezki@gmail.com> References: <20260519194524.158515-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Paul E. McKenney" This commit replaces a nested ?: sequence with clamp_val(). This does not reduce the number of lines of code, but it does simplify the line that it modifies. Signed-off-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Frederic Weisbecker --- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index e46a5124c3eb..09f0cef5014c 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -492,7 +492,7 @@ static int param_set_next_fqs_jiffies(const char *val, = const struct kernel_param int ret =3D kstrtoul(val, 0, &j); =20 if (!ret) { - WRITE_ONCE(*(ulong *)kp->arg, (j > HZ) ? HZ : (j ?: 1)); + WRITE_ONCE(*(ulong *)kp->arg, clamp_val(j, 1, HZ)); adjust_jiffies_till_sched_qs(); } return ret; --=20 2.47.3 From nobody Mon May 25 01:15:23 2026 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31E6A3B95E3 for ; Tue, 19 May 2026 19:45:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219935; cv=none; b=osxejDx7SmCwLMAUf6Lkzrhkk0p3oDiN0h2rhE9xLl07xtOQ0dwgeeSEWhi0XkYv9R8O0AjMl1M4M64LkD31tsH6ogR5pI1A3PWioVeqHV8XeLuiJ5geWKjRleBsq7/evC7ox3QvCaqdmJ2ikEjErsV3ykISR+vlobnAVPoXLBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219935; c=relaxed/simple; bh=RkHk7z2ygyoyi1ilNEZkRX+Ty9Jdxo0cKjCdLWv4d/s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sYUdZySIyhnLJ+swBAWfKyWti9ECQWsKLJS6EPV3zrMJxHxioFLoGrdNuvgVVLyliGW6A2ui5hOXV7cInx9DHAftX2TwgSLGTYMr+cupL+Ln7wckZap1noB4yO6ly1L2x6CPhYnikwzGar+Lb7N8Td42g9elD49insnqYgSXyBg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=oo/cVKbO; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oo/cVKbO" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-392445f11c5so44288041fa.1 for ; Tue, 19 May 2026 12:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779219931; x=1779824731; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HfDpEv+39iIZARqiCjGlpklYp+nlJJtKSY6Ud1S1ntc=; b=oo/cVKbOwuQ9VzCH0JHE1tU30g9CZHYXv/oAQzJOAFFxCanZ0Rj6BrHDbzGkGWNQtl pzqK3l1Y2WOc7adhC/LJ0xGeVUnEa/Fq4XEwS1YcnKaUIssBN8J/IVZB5vPPzHBdetbX mOrwQ7sxRinxJ4j4cm2/MmPnKDq5byeQ5k1CsyDXIzeuPiheMeQR0y71uUsQ1UYElB80 jjZESSdhZTNv6nfD9NnadsUVPdpSXbSuBKgCytmXqvLXD9h39AsEd8XkEWGNiyoGaVrB sfaS4gdpNu7iZQeDswTSXS1lu2jxHiOxwnWJ+JULpJbmtrnlsVzsO8w5oRWRZ+NDpK0W yFxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779219931; x=1779824731; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=HfDpEv+39iIZARqiCjGlpklYp+nlJJtKSY6Ud1S1ntc=; b=YMoPs2J9zb+KOG/9cyr4SS6Ew6mhwGO8TUrBkv8XcXikb2aNYWxuUTaPfw3erCv2y9 WSBirdA37Q3dynDuwDIh/yLGHV9AH4Yo7TIW3/cqZpSFXEPFzQfJcLCBPbxT0HuCGYS9 wD5vEjE3g7+vADQTjFQDJKNMFYeYgWOAo0/vXU69p+YKjWaeIOVG7BOyuMwrN2fXSrOE gdvWS19YhdgxzyPHNaz1gg2jmzkT+igI4r0uYSfkZ4A/xD/Ck5yASPSMTQ9NTaD6C0kg GoJXEmQKsB68Gv5cKHsqGqtu49IJGwuISeHzpKelfdfmLQYlBVjhN1CSfjpUv1ohk2a8 Pisg== X-Forwarded-Encrypted: i=1; AFNElJ981hVwuDbUDMw90PL2gduJsz+zYmz2znlp3BfB93jsYYjbgFGA9KauMjMtniLhIBFVyNa2htPwPbOiyPs=@vger.kernel.org X-Gm-Message-State: AOJu0YyXCp0VNr26iEnGDbj2BzaKKq581WYJLqgRgb1n/KYpZH4T/U3w RreiJEuvbvaRF8denxAzBIKilJaM0m2AMOTdoyCftcfx1JO7Fv1Ew6FX X-Gm-Gg: Acq92OHip3cwbl7YHOlInbMuyicWwTV0ME31ev4jz5w7xmYBepFUihez1Cr72sYu6y9 1yVKBCOdfFJeSxF2WCBSvyd/1p+yWpKrqUii2eYmnW6w7EZgFuC3hafyX2I6PcjGlHbfNhzDGc9 3FDN83qx+tVAbCY6vk0CPV42JEHdJW7VY6ow8ISxExfRlT6RZvf+LkdrH7P55OhfvrNxWC8yi/K k6Nu/D8cZX/x0wZn8VkxLoVYS4bnCOXjUm4k+sI1Chtn7T/KW9KZF4OV3rfAKIacA0hYdI2tN+X 3sRl8Ud+te8O0izG/JyqRKl5mAq4A8QmmHXLdiEOq2o59QEuEJwp3H+xcmttFDH+45g14M8RXZn DZ0SIcIN9nRuJtiU1u5yiO4yDf2pyno6XqIIcgmknFi/7sWwNnLrOh5E1ivam9Ktzhn1ckiYYL6 m1ejJ18higMsFuaUA= X-Received: by 2002:a2e:bccb:0:b0:393:7f7a:4047 with SMTP id 38308e7fff4ca-3945b60917amr73751851fa.16.1779219931313; Tue, 19 May 2026 12:45:31 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3958827ec3fsm23558761fa.9.2026.05.19.12.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 12:45:31 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki , Maxim Mikityanskiy Subject: [PATCH -next v2 09/11] rcu: Document rcu_access_pointer() feeding into cmpxchg() Date: Tue, 19 May 2026 21:45:22 +0200 Message-ID: <20260519194524.158515-10-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260519194524.158515-1-urezki@gmail.com> References: <20260519194524.158515-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Paul E. McKenney" This commit documents the rcu_access_pointer() use case for fetching the old value of an RCU-protected pointer within a lockless updater for use by an atomic cmpxchg() operation. Reported-by: Maxim Mikityanskiy Signed-off-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Frederic Weisbecker --- include/linux/rcupdate.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index bfa765132de8..5e95acc33989 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -592,11 +592,13 @@ context_unsafe( \ * lockdep checks for being in an RCU read-side critical section. This is * useful when the value of this pointer is accessed, but the pointer is * not dereferenced, for example, when testing an RCU-protected pointer - * against NULL. Although rcu_access_pointer() may also be used in cases - * where update-side locks prevent the value of the pointer from changing, - * you should instead use rcu_dereference_protected() for this use case. - * Within an RCU read-side critical section, there is little reason to - * use rcu_access_pointer(). + * against NULL. Within an RCU read-side critical section, there is little + * reason to use rcu_access_pointer(). Although rcu_access_pointer() may + * also be used in cases where update-side locks prevent the value of the + * pointer from changing, you should instead use rcu_dereference_protected= () + * for this use case. It is also permissible to use rcu_access_pointer() + * within lockless updaters to obtain the old value for an atomic operatio= n, + * for example, for cmpxchg(). * * It is usually best to test the rcu_access_pointer() return value * directly in order to avoid accidental dereferences being introduced --=20 2.47.3 From nobody Mon May 25 01:15:23 2026 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C33A53B9DBA for ; Tue, 19 May 2026 19:45:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219935; cv=none; b=DHzfzl5SsuneKdK9TMV/SGLwBvpvNqXSe0uqdotdTGeuVuJB2xtbYpUW/Owe1B1qih49nE8SfxhJtHSA2HULZ8X+ZGVyb0rdxIDqSVC+AU+QLR+HMTOrr4GGcuZTs0BXHCjZ4uGWe/5pB5GSd/Tm1s06cklehyeCa42xikkDN+I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219935; c=relaxed/simple; bh=N1ZRO99Xmu7eMJ4ncdKQ4oBgaMAOlGsvAg+Q2j1/DMo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QWfdPWFlSiEIHuroUvevJIfLhu9AwKqIFsK08J5gEuotzn+aMCeHIUirHJyYh7NYvZxL6i09AhiS7f177QjrttD422ChWmS40/cYQ14d4/9QE8L1Y1p8e50WP8QT0u+RXuez99Pzv0y5ye9lJhMVNiHNaIu3FLvzDduqcgDTd1w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DajfT7oI; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DajfT7oI" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-39397d63804so51838161fa.2 for ; Tue, 19 May 2026 12:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779219932; x=1779824732; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OSjCy54KooYgtOnKS1P4NfKbs3McoPoMDdY9GznQwyk=; b=DajfT7oIOa6xIzArkrPVKZoJPBjl3K4FmdCpK7aYoqiBZ4jQqlxNlSkuhFzp3tmr2R eIan66XkBNNgSc4OGxlEne+Xu93s4huOTTVWfWmqzk2aVfnd88++7oQly7wIK2u/uLJA UlShsrDqkES0rbvYZEErGXlNuYK0opVYQVToIZ5w9HsFOo7heSGHzhw8MZe//FSNdXuV r0uX3L7Bxk0Pfl4mEOTJDsjCxsPeu1N7NXDnwz8ntyKk7RcuNz7i/vsFdpbjuNO1PMdG 6QK9ptUb/duTZyb/KjX0E6E1MDLwenZMRrJmRH92J1QVa8qHpcc5pyNfdiYwdHx3OEnc /F2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779219932; x=1779824732; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OSjCy54KooYgtOnKS1P4NfKbs3McoPoMDdY9GznQwyk=; b=nfIYqL9b+KOapsrmZ2F4MEDPzHETQLMQG0Y4vv7LUOCoRKka4nfmiuskrFFUKVSYad dsimpthAY+Iey6o/5KC/LJJKAhsM+felDQOXBZFIDK6vvSQjrk0OOSlHfX5kmChIUP9c kPaYg7NQAbK4NY9fJ1cxSf6J2/bNDDrwDTOdDiS+13ikAJJ3D0apVdnphJsHftapsFNQ rLgn8xeVfHRztLfbhmcmC9WIow1z+0dLceKv1AT8/0m3VcyltMMCxiPUy18USDM8FUDQ bKWmGDFE0n69f+9QqtkkbA/GDnpS0gxRtdmsgycYYRjgAX/i118UHtG9btwfjrozOB/z NCQw== X-Forwarded-Encrypted: i=1; AFNElJ9PP0F92tL//VgWz1t/Oy27i4mxxOG83tcIANP4Xl0r6IJwP0MQZxF+hM0SuIxNbIiUv/uO9pfArU3csSM=@vger.kernel.org X-Gm-Message-State: AOJu0YwPw56ECnhQ8gfGy2t1l9pPRVRlvzpTIY3WLXX4RZlYPKumO4y4 iiUiR0vpKqar8svacA0yfigJD6R4SHjVxkQzdu9+sgu7Onwrt1Txy6GC X-Gm-Gg: Acq92OFx4a6IxvDN+N4GVquAMy5+cets4gPeP9xh5ynK/Y3zsCln9NIJicb2Y+oAUS/ JZ1vRNve8jx16CNJZTNh6VEQgXDtFOsKDA+Dl8lx8S0ZAa6MDWg/6m/Oxo3vtqq0DOTURNEjdSs +Ihh6ADbeBQRhI94lbECzWv3NbrIbHIQDOMwSpWZ60Y3uhNEL7y6CruCumhTwgD+mAC4FuxzDOg F3S5yaWte5TZKhNJI0HJgkaal92r2+QdD1I8VsOA/FoPISobTQX0DQo5172oUCUzl9mPHjciRvk SgFkkgYnyZHpkA7C134DFyg+4GJAPRvnl6GEclR1qTCkr2cGuRW1qdH0+jQJAkTLYGpGd0iOUb0 zbhZ3GpDvO/oQ15J88w/yQ7N9Bd0P3WhTCwu//2y46OOOeXy22OYISxyzgvtg48ze+dF5r3ZEz2 7rBkrreN0RX8OLhOI= X-Received: by 2002:a2e:c41:0:b0:394:5c9a:f31f with SMTP id 38308e7fff4ca-39561fa8ed4mr43748971fa.16.1779219931855; Tue, 19 May 2026 12:45:31 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3958827ec3fsm23558761fa.9.2026.05.19.12.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 12:45:31 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki , Samir M Subject: [PATCH -next v2 10/11] rcu: Latch normal synchronize_rcu() path on flood Date: Tue, 19 May 2026 21:45:23 +0200 Message-ID: <20260519194524.158515-11-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260519194524.158515-1-urezki@gmail.com> References: <20260519194524.158515-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently, rcu_normal_wake_from_gp is only enabled by default on small systems(<=3D 16 CPUs) or when a user explicitly set it enabled. Introduce an adaptive latching mechanism: * Track the number of in-flight synchronize_rcu() requests using a new rcu_sr_normal_count counter; * If the count reaches/exceeds RCU_SR_NORMAL_LATCH_THR(64), it sets the rcu_sr_normal_latched, reverting new requests onto the scaled wait_rcu_gp() path; * The latch is cleared only when the pending requests are fully drained(nr =3D=3D 0); * Enables rcu_normal_wake_from_gp by default for all systems, relying on this dynamic throttling instead of static CPU limits. Testing(synthetic flood workload): * Kernel version: 6.19.0-rc6 * Number of CPUs: 1536 * 60K concurrent synchronize_rcu() calls Perf(cycles, system-wide): total cycles: 932020263832 rcu_sr_normal_add_req(): 2650282811 cycles(~0.28%) Perf report excerpt: 0.01% 0.01% sync_test/... [k] rcu_sr_normal_add_req Measured overhead of rcu_sr_normal_add_req() remained ~0.28% of total CPU cycles in this synthetic stress test. Tested-by: Samir M Suggested-by: Joel Fernandes Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Frederic Weisbecker --- .../admin-guide/kernel-parameters.txt | 10 ++-- kernel/rcu/tree.c | 52 ++++++++++++++----- 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index 4d0f545fb3ec..d5db2e85d551 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5862,13 +5862,13 @@ Kernel parameters use a call_rcu[_hurry]() path. Please note, this is for a normal grace period. =20 - How to enable it: + How to disable it: =20 - echo 1 > /sys/module/rcutree/parameters/rcu_normal_wake_from_gp - or pass a boot parameter "rcutree.rcu_normal_wake_from_gp=3D1" + echo 0 > /sys/module/rcutree/parameters/rcu_normal_wake_from_gp + or pass a boot parameter "rcutree.rcu_normal_wake_from_gp=3D0" =20 - Default is 1 if num_possible_cpus() <=3D 16 and it is not explicitly - disabled by the boot parameter passing 0. + Default is 1 if it is not explicitly disabled by the boot parameter + passing 0. =20 rcuscale.gp_async=3D [KNL] Measure performance of asynchronous diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 09f0cef5014c..94274330d1db 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -1632,17 +1632,21 @@ static void rcu_sr_put_wait_head(struct llist_node = *node) atomic_set_release(&sr_wn->inuse, 0); } =20 -/* Enable rcu_normal_wake_from_gp automatically on small systems. */ -#define WAKE_FROM_GP_CPU_THRESHOLD 16 - -static int rcu_normal_wake_from_gp =3D -1; +static int rcu_normal_wake_from_gp =3D 1; module_param(rcu_normal_wake_from_gp, int, 0644); static struct workqueue_struct *sync_wq; =20 +#define RCU_SR_NORMAL_LATCH_THR 64 + +/* Number of in-flight synchronize_rcu() calls queued on srs_next. */ +static atomic_long_t rcu_sr_normal_count; +static int rcu_sr_normal_latched; /* 0/1 */ + static void rcu_sr_normal_complete(struct llist_node *node) { struct rcu_synchronize *rs =3D container_of( (struct rcu_head *) node, struct rcu_synchronize, head); + long nr; =20 WARN_ONCE(IS_ENABLED(CONFIG_PROVE_RCU) && !poll_state_synchronize_rcu_full(&rs->oldstate), @@ -1650,6 +1654,15 @@ static void rcu_sr_normal_complete(struct llist_node= *node) =20 /* Finally. */ complete(&rs->completion); + nr =3D atomic_long_dec_return(&rcu_sr_normal_count); + WARN_ON_ONCE(nr < 0); + + /* + * Unlatch: switch back to normal path when fully + * drained and if it has been latched. + */ + if (nr =3D=3D 0) + (void)cmpxchg(&rcu_sr_normal_latched, 1, 0); } =20 static void rcu_sr_normal_gp_cleanup_work(struct work_struct *work) @@ -1795,6 +1808,24 @@ static bool rcu_sr_normal_gp_init(void) =20 static void rcu_sr_normal_add_req(struct rcu_synchronize *rs) { + /* + * Increment before publish to avoid a complete + * vs enqueue race on latch. + */ + long nr =3D atomic_long_inc_return(&rcu_sr_normal_count); + + /* + * Latch when threshold is reached. Checking for an exact match + * restricts cmpxchg() to a single context. + * + * This latch is intentionally relaxed and best-effort. Concurrent + * set/clear can race and temporarily lose the latch, which is OK + * because it only selects between the fast and fallback paths. + */ + if (nr =3D=3D RCU_SR_NORMAL_LATCH_THR) + (void)cmpxchg(&rcu_sr_normal_latched, 0, 1); + + /* Publish for the GP kthread/worker. */ llist_add((struct llist_node *) &rs->head, &rcu_state.srs_next); } =20 @@ -3278,14 +3309,15 @@ static void synchronize_rcu_normal(void) { struct rcu_synchronize rs; =20 + init_rcu_head_on_stack(&rs.head); trace_rcu_sr_normal(rcu_state.name, &rs.head, TPS("request")); =20 - if (READ_ONCE(rcu_normal_wake_from_gp) < 1) { + if (READ_ONCE(rcu_normal_wake_from_gp) < 1 || + READ_ONCE(rcu_sr_normal_latched)) { wait_rcu_gp(call_rcu_hurry); goto trace_complete_out; } =20 - init_rcu_head_on_stack(&rs.head); init_completion(&rs.completion); =20 /* @@ -3302,10 +3334,10 @@ static void synchronize_rcu_normal(void) =20 /* Now we can wait. */ wait_for_completion(&rs.completion); - destroy_rcu_head_on_stack(&rs.head); =20 trace_complete_out: trace_rcu_sr_normal(rcu_state.name, &rs.head, TPS("complete")); + destroy_rcu_head_on_stack(&rs.head); } =20 /** @@ -4904,12 +4936,6 @@ void __init rcu_init(void) sync_wq =3D alloc_workqueue("sync_wq", WQ_MEM_RECLAIM | WQ_UNBOUND, 0); WARN_ON(!sync_wq); =20 - /* Respect if explicitly disabled via a boot parameter. */ - if (rcu_normal_wake_from_gp < 0) { - if (num_possible_cpus() <=3D WAKE_FROM_GP_CPU_THRESHOLD) - rcu_normal_wake_from_gp =3D 1; - } - /* Fill in default value for rcutree.qovld boot parameter. */ /* -After- the rcu_node ->lock fields are initialized! */ if (qovld < 0) --=20 2.47.3 From nobody Mon May 25 01:15:23 2026 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 585A43B5820 for ; Tue, 19 May 2026 19:45:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219936; cv=none; b=kDWhUwB/J5IR76/3gwBnVxuUhXXCVBWOFbE6bDGm+SVLV0UYSyaEWUklrFQlW6ssvIKIUa8Wj3ej7HZWsM664YDoJkXruxOTvI3wPmtGoVvUHuWwk/YLSsFhGYUE7Bh6yj2JPnJfv+0/3PH7kObXNk3DA50oeJqiyOq3kddnrP4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779219936; c=relaxed/simple; bh=aGn8oFIeADYd9zR2os0KsYgOWUkPHLyy0V9cTn+474I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nhanAe38kqxXq4lxX6yVd1pwH1piVw9bm1p5H+3oq7KTVFvwZ4tOfGPABLsNKp+4dy4sycw4ZQS7oUBS3/6esSNf+VbQpenS94Z3uD13wr+jGCi4qiG6tKksP2/USh+H3fpDQivouwL3pLLFRblypJ54VWdffA75jnk6fsBHiKU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RD92niPd; arc=none smtp.client-ip=209.85.208.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RD92niPd" Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-393a44854d2so39094831fa.3 for ; Tue, 19 May 2026 12:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779219932; x=1779824732; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jgAUP6OLEyhflkklRcpo72fjxpM93txMmwPi2+jDRTQ=; b=RD92niPdX0KPsWnjbexl68dIZtonhA0psOyhc7G2IO6XBEeO69+WADTp1KrflnO7mb Wcc+SA2JKx1q72y6tyAFDIDzrsqsQKEOkeGPps7hswOU91lNljknqO1xN+ZUAnL4Bo01 p1fiR3bW9q8dF8FWS454eLa+hB5rkM2eCxwJ0VF5uSaGtNpQMiWm4NY3yE40ZiCRqXHn Y0SKqyLgLn7voafra8t26KeWEtXlzS2xZgaxs55EsrEN1xVvzKDCgUBsDamcsI+eTkey yqQHuBEfEwrlixEAsB24PwoJOWEXm4RGwjwESq15ZT8vPYYrYUOWkTBs7e10Nufe0nAr iNHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779219932; x=1779824732; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jgAUP6OLEyhflkklRcpo72fjxpM93txMmwPi2+jDRTQ=; b=duu/KZL2oNGCBZytPSM45SEMLTqz4yxa48IWmAUvcggthlFzrAPob3GUR4LJ+SCI6T 2bZ654HO+w8/rvZQtXVWix3jc61vz66AIQoZ0bzMTQJQJNVVjVIEAifGMVaARUYwrSAF LV3md3xAoyyFwx/INWS7HFYJvOT0zEpZjJq/VVTnFlQN7+yx3XHI9II96JbyWq14f1vU cpe9nAKA2/SEJKa8mOZNpOuvv7CsPcLMDceUK6UfRiTTfE6DclQtHJWUIF5kh5DKWxPS yXJhJAsx5Z4fDZ/u/CRWtXlM8MB566lJ/vdLog+X9py2PMGvBJvQA4pXmoXCb3saZIre oYTA== X-Forwarded-Encrypted: i=1; AFNElJ9e+jInqzFhaLDUPQQ9hO0YMCxZhw5Ie01sg0DPwJDGKFtjCYuCEGO06bVea0uknh+20FGvEorIW4b4QRs=@vger.kernel.org X-Gm-Message-State: AOJu0YzPVwu+IMZXfdrZHNuBTPJ+fQI26JdK1A5qVuqCDC57yO4mCD8x yeY7GLumHjMR5OmPz6cTRqwMYPqM5kieWZjIUVIdjmfrzaeY3UzegWXd X-Gm-Gg: Acq92OGfWHDop8SHYjALFMGD5aOjR+Vb73mVr4aF36DDrwCPdIAX5UDhQCPKHYQEsZE PEUY5jP4g3DBdfwARpeF7pxXwG4sXGPeYTnKmtDooPp/8lT5HGdru4ymwnvU/THj45wcrHBR5AN dtpIF0a2F0jrLcz4SJGkI2zCCy+dm/1JArTqVaEKK30SQ2jqGItv9+jrGS+Tl8vojwMyfL328VU zhncMDClFsCJnZ1HDT3868itagUKfPmb92uG/wCP5Q1M8Bgx1bc01V9wCrSCJwLsDucX3My28lS PI2romXgaSdZ5jmdasqMS/V/cCtHYO18T9Axm0zOKGAAC1VH/F1mGpMj23mIycxGqexKGeeZyZu pp5q4gjTwwL9+Y8IZjxwOu/94u5Ejq6pKFbjCCCw0zjPkLtx2dBjO+SFBP1poEw5Q7EdNUYIxl4 Myto+hjjAYm7rrx6E= X-Received: by 2002:a05:651c:e18:b0:394:5a09:e8af with SMTP id 38308e7fff4ca-39561adbaa3mr54361861fa.1.1779219932386; Tue, 19 May 2026 12:45:32 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3958827ec3fsm23558761fa.9.2026.05.19.12.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 12:45:32 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki , Zqiang Subject: [PATCH -next v2 11/11] rcu-tasks: Fix possible boot-time tests failed for the call_rcu_tasks() Date: Tue, 19 May 2026 21:45:24 +0200 Message-ID: <20260519194524.158515-12-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260519194524.158515-1-urezki@gmail.com> References: <20260519194524.158515-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Zqiang The following scenarios will cause the call_rcu_tasks() boot-time tests failed: CPU0 CPU1 rcu_init_tasks_generic() ->rcu_tasks_initiate_self_tests() ->call_rcu_tasks_trace(&tests[1].rh, test_rcu_tasks_callback) ->call_rcu_tasks_generic() ->havekthread =3D smp_load_acquire(&rtp->kthread_ptr) "The havekthread is false" .... rcu_tasks_kthread() ->smp_store_release(&rtp->kthread_ptr, current) ->rcu_tasks_one_gp() ->rcuwait_wait_event() ->rcu_tasks_need_gpcb() ->for (cpu =3D 0; cpu < dequeue_limit; cpu++) ->rcu_segcblist_n_cbs(&rtpcp->cblist) =3D=3D 0 ->schedule() ->raw_spin_trylock_rcu_node() ->needwake =3D (func =3D=3D wakeme_after_rcu) || (rcu_segcblist_n_cbs(&rtpcp->cblist) =3D=3D rcu_task_lazy_lim) "the rcu_task_lazy_lim default value is 32, and the func pointer is test_rcu_tasks_callback, lead to needwake is false." ->if (havekthread && !needwake && !timer_pending(&rtpcp->lazy_timer)) "the havekthread is false, will not enter here." .... "the needwake is false lead to rtp_irq_work can not queue, even if the rtp->kthread_ptr already exists at this point." ->if (needwake && READ_ONCE(rtp->kthread_ptr)) ->irq_work_queue(&rtpcp->rtp_irq_work) For the above scenarios, if the call_rcu_tasks() is not called again afterward, the rcu_tasks_kthread will not have a chance to be wakeup, the test_rcu_tasks_callback() will never be called, the boot-time tests failed can happen, this commit therefore check havekthread variable, if it's false and the rtpcp->cblist is empty, set needwake variable is true, if the rtp->kthread_ptr exist, the rtpcp->rtp_irq_work can be queued to wakeup rcu_tasks_kthread. Signed-off-by: Zqiang Signed-off-by: Uladzislau Rezki (Sony) --- kernel/rcu/tasks.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 48f0d803c8e2..f4da5fad70f5 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -373,7 +373,8 @@ static void call_rcu_tasks_generic(struct rcu_head *rhp= , rcu_callback_t func, // Queuing callbacks before initialization not yet supported. if (WARN_ON_ONCE(!rcu_segcblist_is_enabled(&rtpcp->cblist))) rcu_segcblist_init(&rtpcp->cblist); - needwake =3D (func =3D=3D wakeme_after_rcu) || + needwake =3D (!havekthread && rcu_segcblist_empty(&rtpcp->cblist)) || + (func =3D=3D wakeme_after_rcu) || (rcu_segcblist_n_cbs(&rtpcp->cblist) =3D=3D rcu_task_lazy_lim); if (havekthread && !needwake && !timer_pending(&rtpcp->lazy_timer)) { if (rtp->lazy_jiffies) --=20 2.47.3