lkml.org 
[lkml]   [2002]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] 2.5: task cpu affinity syscalls
From
Date
On Thu, 2002-04-11 at 10:23, Aneesh Kumar K.V wrote:

> Now that we have API that allow a process to say I would like to go to
> these CPU, Are there any API's available that will allow a CPU to say I
> will take only these process. ( Resource Affinity domains ? )

First, the Linux scheduler is not really designed to do this. It's cpu
affinity works on a per-process basis and in fact needs to explicitly
move CPUs from each CPU. Second, we could probably do this in userspace
using the exported sched_setaffinity syscall (just loop over all tasks,
setting the affinity as-needed).

There is a problem, though. In 2.5 with the O(1) scheduler, if the
process is not currently running on an allowed CPU when it is affined,
it must be forced off to a legal CPU via the migration threads. This is
expensive and complex and _not_ something we want to do to every process
on the system.

For this reason, and because I honestly favor the simple interfaces I
wrote, I think we should stick with just the exported interfaces we
currently have.

This isn't to say we could not do this in userspace - it would not be
hard (but still gross to move mass processes around). We could also
have a version of init that affines itself on boot, thereby having every
other process likewise affined. Then explicitly move away those
processes we want elsewhere. This is cheap and easy.

Robert Love

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:3.261 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site