lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fd34114d-d2e4-0d10-475c-61585753a639@infradead.org>
Date:   Wed, 28 Jun 2023 11:51:32 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     tj@...nel.org, frederic@...nel.org, jiangshanlai@...il.com,
        linux-kernel@...r.kernel.org, zyhtheonly@...il.com,
        zyhtheonly@...h.net, zwp10758@...il.com, fuyuanli@...iglobal.com
Subject: Re: [PATCH v4] workqueue: add cmdline parameter
 `workqueue.unbound_cpus` to further constrain wq_unbound_cpumask at boot time

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 <tiozhang@...iglobal.com>
> ---
>  .../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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ