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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 28 Nov 2013 15:23:59 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Tejun Heo <htejun@...il.com>, zhang.yi20@....com.cn,
	lkml <linux-kernel@...r.kernel.org>,
	Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
	Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH]: exec: avoid propagating PF_NO_SETAFFINITY into
	userspace child

On 11/28, Peter Zijlstra wrote:
>
> On Thu, Nov 28, 2013 at 02:31:52PM +0100, Oleg Nesterov wrote:
> > On 11/28, Peter Zijlstra wrote:
> > >
> > > On Thu, Nov 28, 2013 at 12:45:42PM +0100, Oleg Nesterov wrote:
> > > > It has? khelper is a workqueue thread, this flag is set by create_worker().
> > > >
> > > > And it does kernel_thread() (not kthread_create()) so the child gets this
> > > > flag too.
> > >
> > > Urgh, but that's still completely wrong. khelper is a singlethread
> > > workqueue, those should be unbound and therefore should not have this
> > > flag set at all.
> >
> > Well. This is debatable, but I leave this to you and Tejun ;)
>
> How can that be debatable? I don't see a single argument in favour of
> doing that; its plain ridiculous.

Let me repeat, I do not pretend I understand the current implementation
in details.

However, I'd like to say that I do not think think this is ridiculous.
I think this is clever.


> > > In fact, I know people want to set affinity on khelper
> >
> > This is not that simple. Note that khelper itself is the rescuer thread,
> > it doesn't not process the works. There are other kworker/u* threads which
> > run the work queued on khelper_wq. There is a pool of threads.
>
> That's just fucked. WTF does singlethreaded mean then?

Yes, the naming is misleading. But it was always misleading.

"singlethreaded" meant a single thread, yes, but this just reflected the
implementation details. What it actually meant is: not bound to any cpu,
and the works can't race with each other.

create_singlethread_workqueue() still has the same semantics due to
WQ_UNBOUND && max_active == 1. So in this sense (max_active == 1) it
is still single threaded, just (iiuc, Tejun can correct me) it does
not guarantee that the kernel thread which actually runs the work will
be always the same.

> A single parent process for all usermode helpers makes so much sense;

This was never true, at least in UMH_WAIT_PROC case.

> not doing it is just weird.

Why?

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ