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: Mon, 08 Sep 2008 08:28:19 -0400 [thread overview]
Message-ID: <48C51A63.1070700@compro.net> (raw)
In-Reply-To: <alpine.DEB.1.10.0809051642200.31439@gandalf.stny.rr.com>
Steven Rostedt wrote:
> On Fri, 5 Sep 2008, Mark Hounschell wrote:
>
>> 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.
>
>
> Note, I'm not just talking about that affinity being masked off, I'm
> talking about a task that is bounded to only that cpu that is about to go
> offline.
>
> If you have a mask (bit mask) 0xf to be on all 4 cpus, and cpu 3 goes
> offline, all those tasks will now be 0x7. But if you started with a task
> with a affinity of mask 0x8, then when it goes offline, it too will be
> 0x7. The difference here is that this task is now running on CPUS that it
> wasn't able to run on before going down.
>
> At least there's a warning about it in dmesg:
>
> "process 6560 (yes) no longer affine to cpu3"
>
> -- Steve
>
>
Right, thats what I was referring to also. A task bound to a single cpu
all by its self.
Mark
next prev parent reply other threads:[~2008-09-08 12:28 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
2008-09-05 20:28 ` Steven Rostedt
2008-09-05 20:45 ` Steven Rostedt
2008-09-08 12:28 ` Mark Hounschell [this message]
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=48C51A63.1070700@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.