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]
Message-ID: <20131205143745.GA18488@redhat.com>
Date:	Thu, 5 Dec 2013 15:37:45 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	Christoph Lameter <cl@...ux.com>,
	Peter Zijlstra <peterz@...radead.org>,
	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 1/1] usermodehelper: kill
	____call_usermodehelper()->set_cpus_allowed_ptr()

On 12/05, Frederic Weisbecker wrote:
>
> 2013/11/28 Oleg Nesterov <oleg@...hat.com>:
> > ____call_usermodehelper() does set_cpus_allowed_ptr(cpu_all_mask),
> > this (and the comment) is misleading. We no longer have keventd_wq,
> > and kmod.c switched to khelper_wq a long ago.
> >
> > And more importantly, "unlike our parent" is no longer true too,
> > this thread was created by WQ_UNBOUND worker thread which has the
> > full ->cpus_allowed mask, so this set_cpus_allowed_ptr() is simply
> > unnecessary.
> >
> > Perhaps we will change this later, so that userspace can control
> > the affinity of the usermode helper tasks, but this is yet another
> > reason to remove this set_cpus_allowed_ptr().
> >
> > To some degree this also applies to set_user_nice(), but this
> > patch only updates the comment.
> >
> > Signed-off-by: Oleg Nesterov <oleg@...hat.com>
>
> I'm adding Christophe in Cc because he is interested in tweaking the
> affinity of call_usermodehelper for cpu isolation. This welcome
> cleanup confirms that we want to take the direction of being able to
> change the affinity of workqueue themselves instead of just
> call_usermodehelper() alone.

OK, but I'd like to remind just in case, as Tejun pointed out this
patch is wrong ;)

And "change the affinity of workqueue themselves" is not simple, but
we can make khelper_wq WQ_SYSFS.

> >  kernel/kmod.c |    8 ++------
> >  1 files changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/kernel/kmod.c b/kernel/kmod.c
> > index b086006..2fe4544 100644
> > --- a/kernel/kmod.c
> > +++ b/kernel/kmod.c
> > @@ -208,13 +208,9 @@ static int ____call_usermodehelper(void *data)
> >         spin_lock_irq(&current->sighand->siglock);
> >         flush_signal_handlers(current, 1);
> >         spin_unlock_irq(&current->sighand->siglock);
> > -
> > -       /* We can run anywhere, unlike our parent keventd(). */
> > -       set_cpus_allowed_ptr(current, cpu_all_mask);
> > -
> >         /*
> > -        * Our parent is keventd, which runs with elevated scheduling priority.
> > -        * Avoid propagating that into the userspace child.
> > +        * Our parent is a workqueue thread, which can run with elevated
> > +        * scheduling priority. Avoid propagating that into the userspace.
> >          */
> >         set_user_nice(current, 0);
> >
> > --
> > 1.5.5.1
> >
> >
> > --
> > 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/

--
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