lkml.org 
[lkml]   [2015]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] workqueue: don't expose workqueue_attrs to users
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


\
 
 \ /
  Last update: 2015-05-13 16:01    [W:0.048 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site