From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751975AbeAWOaO (ORCPT ); Tue, 23 Jan 2018 09:30:14 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:33703 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751706AbeAWOaM (ORCPT ); Tue, 23 Jan 2018 09:30:12 -0500 X-Google-Smtp-Source: AH8x227J/phHfy6hEnTywqvpvD621b2oKlKAFa8UW3H8ny/qBkBZHGSMCcKHYCZlWBptTnFuZXxmZw== Date: Tue, 23 Jan 2018 06:30:07 -0800 From: Tejun Heo To: Wen Yang Cc: zhong.weidong@zte.com.cn, Jiang Biao , Tan Hu , Lai Jiangshan , kernel test robot , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v3] workqueue: Introduce a way to set percpu worker_pool's scheduler Message-ID: <20180123143007.GD1771050@devbig577.frc2.facebook.com> References: <1516705242-30349-1-git-send-email-wen.yang99@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516705242-30349-1-git-send-email-wen.yang99@zte.com.cn> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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