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 2FBC6C6FD1F for ; Thu, 16 Mar 2023 14:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230470AbjCPO5Z (ORCPT ); Thu, 16 Mar 2023 10:57:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbjCPO5W (ORCPT ); Thu, 16 Mar 2023 10:57:22 -0400 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65ABFCD663 for ; Thu, 16 Mar 2023 07:57:18 -0700 (PDT) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-5447d217bc6so36805537b3.7 for ; Thu, 16 Mar 2023 07:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1678978637; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8w7zMMd7x6aGvImR8WNeqUFh64/lLSPtzRGITxok/+k=; b=C5SyNxP8fdmDzuY6FQgR2wVoMpRfFTRlNwcfeqtPE0JSARou3Jg06GsOFoed/IPUP/ FGg73oIv2WXtlYLjrbc8T6c8LAZD96UVSCyxbqqGQV3L4UH2cf+OQs8QK/HIJXOvBoWO mvqO5y/lo0uyx+hHnIfggMQvGdmuvFsC9jtl0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678978637; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8w7zMMd7x6aGvImR8WNeqUFh64/lLSPtzRGITxok/+k=; b=ORCgW+yJps+kDLfxOxYg7hgDpf7FJV03icACltRi7oQbPiz1zxkG/ke5IDaL9kpi+s 8w83L1j9LLSRZ0QsbrfxyWCA3qR7QVY/Zy1Q/mxD0NPtswx0kglwQzMmb33SUdM+kSaj vfTyy42X/Ceucq/lBckppbFrpdMBQuMZbyeBJUWUUYu17wGt9HwsBeGNnxr69GTnDakb Vc5QUcmoSL8nYzeHvZnZpr0oZ7FJDDkzzVyQeyS/PkoJf5jqPKl+WoI3dNFtWWSeqyip WP4uspMorLNnn32R14VXLe3fwRy+aLUP4YTZEg1dMCnmkc6Ha10i8Z89wZ8O3Qy6pyZ0 vxEQ== X-Gm-Message-State: AO0yUKV2vU8AEFjMHb3B0dO/c3EMD6i2LogJMUL2KilpckeLlorqct0G IJ1G4h9PcSCdqilzDNa8mUbIFM299ObTyTKG/DI8CyK9WQT0wROJ2ec= X-Google-Smtp-Source: AK7set9gpBrpMLVvGQC2SDucMEvxUx3cOcSddFhk/h8urAkE6LiD61jtKdlV6M25oA3yKcWDsAGh8dgHefbjAHSLht0= X-Received: by 2002:a81:a807:0:b0:536:4ad1:f71 with SMTP id f7-20020a81a807000000b005364ad10f71mr2303020ywh.9.1678978637508; Thu, 16 Mar 2023 07:57:17 -0700 (PDT) MIME-Version: 1.0 References: <2B9F2C1A-B274-41EF-8ABE-1E660521BCE4@joelfernandes.org> In-Reply-To: From: Joel Fernandes Date: Thu, 16 Mar 2023 10:57:06 -0400 Message-ID: Subject: Re: [PATCH 1/1] rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale To: "Zhuo, Qiuxu" Cc: "paulmck@kernel.org" , Frederic Weisbecker , Josh Triplett , Neeraj Upadhyay , Davidlohr Bueso , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , "rcu@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 16, 2023 at 9:53=E2=80=AFAM Zhuo, Qiuxu = wrote: > [...] > > >> From: Paul E. McKenney [...] > > >>>> > > >>>> How about to pull the rcu_scale_cleanup() function after > > >> kfree_scale_cleanup(). > > >>>> This groups kfree_* functions and groups rcu_scale_* functions. > > >>>> Then the code would look cleaner. > > >>>> So, do you think the changes below are better? > > >>> > > >>> IMHO, I don't think doing such a code move is better. Just add a ne= w > > >>> header file and declare the function there. But see what Paul says > > >>> first. > > >> > > >> This situation is likely to be an early hint that the kvfree_rcu() > > >> testing should be split out from kernel/rcu/rcuscale.c. > > > > > > Another is that it's a bit expensive to create a new header file just > > > for eliminating a function declaration. ;-) > > > > What is so expensive about new files? It is a natural organization stru= cture. > > > > > So, if no objections, I'd like to send out the v2 patch with the upda= tes below: > > > > > > - Move rcu_scale_cleanup() after kfree_scale_cleanup() to eliminate= the > > > declaration of kfree_scale_cleanup(). Though this makes the patch= bigger, > > > get the file rcuscale.c much cleaner. > > > > > > - Remove the unnecessary step "modprobe torture" from the commit > > message. > > > > > > - Add the description for why move rcu_scale_cleanup() after > > > kfree_scale_cleanup() to the commit message. > > > > Honestly if you are moving so many lines around, you may as well split = it out > > into a new module. > > The kfree stuff being clubbed in the same file has also been a major > > annoyance. > > I'm OK with creating a new kernel module for these kfree stuffs, > but do we really need to do that? If it were me doing this, I would try to split it just because in the long term I may have to maintain or deal with it. I was also thinking a new scale directory _may_ make sense for performance tests. kernel/rcu/scaletests/kfree.c kernel/rcu/scaletests/core.c kernel/rcu/scaletests/ref.c Or something like that. and then maybe putt common code into: kernel/rcu/scaletests/common.c - Joel > > @paulmck, what's your suggestion for the next step? > > > - Joel > > > > > > > Thanks! > > > -Qiuxu > > > > > >> [...]