From: Chris Friesen <cbf123@mail.usask.ca>
To: "linux-kernel@vger.kernel.org >> lkml" <linux-kernel@vger.kernel.org>
Subject: question about cpusets vs sched_setaffinity()
Date: Thu, 10 Dec 2015 15:30:39 -0600 [thread overview]
Message-ID: <5669EEFF.20801@mail.usask.ca> (raw)
Hi,
I've got a question about the interaction between cpusets and sched_setaffinity().
If I put a task into a cpuset and then call sched_setaffinity() on it, it will
be affined to the intersection of the two sets of cpus. (Those specified on the
set, and those specified in the syscall.)
However, if I then change the cpus in the cpuset the process affinity will
simply be overwritten by the new cpuset affinity. It does not seem to take into
account any restrictions from the original sched_setaffinity() call.
Wouldn't it make more sense to affine the process to the intersection between
the new set of cpus from the cpuset, and the current process affinity? That way
if I explicitly masked out certain CPUs in the original sched_setaffinity() call
then they would remain masked out regardless of changes to the set of cpus
assigned to the cpuset.
Thanks,
Chris
PS: Not subscribed to the list, please CC me on replies.
next reply other threads:[~2015-12-10 21:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 21:30 Chris Friesen [this message]
2015-12-11 22:15 ` question about cpusets vs sched_setaffinity() Jason Baron
2015-12-11 23:26 ` Chris Friesen
2015-12-14 22:14 ` Jason Baron
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=5669EEFF.20801@mail.usask.ca \
--to=cbf123@mail.usask.ca \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox