All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Hounschell <markh@compro.net>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Karthik Singaram Lakshmanan <karthiksingaram@gmail.com>,
	linux-rt-users@vger.kernel.org
Subject: Re: Question regarding sched_setaffinity
Date: Fri, 05 Sep 2008 16:04:28 -0400	[thread overview]
Message-ID: <48C190CC.10400@compro.net> (raw)
In-Reply-To: <alpine.DEB.1.10.0809051523270.23959@gandalf.stny.rr.com>

Steven Rostedt wrote:
> On Sun, 31 Aug 2008, Karthik Singaram Lakshmanan wrote:
> 
>> Hi,
>>  I am a noob to SMP real-time scheduling in linux, I have a question of
>> sched_setaffinity(). If I restrict an application to a single CPU
>> using the appropriate cpumask for sched_setaffinity(), Is it
>> guaranteed that the kernel will never schedule it on any other CPU? I
>> am asking this because looking at kernel/sched.c seems to use
>> cpu_clear during load balancing. I am interested in knowing whether the
>> cache will be invalidated when my task is assigned to a single CPU.
>> Are there exceptions where the cpu-mask will be overridden?
>> Thanks for taking the time to answer my query.
> 
> A task should never be scheduled on a CPU that is not in its affinity. 
> (although I hear a rumor that if a task is bound to a single CPU, and that 
> CPU is taken offline, it will be migrated. But I doubt this is true, since 
> there are tasks that would crash the system if this were true).
> 
> -- Steve
> 

It seems to be true. It's affinity mask gets changed to the CPUs left online.
At least according to sched_getaffinity.

Mark

  reply	other threads:[~2008-09-05 20:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01  3:12 Question regarding sched_setaffinity Karthik Singaram Lakshmanan
2008-09-05 19:24 ` Steven Rostedt
2008-09-05 20:04   ` Mark Hounschell [this message]
2008-09-05 20:28     ` Steven Rostedt
2008-09-05 20:45     ` Steven Rostedt
2008-09-08 12:28       ` Mark Hounschell
2008-09-08 14:40         ` Karthik Singaram Lakshmanan

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=48C190CC.10400@compro.net \
    --to=markh@compro.net \
    --cc=karthiksingaram@gmail.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.