From nobody Sun Feb 8 05:30:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53911C001DC for ; Sat, 29 Jul 2023 14:28:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231978AbjG2O2z (ORCPT ); Sat, 29 Jul 2023 10:28:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231687AbjG2O2x (ORCPT ); Sat, 29 Jul 2023 10:28:53 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8DDE3C38 for ; Sat, 29 Jul 2023 07:28:26 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-76c9e9642b1so38959185a.3 for ; Sat, 29 Jul 2023 07:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1690640896; x=1691245696; 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=iwxEGA9bB7b0DElBaIYcQs9XoGIY+NHTZRuaPpVwP9M=; b=bgVc8RgM8MUE3/FR/qxJAAVnZPDSL8B/L8Y55nDBH4dQN+gKdet8DkRYtYGE5rhJKB 5PFNZ2s+lGod3ijPAm+7YYjP7qeW1FBV3BCBrlG7+C52Vjzf4HQApIQy+8ztJrApuvFA jh0kfZEj3pdfu2H7JHKa7COI15JG/bknJpcRI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690640896; x=1691245696; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iwxEGA9bB7b0DElBaIYcQs9XoGIY+NHTZRuaPpVwP9M=; b=GL+nNzu6yFALb0OEZnhSzJ5S796vLIKy5H6qmY/t1gk32XzhyX4+Nrt2poDo5IGifc W4hgfT2LWvlZ5/2LHDKb0hDKO+WDaCA4e5cyHZd8+iIyNWIRpj4MTV8vOzfJB3ftDSig hN1IqP4ZG3jycxAgMoO+gOdY+9JLFrOUxx+JzhK+Pe568wijVi+gGHXKydZYY/nn5oyg Q2bAX8vynayVAGAC4gxrGh7rwnkoeAXfAKXpbyjz6kGhYYNf1Tw/X5giaMcF2hux5RVL mHIq8C/oQiAL3HLfdFEAUe6q4BXRiK9uaB8jc2IIfiZ+Eld5Ceh5IM9WuNZkBPHw5FKP larg== X-Gm-Message-State: ABy/qLZKMOSotV6gF4aPhIEqepJVcri6NPMH0cqDX5aXNo7BOYNJ7Guw o8qPO4BXOGp4J95oig5vzJ1ucizxmCs7CbwlEGE= X-Google-Smtp-Source: APBJJlFk+pVi5ucHAZ4YN78zym81iXhYotkmEVyM8rGXoNXNjoUsMje3qOOrHrpWOnLI579JZtCj9g== X-Received: by 2002:a92:cdab:0:b0:348:8050:d7a with SMTP id g11-20020a92cdab000000b0034880500d7amr3082832ild.30.1690640875892; Sat, 29 Jul 2023 07:27:55 -0700 (PDT) Received: from joelboxx5.c.googlers.com.com (254.82.172.34.bc.googleusercontent.com. [34.172.82.254]) by smtp.gmail.com with ESMTPSA id q9-20020a0566380ec900b0042b35c7b8c5sm1855362jas.61.2023.07.29.07.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jul 2023 07:27:55 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: rcu@vger.kernel.org, paulmck@kernel.org, "Joel Fernandes (Google)" , stable@vger.kernel.org, Davidlohr Bueso , Josh Triplett Subject: [PATCH v2 1/5] rcutorture: Fix stuttering races and other issues Date: Sat, 29 Jul 2023 14:27:31 +0000 Message-ID: <20230729142738.222208-2-joel@joelfernandes.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729142738.222208-1-joel@joelfernandes.org> References: <20230729142738.222208-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The stuttering code isn't functioning as expected. Ideally, it should pause the torture threads for a designated period before resuming. Yet, it fails to halt the test for the correct duration. Additionally, a race condition exists, potentially causing the stuttering code to pause for an extended period if the 'spt' variable is non-zero due to the stutter orchestration thread's inadequate CPU time. Moreover, over-stuttering can hinder RCU's progress on TREE07 kernels. This happens as the stuttering code may run within a softirq due to RCU callbacks. Consequently, ksoftirqd keeps a CPU busy for several seconds, thus obstructing RCU's progress. This situation triggers a warning message in the logs: [ 2169.481783] rcu_torture_writer: rtort_pipe_count: 9 This warning suggests that an RCU torture object, although invisible to RCU readers, couldn't make it past the pipe array and be freed -- a strong indication that there weren't enough grace periods during the stutter interval. To address these issues, this patch sets the "stutter end" time to an absolute point in the future set by the main stutter thread. This is then used for waiting in stutter_wait(). While the stutter thread still defines this absolute time, the waiters' waiting logic doesn't rely on the stutter thread receiving sufficient CPU time to halt the stuttering as the halting is now self-controlled. Cc: stable@vger.kernel.org Signed-off-by: Joel Fernandes (Google) --- kernel/torture.c | 45 ++++++++++++--------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/kernel/torture.c b/kernel/torture.c index 6ba62e5993e7..fd353f98162f 100644 --- a/kernel/torture.c +++ b/kernel/torture.c @@ -720,7 +720,7 @@ static void torture_shutdown_cleanup(void) * suddenly applied to or removed from the system. */ static struct task_struct *stutter_task; -static int stutter_pause_test; +static ktime_t stutter_till_abs_time; static int stutter; static int stutter_gap; =20 @@ -730,30 +730,16 @@ static int stutter_gap; */ bool stutter_wait(const char *title) { - unsigned int i =3D 0; bool ret =3D false; - int spt; + ktime_t till_ns; =20 cond_resched_tasks_rcu_qs(); - spt =3D READ_ONCE(stutter_pause_test); - for (; spt; spt =3D READ_ONCE(stutter_pause_test)) { - if (!ret && !rt_task(current)) { - sched_set_normal(current, MAX_NICE); - ret =3D true; - } - if (spt =3D=3D 1) { - torture_hrtimeout_jiffies(1, NULL); - } else if (spt =3D=3D 2) { - while (READ_ONCE(stutter_pause_test)) { - if (!(i++ & 0xffff)) - torture_hrtimeout_us(10, 0, NULL); - cond_resched(); - } - } else { - torture_hrtimeout_jiffies(round_jiffies_relative(HZ), NULL); - } - torture_shutdown_absorb(title); + till_ns =3D READ_ONCE(stutter_till_abs_time); + if (till_ns && ktime_before(ktime_get(), till_ns)) { + torture_hrtimeout_ns(till_ns, 0, HRTIMER_MODE_ABS, NULL); + ret =3D true; } + torture_shutdown_absorb(title); return ret; } EXPORT_SYMBOL_GPL(stutter_wait); @@ -764,23 +750,16 @@ EXPORT_SYMBOL_GPL(stutter_wait); */ static int torture_stutter(void *arg) { - DEFINE_TORTURE_RANDOM(rand); - int wtime; + ktime_t till_ns; =20 VERBOSE_TOROUT_STRING("torture_stutter task started"); do { if (!torture_must_stop() && stutter > 1) { - wtime =3D stutter; - if (stutter > 2) { - WRITE_ONCE(stutter_pause_test, 1); - wtime =3D stutter - 3; - torture_hrtimeout_jiffies(wtime, &rand); - wtime =3D 2; - } - WRITE_ONCE(stutter_pause_test, 2); - torture_hrtimeout_jiffies(wtime, NULL); + till_ns =3D ktime_add_ns(ktime_get(), + jiffies_to_nsecs(stutter)); + WRITE_ONCE(stutter_till_abs_time, till_ns); + torture_hrtimeout_jiffies(stutter - 1, NULL); } - WRITE_ONCE(stutter_pause_test, 0); if (!torture_must_stop()) torture_hrtimeout_jiffies(stutter_gap, NULL); torture_shutdown_absorb("torture_stutter"); --=20 2.41.0.487.g6d72f3e995-goog From nobody Sun Feb 8 05:30:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 141D1C41513 for ; Sat, 29 Jul 2023 14:28:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231950AbjG2O2D (ORCPT ); Sat, 29 Jul 2023 10:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231918AbjG2O16 (ORCPT ); Sat, 29 Jul 2023 10:27:58 -0400 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE3162686 for ; Sat, 29 Jul 2023 07:27:57 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-348de515667so13590085ab.1 for ; Sat, 29 Jul 2023 07:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1690640877; x=1691245677; 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=K/AP9GOcXVQHz8AOI7UjuaU+sYzEqAzG6F3W2fxwbBg=; b=J4kyjvgZ82W4wgXCeEeMZsVCguRFpikKkcE2HcgJj1qeY7vt+QnMIYGWOOT+WB4w/d QxBIq/qctXIL+Pq+QR5781uOJJWRU23mvLFOkz/5oH2U307qLuDCMVxppr9LWan2wYgB x4GjVCbkk7A28bEYLtEBKdloUvZLupH9Z4E6M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690640877; x=1691245677; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K/AP9GOcXVQHz8AOI7UjuaU+sYzEqAzG6F3W2fxwbBg=; b=MmbCjhmnhhzS+cV4pIno0bermGYFpi59srOVhM0NWii3lzPecxpKkPEaGBy/7RwRVl UK+6r8rJk8niLD1yqz9UN9jtDByXARzXI6kxS7WQI6Mq2OlYAGVEZuqsjMDeiZci4A5D SHUAZcdZkejHdiiu+KYq8JRi9UD39xy2botbHI28KX7b88RMhboc69WVKacaOZY0lR6m zxmGPI3ZyL1c8m8y0oKto2S+vPCZCrf5sISflUC+rP7WGGmtLC4u6BrZIOtnDmrrKGeK tBfV5b+jAy1B03izf/cO7nSJmsVW8TeUn+JuqlLtJLYzUBhoaZH/5sBG+uprfSIsZk6P CtiQ== X-Gm-Message-State: ABy/qLZTWYXoW924/o/fA03kK1INuyktAARTGlttc/NWM62t8weZ6Wmf +lJ3wWqNwi2aO3N18jLq7F1wemR1BvUf2BhPS4A= X-Google-Smtp-Source: APBJJlE8nBeVkXcUMALJORNmqTh8c7r1ht4vw0YPrIrwKi+ZvPe7AoO4UA+ZLaLbe2+FsI5VCRzahg== X-Received: by 2002:a92:c7c1:0:b0:345:ad81:ecaf with SMTP id g1-20020a92c7c1000000b00345ad81ecafmr2084447ilk.3.1690640876885; Sat, 29 Jul 2023 07:27:56 -0700 (PDT) Received: from joelboxx5.c.googlers.com.com (254.82.172.34.bc.googleusercontent.com. [34.172.82.254]) by smtp.gmail.com with ESMTPSA id q9-20020a0566380ec900b0042b35c7b8c5sm1855362jas.61.2023.07.29.07.27.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jul 2023 07:27:56 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: rcu@vger.kernel.org, paulmck@kernel.org, "Joel Fernandes (Google)" , Lai Jiangshan , Josh Triplett , Steven Rostedt , Mathieu Desnoyers Subject: [PATCH v2 2/5] srcu: Fix error handling in init_srcu_struct_fields() Date: Sat, 29 Jul 2023 14:27:32 +0000 Message-ID: <20230729142738.222208-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729142738.222208-1-joel@joelfernandes.org> References: <20230729142738.222208-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The current error handling in init_srcu_struct_fields() is a bit inconsistent. If init_srcu_struct_nodes() fails, the function either returns -ENOMEM or 0 depending on whether ssp->sda_is_static is true or false. This can make init_srcu_struct_fields() return 0 even if memory allocation failed! Simplify the error handling by always returning -ENOMEM if either init_srcu_struct_nodes() or the per-CPU allocation fails. This makes the control flow easier to follow and avoids the inconsistent return values. Add goto labels to avoid duplicating the error cleanup code. Link: https://lore.kernel.org/r/20230404003508.GA254019@google.com Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/srcutree.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index 20d7a238d675..f1a905200fc2 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -255,29 +255,31 @@ static int init_srcu_struct_fields(struct srcu_struct= *ssp, bool is_static) ssp->srcu_sup->sda_is_static =3D is_static; if (!is_static) ssp->sda =3D alloc_percpu(struct srcu_data); - if (!ssp->sda) { - if (!is_static) - kfree(ssp->srcu_sup); - return -ENOMEM; - } + if (!ssp->sda) + goto err_free_sup; init_srcu_struct_data(ssp); ssp->srcu_sup->srcu_gp_seq_needed_exp =3D 0; ssp->srcu_sup->srcu_last_gp_end =3D ktime_get_mono_fast_ns(); if (READ_ONCE(ssp->srcu_sup->srcu_size_state) =3D=3D SRCU_SIZE_SMALL && S= RCU_SIZING_IS_INIT()) { - if (!init_srcu_struct_nodes(ssp, GFP_ATOMIC)) { - if (!ssp->srcu_sup->sda_is_static) { - free_percpu(ssp->sda); - ssp->sda =3D NULL; - kfree(ssp->srcu_sup); - return -ENOMEM; - } - } else { - WRITE_ONCE(ssp->srcu_sup->srcu_size_state, SRCU_SIZE_BIG); - } + if (!init_srcu_struct_nodes(ssp, GFP_ATOMIC)) + goto err_free_sda; + WRITE_ONCE(ssp->srcu_sup->srcu_size_state, SRCU_SIZE_BIG); } ssp->srcu_sup->srcu_ssp =3D ssp; smp_store_release(&ssp->srcu_sup->srcu_gp_seq_needed, 0); /* Init done. */ return 0; + +err_free_sda: + if (!is_static) { + free_percpu(ssp->sda); + ssp->sda =3D NULL; + } +err_free_sup: + if (!is_static) { + kfree(ssp->srcu_sup); + ssp->srcu_sup =3D NULL; + } + return -ENOMEM; } =20 #ifdef CONFIG_DEBUG_LOCK_ALLOC --=20 2.41.0.487.g6d72f3e995-goog From nobody Sun Feb 8 05:30:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE9EDC00528 for ; Sat, 29 Jul 2023 14:28:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231972AbjG2O2F (ORCPT ); Sat, 29 Jul 2023 10:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbjG2O17 (ORCPT ); Sat, 29 Jul 2023 10:27:59 -0400 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBA4AE7A for ; Sat, 29 Jul 2023 07:27:58 -0700 (PDT) Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-34914684b62so353225ab.3 for ; Sat, 29 Jul 2023 07:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1690640878; x=1691245678; 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=B6faQrb3vVDF+1ZA3HcLro9nEgsaXGn2RtvbxbNNEvc=; b=plXTHquWdh4bDvLFn2iXXCHJmvv/+MoXo8lRqYopE64G7FgOHv+cnT2c05bBwokNCo f2+s+ItwB5Hhqd7VCNCKAVOINhdBw91B9XtHD1TQBm0bxbtcj/QaCeXNKMY+P2vShgB/ AyVO2DIkMfhumM/yGpIR5gkL7/1244kpfN2Zs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690640878; x=1691245678; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B6faQrb3vVDF+1ZA3HcLro9nEgsaXGn2RtvbxbNNEvc=; b=Qya9OLad6LWWqBl07H2mxVxYhEwybDTGI+KqTfMcxOhbCdMC3ygr4spgmQbAsmAtiA 2jrq6ZTQGy2Q1J2cxo7PzjR8J2lK3Uqf8UAAbK1DT5ou+YxEDaIaQiFpHCFAeZwe/TLN jPPufDPnBl6U2Lk2LPlkfnqx1RSrjLkfu96NZzB/BJuNNOhhhuuIbH22dEjQCkUxHC5T e87m/WYDzwZSHOYfOqD8BKs2o3V915L9df5Np87m69QYNuwnuafJb/FmMDarG6w45/nV Lkz7MMdVMMZEBiP7n1vXLX9lFO5XzRFATb1rm8hbwIs5FxkFo9ygSjZN6pwAv4sYnTfO 8dgw== X-Gm-Message-State: ABy/qLYYumvClh7ASHJUR/cAnsWEdQH6J7SLfTsVbZWukv30j0YHoFvC JMTq/eeRnKu/zCy8vc691TqPOeODkh8ccmlQGJo= X-Google-Smtp-Source: APBJJlHK/5GmyzQgFG1Ksqn6znBGEhc+zRSHdPwsSlZO5dCGgHvfR+k/CmjuBsoXHLn5orj/tiR73g== X-Received: by 2002:a05:6e02:1d94:b0:348:f6cb:e585 with SMTP id h20-20020a056e021d9400b00348f6cbe585mr2922758ila.30.1690640877759; Sat, 29 Jul 2023 07:27:57 -0700 (PDT) Received: from joelboxx5.c.googlers.com.com (254.82.172.34.bc.googleusercontent.com. [34.172.82.254]) by smtp.gmail.com with ESMTPSA id q9-20020a0566380ec900b0042b35c7b8c5sm1855362jas.61.2023.07.29.07.27.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jul 2023 07:27:57 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: rcu@vger.kernel.org, paulmck@kernel.org, "Joel Fernandes (Google)" , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang Subject: [PATCH v2 3/5] tree/nocb: Adjust RCU_NOCB_WAKE_* macros from weaker to stronger Date: Sat, 29 Jul 2023 14:27:33 +0000 Message-ID: <20230729142738.222208-4-joel@joelfernandes.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729142738.222208-1-joel@joelfernandes.org> References: <20230729142738.222208-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This is needed to make the next patch work correctly as we rely on the strength of the wakeup when comparing deferred-wakeup types across different CPUs. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index 192536916f9a..0f40a9c2b78d 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h @@ -288,8 +288,8 @@ struct rcu_data { =20 /* Values for nocb_defer_wakeup field in struct rcu_data. */ #define RCU_NOCB_WAKE_NOT 0 -#define RCU_NOCB_WAKE_BYPASS 1 -#define RCU_NOCB_WAKE_LAZY 2 +#define RCU_NOCB_WAKE_LAZY 1 +#define RCU_NOCB_WAKE_BYPASS 2 #define RCU_NOCB_WAKE 3 #define RCU_NOCB_WAKE_FORCE 4 =20 --=20 2.41.0.487.g6d72f3e995-goog From nobody Sun Feb 8 05:30:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBF4AC001DC for ; Sat, 29 Jul 2023 14:28:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232010AbjG2O2J (ORCPT ); Sat, 29 Jul 2023 10:28:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231919AbjG2O2B (ORCPT ); Sat, 29 Jul 2023 10:28:01 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF95A30F4 for ; Sat, 29 Jul 2023 07:27:59 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-76c64da0e46so142001639f.0 for ; Sat, 29 Jul 2023 07:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1690640879; x=1691245679; 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=0DIiXFGh73Irk8k8jfSTlgn3pzuU9BPg/xYZpIge3SA=; b=HsW5SYF4O4C1xrNtb8sm4pRTfnrrViTLGL7v+Gn/Ah7UCbBgZ2opbMTyrHiGdhoaEn gcNOhQcOz0QL2+Q2P4xe34TxFbuIhXlf9EExkeLpiag6Pz3CQW2C2PScS3kCNl4lYs5+ 6y9zYLXR2axTa6ZjwfeIofwo3CIgGps6icYMg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690640879; x=1691245679; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0DIiXFGh73Irk8k8jfSTlgn3pzuU9BPg/xYZpIge3SA=; b=ft8y3Iq4Nybu4vm7/hYZgp1feZWmww1GxCj818YvKVSlUW2jxXu5XVL6IEdICMBnkS S6FCuUNlegiFgDsGwtJQDrALIDR0zK+sl2zKt8tpl4BbR748br0/B9yhu2XoMk9ERDlB 1qyUX/MvhClR6LrZVAyc8noyuEdfB1p/fRxLgdyRup2dTUgiQbOzN2Xlu48QexXTs9kb nmWatmuLUNaHjxpoOIzqt6GHVr+RoHt5UxvYiVGzeHIHRYS+l6bi/jA2lCY/1p2mzw1F 65drC8hTQbQJvx49DatGA11JP0toDmJYJhJ2BUTKDv8PRcw/xxNtdj9qk+raWosg04Ou pW9g== X-Gm-Message-State: ABy/qLYsRLFSYm9oGi3tkz9D9r5NmMmTy3kr2Chw33ArQWZD3I+5Bwre JxHEUVLy0+DCoB4t7feHnVa2lc8XuV3yVGmgFkI= X-Google-Smtp-Source: APBJJlGcgY471iiH1xZgoLcliih5C9aIWb1vc/SB0/AH9RPxwH+38J4y3R/0f9F30AOyyZrL/iE+Xg== X-Received: by 2002:a5e:a90c:0:b0:787:34d:f223 with SMTP id c12-20020a5ea90c000000b00787034df223mr2373322iod.11.1690640878695; Sat, 29 Jul 2023 07:27:58 -0700 (PDT) Received: from joelboxx5.c.googlers.com.com (254.82.172.34.bc.googleusercontent.com. [34.172.82.254]) by smtp.gmail.com with ESMTPSA id q9-20020a0566380ec900b0042b35c7b8c5sm1855362jas.61.2023.07.29.07.27.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jul 2023 07:27:58 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: rcu@vger.kernel.org, paulmck@kernel.org, "Joel Fernandes (Google)" , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang Subject: [PATCH v2 4/5] tree/nocb: Improve readability of nocb_gp_wait() Date: Sat, 29 Jul 2023 14:27:34 +0000 Message-ID: <20230729142738.222208-5-joel@joelfernandes.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729142738.222208-1-joel@joelfernandes.org> References: <20230729142738.222208-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The nocb_gp_wait() function contains logic to check each rdp's bypass list, flush if needed, and decide on wakeups. This makes the function hard to follow. Split out the bypass checking and flushing into a separate helper nocb_gp_flush_wake(). The new function encapsulates the logic to: - Check if the bypass needs to be flushed - Flush if needed - Return info on wakeups (lazy, bypass or none) nocb_gp_wait() now becomes simpler by calling the helper to handle the bypass flushing and waking logic. This splitting improves the readability and maintainability of the code by encapsulating related logic into a function with a clear purpose. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree_nocb.h | 113 ++++++++++++++++++++++++----------------- 1 file changed, 66 insertions(+), 47 deletions(-) diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h index 5598212d1f27..c805825c3f00 100644 --- a/kernel/rcu/tree_nocb.h +++ b/kernel/rcu/tree_nocb.h @@ -670,22 +670,68 @@ static void nocb_gp_sleep(struct rcu_data *my_rdp, in= t cpu) trace_rcu_nocb_wake(rcu_state.name, cpu, TPS("EndSleep")); } =20 +/* + * Given an rdp, flush its bypass list if needed and return information ab= out + * if a deferred-wakeup needs to be organized depending on whether things = are + * still in the bypass list. Also tell caller if the list was flushed and = if it + * is still empty after any flushing. + */ +static int nocb_gp_flush_wake(struct rcu_data *rdp, bool *empty, bool *flu= sh) +{ + long bypass_ncbs; + long lazy_ncbs; + unsigned long j =3D jiffies; + + trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("Check")); + lockdep_assert_held(&rdp->nocb_lock); + bypass_ncbs =3D rcu_cblist_n_cbs(&rdp->nocb_bypass); + lazy_ncbs =3D READ_ONCE(rdp->lazy_len); + + *flush =3D false; + *empty =3D false; + if (bypass_ncbs && (lazy_ncbs =3D=3D bypass_ncbs) && + (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + jiffies_till_flush= ) || + bypass_ncbs > 2 * qhimark)) { + *flush =3D true; + } else if (bypass_ncbs && (lazy_ncbs !=3D bypass_ncbs) && + (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + 1) || + bypass_ncbs > 2 * qhimark)) { + *flush =3D true; + } else if (!bypass_ncbs && rcu_segcblist_empty(&rdp->cblist)) { + *empty =3D true; + return RCU_NOCB_WAKE_NOT; + } + + if (*flush) { + // Bypass full or old, so flush it. + (void)rcu_nocb_try_flush_bypass(rdp, j); + bypass_ncbs =3D rcu_cblist_n_cbs(&rdp->nocb_bypass); + lazy_ncbs =3D READ_ONCE(rdp->lazy_len); + } + + if (bypass_ncbs) { + trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, + bypass_ncbs =3D=3D lazy_ncbs ? TPS("Lazy") : TPS("Bypass")); + return (bypass_ncbs =3D=3D lazy_ncbs ? RCU_NOCB_WAKE_LAZY : + RCU_NOCB_WAKE_BYPASS); + } + return RCU_NOCB_WAKE_NOT; +} + /* * No-CBs GP kthreads come here to wait for additional callbacks to show up * or for grace periods to end. */ static void nocb_gp_wait(struct rcu_data *my_rdp) { - bool bypass =3D false; int __maybe_unused cpu =3D my_rdp->cpu; unsigned long cur_gp_seq; unsigned long flags; bool gotcbs =3D false; - unsigned long j =3D jiffies; - bool lazy =3D false; bool needwait_gp =3D false; // This prevents actual uninitialized use. bool needwake; bool needwake_gp; + int defer_wake_type =3D RCU_NOCB_WAKE_NOT; struct rcu_data *rdp, *rdp_toggling =3D NULL; struct rcu_node *rnp; unsigned long wait_gp_seq =3D 0; // Suppress "use uninitialized" warning. @@ -712,44 +758,24 @@ static void nocb_gp_wait(struct rcu_data *my_rdp) * won't be ignored for long. */ list_for_each_entry(rdp, &my_rdp->nocb_head_rdp, nocb_entry_rdp) { - long bypass_ncbs; - bool flush_bypass =3D false; - long lazy_ncbs; + int defer_wake_type_one =3D RCU_NOCB_WAKE_NOT; + bool flushed; + bool empty; =20 - trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("Check")); rcu_nocb_lock_irqsave(rdp, flags); - lockdep_assert_held(&rdp->nocb_lock); - bypass_ncbs =3D rcu_cblist_n_cbs(&rdp->nocb_bypass); - lazy_ncbs =3D READ_ONCE(rdp->lazy_len); + defer_wake_type_one =3D nocb_gp_flush_wake(rdp, &empty, &flushed); =20 - if (bypass_ncbs && (lazy_ncbs =3D=3D bypass_ncbs) && - (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + jiffies_till_flus= h) || - bypass_ncbs > 2 * qhimark)) { - flush_bypass =3D true; - } else if (bypass_ncbs && (lazy_ncbs !=3D bypass_ncbs) && - (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + 1) || - bypass_ncbs > 2 * qhimark)) { - flush_bypass =3D true; - } else if (!bypass_ncbs && rcu_segcblist_empty(&rdp->cblist)) { - rcu_nocb_unlock_irqrestore(rdp, flags); - continue; /* No callbacks here, try next. */ - } + // We may need to do a deferred wakeup later for bypass/lazy + // So note down what we learnt from the rdp. + defer_wake_type =3D max(defer_wake_type_one, defer_wake_type); =20 - if (flush_bypass) { - // Bypass full or old, so flush it. - (void)rcu_nocb_try_flush_bypass(rdp, j); - bypass_ncbs =3D rcu_cblist_n_cbs(&rdp->nocb_bypass); - lazy_ncbs =3D READ_ONCE(rdp->lazy_len); + // Did we make any updates to main cblist? If not, no + // non-deferred wake up to do for this rdp. + if (!flushed && empty) { + rcu_nocb_unlock_irqrestore(rdp, flags); + continue; } =20 - if (bypass_ncbs) { - trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, - bypass_ncbs =3D=3D lazy_ncbs ? TPS("Lazy") : TPS("Bypass")); - if (bypass_ncbs =3D=3D lazy_ncbs) - lazy =3D true; - else - bypass =3D true; - } rnp =3D rdp->mynode; =20 // Advance callbacks if helpful and low contention. @@ -792,23 +818,16 @@ static void nocb_gp_wait(struct rcu_data *my_rdp) rcu_gp_kthread_wake(); } =20 - my_rdp->nocb_gp_bypass =3D bypass; + my_rdp->nocb_gp_bypass =3D (defer_wake_type =3D=3D RCU_NOCB_WAKE_BYPASS); my_rdp->nocb_gp_gp =3D needwait_gp; my_rdp->nocb_gp_seq =3D needwait_gp ? wait_gp_seq : 0; =20 // At least one child with non-empty ->nocb_bypass, so set // timer in order to avoid stranding its callbacks. - if (!rcu_nocb_poll) { - // If bypass list only has lazy CBs. Add a deferred lazy wake up. - if (lazy && !bypass) { - wake_nocb_gp_defer(my_rdp, RCU_NOCB_WAKE_LAZY, - TPS("WakeLazyIsDeferred")); - // Otherwise add a deferred bypass wake up. - } else if (bypass) { - wake_nocb_gp_defer(my_rdp, RCU_NOCB_WAKE_BYPASS, - TPS("WakeBypassIsDeferred")); - } - } + if (!rcu_nocb_poll && defer_wake_type !=3D RCU_NOCB_WAKE_NOT) + wake_nocb_gp_defer(my_rdp, defer_wake_type, + defer_wake_type =3D=3D RCU_NOCB_WAKE_LAZY ? + TPS("WakeLazyIsDeferred") : TPS("WakeBypassIsDeferred")); =20 if (rcu_nocb_poll) { /* Polling, so trace if first poll in the series. */ --=20 2.41.0.487.g6d72f3e995-goog From nobody Sun Feb 8 05:30:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1696AC001DC for ; Sat, 29 Jul 2023 14:28:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232029AbjG2O2M (ORCPT ); Sat, 29 Jul 2023 10:28:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231934AbjG2O2C (ORCPT ); Sat, 29 Jul 2023 10:28:02 -0400 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAB4930F7 for ; Sat, 29 Jul 2023 07:28:00 -0700 (PDT) Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-3491516c4aeso113825ab.1 for ; Sat, 29 Jul 2023 07:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1690640879; x=1691245679; 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=ynoALsv1aca8y8xpjhuiunc/CTMUKjN2qeAE0MoxzWk=; b=w+eXq0b+xVCeRwLimsIFDmDvgRjcNTvCTtckAuYL+NxLFVlICU0f2/cWdwaY8mOG/Z q9zwNJwGGpEOV3xOiYldmz0Ht7ao1zWta1BbZEEjXcNOnH9EHP0dAD99T3uBoMbvXql5 a9TVjh54Y30EGW5rDrtC/vX3tjxDAXxWkwGk0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690640879; x=1691245679; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ynoALsv1aca8y8xpjhuiunc/CTMUKjN2qeAE0MoxzWk=; b=VgdKRdQgcTNwzM2zjm0h74DbYqdLftVp+6thIve500eUcLIG1WYdddc4jkH6CRYDEJ 7yIIwRAOG5Eqct5HD6kAuzLPZzL1dIZ4pxsyIt5ImNPRe2L0/KV+j2g+D0m7vROx/G7F RASr/tHmzuqhQbqKtZuUEDA7oE+krJ9Puuu33Qu7OCSRzpU7cSMuLsrDw4ctYYJ3Vc4w NOCEMAGNh1V4BF8OcxZs43vEHmKs4I3TP1adnWeAQZGWDRdrdRMtqCCP6raRduyYp2pj zu2ckpj14ZZWzcJ0Er6t+CEM+dmbrNuf+Nd4sOqGLQHjM0X8TRhwpj/LvL8fbvlEk/HK iLnA== X-Gm-Message-State: ABy/qLa1VxqNfADMrNPJ/ZH1/Dp+dW8cHsqMY6k4KRRCAl7LjgHRc1PD aXrSMiZXK6GYmRNkdek9Qhn+vvdS1cEySwJCUek= X-Google-Smtp-Source: APBJJlFNIZPWUROiB89przJra0uGXRoZjzPe5M07xGkhX3SWIVZXoL08l9IiN4nUOnSpcobgTvOV7A== X-Received: by 2002:a5e:d717:0:b0:790:9460:6304 with SMTP id v23-20020a5ed717000000b0079094606304mr657721iom.5.1690640879700; Sat, 29 Jul 2023 07:27:59 -0700 (PDT) Received: from joelboxx5.c.googlers.com.com (254.82.172.34.bc.googleusercontent.com. [34.172.82.254]) by smtp.gmail.com with ESMTPSA id q9-20020a0566380ec900b0042b35c7b8c5sm1855362jas.61.2023.07.29.07.27.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jul 2023 07:27:59 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: rcu@vger.kernel.org, paulmck@kernel.org, "Joel Fernandes (Google)" , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH 5/5] Revert "checkpatch: Error out if deprecated RCU API used" Date: Sat, 29 Jul 2023 14:27:35 +0000 Message-ID: <20230729142738.222208-6-joel@joelfernandes.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729142738.222208-1-joel@joelfernandes.org> References: <20230729142738.222208-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The check for single-argument kfree_rcu() is no longer needed as all users have been converted. This reverts commit 1eacac3255495be7502d406e2ba5444fb5c3607c. Signed-off-by: Joel Fernandes (Google) --- scripts/checkpatch.pl | 9 --------- 1 file changed, 9 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a9841148cde2..528f619520eb 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -6422,15 +6422,6 @@ sub process { } } =20 -# check for soon-to-be-deprecated single-argument k[v]free_rcu() API - if ($line =3D~ /\bk[v]?free_rcu\s*\([^(]+\)/) { - if ($line =3D~ /\bk[v]?free_rcu\s*\([^,]+\)/) { - ERROR("DEPRECATED_API", - "Single-argument k[v]free_rcu() API is deprecated, please pass r= cu_head object or call k[v]free_rcu_mightsleep()." . $herecurr); - } - } - - # check for unnecessary "Out of Memory" messages if ($line =3D~ /^\+.*\b$logFunctions\s*\(/ && $prevline =3D~ /^[ \+]\s*if\s*\(\s*(\!\s*|NULL\s*=3D=3D\s*)?($Lval)(= \s*=3D=3D\s*NULL\s*)?\s*\)/ && --=20 2.41.0.487.g6d72f3e995-goog From nobody Sun Feb 8 05:30:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60B6AC001DF for ; Sat, 29 Jul 2023 14:28:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231992AbjG2O2P (ORCPT ); Sat, 29 Jul 2023 10:28:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231948AbjG2O2D (ORCPT ); Sat, 29 Jul 2023 10:28:03 -0400 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDEB530F4 for ; Sat, 29 Jul 2023 07:28:01 -0700 (PDT) Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-348dfefd1a4so14299185ab.1 for ; Sat, 29 Jul 2023 07:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1690640880; x=1691245680; 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=qV1mKGTo1HAZ4CYm++JYZHEnfRnVP5qO40eCYy1XceI=; b=S7Lx25DBRYt0tjnRLA8AhoSntDcL9y6o1ekAFGNTXrA+Mf8j2i9gpElBv/rLiVGE+U zWI6Fe+2ZdWxeJeiB7VSx4TdmVubfqmVlZqJL446+4d/C1CxnIvrOkDkUtLpNqsM04VS C7GzcZjEatmp3kLZRPfZhDK8JUcMEnuxVNDUk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690640880; x=1691245680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qV1mKGTo1HAZ4CYm++JYZHEnfRnVP5qO40eCYy1XceI=; b=LFnbXBdCvag47iTkFe7t877Qj44qalQvkHujPf1rvGFj1Y3Y3iNjXFXziX0cVi5TuV 8F2g/WfDIuipKUCi2rd5a1AHH8P0PxaXr/SLPZg6WTTvT9k3MpFHbIzP5M/b+LrheUYz Je9UiwXS1OMbeuLGcUxW+5V4//KhcgHAymQEQsTQT6KVSzs8E2H8+4w169K9bB9AjFyY QTYDmbIgeefCLIbzw2w4jpNe7AZhlxF1XV6dhQpdgX1Sfa4z/KfftlbB8OfQycGVzT4Q bVjlu7Xnll2myvDezvCB9Lj0H41Qz/3xDdvLiyxs4mLYRZ+li4pKeUMLPOX5YlCRrucQ 3idw== X-Gm-Message-State: ABy/qLaOWi+g8ffkuMKePKw64gCFKMOFBHeLDwQnLxOIe8pDvGK7QxHm +/i9+w3sQpokm3254QzlMyazYsTPrXnZrvPFZEk= X-Google-Smtp-Source: APBJJlGsHpfOeIUPjpE/9g13bl9f1kfstD5OXUxuEldNz7Kdcq/S8OFlgCGXB+OArZ2BznN4qPVMaQ== X-Received: by 2002:a92:c566:0:b0:345:df7f:efc4 with SMTP id b6-20020a92c566000000b00345df7fefc4mr3289147ilj.27.1690640880705; Sat, 29 Jul 2023 07:28:00 -0700 (PDT) Received: from joelboxx5.c.googlers.com.com (254.82.172.34.bc.googleusercontent.com. [34.172.82.254]) by smtp.gmail.com with ESMTPSA id q9-20020a0566380ec900b0042b35c7b8c5sm1855362jas.61.2023.07.29.07.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jul 2023 07:28:00 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: rcu@vger.kernel.org, paulmck@kernel.org, "Joel Fernandes (Google)" , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang Subject: [PATCH v2 5/5] rcu/tree: Remove superfluous return from void call_rcu* functions Date: Sat, 29 Jul 2023 14:27:36 +0000 Message-ID: <20230729142738.222208-7-joel@joelfernandes.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230729142738.222208-1-joel@joelfernandes.org> References: <20230729142738.222208-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The return keyword is not needed here. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index cb1caefa8bd0..7c79480bfaa0 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2713,7 +2713,7 @@ __call_rcu_common(struct rcu_head *head, rcu_callback= _t func, bool lazy_in) */ void call_rcu_hurry(struct rcu_head *head, rcu_callback_t func) { - return __call_rcu_common(head, func, false); + __call_rcu_common(head, func, false); } EXPORT_SYMBOL_GPL(call_rcu_hurry); #endif @@ -2764,7 +2764,7 @@ EXPORT_SYMBOL_GPL(call_rcu_hurry); */ void call_rcu(struct rcu_head *head, rcu_callback_t func) { - return __call_rcu_common(head, func, IS_ENABLED(CONFIG_RCU_LAZY)); + __call_rcu_common(head, func, IS_ENABLED(CONFIG_RCU_LAZY)); } EXPORT_SYMBOL_GPL(call_rcu); =20 --=20 2.41.0.487.g6d72f3e995-goog