From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.43 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796147344; b=scGDHu1trEGykeQ7fBEEjqBqOV2UyF7D6Pnx4aHVwNcEqg2wzAuFlIxD3y+Po0w4WDgi iuGGX7oL48JWpDo/Whe1R8f1vHaMEHc0pVCEmD1jm81w30wjqJ6TXW2jCpTbQ5QNpQSia YaNGWLl4CW206PKAs2nhJ+jIO1R3UdVAi3mqyHld7whd4DcZh8EMtwGzf43ZtRmQAHzNq e1S2NP0fhCUydVtZb6ITqOb5fD4IsKhnOmXD/ZX3ubImnoTiydH/T2tDR0JKcfW5gO4Cb 3L33cfabQ+IINVdMGUu2Dw3m0V7dzcwV0HhFNjPLIsnkjpS+B26m3TiFf4VYa+D3v+A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796147344; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=VuwAgn+Q2ff28fnYj1qeA5yDYLG8viqvVJeC8E7MNm4=; b=wH9QXneZ5hybcrSS7v5e+Zqc2ix6JQZDVnjG//8mLCW1XiVbO6cvK8c8X7tCAFWH06io vecDlnQMaxiBIQ7rguoi0PHl6t0ePjpDuzY3HQH1Ug7wkYopf1KGLb0okvHG4edBfQkCX NSffeRFI8YBos6zxagKvcnAV3R26GXaz3MIwDnMJjEn1KpY3iYswonGSbljYHK2ing3/t /2ib/Rs8GQ2zPXoJzRyJwLYzAFrwdE/Jcdq2++yF2LcNFBswTrxH4no31tZWu7grjxgY8 fgdHm3zSYzVftP0XOGSTC6SpOnTWpwTAFY2q+vv18jk/xbJMj8PyEfwzRKm+1M/wj+Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=wtGId1Tx; arc=none smtp.remote-ip=209.85.128.43 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53BD2606A322 for ; Tue, 1 Dec 2026 17:49:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 53BD2606A322 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.a=rsa-sha256 header.s=20260707 header.b=wtGId1Tx Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4b79502c27aso122189325e9.1 for ; Tue, 01 Dec 2026 09:49:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796147342; x=1796752142; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=VuwAgn+Q2ff28fnYj1qeA5yDYLG8viqvVJeC8E7MNm4=; b=wtGId1TxRYqsxkftRW1LNr/qnWTnCP0u6z44g4zwwHUd90CiY5DswqnUF2ulAP7p5t nSxlD/mY4fcIljPpHZlSyuyLyzTj7wpKO6r4JOHDOyhDs1LZEX+JEfY7is4cv0b8hoW+ zjJ6pNqynFWeW2tppTjNSTcBbFaUDwL+QOfgyMzhHM6QE62YrdBgti6FjR/Bnd/V+1FA Qc6TBP9nL9i9Lmq73ay9sJ7Au75HqUkrJgT2VyjGz6hyMq0zBccQ9DaMdyKPatwoo9dP ezw720HFuSulMazlQhFuwLZfXiKGP1ycTEU/k2I1bBR4HI9bcJSMSqws/g5NMbqduIuf jsAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796147342; x=1796752142; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=VuwAgn+Q2ff28fnYj1qeA5yDYLG8viqvVJeC8E7MNm4=; b=vV+hP/YcdQT8xBAholts/ZOmHIs5WgmPnLJMZiYmjiZQGXhtydSUJaJ8Kud94raXCg XleED0aub99uN7YSR/Nh5jWmq9AEqmJSPl+v/MQ0xjQKF/Keb9kMGCFbZT8BV1e4M4VJ askwDD7erFSg1/XnGJ6sZdnbpt0SBYWNG3kLx9zpJs1vz/hMvxG/07bekZHilqW5jcwS xqGTXSeTKYvGVh9xqNzQho7CEKw+3CMrlDDV9AHWofbff4rTz2gksBUmk89MUJunhwhZ 1CWyjtO3GH0bvMfT+NqiwV9Z7M9pX4M0HfzocxKot1G7TL86SGM+qZIXkAB0WNQ6QNMl HH4g== X-Forwarded-Encrypted: i=1; AL+hErHfZFDVSXiaLaTHwQTcXJnnCVWgVMNPrEk3u5fT02dwuSUF6F6WZiD+DZVpqqkLU7RofdSQkRZnYSgGEQE=@vger.kernel.org X-Gm-Message-State: APuU4Z8HYCQw6YpjZRhl0OvpCNbs2X1M+LCOhceJ0dYKP0sHArGuVDSB GV0wJdtFRKpI/B/PEeeH9Yqq/RAS//w5TccGV6oe8KoSxOxNV0h3Dd65 X-Gm-Gg: AZFdTZfi3tWUmYnLjBgBGmiYYHDFAU+/jHjtDqE+Nd604k1w70V+PM5sstzgN1Asf0h fbkDOSuLtIR6s6kXHwTL+1V51OwQfFqwQorniHqaCbzWKVQ12zR7a195w5S/wlOMj1x+EncxEKt 4h72wm6Xzqjezn0yzGfsv3kT20bquoKbuA/eH4li4HZSQqMn7jOZi7Zw/uuLMhXtTLgoH/6FJg0 98aQROzFJTvMeKKw5aGLV8v+KEsetN4xTVE5BSdkV2T1ouzrdW813+7W4pejMe7OckC0PFo+TWM qHU3QH8PJOkbQeOuEg+pO0Ia88Rr9qbLiQ6Acdb5XtK2mNqwhv+0+F3sIdu6xSxMjW9+JmIcvPA DBIZhPUax6DtYAeJgGJrD4tRURMZ2Fa30bufeUp3mODYEBovSe6afUHtG4ZVPcEcmGZBso2BmtN uXYxwSg50FXEW+PUa1jU7y7gm9Fk7AI87t1Ye8EJ0sBk/s9BaM7Q2JNAXbf55qLpbD6dvleth2d mcivCIj4u7jH5mDFxNI9QKcoykN2leOfGFyPZOAYIlle0sEhCjq0rVngepeh76wt5UYpd27t9eJ KXQxdW1K3OTiXDjAmDJ1k8QwHEAukYt9TN1iTCR2Lv0Ofj0P0m7qdrN68pFNxX/C47FBLTWXvXO z X-Received: by 2002:a05:600c:828e:b0:4a1:e6a9:4086 with SMTP id 5b1f17b1804b1-4bb88785a99mr710619405e9.0.1796147341464; Tue, 01 Dec 2026 09:49:01 -0800 (PST) Received: from andreayoga.wind3.hub ([31.189.39.21]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb884b8429sm1620932075e9.14.2026.12.01.09.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 09:49:01 -0800 (PST) From: Andrea Parri To: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki Cc: Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcu-tasks: Raise ->percpu_dequeue_lim before enqueueing on new queues Date: Tue, 1 Dec 2026 18:48:49 +0100 Message-ID: <20261201174856.70795-1-parri.andrea@gmail.com> X-Mailer: git-send-email 2.53.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When call_rcu_tasks_generic() sees enough lock contention, it switches to per-CPU callback queues by setting ->percpu_enqueue_shift to zero and then raising ->percpu_dequeue_lim to rcu_task_cpu_ids. Between the two stores, another CPU can enqueue onto its own queue while the scans in rcu_barrier_tasks_generic() and rcu_tasks_need_gpcb() still stop at CPU 0: CPU 0 CPU 1 ----- ----- call_rcu_tasks_generic() ->percpu_enqueue_shift = 0 call_rcu_tasks(rhp, cb) enqueue on CPU 1's queue rcu_barrier_tasks() ->percpu_dequeue_lim == 1 entrain on CPU 0's queue only ->percpu_dequeue_lim = rcu_task_cpu_ids rcu_barrier_tasks() can then return before cb() is invoked, so a caller that frees what cb() uses, or unloads the module containing cb(), could have cb() run afterwards. rcu_tasks_need_gpcb() can likewise skip CPU 1's queue and delay the callback's grace period. Raise ->percpu_dequeue_lim first and clear ->percpu_enqueue_shift with smp_store_release(), so the scans cover a queue before any CPU can pick it. The READ_ONCE() of the shift then needs no acquire. For rcu_barrier_tasks_generic(), the full ordering of rcu_segcblist_inc_len() on enqueue puts the load of the shift before the barrier's load of ->percpu_dequeue_lim, or of ->barrier_q_seq when rcu_seq_done() makes it rely on a concurrent barrier. rcu_tasks_need_gpcb() loads the limit after rcuwait barrier (A), which pairs with (B) in rcuwait_wake_up(). With a test-only 1000 ms mdelay() between the two stores, an 8-CPU guest flooding call_rcu_tasks() from CPUs 2-7, with CPU 1 looping on call_rcu_tasks() and rcu_barrier_tasks(), saw the barrier return early 7 times in 1498 iterations; with this patch, 0 times in 1372. Without the delay, the unpatched kernel showed no failure in 1128. The bug was found with the help of an LLM, which was also used to write the fix, the changelog and the tests. Fixes: 00a8b4b54cd6 ("rcu-tasks: Set ->percpu_enqueue_shift to zero upon contention") Signed-off-by: Andrea Parri --- The existing smp_store_release() of ->percpu_enqueue_lim no longer pairs with any acquire: commit 2cee0789b458 ("rcu-tasks: Use separate ->percpu_dequeue_lim for callback dequeueing") moved the smp_load_acquire() calls to ->percpu_dequeue_lim, and the remaining readers, apart from diagnostics, either hold ->cbs_gbl_lock or only use the value to decide whether to take that lock and check again. This patch leaves it, and the one in the collapse path, unchanged to keep the fix minimal. I can send a follow-up that turns both into WRITE_ONCE() if that is wanted. The test numbers in the changelog come from the out-of-tree module and the test-only delay listed below, run on x86_64 under virtme-ng with 8 vCPUs. The kernel was configured with "vng --kconfig" plus CONFIG_RCU_EXPERT=y, CONFIG_FORCE_TASKS_RCU=y, CONFIG_DYNAMIC_DEBUG=y, CONFIG_DETECT_HUNG_TASK=y and CONFIG_RCU_TORTURE_TEST=y (the boot-time rcutorture run provided background load), and booted with: update.dyndbg=+p rcupdate.rcu_task_contend_lim=0 rcupdate.rcu_task_expand_delay_ms=1000 followed by "insmod rtx_test.ko duration_s=1200" and a check of the "rtx_test: done: checks=N early_barrier_returns=M" line. A contention limit of 0 makes the queues expand on any lock contention, and update.dyndbg=+p prints the "Switching RCU Tasks to per-CPU callback queuing." message for each expansion: the two 1200-second runs saw 390 and 384. The no-delay run omits rcupdate.rcu_task_expand_delay_ms and uses duration_s=600. Test-only delay, shown on top of this patch. On v7.4-rc5 the mdelay() goes between the two WRITE_ONCE() calls instead: diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 14ad1c84a4057..bb0d36b281fa2 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -180,6 +180,8 @@ static int rcu_task_collapse_lim __read_mostly = 10; module_param(rcu_task_collapse_lim, int, 0444); static int rcu_task_lazy_lim __read_mostly = 32; module_param(rcu_task_lazy_lim, int, 0444); +static int rcu_task_expand_delay_ms; /* TEST ONLY */ +module_param(rcu_task_expand_delay_ms, int, 0644); static int rcu_task_cpu_ids; @@ -397,6 +399,8 @@ static void call_rcu_tasks_generic(struct rcu_head *rhp, rcu_callback_t func, // the full ordering of rcu_segcblist_inc_len() when // the callback is queued; for rcu_tasks_need_gpcb(), // with barriers (A) and (B) of rcuwait. + if (rcu_task_expand_delay_ms) /* TEST ONLY: widen race window. */ + mdelay(rcu_task_expand_delay_ms); smp_store_release(&rtp->percpu_enqueue_shift, 0); smp_store_release(&rtp->percpu_enqueue_lim, rcu_task_cpu_ids); pr_debug("Switching %s to per-CPU callback queuing.\n", rtp->name); Test module (rtx_test.c, built with "obj-m := rtx_test.o"): // SPDX-License-Identifier: GPL-2.0 /* * Test for the RCU Tasks queue-expansion race in call_rcu_tasks_generic(): * ->percpu_enqueue_shift is set to 0 before ->percpu_dequeue_lim is raised, * so a callback can land on a per-CPU queue that rcu_barrier_tasks() and * rcu_tasks_need_gpcb() do not yet scan. * * Flooders on CPUs >= 2 generate bursts of call_rcu_tasks() to trigger * contention (expansion), then go quiet so the queues collapse again. * The checker on CPU 1 repeatedly does call_rcu_tasks() + rcu_barrier_tasks() * and verifies that its callback was invoked before the barrier returned. */ #include #include #include #include #include #include #include static int burst_ms = 200; module_param(burst_ms, int, 0444); static int quiet_ms = 1500; module_param(quiet_ms, int, 0444); static int duration_s = 120; module_param(duration_s, int, 0444); static struct task_struct *checker_task; static struct task_struct *flood_tasks[NR_CPUS]; static atomic_long_t flood_cbs_outstanding; static atomic_long_t n_flood_cbs; static unsigned long n_checks, n_early; static unsigned long end_jiffies; static void flood_cb(struct rcu_head *rhp) { kfree(rhp); atomic_long_dec(&flood_cbs_outstanding); } static int flood_fn(void *arg) { while (!kthread_should_stop() && time_before(jiffies, end_jiffies)) { unsigned long period = msecs_to_jiffies(burst_ms + quiet_ms); unsigned long phase = jiffies % period; if (phase < msecs_to_jiffies(burst_ms) && atomic_long_read(&flood_cbs_outstanding) < 1000000) { struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_KERNEL); if (rhp) { atomic_long_inc(&flood_cbs_outstanding); call_rcu_tasks(rhp, flood_cb); atomic_long_inc(&n_flood_cbs); } cond_resched(); } else { schedule_timeout_interruptible(1); } } while (!kthread_should_stop()) schedule_timeout_interruptible(HZ); return 0; } struct check_head { struct rcu_head rh; int invoked; }; static void check_cb(struct rcu_head *rhp) { struct check_head *ch = container_of(rhp, struct check_head, rh); smp_store_release(&ch->invoked, 1); } static int checker_fn(void *arg) { struct check_head ch; while (!kthread_should_stop() && time_before(jiffies, end_jiffies)) { ch.invoked = 0; call_rcu_tasks(&ch.rh, check_cb); rcu_barrier_tasks(); n_checks++; if (!smp_load_acquire(&ch.invoked)) { unsigned long t0 = jiffies; n_early++; while (!smp_load_acquire(&ch.invoked)) schedule_timeout_interruptible(1); pr_err("rtx_test: rcu_barrier_tasks() returned before callback invoked (check %lu, early #%lu, cb invoked %u ms later)\n", n_checks, n_early, jiffies_to_msecs(jiffies - t0)); } } pr_info("rtx_test: done: checks=%lu early_barrier_returns=%lu flood_cbs=%ld\n", n_checks, n_early, atomic_long_read(&n_flood_cbs)); while (!kthread_should_stop()) schedule_timeout_interruptible(HZ); return 0; } static int __init rtx_init(void) { int cpu; end_jiffies = jiffies + duration_s * HZ; /* Create the checker first: on failure no flooder has started. */ checker_task = kthread_create_on_cpu(checker_fn, NULL, 1, "rtx_check/%u"); if (IS_ERR(checker_task)) return PTR_ERR(checker_task); for_each_online_cpu(cpu) { if (cpu < 2) continue; flood_tasks[cpu] = kthread_create_on_cpu(flood_fn, NULL, cpu, "rtx_flood/%u"); if (!IS_ERR(flood_tasks[cpu])) wake_up_process(flood_tasks[cpu]); else flood_tasks[cpu] = NULL; } wake_up_process(checker_task); return 0; } static void __exit rtx_exit(void) { int cpu; kthread_stop(checker_task); for_each_online_cpu(cpu) if (flood_tasks[cpu]) kthread_stop(flood_tasks[cpu]); rcu_barrier_tasks(); } module_init(rtx_init); module_exit(rtx_exit); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("RCU Tasks queue-expansion race test"); The ordering was also checked with herd7 (tools/memory-model, linux-kernel.cfg). With this patch, the outcome where CPU 1 sees the zero shift but the old ->percpu_dequeue_lim is still used is "Never" for rcu_barrier_tasks() after call_rcu_tasks(), both when it scans the queues itself and when rcu_seq_done() makes it rely on a concurrent barrier, and for rcu_tasks_need_gpcb() when rcuwait_wake_up() finds no waiter. When it finds one, wake_up_process() makes the kthread scan again. With the current store order, all three are "Sometimes". The early-return case is also "Sometimes" with this patch if the model leaves out the full ordering of rcu_segcblist_inc_len(). The three tests with this patch are: C rtx-same-task (* * P0: expansion with fix (dequeue_lim first, then release shift). * P1: call_rcu_tasks() reads shift and enqueues (full ordering of * rcu_segcblist_inc_len()), then rcu_barrier_tasks() scans: * smp_load_acquire(dequeue_lim). *) { lim=1; shift=3; } P0(int *lim, int *shift) { WRITE_ONCE(*lim, 8); smp_store_release(shift, 0); } P1(int *lim, int *shift) { int r0; int r1; r0 = READ_ONCE(*shift); smp_mb(); r1 = smp_load_acquire(lim); } exists (1:r0=0 /\ 1:r1=1) C rtx-barrier-fastpath (* * P0: expansion with fix (dequeue_lim first, then release shift). * P1: call_rcu_tasks() reads shift and enqueues (full ordering of * rcu_segcblist_inc_len()), then rcu_barrier_tasks() reads * barrier_q_seq in rcu_seq_snap(). * P2: a concurrent rcu_barrier_tasks(): rcu_seq_start() (store, then * smp_mb()), then smp_load_acquire(dequeue_lim). * Bad outcome: P1 used a per-CPU queue and its snapshot predates P2's * start, so P1 returns early via rcu_seq_done() and relies on P2's * scan, yet P2 scanned with the old dequeue_lim. *) { lim=1; shift=3; seq=0; } P0(int *lim, int *shift) { WRITE_ONCE(*lim, 8); smp_store_release(shift, 0); } P1(int *shift, int *seq) { int r0; int r1; r0 = READ_ONCE(*shift); smp_mb(); r1 = READ_ONCE(*seq); } P2(int *lim, int *seq) { int r2; WRITE_ONCE(*seq, 1); smp_mb(); r2 = smp_load_acquire(lim); } exists (1:r0=0 /\ 1:r1=0 /\ 2:r2=1) C rtx-kthread (* * P0: expansion with fix. * P1: call_rcu_tasks() on CPU 1: reads shift, enqueues on queue 1, * later rcuwait_wake_up(): smp_mb() (B), then reads w->task. * P2: rcu_tasks kthread: registers/sets state, smp_mb(), then * rcu_tasks_need_gpcb() reads dequeue_lim. * Bad outcome: P1 used per-CPU queue, saw no sleeper to wake, and the * kthread scanned with the old dequeue_lim. *) { lim=1; shift=3; task=0; } P0(int *lim, int *shift) { WRITE_ONCE(*lim, 8); smp_store_release(shift, 0); } P1(int *shift, int *task) { int r0; int r1; r0 = READ_ONCE(*shift); smp_mb(); r1 = READ_ONCE(*task); } P2(int *lim, int *task) { int r2; WRITE_ONCE(*task, 1); smp_mb(); r2 = smp_load_acquire(lim); } exists (1:r0=0 /\ 1:r1=0 /\ 2:r2=1) kernel/rcu/tasks.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 743f777b4c18f..14ad1c84a4057 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -353,6 +353,7 @@ static void call_rcu_tasks_generic(struct rcu_head *rhp, rcu_callback_t func, rhp->func = func; local_irq_save(flags); rcu_read_lock(); + // READ_ONCE() suffices, see the switch to per-CPU queuing below. ideal_cpu = smp_processor_id() >> READ_ONCE(rtp->percpu_enqueue_shift); chosen_cpu = cpumask_next(ideal_cpu - 1, cpu_possible_mask); WARN_ON_ONCE(chosen_cpu >= rcu_task_cpu_ids); @@ -387,8 +388,16 @@ static void call_rcu_tasks_generic(struct rcu_head *rhp, rcu_callback_t func, if (unlikely(needadjust)) { raw_spin_lock_irqsave(&rtp->cbs_gbl_lock, flags); if (rtp->percpu_enqueue_lim != rcu_task_cpu_ids) { - WRITE_ONCE(rtp->percpu_enqueue_shift, 0); WRITE_ONCE(rtp->percpu_dequeue_lim, rcu_task_cpu_ids); + // Clear the shift only after raising the dequeue + // limit, so that rcu_barrier_tasks_generic() and + // rcu_tasks_need_gpcb() scan every queue that a CPU + // can pick once it sees a zero shift. For + // rcu_barrier_tasks_generic(), the release pairs with + // the full ordering of rcu_segcblist_inc_len() when + // the callback is queued; for rcu_tasks_need_gpcb(), + // with barriers (A) and (B) of rcuwait. + smp_store_release(&rtp->percpu_enqueue_shift, 0); smp_store_release(&rtp->percpu_enqueue_lim, rcu_task_cpu_ids); pr_debug("Switching %s to per-CPU callback queuing.\n", rtp->name); } base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244 -- 2.53.0