public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: ebiederm@xmission.com (Eric W. Biederman)
Cc: fweisbec@gmail.com, mingo@elte.hu, linux-kernel@vger.kernel.org,
	oleg@redhat.com, travis@sgi.com, a.p.zijlstra@chello.nl,
	mm-commits@vger.kernel.org, rusty@rustcorp.com.au
Subject: Re: + work_on_cpu-rewrite-it-to-create-a-kernel-thread-on-demand.patch  added to -mm tree
Date: Thu, 12 Feb 2009 14:20:21 -0800	[thread overview]
Message-ID: <20090212142021.3978072c.akpm@linux-foundation.org> (raw)
In-Reply-To: <m1eiy3z4ty.fsf@fess.ebiederm.org>

On Thu, 12 Feb 2009 14:08:09 -0800
ebiederm@xmission.com (Eric W. Biederman) wrote:

> Andrew Morton <akpm@linux-foundation.org> writes:
> 
> > The problem with set_cpus_allowed() is that some other
> > suitably-privileged userspace process can come in from the side and
> > modify your cpus_allowed at any time.
> 
> According to the comments the only reason we care is so that
> we get the appropriate NUMA affinity by default.  I don't
> think it would be fatal if userspace messed around and we
> had a wrong value.

Right.  In this particular case, if you are fantastically unlucky and
hit the race window, all that will happen is that one particular device
will run a bit more slowly.

But at other codesites, the effects of a racing cpus_allowed rewrite
can be fatal.

> Does work_on_cpu prevent that?

Yup.

I think.

Nope.

I don't think there's actually anything which would prevent a
sufficiently stupid/malicious/unlucky administrator from moving the
work_on_cpu thread onto the wrong CPU at the wrong time.  hrm.

Another reason to use smp_call_function_single().

  parent reply	other threads:[~2009-02-12 22:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200902031058.n13AwOoK016719@imap1.linux-foundation.org>
2009-02-03 12:11 ` + work_on_cpu-rewrite-it-to-create-a-kernel-thread-on-demand.patch added to -mm tree Ingo Molnar
2009-02-03 16:58   ` Frédéric Weisbecker
2009-02-03 19:25     ` Andrew Morton
2009-02-04  3:58       ` Rusty Russell
2009-02-04  4:16         ` Andrew Morton
2009-02-04 10:46           ` Rusty Russell
2009-02-12 20:38       ` Eric W. Biederman
2009-02-12 20:48         ` Andrew Morton
2009-02-12 22:08           ` Eric W. Biederman
2009-02-12 22:13             ` Eric W. Biederman
2009-02-12 22:23               ` Andrew Morton
2009-02-12 23:04                 ` Eric W. Biederman
2009-02-12 22:20             ` Andrew Morton [this message]
2009-02-13 21:21         ` Rusty Russell

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=20090212142021.3978072c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=ebiederm@xmission.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mm-commits@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --cc=travis@sgi.com \
    /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