public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Tejun Heo <htejun@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
	zhang.yi20@zte.com.cn, lkml <linux-kernel@vger.kernel.org>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH]: exec: avoid propagating PF_NO_SETAFFINITY into userspace child
Date: Thu, 28 Nov 2013 17:33:23 +0100	[thread overview]
Message-ID: <20131128163323.GF10022@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20131128153906.GL3925@htj.dyndns.org>

On Thu, Nov 28, 2013 at 10:39:06AM -0500, Tejun Heo wrote:
> Hey,
> 
> On Thu, Nov 28, 2013 at 04:17:04PM +0100, Peter Zijlstra wrote:
> > So there's three useful parts to having a single parent task:
> > 
> >  - its a task so you can change the entire task attribute set; current
> >    and future.
> 
> Using task as interface could be okay but I'd still go for explicitly
> specifying what gets inherited and expand them gradually; otherwise,
> we end up exposing broken stuff unintentionally.  cpuset did this with
> bound workers and the capability was removed retro-actively, which is
> not a happy situation.

I can work with that. We'd need way to inhibit setting certain
attributes, but that can be worked out -- its all in-kernel anyway.

> >  - new children will automatically get the desired attributes.
> > 
> >  - all children are easily identified by virtual of being children of
> >    said parent process.
> 
> That'd mean that we'd have to have a dummy target task for attributes
> for each workqueue and hooks for workqueue to get notified of
> attribute changes.  Unless we're gonna go back to per-workqueue
> workers, we can't have a single parent per workqueue and all its
> workers as children of it.  Different workqueue configure different
> set of attributes.  Not all !percpu workers are equal and each
> workqueue serves as an attribute domain.
> 
> We *could* do all that and it proably won't require walking the
> children from userland as each attribute change would surmount to
> finding or creating a matching worker pool, but it doesn't look
> attractive to me.

I'm not sure we need a single parent per workqueue; certainly the case I
get asked most frequently about doesn't care, they only want to contain
_all_ unbound workers.

I don't see a problem with later splitting out other workqueues if
there's a good use-case for those.

I'm not even sure we need to split out the userspace helpers per-se;
again, they fall in the all-unbound category and I don't think I've seen
people ask for specific control of those over other unbound workers --
although conceptually it does make some sense to split them out.

> > Well, mixed attributes is you own responsibility. I'm all for letting
> > people shoot themselves in the foot as long we don't crash.
> 
> Again, I'm worried about exposing unintended characteristics of
> implementation and being locked into it.  Regardless of interface, I
> think it's important to control what can be depended upon from
> userland if we're gonna keep up "no userland visible behavior will
> break" thing.

I appreciate your caution, but we shouldn't overdo the thing and
dis-allow everything.

> > The huge disadvantage to creating special interfaces is that you can
> > only capture a small part of the task attributes; and worse, you create
> > a special limited interface for a special few tasks.
> 
> Yeah, that's the disadvantage but I don't think the single parent per
> workqueue model is gonna work. 

I never proposed a parent per workqueue. The most I proposed was a
single parent for all unbound workers and a parent for all usermode
helpers.

> automatic
> NUMA binding, which means we need workqueue-specific interface anyway.

I'm curious; why is there workqueue numa stuff? NUMA doesn't have the
correctness issues per-cpu has -- per-cpu is fundamentally special in
that there's no concurrency.



  reply	other threads:[~2013-11-28 16:33 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14  1:51 kmod: avoid propagating PF_NO_SETAFFINITY into userspace child zhang.yi20
2013-11-14  5:23 ` Tejun Heo
2013-11-14 11:40   ` Oleg Nesterov
2013-11-14 11:55     ` [PATCH 0/1]: (Was: kmod: avoid propagating PF_NO_SETAFFINITY into userspace child) Oleg Nesterov
2013-11-14 11:56       ` [PATCH 1/1] workqueue: swap set_cpus_allowed_ptr() and PF_NO_SETAFFINITY Oleg Nesterov
2013-11-22 23:13         ` Tejun Heo
     [not found]           ` <OF36E72FA9.51146BE3-ON48257C2E.0008BC6D-48257C2E.0008FF9C@zte.com.cn>
2013-11-25 12:14             ` 答复: " Oleg Nesterov
2013-11-26  2:10               ` [PATCH]: exec: avoid propagating PF_NO_SETAFFINITY into userspace child zhang.yi20
2013-11-26 18:04                 ` Oleg Nesterov
2013-11-27  2:07                   ` zhang.yi20
2013-11-27 13:20                     ` Oleg Nesterov
2013-11-27 18:31                     ` Tejun Heo
2013-11-28  9:13                       ` Peter Zijlstra
2013-11-28 11:45                         ` Oleg Nesterov
2013-11-28 12:17                           ` Peter Zijlstra
2013-11-28 13:31                             ` Oleg Nesterov
2013-11-28 13:39                               ` Peter Zijlstra
2013-11-28 14:13                                 ` Tejun Heo
2013-11-28 14:31                                   ` Peter Zijlstra
2013-11-28 14:38                                     ` Tejun Heo
2013-11-28 14:47                                       ` Peter Zijlstra
2013-11-28 14:51                                         ` Tejun Heo
2013-11-28 14:55                                       ` Peter Zijlstra
2013-11-28 14:57                                         ` Tejun Heo
2013-11-28 14:59                                           ` Peter Zijlstra
2013-11-28 15:07                                             ` Tejun Heo
2013-11-28 15:17                                               ` Peter Zijlstra
2013-11-28 15:39                                                 ` Tejun Heo
2013-11-28 16:33                                                   ` Peter Zijlstra [this message]
2013-11-29 14:33                                                     ` Tejun Heo
2013-11-28 15:47                                                 ` Oleg Nesterov
2013-11-28 16:07                                                   ` Oleg Nesterov
2013-11-28 14:43                                     ` Peter Zijlstra
2013-11-28 14:53                                       ` Tejun Heo
2013-11-28 14:57                                         ` Peter Zijlstra
2013-11-28 15:02                                           ` Tejun Heo
2013-11-28 15:07                                             ` Peter Zijlstra
2013-11-28 15:10                                               ` Tejun Heo
2013-11-28 15:18                                                 ` Peter Zijlstra
2013-11-28 14:38                                   ` Peter Zijlstra
2013-11-28 14:45                                     ` Tejun Heo
2013-11-28 14:53                                       ` Peter Zijlstra
2013-11-28 15:34                                     ` Oleg Nesterov
2013-11-28 15:40                                       ` Peter Zijlstra
2013-11-28 16:20                                         ` Oleg Nesterov
2013-11-28 16:38                                           ` Peter Zijlstra
2013-11-28 18:13                                             ` Oleg Nesterov
2013-11-28 14:23                                 ` Oleg Nesterov
2013-11-28 14:31                                   ` Tejun Heo
2013-11-28 15:00                                     ` Oleg Nesterov
2013-11-28 15:02                                       ` Peter Zijlstra
2013-11-28 19:33                                         ` [PATCH 0/1] usermodehelper: kill ____call_usermodehelper()->set_cpus_allowed_ptr() Oleg Nesterov
2013-11-28 19:33                                           ` [PATCH 1/1] " Oleg Nesterov
2013-11-29 13:44                                             ` Tejun Heo
2013-11-29 16:49                                               ` Oleg Nesterov
2013-12-05 14:21                                             ` Frederic Weisbecker
2013-12-05 14:37                                               ` Oleg Nesterov
2013-12-05 14:39                                                 ` Tejun Heo
2013-12-05 15:30                                                   ` Oleg Nesterov
2013-12-05 19:13                                                     ` Christoph Lameter
2013-12-06 14:53                                                       ` Oleg Nesterov
2013-12-06 15:37                                                         ` Christoph Lameter
2013-12-06 15:56                                                           ` Oleg Nesterov
2013-12-05 16:26                                                   ` Frederic Weisbecker
2013-12-05 14:42                                                 ` Frederic Weisbecker
2013-11-28 13:41                               ` [PATCH]: exec: avoid propagating PF_NO_SETAFFINITY into userspace child Peter Zijlstra
2013-11-28 14:05                                 ` Tejun Heo
2013-11-28 14:34                                 ` Oleg Nesterov
  -- strict thread matches above, loose matches on Subject: below --
2013-11-29  9:19 zhang.yi20

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131128163323.GF10022@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=htejun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=zhang.yi20@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox