From nobody Sat Jun 13 00:35:07 2026 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 3E73E35E958 for ; Mon, 11 May 2026 17:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522094; cv=none; b=WwlzWy5mKwu8RZnOL09Hlm++lkcUNVBEOzOMUlwqg8Z+NK1T+pltE07kFu20niUGx1TboLtXDLqMjqACBummA3A4gSe0qo9k8VFpLpuhZxvAAhZ1IHUWs271oSNUXELAiSh4TlaB5fjiHjPRlJTyV9/iUAPqP8dj6K+C52LcZm8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522094; c=relaxed/simple; bh=oyj44b2X/gf31b64EzcddFgoIyjqK3vIjWVheZ8B7eU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R3EZIGE5sqifYQAGPK0ehl7JnFj4SuE6mO28OUgLs4CfpmpIWNp48ZvaPfnWbNi7Oel3+8lBjGp6UobioxXZiSv73Yk/95ncggVA+Bf5RH1FLoUxF2VHPvOVZTofyBuOXEWnmtWdqM8l3smKdThthGRgMHJY1jA8JpMwcRlEKfw= 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=Nv/J9Thq; arc=none smtp.client-ip=209.85.208.169 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="Nv/J9Thq" Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-393925cb1baso47824151fa.0 for ; Mon, 11 May 2026 10:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522091; x=1779126891; 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=oypEOShKaWqUxhXIr4cP4ZN66BvXq7YgjyA1BVRqQPI=; b=Nv/J9Thq3cIO0IrDdR14mNu+Ftsovebz083cmpMNlbsQ9y0UQ0f93ivOvtqz+azcsb Mu7IOxOsUBtdgFFbUYa905zEx4nVL5LmiyvzrqCw6RKqQxLj2076yFg2opprrsuLNLTd PZNcSFOQjhe8gLIfSEGBdJoT2s3B2mAfwJTfZjZTb3s1SzbwQH7u961x8tTzP9D6oZmw QtkIvx+3FQXFJTBw43Sk1XgZjkkOace+/AoP04o8UuGdSPDiY8lj7Jm/4WlxT7V69n7A A9auCqW26wzCMk/40nlvcAuGLHgOosNvKPeyRJ1LPKEbVE1d/PE3D5cuWQWyvPwP1ok1 omPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522091; x=1779126891; 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=oypEOShKaWqUxhXIr4cP4ZN66BvXq7YgjyA1BVRqQPI=; b=K/9aGXAZMjlUi6ZGYhb8F5S4tq2psIHiHoRLMtMLV6A0v58R6ive7DirmBye5GYyCU jKppY5LndXW/L8+6p4T5fQh/5IqZI9ltihanSUHjuJ8yVyMG+Hf11FKWvLazEcM5MUkQ hAW3c6RJ/qSTzddMfjf0PLlPZTd30iPRqc8MoeQnMlwratE6Njgbb11mmPIpEnNb6qbF t6W1atgun7WVDkY5m/It8Vk41UzufV45FjFXxqKzCItvOmgft6Uu5s2Pxjum7MHtp6aJ YwTO7VWVrKaqv2iVb3DortG3Yw0Y22Rb5SCIsuTtl3zafDftQn8s3UsXunpOk7ZafP5K Fndg== X-Forwarded-Encrypted: i=1; AFNElJ8bdwr8ShbiUWBaEmKXOvdHu8VVL+4mjX/NzoE1HzFcYIR7QqSDKEeSeyQWFjrRGz4TG5ylfQwCDyhGxwc=@vger.kernel.org X-Gm-Message-State: AOJu0YyVRZCulOfGgkLAp4gSeTZ4xNggwS3DU+OM8h5GbqKPkrqXMF7K 6Suk64f8pIyzEtZaxK8H2FWqzgssgDL34MuUPCF2EIC/2Hy0t93yQ2sP X-Gm-Gg: Acq92OG99U3hpG+EGHNPPW/XKR3/NHlgTmmAB6tD4M/ekS0b8AerYR3+FTNZtK1K1A2 CMM7ko8IztcvsUpj/mX6DMdL8w+01CybozAdodvoCJrg+79O2jyZzizMFbDvgDsLfAdWkgIa8hC fChiq0RUTnRBQDvwt9R8y2OW7p18DIkgsJOPT++J11zahtusUIxEs9KLkJAOfQLVmfof1KRdB9l forP6MUjPesW0VF/XJTZRic2GkHZHS8dF/gLxJxCu+rXHcGSlSmG5tzB8oJe05NiP6pMdicm/3L lk2N5+qW6wsQPIOUwUjQL548wd4gTQUZU3f3Vc2oDJj2rBYfede5saxSJtErHGzAGrvgfz8C47/ RT7jCBcQ5qpSaDp7UAMNz7qLo81TVpmU5ypVa2/eja2bLfwLbYlIo9Y0uKkP+WNwO0rDFtiqDW7 xbHeimOHcOHtHdkg8= X-Received: by 2002:a05:651c:1448:b0:393:7ab7:2c9f with SMTP id 38308e7fff4ca-393c4324db2mr89692671fa.31.1778522091287; Mon, 11 May 2026 10:54:51 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:50 -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 v1 01/12] rcutorture: Fully test lazy RCU Date: Mon, 11 May 2026 19:54:37 +0200 Message-ID: <20260511175448.153326-2-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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. Questions for review: 1. Should we avoid queueing work for RCU implementations not supporting lazy callbacks? 2. Should we avoid queueing work in kernels built with CONFIG_RCU_LAZY=3Dy, but that were not booted with the rcutree.enable_rcu_lazy kernel boot parameter set? (Note that this requires some ugliness to access this parameter, and must also handle Tiny RCU.) 3. Does the rcu_torture_ops structure need a ->call_hurry() field, and if so, why? If not, why not? 4. Your additional questions here! Reported-by: Saravana Kannan Signed-off-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) --- kernel/rcu/rcutorture.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 5f2848b828dc..91ba3160ba6a 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; @@ -1667,6 +1679,7 @@ rcu_torture_writer(void *arg) stallsdone +=3D (stall_cpu_holdoff + stall_gp_kthread + stall_cpu + 60) * HZ * (stall_cpu_repeat + 1); VERBOSE_TOROUT_STRING("rcu_torture_writer task started"); + INIT_WORK_ONSTACK(&lazy_work, rcu_torture_writer_work); if (!can_expedite) pr_alert("%s" TORTURE_FLAG " GP expediting controlled from boot/sysfs for %s.\n", @@ -1895,6 +1908,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) && --=20 2.47.3 From nobody Sat Jun 13 00:35:07 2026 Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 EC8B242EEA3 for ; Mon, 11 May 2026 17:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522096; cv=none; b=clH3CV4HoybCUtxV37ZRjVSmAwIPryFtJxY4LM2lgQPkNEn0d5AxvkZuNcweLcuc20j0AQYbXYot8cvvTu1g+LZ0ttlX3CyRf5RtCWqjJJl768wW8qR4CQyjuQRR84lhiNLH0HYr+7J6BEXN+hmaifT1uHRZz0WuCge1mfyfY84= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522096; c=relaxed/simple; bh=nf3d6Th/qqcFPA3j+0FA/cKyNhD0kVORFLgt2PalDbc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Va0wSLNT777p2JoMnAdKs3Og67i9kzPetpHfid94u65626kXqCX5tA9FArNSvfWn6XZsE8X4yaUtzrmVZJze/a1/tkOR8K4vqA8lYyQw1jnVCUrYjwldk1AU5y5WWuDmXTkTtBKodLFcULzo1V3vFJXi1pLW0zXwscG/TtiFjN8= 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=pVpeUdue; arc=none smtp.client-ip=209.85.208.172 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="pVpeUdue" Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-3938d17d6c5so40226771fa.1 for ; Mon, 11 May 2026 10:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522092; x=1779126892; 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=pVpeUdueFnnPECTMz//oiyPwZ7dcW/oxkzJmPjU+g3CXQ2JXXg3nrTJ3fmBu1MXNHg rwPU8ByopHGqqC39WK6ODyGKDjIQx3PcU9ItlwMRioCObdG64FO2fvCZLvHK/6GV9lM0 jPkyqNUDTYrNQQoHZWj4cPEwaTzsrUhiO5+hvDk8i8PB6xNPD8GTcurSHZEHdVVJIWdZ vdcNEhP3g/3sqfKWYh9xlkQ76xQz+I+39J4XwvXWhQJmTnYRXXr+Nl92ZZ2N/2s1XMF1 RfVPXve6zbGjrAjE/bs2W8+u517U29wpjyyQWMBLeUrp0YhuDri/aGAgcEatseO8lTUN jj6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522092; x=1779126892; 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=pbBP8hu3I+5HJW3SLfd7KE0R5sgOBPn7SKO27GhrH2RgtQ+I66s+KyyK8XcfnFHhZa QeY6RX2if9D/6Hn1IH5j/LifElhkLVBBV+hrjnK/lYQ0e/6ZjB5ASO6y3baO3eNbI5BE Aea/dKrjiBAup3YoyiN0MZlkz8tjx/4IoGyD7kD7CnDF4+5GGbgvA4gq98tndAtso+Le dGfB9KRjhxEWsnsr+M0K+3V0pWOy9s0qYt8rV4jCHJTHCv0obLoAd9H/S9C+DKmORUMJ rXWm5NcKr2bfOF6DEtaB/JTae/zUHQ8RqKBMz7ilFnm9m0uFCrWHdNGGhEIAMPnoSHtB bKPQ== X-Forwarded-Encrypted: i=1; AFNElJ+XpDk3WPrX9uT6mOKIABdwsXUe1omcwQ+bzsfFnOy2Ccez+4s6rsa71dY0i5/z1BAwYNtR5JfUsiFE2mI=@vger.kernel.org X-Gm-Message-State: AOJu0YxvrhcLX2u/7qX1v5Ws+VoGRr6zGTDyJKeGZ14ITAoGjZNZ+IQz RKUYTK/OBQOqLPf0iNNrGgNSVeyxhiiwc7kJYYBCUyyNovbe099D0jTF X-Gm-Gg: Acq92OHbpU8+BmF5yZyOCUfcOBviw328H7RPmpM5wzoPrMkUxIX2biDCXl0Z7HN0oro S88V4hFHd4BAB3Bhc6D45pcZG4M4txB4Ty0FNALZn55Lx6l/1b0Wx9BUagd5noG4jUn4AFvOC1i Ro0R+7EtNr4IDlCZuEnptxFH6fSAPoFhSkEYgNEXYwY7zp1ZHT92p7N19OzrxROkPI9U5A5H1C6 3Sbth4VL+Knp0u/UL0A/l/43CKwQrVpBTGcWBopUhO56Z0tKH1fGXrA4c7hun7f98qMWuWAAQsQ rkPLnKFKcv47eyedgCT3MxrOWs9cbplQOog4kDrOKqESjeLPf/id/DgsReLXLJDrZEftDBMHXgc 59fIU93qIWjx4RC4ud5kgnXHmJG0LSX/ZrfgP477VqFA+Vlla9mRkyfPrpGrRe+P3RoMLHp1kHU OOL3TNlnMl8uaNdDU= X-Received: by 2002:a2e:b554:0:b0:393:d562:d51b with SMTP id 38308e7fff4ca-393d562d88dmr49585891fa.9.1778522091997; Mon, 11 May 2026 10:54:51 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:51 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v1 02/12] torture: Add torture_sched_set_normal() for user-specified nice values Date: Mon, 11 May 2026 19:54:38 +0200 Message-ID: <20260511175448.153326-3-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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 Sat Jun 13 00:35:07 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 B45474534BB for ; Mon, 11 May 2026 17:54:54 +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=1778522096; cv=none; b=qZWGK04BivH8sKC0+2jzPaSlugUddTYs/c977l0Z5YRkjFbfkqNjvyKBUl3m7tuawN+oc1bhTwc9ZbddcDEvAVH1w0V0Hbn9ycD38AZcghxCEVKGrlU61OemSeMWSEG4YEnLHt/+EmFkFdQDPmQ4xuLSUwPdC7jQ5IZudilsxQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522096; c=relaxed/simple; bh=qWh56X7aUC/LYuqv1uyB7V3OeBHhVcVqIZiSpCS54nE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VofqIj/PAn2bim0zYlcK6kHE55qIVJs823lAgBLMmDSSm5BQEShTYla37FXphf7CRk/eODEG00tOiDay6M/lKEzaMmVtEp10pgpywQH6iDUStQzBOxsh2uW7ZHMuvKoT8apNz0iKZJVjyjWJz7PXsC5aMYVMBbmoDznamyCkBTg= 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=E23WqaRY; 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="E23WqaRY" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-39394e1e8f3so38979191fa.1 for ; Mon, 11 May 2026 10:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522093; x=1779126893; 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=E23WqaRYAXWyttPEmASV8IhkW0PcJDDVbMjNXj7Goiacog7myNZfKXDjjjizWbqu6f /jhOG5DhX5jp/cWmC1j2pFhpxHy9xIixJGZDx7XqPMgAhdyB+O1JOM9OcmfN1F0VBsBs CchgPxvK0abGMzL1EQ8Gv496ctpuA4Oj1v9SsVusxaUN/cfihgz0mtI9WR6SvGkQqmHB y5PAitNRGgLqhsorkYPwA1yuxbXRHje4UmBDONh7MztztBSH/nsfnHWcyV9sf6ccthDO kJ3uRwvnHUnxhl+8JLrzY1KbnU6r3L9jBTgUcQrRyCDHAhsOH6eWUoVNFi5Z7ZLEY32V nnkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522093; x=1779126893; 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=RtZuTeQn0ZhP8Edk3WFsw4GdbouPGpPwxSH+jniceJdhtMCvOkENtYjay5Zbbni/ux 8btEJxiII6a9Js5lfvlCO2y/HC0mY4BwszYwxM8wmAN0ID03MdZsV+7T3+Cgtj/wkTUm fRWxBwwwclagGT/Rhv71BQGOKPZ0uR5DJKWustYyVTOQFcwQVy/bMZ3mE4wTX1pC1lW1 xAG+w5kdhKjeJ2DbDOlwLJCL4IIDVTX6Nuv48XAvNhMfJcH8GA2vmlJgGmKwWZ60sc4X 5713IulnYIMnVOEzOziUtZ9lbmL4Ws8pZPJF07aiwHu8u+oskMLgVQbhPOAvxKns4ZGH 3Y0g== X-Forwarded-Encrypted: i=1; AFNElJ93m5CzDdxAhjFMisW6kSrdzKhRI3Yx0J61ES6dyJMnVVFobGGxxjKdTA3gUXP2ztxzUWBwbsl1vT2uGBk=@vger.kernel.org X-Gm-Message-State: AOJu0Yyb5f9Iyh+F5HHJkvj0J5GKfvyildYCba3RgzyrxFqHAIqsOJMN Gbr3ztaSAz0ZgxDIoEOfRDCpR9jVY7wTz35XnthqmXw0YPYSxIwYhvr7 X-Gm-Gg: Acq92OF+ANJSrXpmzIWvaAFmnLa+LFwh0aDQWhAZNKL53sKJxRsETcyIeOhMed7AzAK za0z0oLm1i1eha2i/VGzlCudM5GiEtl4fmaNVs/rxVnlYaTbcM6B2VMEli5MJ27YUFSfpjuX6qX Frzr/AEDFzrsPsA69XaZYoZMG+Z6qUyDJXO7bhvmJlcV+Mfsva6EbxlBBm3TXNv3sNgflatE/er oZ481T46+0b9XOiyHa2HjsJExoTY52STFLCzVw3MEvUsNqg9trpy5YkIcFZNVahMZJX7ZInHs/O v7QduRqxGgYH1wffEZk2z5FLpNGXpO4j8vLdAFnQAhmycSGhrQmwIMSMagctu1aRQsmFJ5dvesa puVNu8yY6ygHqmQ169p4eYKXaJ/lNNax5y+f7dcVk52P+57+QVzEQDqOqtUGyauWOw4FFnI91Af MF84kF/cOOY3r+xOOSQFABJEiOMQ== X-Received: by 2002:a05:651c:4413:10b0:38e:8902:7a7f with SMTP id 38308e7fff4ca-39408064df2mr23396941fa.13.1778522092679; Mon, 11 May 2026 10:54:52 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:52 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v1 03/12] torture: Improve kvm-series.sh header comment Date: Mon, 11 May 2026 19:54:39 +0200 Message-ID: <20260511175448.153326-4-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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 Sat Jun 13 00:35:07 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 6A63B477986 for ; Mon, 11 May 2026 17:54:55 +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=1778522097; cv=none; b=eIH+fiO32jv+cX93iIo2FcX1Fee7+Heh6pv+AtGps805g85fjqZveBewA86g4OHE4EVQFOyFeOUP9z527WqnM11oNvm0ZB0BPaFgFMZwJdfaksmutv64SHOuPNA7SgWdWbOchGwd8wWptp9nJRvBrZbbTmQi1BqFZz8srXpI9o0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522097; c=relaxed/simple; bh=AMef3pkMscCEIVOua4C09Swew/rkArkcZrElIxGazHY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gCh4pqw6YEA3/x828QNrdQAF0ZSTbvfhAfTSLXQe9ldh4K12vYOXg8Q/cSMKFDH7gP7UAgLBW5r8RUPWNZ5eIj1ojKuTPatWppN/utWatbr8JPUlydBnesRDUlvOWgKNS2z3PhNpRcm/ig9fNwd+AjLuJBgy+qoFLt13G331EG0= 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=PIwYHwaF; 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="PIwYHwaF" Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-38e800deae4so35982481fa.0 for ; Mon, 11 May 2026 10:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522093; x=1779126893; 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=PIwYHwaFQv4ND9twDQ/vLD/R1WsrgvyxrpgWMzKzfiafhNssOaKepcmkS4tek3CGxe wDIWAJ9KASLslpyT8AjQwb/UavKKB7s7h15r6+neiXEIG/Jnuoxwqsro66bHFQSnIoad YSFOxBo6EUB+nSA4P146MN8eonpSpAt0b9CENaSDed1+DeNvV+7/10Z9TNGDxsc8mfAt +Xud/7zoUGY2F7b9nKWB9ncc90Thp3wz09Zis/IftykytCA6yvNS//n3akCtFaRVNBHd ArG+IqIHUprS+oze9NQ0XAMQGBWxPXascbUueaTyUf+JyEwKK+Z4LSpdGRGw2m8KMp4+ 8x9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522093; x=1779126893; 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=fr8acqAVsSKCLUKpkPDuOhBoFdp1ukC/MZGmq1Nhndm6Es1Irw5efG4pcMsafQrnZd OmVFPs8KUjoZvm/OeIarExWHZp0e9YLoKeUjHIT0U/QT38YLchsldA6S53f8xjTiiEdJ 5RBBAC4ke+9PRS8HiplJWgj5at4kZqUlS7F+Bj7MWHV+aCt/NCSs+GCTJaFdmt2vRI7N sp4bKKGfA/VLuObSpF796eeSnW2jLpgur7TNIIwhvgS5jVpZ513H1W/f0bqXueZamyR8 uZAnxXIE7Cw5dIqZTbK2Cb1PXglBsYtiUxGpdi/oNyJK3NLPlwYrt25Z1oUFis7FD6J4 YQCw== X-Forwarded-Encrypted: i=1; AFNElJ+D4akg3ejFy2XnAcKB3nxfQxwI1pzSgzZACxez5DfU7JhLcMDy3oCWG1PpDIOcDwy41nY9dSpKWsUwkd8=@vger.kernel.org X-Gm-Message-State: AOJu0YyaRfuxpApCuUDIVWYdsTm3Yf+818GADD90Dz6c9CGx5q3VqxlP wJpxC7PI7V4nJH6nun49ZK1lpy5PAQ7iUfJ81++QnWS+AeYiKABKS952 X-Gm-Gg: Acq92OHIKZ9hECxICKwlsgOpBzx5FZ+zf9jT1Ay+omKc/0knvOslUa8Yb3TV69XbPWL haWvr6605vWrI5JN6EB9eeywkCPzRN//ahIHIcbzg2jva1MXIji/RBBNkuz9Z9HOWdyja394ggH 7SF259Eul5tpTGAFWJOxeq4Bxz2bDyH54g/SwaxirNAdnWx0V2VItepxpOjBVi4ITqMnz+tQSUb WswbDBsRCfLszKidVK3ZjH1vHQEvKva6lMv8gHUe0lTYl40z1kSXGUruud/u2K2fqMwcvoflwM1 Tam26KsaokI4QPtT7OX/rEG+BCoV+KmoQRFRwio6hsURw4grhsOmDCLejB/z+H10EAP0BMNGpef FiwVWOphpJm91TgI5kVdk7NiLBMeifjd5ckitP+sFVV4F+KZtDhh7dhqXb+bcq1uEeLGF3lFhFF s2VncnJLBeTpHd4kOnsIbVGdV1Vw== X-Received: by 2002:a2e:bc14:0:b0:393:a4f5:3e0f with SMTP id 38308e7fff4ca-39407ff0857mr37459531fa.2.1778522093253; Mon, 11 May 2026 10:54:53 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:52 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v1 04/12] torture: Allow "norm" abbreviation for "normal" Date: Mon, 11 May 2026 19:54:40 +0200 Message-ID: <20260511175448.153326-5-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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 Sat Jun 13 00:35:07 2026 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (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 EFBAF477995 for ; Mon, 11 May 2026 17:54:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522098; cv=none; b=UKaVS3qvMlP7+ki1OZGcoRQkEGGDQW28LGYdAZpDIScWRerCG6DA3eHhpz6JObUJScO2GUGRgMK7NI96XLNFIl0eEHVZ7BlMd26eaVLONVIdxUhAE+h6q7nKERdc1xmVJfejcXJ/RxrXAjjEQRjU0MjRRUimw/J9Cbb1Xr4lGIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522098; c=relaxed/simple; bh=1gqbdSXuc2lYJ9G7B+thJWtUos0MtzF5jgiSQKynjWQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X+FmmFDsjFbccbj5OnhCa2b+Vvw6Zr6kR0X3ddKIJ8+/9e1YIaCALGXu9Yvu//WMdMEPlYj6YD4Ac3hk5sqOMnmwhNCyOBZ1S4ZJyt8KrMd+KIzloFmVwHzwf77tTxRBc1LT/5Fh6Z8Xo7qznzOkMnIbiBK6HIn7RybiBFsuC/I= 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=PgcOubl6; arc=none smtp.client-ip=209.85.208.181 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="PgcOubl6" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-39380e79936so58239481fa.2 for ; Mon, 11 May 2026 10:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522094; x=1779126894; 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=wHIDhlOJb8urKkomAEMs1m87rndRxl/f43Adb3lInY4=; b=PgcOubl6Y/FdPFWtoCtspYmTpt260eQBD/YoQvixSBdvJhjja3XhD+WUtzXcnE4Ihw 8UG87PXYxIYEBm0DUjnyslA6y0n7HCWecYVByFldaC6H7Ca/I+FUdBfjq40iV+VjPyc2 tMLZWj2E3bKYT125PhjGt/RTsraRBvQZaKmxu+m+/R6Phlgtd4ot+gdCdvbb4pGgxtTF NVhgb7X5OYEW3ikLcJyWCqjgEZqZYjOoE9K+atx3b+mCIQE8vZpdf/p0i2JlxEZP5Cvq cCAMMRBPOC8JbZn9Co2hi2Jalqc6bnPZvr9VkpA8CHrjBhASjLimIwWehm4NX+77kUKB I2vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522094; x=1779126894; 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=wHIDhlOJb8urKkomAEMs1m87rndRxl/f43Adb3lInY4=; b=UmWIrtvfb4WeJCRz2q+roZJKrXHA7LQ8LVNHK8p9gsc0ZIfBf1DgozuYQi5qhIqfFx f2p+ROfEnvmKtSIyFYg8libFEZAFMFJK0AhZKbYZzbvFu0ivZ5PyveOLwrJwa//IHvHs 8RxWqhOxmT4xUd5PjBiytvp5aK1LRb66dcIShOYviwIK3ciyLo+FLfKSzkjosRpX+T2m 4H58tlv8poy8ung1KSAL1qkZCoPXkKtHE/INVTbI7IdMufYoZF8pTLp0nPoPa5sAo2Nq y5SgCL1OHT+h9yBcBu6tRLXfNBH3zNflvS+mpsduy3lyqj6Uzf3FjbSYIM7Xt7iTzngN /t2g== X-Forwarded-Encrypted: i=1; AFNElJ/sHK4k9FaebqSEQlqAMQtobty/vs5eNkpR4PoS9Hz6KI4Bi69oElJUJdzjh5EUkKOfJsb8a9yjERbPAT4=@vger.kernel.org X-Gm-Message-State: AOJu0YxsKp82K9iXzeEek4En1LjBzlXHIOeyKvnuFDEV8/WCLEbiIqGJ jdM1ynCFc/+Ny+KIs/tl4xr9s4+149FRcS6jPgVV5UnWD27Q7UScwHDT X-Gm-Gg: Acq92OHIjRCOQAOdxufPRTs5JSOE2LMjA10LwUPrFsc5l66VxV3TkavUyVcWN4KJTD8 V9ZW2VhgyE+miXTVe+LR40p8bodaI2AptAtlLlrDE7E0OZpHV/13Jfl/Eyb8mlsytyqYZUluLpF /mTAvaKC44eGlzm0Oww4rqmDODGLzkFxdVjOTRRSiKvGN6xU0KqJoj1X+1WkVukEg1GITLCatdI IIvm+imbhYYlEgSk8aMuV+cCBFg9C0gW9MP86zmDj5Zvt7xJe707acGTXDlcPCvKdZn2SDxKaxc N6E+3ZifW95yaiJTOLpmfjsM0q+C3l/Cfv/ZuIH5aVatVFJ61Qn20CPw+m37niTq6IBWcVEChUf hLr3Bk6pM4YN9IgiNc0N9Ykf9VxwZ6HFV2eWBk4iLT4zhPfXHru2/iaeR0R1ZwkEYLSqE3zYlbB dwfFjjO03Yr3iG2x0= X-Received: by 2002:a2e:9783:0:b0:393:903c:225b with SMTP id 38308e7fff4ca-393c4338719mr65673121fa.31.1778522094076; Mon, 11 May 2026 10:54:54 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:53 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki , Vasily Gorbik , Samir , Shrikanth Hegde , Tejun Heo Subject: [PATCH -next v1 05/12] srcu: Don't queue workqueue handlers to never-online CPUs Date: Mon, 11 May 2026 19:54:41 +0200 Message-ID: <20260511175448.153326-6-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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" While an srcu_struct structure is in the midst of switching from CPU-0 to all-CPUs state, it can attempt to invoke callbacks for CPUs that have never been online. Worse yet, it can attempt in invoke callbacks for CPUs that never will be online, even including imaginary CPUs not in cpu_possible_mask. This can cause hangs on s390, which is not set up to deal with workqueue handlers being scheduled on such CPUs. This commit therefore causes Tree SRCU to refrain from queueing workqueue handlers on CPUs that have not yet (and might never) come online. Because callbacks are not invoked on CPUs that have not been online, it is an error to invoke call_srcu(), synchronize_srcu(), or synchronize_srcu_expedited() on a CPU that is not yet fully online. However, it turns out to be less code to redirect the callbacks from too-early invocations of call_srcu() than to warn about such invocations. This commit therefore also redirects callbacks queued on not-yet-fully-online CPUs to the boot CPU. Reported-by: Vasily Gorbik Fixes: 61bbcfb50514 ("srcu: Push srcu_node allocation to GP when non-preemp= tible") Signed-off-by: Paul E. McKenney Tested-by: Vasily Gorbik Tested-by: Samir Reviewed-by: Shrikanth Hegde Cc: Tejun Heo Signed-off-by: Uladzislau Rezki (Sony) --- kernel/rcu/srcutree.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index 0d01cd8c4b4a..7c2f7cc131f7 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -897,11 +897,9 @@ static void srcu_schedule_cbs_snp(struct srcu_struct *= ssp, struct srcu_node *snp { int cpu; =20 - for (cpu =3D snp->grplo; cpu <=3D snp->grphi; cpu++) { - if (!(mask & (1UL << (cpu - snp->grplo)))) - continue; - srcu_schedule_cbs_sdp(per_cpu_ptr(ssp->sda, cpu), delay); - } + for (cpu =3D snp->grplo; cpu <=3D snp->grphi; cpu++) + if ((mask & (1UL << (cpu - snp->grplo))) && rcu_cpu_beenfullyonline(cpu)) + srcu_schedule_cbs_sdp(per_cpu_ptr(ssp->sda, cpu), delay); } =20 /* @@ -1322,7 +1320,9 @@ static unsigned long srcu_gp_start_if_needed(struct s= rcu_struct *ssp, */ idx =3D __srcu_read_lock_nmisafe(ssp); ss_state =3D smp_load_acquire(&ssp->srcu_sup->srcu_size_state); - if (ss_state < SRCU_SIZE_WAIT_CALL) + // If !rcu_cpu_beenfullyonline(), interrupts are still disabled, + // so no migration is possible in either direction from this CPU. + if (ss_state < SRCU_SIZE_WAIT_CALL || !rcu_cpu_beenfullyonline(raw_smp_pr= ocessor_id())) sdp =3D per_cpu_ptr(ssp->sda, get_boot_cpu_id()); else sdp =3D raw_cpu_ptr(ssp->sda); --=20 2.47.3 From nobody Sat Jun 13 00:35:07 2026 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 8EC07477E4C for ; Mon, 11 May 2026 17:54:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522098; cv=none; b=lR+P/CYSEf05Q1E9HGgKcFtm98MeADVt0yaZ2cjXmWfooDCO8v69IOVZG27rmgHwpmUg0fwws78Cmt4BgkeK7StsK8RQeAfEIkVyG9iGhos3HGbkQ1vZuvh/tGXKqVpQaaMYbcYk45cYE6Xk36Zhvlz1coT4kn3grsqxYvqRCds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522098; c=relaxed/simple; bh=sCzlW8dI0Fhs+cB9tikStcBigUiohJn/nNVBfBD/Z7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qsv3wTfm5Jkzn3XFiOqxFy5lUPZNTUDL+Sona0eet4XTabmSxQk8nPmYrQARfeJKtiZ8hdoFA6LOK5e2Fvw8C7WBFT2wmPYcQT3jPpYIj8m9u201c7jtNFVe+F0TtduDQyySndPotl05B0ucg49pb3BArHGVrwuHEZ+8qK/5r78= 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=MG4JWMcv; arc=none smtp.client-ip=209.85.208.173 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="MG4JWMcv" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-393c93a0166so47549811fa.2 for ; Mon, 11 May 2026 10:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522095; x=1779126895; 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=MG4JWMcvSY4DguR9zqc3dHmxllIx5xIjqDNoUybc8qrdklvB/ldeLjxkISMcc0eXlo t1hxmWICxMRMMjN7yfhFrcUR+J0ycb1QWCCADFiSs7V1agY7iVJfcTX8lyDAdqVJtxyA yXd/tAE8RcwUByA1SMJS8UszS/GUAc1gKXvxXNZHn6p2aw2VrL6l2ElwzZJ+RWvmuXX+ kEGE3eeJJHjRZQhqLJAc8nydwFWdCYFEvwZerYxTpnniYRIg+Wp75qSM59LpzSqdEQ4S I/aTPAvamh2tG7zF86xa8vmDEeZbrao/SPSO2elaarUjEaHpniO97XyQdXOGidipXnFd CtUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522095; x=1779126895; 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=rS0zwdqU1AZb5xmKFcnD4xqlae7R2A5PR+v2gePgzUgbgj6G8KKKGcezcwjWE8R/zF dBNtbBMHUbtNo7feFSmmTrrh6uB277i06IrNUKI+tXPxl/Wu2TAFPgZ+pYA0SoGhPDps lz+nskpcXcWVPwNwizM6R3cyFEXw5w/DRWSlrmOJoVG29RJC6lWHS/EaiC2Z/bBDay9o s+yvSwpnmRUZn2bHrHALqTfwJjS5ejE4JW4Ugto/YOSeGSwooWcy/eSDQvVoptQWNCfT /m4dWJ/+OGnPG/aNVnVC207njPECAA6ndTYXYnIlVdhhz2aSoree6HL2waPi2gnfROz4 y+Lg== X-Forwarded-Encrypted: i=1; AFNElJ//y/84deUBZsSk/17+XkwKCiEHnDfjum8yM51OuaAh2h0YHuiuVPWeGeYXCs+4bTv6mdL1iB0uesPiHF0=@vger.kernel.org X-Gm-Message-State: AOJu0YyfH6d22VD5HfvZ86P9eKQRmhO0LVr6MNlcQCrBmS1tPo7SMSds 8fBqaf9P8hlDrAsB8GskyPrVjnb/wxR1W/TF3H2UlRvG6wxbMX30fyv+ X-Gm-Gg: Acq92OGvLUFEgVWMaA8pgODDSFRZm48oRyEYzH6Ynl1ZzzkFD3smCD9eejCQr1Lu+3z mAlIK/NS8avjvKmKfSnChPXvKH0QjAQnfkEn/i66KdH9jbiL62wXkff0uCbXF1PLIEOZsZ6di4/ NoSUZh8IjokcqRCXqjg5RoBUiJgKdpTwhGq1xMF9WxlHTAC86qjQ8Ax6YDBXLm4KMrpg5E34HdW 46XJs3jxFmieAUXx9ig5XrMrUHNVegn9+hNVq0JQIXBUScMayeHBhWsfx26V0OBTx+nsHuj1rji 3qPUg/0GB7CV2psLL5BY7RofR/BpZtx8YurPlgtBxtRcxybYtGc4viRFd1PSsL/kLVM9sK9P6lF miKjE2Z4PeXi0cTnQfUPeNittTLj5J/I6iHTCVLGJXK99yNAcwtFTyxHNPajghWfI47v/U1OPr1 WoE4GzPbmbMLfUICLFQaa70hCauA== X-Received: by 2002:a05:651c:54e:b0:38e:e6fd:65b2 with SMTP id 38308e7fff4ca-39408132229mr34016011fa.21.1778522094672; Mon, 11 May 2026 10:54:54 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:54 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v1 06/12] srcu: Fix kerneldoc header comment typo in srcu_down_read_fast() Date: Mon, 11 May 2026 19:54:42 +0200 Message-ID: <20260511175448.153326-7-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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 Sat Jun 13 00:35:07 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 778E0478E4A for ; Mon, 11 May 2026 17:54:57 +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=1778522099; cv=none; b=jv9ulIt9wiwyrUNT99O+kBD8PCnZDLd46zoCfy3kZ15p0myipFU6FzRay3Hex8iKnDDX3SMIfw61WmeXvkD+wJ4vRJXgYTZODVjYtJ8Mu0delV2kdVopSnS2ePh2OhjTxTthga+4Pj4QZ6OONilmWYVAoiB9ERhDZ/25gE46PqU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522099; c=relaxed/simple; bh=yg95+jA4OYlmIgo8aira0sfiDymydxJc4HtaxzIjeEY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WGd3Skgy5ds58tR5HQyd24Hhx2Z+TfeS3Q9Q1QQnGomYJeW0B/maaVRdmdBcwiS8i3M1KfzOTciATDBGxL94cLiJzdGjcAbrrG6SyzjzVCP/mGKx9RbGQqc7ijHDgVBB6QZhAxGEbTNnl4ssI/a58uOCHLU7LYAaJ2j2VfGeLqU= 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=p3MU2aUA; 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="p3MU2aUA" Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-393a49d2e5eso39257751fa.2 for ; Mon, 11 May 2026 10:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522096; x=1779126896; 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=p3MU2aUARkCvcDmRt2fQMHJcUFDqMd7RGb+iAFIXZdDrexpy6tHTupRzLujP4Q3Xnc e3e4bJcO2I+dtkaMfupr2OA/WnngH2p0wL83qDj4JxjhGDTeqe5rVWOJ39rzTO7AoNfO kdews+gM3eBeVATqtjUElMC6qfwKJcQrx4PPIdnvYQEAD3vSkEcDJABw4lVa88qAUHBx NGgTyk7DJ9Ia+PsL7/qlh6kV/F/B7RZNsKo4bgr/5wI66iuneddC0yAN6hxcaL7TK7k6 o83mLqmclSbCTZXVOsHYetF90WkbGebMWwZRJIAazq3XNDKB2FkHIZ4tnmetVrtq4DUr +H0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522096; x=1779126896; 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=msAZm31vGHDnVnHAsf69BpSPWvtyReneQEwRS4oJp2f73Fm00Ta+dur7gb8iWVTScs PwYiNlSH2GF3BibShNKsD9JEs8339g145M8IElR/p6SCL0jxnR6H30zK8twQRLPZHSG7 alexQnDXkFVLvze3KpWcLOlhy26Komt599jtPLoDFBsyW1+SSNWe3PmmRudryzKbHPpb OIPDsUVU7vUOQ/wl4KtehgXUaTx76TdBTFwaUkO5YKAg2ZgwD9hcJdOGRQs/ugoK8DLe lkBtPG7Z7+nZThBNw+z98+VO49BGU2lkp9bxtcOXZL5se/OAWRTC4MHn5PcLLDuARTMl mytQ== X-Forwarded-Encrypted: i=1; AFNElJ/KZWv7ZrcXEfMyG8nJ4T69E1/dL2EpFubAhQolULC3WH/ouTzMRHwpS77XV/eFhZ1Sv4VEXk0Qw7mAIQ8=@vger.kernel.org X-Gm-Message-State: AOJu0YxVVU5UOyxqxEsYCCnmbsQxuQeW3GG+rhENzZnC8XZIoJ/Hg/+e zie9KoVN7DCs+QzdZ8auOkg5MLbSe8MwRjnktIgfdS6TEJzg0IyiJqzZ X-Gm-Gg: Acq92OFZ4DIUn/ogTZWTg2ollA6B3L5z3RByQ/c2jXRE7oPkAEvXEQmLJaZERSa2zvK 6aRmFJRx7FjV0zk/KiSEb8lWvQu1F+wGB374O1RRKRyfnYeZq7PWnptMI0rU9d5DRB0lnb3NDNc byBKLKorjKJd8AoJgVCLpB/eeVzDNcuWyNeHOi2osdHpPcUMtPHaZttcRphZrjCyqiSN5X0rvv0 zTi9D6dEWYHWhiPTBen66/wocn/1ZX2umR0JW0d6IiF5WI0LYVwg8x6xk4rGCwxAco8+9nFSVMn opICPt5v014KHUAHmbqOmSJlUf3BvYxttMLTm9sJ+MSsIcgb6/IlWJ3m4O9M9WtZMVD5lTRz4PT tgVc4N2fuxjSs+IiviraMBZAYXsObIUxoBrwlIxBzXi6fjY3m2/I/tilp8j3iRlaHQXw1m6Bl5t L7CBRYfYpVk2fj4JJrVP6+WHZeDg== X-Received: by 2002:a2e:be14:0:b0:393:5920:2c5d with SMTP id 38308e7fff4ca-393c432462bmr104321521fa.28.1778522095555; Mon, 11 May 2026 10:54:55 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:55 -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 v1 07/12] checkpatch: Undeprecate rcu_read_lock_trace() and rcu_read_unlock_trace() Date: Mon, 11 May 2026 19:54:43 +0200 Message-ID: <20260511175448.153326-8-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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 Sat Jun 13 00:35:07 2026 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 0C09347A0B4 for ; Mon, 11 May 2026 17:54:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522100; cv=none; b=Q0bq0Q3Xou5Lm/USSE9/SZ5Bwy93Wh1zV/TFH+1IA0yBpzZaj7yYP954FSDsSd83y3+HiD2TqSd1yJDSIx2/Yh06TKj4OC+pOiopRs0QCRAirj3Gi6UXEhQp41U4VNXUvnxqOfxT2fbcFqv6BiMsjsJtv9TYhgmxzaKHIG0JU2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522100; c=relaxed/simple; bh=jofbNNrCF39vcNdNgWy6T1Gh9+EoGuK9YxZyAMEyS4w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=efJRrqIeHqEnCieizosYpQFNo7APEU9TeLDdScyuVjDRbk8NDZudFbRoZMVaUTYIVPkFcJ5XpfJ2msIdC6tJtskb8F98c46Vp1tKCP7sE5S8uYJwE9+GXvmRf3Wz+M/9/TZlF3S8HS6P2D7IJCFSVkGgi1qfCsPW2gho/XrS8dA= 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=C2PN4Px6; arc=none smtp.client-ip=209.85.208.173 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="C2PN4Px6" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-393d07e8938so43028291fa.2 for ; Mon, 11 May 2026 10:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522096; x=1779126896; 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=C2PN4Px6MVkhCX7iptbpWVRbXHXPo6UrxXJyC39iig/h7MZl8PDVq0OO3ALB0ZnnTt rcU69eVZyA7hdFebOyJrGC8UgCJRiFgnk3po8gwzMjHMqFCu1HqF8E3d5i+tJoBAFrYc oDfoY3Ge2Ki3YSISSOJu/m3ZSdwNzHSPdiGRUqZEFequOOt0OYNeZel7EGs64WQr0Wgv nVXR/xBkUG1E241w2c/IoPwGAwUGLo59LRsa7rYGN2R+bN9CMKtHw2zm5aQ1JhDTkbAL dkjZpp8kOhW8Pd/+0zC7oSRJXg7Hl9fltDk1vwrhuFodq/ihPu5YROcR8eDbseeMo4+8 OfWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522096; x=1779126896; 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=DgTH+DJ7HeiQEVp/V0YQ8qeEiDybVLtH6uddcAplfPYTayCNPomvURgBZHaeK/Zezp VaTnx1tif3nSVCqF4G9AhtV5orLxUjQmIQE/u4gKPBTbfvtL91QNbe7n0XFWSJrfeikH CqlBz/iNUoa60X12rZkJXfHmEkHdscJdt0uTwyc/CpK0dsWVMLAM2fwTu9iWlTlbdLyx Pss44k0g15lTUL8X4ErOb57exe1YypbVciQ0PUIcJ+R+xTAvG2f4kkQpZW87JiUPoS4Z TmAvyorzFbNy5NURQ8eHAbhmd50adzPQeUmMnatr+6OSUfDcZ71od7LNeqi5t8iTDic1 TLeQ== X-Forwarded-Encrypted: i=1; AFNElJ913V632CW+5VzB+xKhz1x3jaZUxkv29nuHnwewPIfrT0ZwziL2Z6wn7f+ukBJQb+qhqF7pch5fqotW5jk=@vger.kernel.org X-Gm-Message-State: AOJu0YwWjlXYetRibi0pYooOqKNA308/IsNwLfrVrlM0FqiXueDDhUil lXzkhZBdUTxkQpk4Q9jMf+KxcTQZRF+3xYvo0VPni6Ek/Lb5y/9oN8af X-Gm-Gg: Acq92OFVlHNcqXyGKCTK8mBPzeOXtujbKm7oPZgAKKADEjXCtzjmF2CM0s5erLvYtKB i0VqXvsjT9hFNW+uLjjNeLhbTmQUmZfla9eiEtSGMJ/gws+Zhmqr581LWiwQZzQpMGu6qKGggp2 qd7YhNyYIAFWT+lYEx087LQnJ+dmFJBSr7m8rwk4IvdiOSIQqn98GOkdbm39VLYn8ljIRlUTB34 V/vGvj/Px+Cgnple2SEcZB3zbxTYLlmOro1sZN4M/dzryYMGBRn2aW8cZAUn2R6RYsKVIQLK/Dn 45rGi46JRILo/H8Lm6Fo0tXCMYwwV+bErOU7qovjRWDJR1i8ZbAtxwvz3PF0WP+YQUqsOAkn+hJ eAxHVeXXggMi2HjEwPu8umIp32SWtKVVyFknItjo/jXVNfgNrbW7QWQyq15KVtS1CM195+0BQfa MhH4cK0u4P+zvPOeU= X-Received: by 2002:a2e:bc28:0:b0:394:2b8a:234a with SMTP id 38308e7fff4ca-3942b8a5e7fmr14884781fa.25.1778522096122; Mon, 11 May 2026 10:54:56 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:55 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v1 08/12] rcu: Simplify rcu_do_batch() by applying clamp() Date: Mon, 11 May 2026 19:54:44 +0200 Message-ID: <20260511175448.153326-9-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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) --- 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 Sat Jun 13 00:35:07 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 DB77E47AF69 for ; Mon, 11 May 2026 17:54:58 +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=1778522101; cv=none; b=MP7Rpm4Qbv6uZRL39R1u6C4NBjthJQwThTD2aKH6jLueQSm02hIDsFVf/6p92PTXhbyx1FsdJhRzW09bv3Mqa6QKaKkTgkvbEoEG27OuEvVNNvwW4Zl74otmp1IUCyW/s+1qt4hrupbaO+U32fO8k4g1hOltK+ZoPaVrytZ/H/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522101; c=relaxed/simple; bh=fWM441cbSLZxfDsFxOgkHb2BPMc6Nc/hi4JixQXl/Tg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ohpkqO3FlFd1kgznOaV5TwaQLmPNWUr/n9A+CtgSRQOFB4jRwoGwxf5XGkGgKHR+kM9v4AODxUvZHPiFe4mI5IqDvchGAIkZ0ENezk2WrbKjQZP10pIaLhR6R2qa9Zi2kDODKp7kC8mmTVgPXAdd9FQP71Sx5t0nZ7c42DL67nU= 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=h1t1FMdQ; 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="h1t1FMdQ" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-39397d63804so53826891fa.2 for ; Mon, 11 May 2026 10:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522097; x=1779126897; 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=h1t1FMdQnBwCYKn1TNMBkk6RRyfAzvF2ZKdzFgfwCwF2qs3AXNa3s6nd99rvgypG6l /dWLrzoYerU1jDDyKjYU1Px2qrTdGOtrzxDRV/Gxjgw00Xa3ZiAVozbRF/OTOTMl/3Gh abqkfwKJb2GZB9KJczHt9SzGKAZ511d4Vub3/FiCT4rOZoQbnYBh6P5T+7XBgqGqyQm+ L7GfldTJONeHyaWKBSpDq67W0+JSyNEX20sh06nRgwWm8rD2UXgvj9CFrO1KaNxtx6yG a/nqeNPqFSIHvs3RSegvPxO74LKMBmwcH8+jANIhh58eoFpSd/wzlWsjiO6Ha6DHlCxI wA6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522097; x=1779126897; 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=lUFUnhI2mpGlG9q4P6td80k/bhWxpTViNKkSNYZBw+pG54wRZ7Q6HqGXlGgX35eIlB R0sOVQGFPyF3ONruHVpdsj9VsC+HPPH+J+vPkwdiUTQqKHP8T4/rBMl7YPDOK1auypSw 1++a3SQl3+4hHKMDLBUYC6vRpHCQSgytU7IwSkvjhpLkoGEFDyYpfQzYFBcyiRYelw61 l1ZFMzibYuH3it5mq8SFhJY5rQgZOwt0o9Nd+41jXU/Wg8WEzWWhfwKEM2MQJII6p5kd yO29F/uVBEfcy3q8JS8+YoWMqwP5RtCVy3cNfDYm7EG6/Rc1ctV1QePSK6YlhDwiLFld zfDA== X-Forwarded-Encrypted: i=1; AFNElJ+nSN/YRoksK3jU9m92cmdAeyHKagsP6FH5HdgjH15jddRP9jJ2WeC1wLHioFeMnafg3ibYjjepxiWCQUY=@vger.kernel.org X-Gm-Message-State: AOJu0Yyfdg4ST4oFf+8dawA2z5HtmJPd7vuhVrvnypOCwenafUzTswUi opHA8Oq61TOKOQekFO5ctuB0rL/rvPmAHhR45cKThu1I3A8DANRtOt5M X-Gm-Gg: Acq92OGXbxDU7nz6JkCs6c4pxnsaOwAjm+DeWG+i6myO6DNYtxrg29TOdD5Cq4K0hM5 DysfwnmrxdoHJRDCx0DRJOxcRLUkUl8uASSyXrB+CAE2wQe75YINILMbzn98lq/RfVSDmY5qYeW GcurZeTpcM5Tcd9N5WqlGGFT5E2mNT8ZzJkpFMSvLZqNTcMN8XXFtIEESJOaCEaaikx3jM8lU3x BzNeWQKkHy3mL1GDvf6Si4kjWFs8k6hre329OTOeXyTCJzPgs/LnUEu3YSrUK8MjGiA7ClndzkR 1kIrugvlm5h+n/yEp528TGmX6Sx9nLp/cXN770/W38Dv7cGsFCOTUa7hjkQROfNWXw6jNXK4AJ0 ivV8nEh2LU3s1gHxYmqZu7ZX2XImWUE8usjfIG7+VzubZtWAbPf6QB4KG8kzu/XyS9FZgehYlKI 0T5LRNJGo4m3LwH5sOkBrErUcR6w== X-Received: by 2002:a05:651c:503:b0:38f:f8f3:6c58 with SMTP id 38308e7fff4ca-393f4d1cb99mr48232041fa.11.1778522096884; Mon, 11 May 2026 10:54:56 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:56 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Joel Fernandes , Frederic Weisbecker , Boqun Feng Cc: RCU , LKML , Uladzislau Rezki Subject: [PATCH -next v1 09/12] rcu: Simplify param_set_next_fqs_jiffies() by applying clamp_val() Date: Mon, 11 May 2026 19:54:45 +0200 Message-ID: <20260511175448.153326-10-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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) --- 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 Sat Jun 13 00:35:07 2026 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 A942D47B437 for ; Mon, 11 May 2026 17:54:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522101; cv=none; b=NnHnw55w2w23lXJlxsgoe68kqWIPROPK+oMcdovgfuPRCFso317D88becLS37bOH5o+hNSkZd7VXQNJt15Zkwg19uW6gx2odj2qesnny6279CItZ9ArGih8+REgoxI8Wl21XJiT5mXBTMG4sGzM2//AMLF0q/1m1qS/cto9yHKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522101; c=relaxed/simple; bh=RkHk7z2ygyoyi1ilNEZkRX+Ty9Jdxo0cKjCdLWv4d/s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CfzlYswD4b8S+1CBA/m9mlJzRbUMatpqi9L7iOym+EEJt9QImASHzvnVvHKfr5micd3nJEFoaW9Wh60nGiGYOoKUGP37s+/tPY73VOjTY9IL3l+n3hjxOVhpDzpYrPHDMuHbiAXr1kuIZcrzrlTEUfCVJQP9Lhfc6zhhzrcMO6g= 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=O3sOBPcL; arc=none smtp.client-ip=209.85.167.42 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="O3sOBPcL" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5a884815606so4553741e87.0 for ; Mon, 11 May 2026 10:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522098; x=1779126898; 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=O3sOBPcL/gSNMfdxnbbG3+8C99s8vlSyT01BeGyCPngE8ZiWrf/zESoxVXGcBHzWRW 2ZrJDCKZ5ZWQI9U2cWGeS1UCzPuh45Pr/2E0Sf1qbjp0/FrwM9K7gGngwZ+97QghSdYy XIWBcphllWB22ih/ql64HtFJpP/pI9mVLHJmp2zCEJJFkwj/tzpI7gGH6GiYQwkB4+oW plFPAX9cd8l/DveEM3J0NfK4phHRUSTclZPF3wCIhxtcH62SeO6KJIZKdxBZmqyoiddQ Dud2BjkfsG6a24pZzFFKRbOvIZqbNfUv7nT3lyLAdJdCNvpCm6ryyjGN0CvBfJU1flv0 xYIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522098; x=1779126898; 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=Wn1awhJarcIUqn+0UJrtBxw0dfUKOZ/LKbjNZuxRr70QqF0kixxLjjcppbxZFOKDPb UMLH73tPe/NWz9WDRpOMncuj1eFRUEH+x987VCN3M67zctzPYFbt0lbEu2YOFm4QL+cn VLsRGAMduboJ8cv7t/EkYhD/3SEElpe4VYjgkRXO/ZBLkbDraFirULAIddNlcxPrueYb Qq/+J3lgdsiP3dcF3KX7aNUQeYbp+5KVY6BE3xpcAk8zOcJC6hi0eZpsvA/yy9vZZRoI 74BkkAmPMxrkaQLxIkotUBaOo2NTUfzReI383QdiOXpvuoJyWKfrwB2L5sDCPowiVfSl oZBA== X-Forwarded-Encrypted: i=1; AFNElJ/2/C7dokEfM9gVOMWO3fmLt1oOCGKwp0v0Wep1QMDTP4M7MZqQ4u4STZPai8tc2fFxYn9vViXUDGl2DEQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwoUcvBazhycpJ0TK6iygJh05NpMx1n3cV/FFm7EkKfSpTksdtK 0dabLfIfvtHjbzFphhKRcVxjS2yOu/AZKUsc67EoDyiJSxlQJz7oqipmQwRdYg== X-Gm-Gg: Acq92OEimp6xL7qW3QkXdxvWHAQoD//06Jp1zO8hYSrtLpChfuaDxaoMiHQSIvXjFFO KTG3Ktws0k/QOR4TSz1HR2sMsm2Fu+CVTw3hjG+Hs4+m0fn3y5v1unJWy09FF+DzvFpOyaZj82y JhHMHiEqxqfMwplr6c6M+kBAL0xuXMmmXdc+5pox6/TZBOTD+gvmLHpFhsPHXi1XI2H4tYTq5Zv +QjCqlEZ4ZgmJEhRZnUPyHfaqqadX3lvdkIcHfN2m7sFOEojvEooKApDF+e0FG5SrSTQXWTFYi2 ucNlNcadS+erBeJ2htnELEm/5geZFGcj+fKetGHYW2GZ2PPovZL4rHi6ZMBg6aZRHaciUYD+wJL LOX+XKFtpHAIn7ZNCKwMeP+9SEGtDzKvnucOuEpkfJPPs7Vl1GLvAUdO2TcxafsUZxhuYV1iEJx qJ5GNYILDW92mC7xEnEfaQ2u8hnA== X-Received: by 2002:a05:6512:401f:b0:5a2:843f:5800 with SMTP id 2adb3069b0e04-5a887cde847mr8139783e87.23.1778522097566; Mon, 11 May 2026 10:54:57 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:57 -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 v1 10/12] rcu: Document rcu_access_pointer() feeding into cmpxchg() Date: Mon, 11 May 2026 19:54:46 +0200 Message-ID: <20260511175448.153326-11-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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) --- 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 Sat Jun 13 00:35:07 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 4D6CC47CC86 for ; Mon, 11 May 2026 17:55:00 +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=1778522102; cv=none; b=R+9Shy1zoB/Vj8iMufvx5efF62wJz2g3lQMyMm7EK6iqcjRxcTqxbBdQVHphGa/kt/vMlobaP7PL3p/o8i/E4eXthhndxktkfl+bf8USaCtqtQ2PRo2zibVdf5LDN+Z+wFxpj9ngFpE8Nvx2Rby+ICU9suuTc5wYw7Ke6+STxzc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522102; c=relaxed/simple; bh=N1ZRO99Xmu7eMJ4ncdKQ4oBgaMAOlGsvAg+Q2j1/DMo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AfTCNRg9DZyoW4l+QksN/29j9E57jQQUEgsnmfvjIgXS0Lns5qhbOlbsiNg97tStvbExyy9vkSReyYGezoZaSAMx3MqV5Iky2I3ynhAXZ2XFRYN2oBX1ItKN0eoWYGQ3pss1Ikpq4Ww5N646JvZDt23SEGXT0sH9bJpQC6KW3Oc= 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=HZ7cMTqx; 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="HZ7cMTqx" Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-393da8f389bso45939521fa.1 for ; Mon, 11 May 2026 10:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522098; x=1779126898; 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=HZ7cMTqxfT4oI8TfOkrV2pTIkLTUmrbXVDkOZjCXxPU2nSKLkuO6UyaP1XfRceUUf/ 452fjdrXJ6ys2hTuHXWuiRxbSCvUGzrLayG+SDPFPp3PFm+z159Yl3y8Zb53GkQ/bzMd IGVQJKvx5OsKVaX8PF/L0ja/h0Jndln9cs+gpI5EL/qNha1qQQMi2tb/pWeE8mJALTXp yCEsKxnCiPcactCBNfgrx2Cxt+N/e1fQJ8bX2wxpi9iCbVVg7MTadkjcG/GoaDvKDqFD 2QoJaRNg+dhMNVZeq+L6GzD350PZJtuQ+0Uo7auvxqcBuNHYyaYhsA16ikFRqAKClDE8 UQkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522098; x=1779126898; 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=a9k4b90Up2akw9oDMHWQNy+zy3FMC/rlbJXG4l8Tslx6ZKg++8qJp/oSSayI/JwAWq UNVV5zD0UWtQ2BNLLqACrcxHAJUCFGroEwSd6m5dHREZxaUcpkl4qv74qMkdp2o+cu7Z rL9NpTzATDod8qiXYP5EfkuUsx7w3g/g4HBA1CVEedWpouBjq89EvK4dzri3Cx3Owbcy SMpLDrXT5JkIV3oMhP8ZcszsAaIJnBCJInHcNzjHJVrRNCQLdkp6pQfIQmM4rek0w6v6 BxoWNcAHskNJ2Nvyr5A/9xvcpcy2Y29INnCdFbVkRqb1L9iCt8+slNhQ1Ohadkjc9fCQ zpZg== X-Forwarded-Encrypted: i=1; AFNElJ8wkVrcK0EuP766xTUlm86a6HnNVqtIGuvdDtLDWr/XvAigkBwRMLWdTfjd/DaJAhMtUl8uGkHkuTGHdkM=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9+ea96lIJzWqCIyhrSxb43hP8HppHHgL6LTzCfBFS6qhCpbBX GNyan4seUEbxc74xLRYPat0m60UzTfw3sBOIMCUfKu8/tcrQ4fpZQsMK X-Gm-Gg: Acq92OE6kAJNb9JKmKqZ30aCaUbISWpIRacgCmHvS3sdUZc2u3rwMW12340msKl1Svg tyrspoFQsoXxrm6P3yA/lZFpJLxdqqxbBBOieponr8/LO0JeI05JQM5CFvkzzVRoBrG8xlT8k6D k95US3B3mk46GcCV8q3gnj9VkyCm6rUuLMUi1nTGOLocjthhE6XOujqBmEL9WD0mW6s503jtq/Y 0jsNa2QPGtSy3eqphAZVIaug+MMN/KxKk+7zGDWwYJn9a5IDtmheI5sWVPpXRUEy3baRMZIqXuf jtC2KZpYpyXPTILswDqzOvy8BvxKqgPO6gD3C5L/xlJZCP9HbHfXxeNbh0/D0f8PSYrHOPzVVxJ 9y3v0GMcxQjcpzBOUbGuLxBp92YAL8UVRIKeitykr+TqMcF8fIM93sUCk3Hn2cu32vNR+Adwmgq +ielexKLaFKeRrqjo= X-Received: by 2002:a2e:a596:0:b0:392:5c61:c583 with SMTP id 38308e7fff4ca-39408157c68mr38748381fa.23.1778522098290; Mon, 11 May 2026 10:54:58 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:57 -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 v1 11/12] rcu: Latch normal synchronize_rcu() path on flood Date: Mon, 11 May 2026 19:54:47 +0200 Message-ID: <20260511175448.153326-12-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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) --- .../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 Sat Jun 13 00:35:07 2026 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 F05E83128B2 for ; Mon, 11 May 2026 17:55:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522103; cv=none; b=jmFGJW3+m/K5T1i2M7uBepvvuCTkXtAVftJuNGjgCUNPg3d9dk2M0V9YL3djfQtLLhA22+DindxVWjgyJ2sstdQLGG2hb5MPSmO9g/3NxtfCegLEhf3fhj3OWjMH1gxCBblQljcxK9vqc+riAmUoMUKH7JNd2cx9/aDA5JyEDD0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778522103; c=relaxed/simple; bh=aGn8oFIeADYd9zR2os0KsYgOWUkPHLyy0V9cTn+474I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V2ggztHYrHYYVwdudAAlsPB9I6U3P7yH+710HsNoFdDBWc2pePE0moYPQR3vo1wUmALbqAoFDelVXRfdbz/RBaXne868SbbFXVyI4hDXQOKLe8V3xdX8wUH0WadzzMfuyll3lF70Y6MKTPlad1cps0XQkpyjVjnyCGP9KwJyj0s= 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=Q0FMVz/D; arc=none smtp.client-ip=209.85.208.171 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="Q0FMVz/D" Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-39394e1e8f3so38980101fa.1 for ; Mon, 11 May 2026 10:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778522099; x=1779126899; 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=Q0FMVz/DfjFpaoRaB0RxYuo7jZdhUPrwfuiFUnINQLvMVeocPjBfJBp+9eXeYUd3TW cNFJhpPsbm1a6g5AQWuQItnND0ASh0jolLw5CcetOTnb0eJNjIEibZjo0OdhSANmMj3A j2qyzRfqLQ9huM9GgSeVjeDL0O/AcN5ZTJF5P/8vD9thqNWfYqK3ovH9Hzk3w/svsuiZ IIlrfUyFeQ+CxBrAOFBdDeSUuFA0i2TRE9k7QWRcQXeWkAz34x9KefOKiSV9KpNqnNFJ AZqmEDb+G1SpBUNmQpDrFJFG96OnFavuGz8bzxrlorI8KxioRIktsR52vGVf1JFUSXTk kmaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778522099; x=1779126899; 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=l2KEFugx8Eoa62pGlBUPnTx/zLEpULRZo5kQKUVwbD/T9kyeGJZFxYe+14eBnKeKDY /s2+5WOyH78u+qg/leUCTmNJBkmrgx5sIR8gdhk+Jhpm2KlJFM+zMvAmX/4ZHgToNAtd 7Pshwyxrk7FMRFMy29sfqLdArxSjLIVz574/OFzONN/+CFPjxvlpFymoPTiJSNF/kYMG Bz2YUVG7aUKHrm9JhZXGcE88gv+Tj64O3VTZzxhU6sDDiRINdJT5fzOqGX+QtJiYy7x3 WOR86KltxBhQjN/TafaWOsCKn16kdMPiPnnuL4G96obB+SBB/AeDpqzcXN6oIQAv5g2O WBtg== X-Forwarded-Encrypted: i=1; AFNElJ8mzzUm8aeSG7K8HU/h/VKWHXsqCrjTHVs9jKUZDnVgd9qNp1IamWAJGqlqNHRJ9IFLWO5jpaoUVtJzVyc=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+rarMdif6Xpx0V38RLvuFN76HqXoI0BqIo3bvSzL0BTt+RVR9 ghjGocEx6eb6Y1oLs4xLZQqeWlvKm4RmxOluup3AKj0qlw5KNrhmZPn/ X-Gm-Gg: Acq92OH6YMKaYxGSl6dUr2dpnC4hYaRW485Dshpm/iQLgcaiXBO3R4V1fAXy7+hpuHF hRaEOY1K8T+nVsJ7zzdNxbVBW8pBHPF3gPJ6A5FQgqsqqBpGQC9C5OiB05u19hru8SVSieA1wYr 2WXSBjeW291IZCoqe0R2P74R/G5rKfdNw/yjh/ddSiA8P2G5QYB8mVnQ4DlCod2jtIV3yeVHv2K dq3pO1LwJf/LiSy7mMlET83gp7aNWu0tf9T7ec54j9H+IHXfq1uP+itVVk9NIWQ3cziHtQotuAU Phk5eI/ZTa4cYLkaz++Fw83LxPxVSvZlByjJgTC8Y9uxs4gYTe5g8Ln/HcONUat5JZOEiHwpzz5 k15j+H/ZwFbnmV1UZh6KabBWY6MAMmaaxVYTCSzfAs1QPH57SElpxPUxjteLNfASiOQN2tv1UI2 lMJ7hpZ3T+Xwpt4Hw= X-Received: by 2002:a05:6512:6d0:b0:5a8:74c3:5d9b with SMTP id 2adb3069b0e04-5a8b6c5f46fmr3217767e87.0.1778522098929; Mon, 11 May 2026 10:54:58 -0700 (PDT) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f614a5f4sm28968891fa.33.2026.05.11.10.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 10:54:58 -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 v1 12/12] rcu-tasks: Fix possible boot-time tests failed for the call_rcu_tasks() Date: Mon, 11 May 2026 19:54:48 +0200 Message-ID: <20260511175448.153326-13-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260511175448.153326-1-urezki@gmail.com> References: <20260511175448.153326-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