Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965307AbbEMNxA (ORCPT ); Wed, 13 May 2015 09:53:00 -0400 Received: from mail-qk0-f171.google.com ([209.85.220.171]:36672 "EHLO mail-qk0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933870AbbEMNw6 (ORCPT ); Wed, 13 May 2015 09:52:58 -0400 Date: Wed, 13 May 2015 09:52:54 -0400 From: Tejun Heo To: Lai Jiangshan Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] workqueue: don't expose workqueue_attrs to users Message-ID: <20150513135254.GQ11388@htj.duckdns.org> References: <1431336953-3260-1-git-send-email-laijs@cn.fujitsu.com> <1431336953-3260-5-git-send-email-laijs@cn.fujitsu.com> <20150511145952.GE11388@htj.duckdns.org> <55516240.6000601@cn.fujitsu.com> <20150512132209.GM11388@htj.duckdns.org> <5552AC37.8000809@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5552AC37.8000809@cn.fujitsu.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1544 Lines: 47 Hello, Lai. On Wed, May 13, 2015 at 09:43:19AM +0800, Lai Jiangshan wrote: > >> I think the workqueue.c has too much complicated and rarely used APIs > >> and exposes too much in this way. No one can set the nice value > >> and the cpuallowed of a task atomically. > > > > What do you mean no one can? > > normal/general task. not kworker. > > no one can set the nice value and the cpumallowed of a normal task atomically. > > The kernel doesn't have such APIs: > > lock_and_get_task_cpus_allowed(task); > /* modify cpumask */ > set_cpus_allowed_ptr_and_unlock(); I'm still not following. What are you trying to say? > > So, we're now requiring workqueue users to take care of > > synchronization, disabling and reinstating WQ_SYSFS (what if userland > > hits those knobs at the same time?) > > I think there is no userland knobs when !WQ_SYSFS. So, fail apply attrs calls if the workqueue is exposed to userland? Are you serious? > > and poking into workqueue struct to determine the current values of the > > I think the copy version of cpumask, nice, numa values are same as > the workqueue struct have. No poking is required. > (Its own lock-protect-region is the ONLY entry to call apply_workqueue_attrs()). And how would the caller know the current values? Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/