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] [day] [month] [year] [list]
Date:   Tue, 23 Jan 2018 06:30:07 -0800
From:   Tejun Heo <tj@...nel.org>
To:     Wen Yang <wen.yang99@....com.cn>
Cc:     zhong.weidong@....com.cn, Jiang Biao <jiang.biao2@....com.cn>,
        Tan Hu <tan.hu@....com.cn>,
        Lai Jiangshan <jiangshanlai@...il.com>,
        kernel test robot <xiaolong.ye@...el.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v3] workqueue: Introduce a way to set percpu
 worker_pool's scheduler

Hello,

On Tue, Jan 23, 2018 at 07:00:42PM +0800, Wen Yang wrote:
...
> This patch introduces a way to set the scheduler(policy and priority)
> of percpu worker_pool, in that way, user could set proper scheduler
> policy and priority of the worker_pool as needed, which could apply
> to all the WORK_CPU_BOUND workers on the same CPU. On the other hand,
> we could using /sys/devices/virtual/workqueue/cpumask for
> WORK_CPU_UNBOUND workers to prevent them starving.

The general approach looks good to me but this is way too big a patch.
Can you please split it so that the following steps are separate?

* Rename system workqueues.
* Expose attrs for system workqueues.
* Rename unbound_attrs to attrs.
* Convert ->nice to ->sched_attrs.
* Add scheduling policy to the exposed attrs.

And one nit below.

> +static int wq_parse_sched_attr(const char *ubuf, size_t count,
> +		struct sched_attr *sched)
> +{
> +	char buf[SCHED_ATTR_BUF_SIZE];
> +	char *sptr, *token;
> +	size_t len;
> +
> +	memset(buf, 0, sizeof(buf));
> +	len = min(count, (size_t)(sizeof(buf) - 1));
> +	strncpy(buf, ubuf, len);
> +	buf[len] = 0;
> +	sptr = buf;

Can't we just do sscanf?

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ