Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19631722rwd; Wed, 28 Jun 2023 11:54:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ57xCN3ASPgRFGBy2h/5e/m1cDCKkka2SH83K3o2YeE3czhBtq74jUwdooTjmAMWwe3MBba X-Received: by 2002:a05:6a20:1453:b0:125:f3d8:e65b with SMTP id a19-20020a056a20145300b00125f3d8e65bmr13730353pzi.18.1687978459787; Wed, 28 Jun 2023 11:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687978459; cv=none; d=google.com; s=arc-20160816; b=dHIKgRqyUfluZwKehuJehtP8HjvcJ1WKfn1sI1t6RdIvmkmDQHOpbdGGCzhv0gunIa MAxhtjAzOcPtMXXzSvKL4woavWwH0sge0v8xXafyBIb707K7lO++ThyuwxyQCBMSNRu6 Zl0C5jjK1gitdAAyKo2Qn14Kq5CZy8EXUzuO1kztku8RVKTxuM63AhnjOlB7E2yfmIog ht7bn3fophbyMR1ZgM6yNGesNBb03E7lik/UXuxZKN/UEsbrW4kpib+DTotNAe8CMmr9 rS2W6jv82O5wvGsDrYxfES4LsEAn9kBdI82Q1/WfDX/S8lGy/sjzkc2iAXc7RUDfLsOZ Xc9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=lI2tg1GnlinJyvRIAEmAI51EovH7MwFyKO06irrJ0rE=; fh=4VB54M9pgX0zdGLugza9cb8hy0/fQ0V0EnyNgw6vaeg=; b=mUW79tE+P1IvcY5trMbHnBQYGJb6ssF6GPpi502hXWUBn2jTBU1vSe2qcu50cY89A9 gMUv3CQ6OVFVIOIZxUizlUY4Zl2ga/FbtP7Epw4VPq+3/LfgQ8+olFiWe9ateobavogF 9I/eDHYNHgKIBcgF3vpRkv6J4Yre4MSgxAwvpBcH9Feg9RMme2NZenscxAs9VY/FQByg TxTP5/uSyDVe8V4qxU6P5jLB1Yt/uz3X/sTpXSuNwH3iCUk3H4XJeU31qr70WJrxHCxP UG15/kADYNoS8ifxu5wPCWHheeHopSzqU5e0wT0PigiY0tePbNxIVGanF7UJFHAKFlg+ H8zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=arERCPNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s36-20020a635264000000b00553939d6a6dsi9780604pgl.44.2023.06.28.11.54.05; Wed, 28 Jun 2023 11:54:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=arERCPNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232182AbjF1SwB (ORCPT + 99 others); Wed, 28 Jun 2023 14:52:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232013AbjF1Sve (ORCPT ); Wed, 28 Jun 2023 14:51:34 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E75962694 for ; Wed, 28 Jun 2023 11:51:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Cc:Content-ID:Content-Description; bh=lI2tg1GnlinJyvRIAEmAI51EovH7MwFyKO06irrJ0rE=; b=arERCPNnSQbvk/W9vqqLIsVrwf cqJSPEgNbHk7B+6gAS6Ez6WQPYuSzz+GmWsF5RkEgEqvSs3sLRbOPn0MQoUEMnT8ZZQgkRLDoXCyr oeB3Snrb8DxiIpw4RAX/2SpjcPs2OZOCSXqBazZAa027ExGRNCi90M5sdtCeJuIap4Vg1vJ0SmmvV hif46q7Ar2eLTXL++UtOv2a8lThm2eRu7zYKhDmrjG1pwtmJLbHa/L4d/rjXTEEPfH5sTffJCGP+i dfgY5s8UtxQ4j+elXtGke9OX826DZ7O7mqLyWofla+yIGyIfhiwMkAaPsxItykW8IUZXl3bptJ1tG qJ19Hcpw==; Received: from [2601:1c2:980:9ec0::2764] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qEaGK-00GRGs-3B; Wed, 28 Jun 2023 18:51:33 +0000 Message-ID: Date: Wed, 28 Jun 2023 11:51:32 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v4] workqueue: add cmdline parameter `workqueue.unbound_cpus` to further constrain wq_unbound_cpumask at boot time Content-Language: en-US To: tj@kernel.org, frederic@kernel.org, jiangshanlai@gmail.com, linux-kernel@vger.kernel.org, zyhtheonly@gmail.com, zyhtheonly@yeah.net, zwp10758@gmail.com, fuyuanli@didiglobal.com References: <20230628111722.GA31661@didi-ThinkCentre-M930t-N000> From: Randy Dunlap In-Reply-To: <20230628111722.GA31661@didi-ThinkCentre-M930t-N000> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi-- On 6/28/23 04:18, tiozhang wrote: > Motivation of doing this is to better improve boot times for devices when > we want to prevent our workqueue works from running on some specific CPUs, > e,g, some CPUs are busy with interrupts. > > Signed-off-by: tiozhang > --- > .../admin-guide/kernel-parameters.txt | 7 +++++++ > kernel/workqueue.c | 20 +++++++++++++++++++ > 2 files changed, 27 insertions(+) > > diff --git a/kernel/workqueue.c b/kernel/workqueue.c > index 7cd5f5e7e0a1..29e8254edd63 100644 > --- a/kernel/workqueue.c > +++ b/kernel/workqueue.c > @@ -6129,3 +6135,17 @@ void __init workqueue_init(void) > */ > void __warn_flushing_systemwide_wq(void) { } > EXPORT_SYMBOL(__warn_flushing_systemwide_wq); > + > +static int __init workqueue_unbound_cpus_setup(char *str) > +{ > + int ret; > + > + ret = cpulist_parse(str, &wq_cmdline_cpumask); > + if (ret < 0) { > + cpumask_clear(&wq_cmdline_cpumask); > + pr_warn("workqueue.unbound_cpus: incorrect CPU range\n"); > + } > + > + return ret; > +} > +__setup("workqueue.unbound_cpus=", workqueue_unbound_cpus_setup); __setup() functions don't return 0 for success or errno/other values for error. They return 1 if the parameter is handled and 0 if it is not handled, as documented in include/linux/init.h. And "handled" basically means "recognized" as a kernel parameter, not that the value(s) passed to it are correct. I.e., they should usually return 0. -- ~Randy