mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: Rolf Fokkens <fokkensr@linux06.vertis.nl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: cpus_allowed
Date: 13 Oct 2001 12:22:15 -0400	[thread overview]
Message-ID: <1002990137.868.59.camel@phantasy> (raw)
In-Reply-To: <01101316594000.02369@home01>
In-Reply-To: <01101316594000.02369@home01>

On Sat, 2001-10-13 at 19:59, Rolf Fokkens wrote:
> I was curious about "CPU affinity" in linux. I found some patches which add 
> affinity in task_struct but later I found out that "cpus_allowed" in 
> task_struct almost does the same thing.
> 
> It resulted in some new curiosity: where's cpus_allowed initialized? I can 
> only find an assignment to cpus_allowed for softirq's but no initialization 
> for other processes. I assume the correct init value would be "0xffffffff" or 
> -1. Can't find it though.
> 
> I'm sure I'm overlooking something, but that doesn't help me finding the 
> answer. So would someone be so kind to enlighten me?

It is initialized to -1 (0xffffffff) by struct definition at
linux/kernel/sched.h.  Since it is a mask, this means all CPUs
(obviously).

It isn't used much.  The softirq code uses it to try to keep some tasks
on one CPU, for performance reasons.  The Tux in-kernel httpd uses it
for performance reasons.  Some patches use it, too.

Most of the CPU affinity patches you see were written before
cpus_allowed.  They go through all sorts of trouble to do what the OS
now does on its own.  If you want to change CPU affinity then you just
need a patch that adds a syscall or proc interface for setting the
cpus_allowed mask.

I wrote a proc interface but for the life of me I can't find it.  If you
can I would be happy to update it to your kernel.  It isn't very old,
anyhow.

Andrew Morton wrote has a similar patch that is quite good.  Get it at
http://www.uow.edu.au/~andrewm/linux/#cpus_allowed

	Robert Love


  reply	other threads:[~2001-10-13 16:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-13 23:59 cpus_allowed Rolf Fokkens
2001-10-13 16:22 ` Robert Love [this message]
2001-10-13 16:14   ` cpus_allowed Tim Hockin
2001-10-14  0:37   ` cpus_allowed Rolf Fokkens
2001-10-13 16:23 ` cpus_allowed Dave Jones

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=1002990137.868.59.camel@phantasy \
    --to=rml@tech9.net \
    --cc=fokkensr@linux06.vertis.nl \
    --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

all inboxes | Powered by JetHome®