[patch 6/8] cpusets v4 - The main new files: cpuset.c, cpuset.h

[patch 6/8] cpusets v4 - The main new files: cpuset.c, cpuset.h

Post by Paul Jacks » Sat, 03 Jul 2004 20:10:09


he main cpuset patch - including Documentation, kernel/cpuset.c,
cpuset.h, and the kernel/Makefile hook.

The main cpuset code establishes a hierarchy of cpusets, visible
in a pseudo filesystem. Each task links to the cpuset that controls
its CPU and Memory placement. The CPUs and Memory Nodes allowed
to any particular cpuset are always a subset of that cpusets
parent, with the top cpuset containing all CPUs and Memory Nodes
in the system.

This hierarchy is required in order to efficiently provide for strictly
exclusive cpusets - the CPUs and Memory Nodes of a strictly exclusive
cpuset are guaranteed by the kernel to not be part of any other cpuset
that is not a direct ancestor or descendent.

Follow on patches will add the necessary kernel hooks to connect
cpusets with the rest of the kernel.


Index: 2.6.7-mm5/Documentation/cpusets.txt
===================================================================
--- 2.6.7-mm5.orig/Documentation/cpusets.txt 2003-03-14 05:07:09.000000000 -0800
+++ 2.6.7-mm5/Documentation/cpusets.txt 2004-07-02 00:06:40.000000000 -0700
@@ -0,0 +1,381 @@
+ CPUSETS
+ -------
+
+Copyright (C) 2004 BULL SA.
+Written by XXXX@XXXXX.COM
+
+Portions Copyright (c) 2004 Silicon Graphics, Inc.
+Modified by Paul Jackson < XXXX@XXXXX.COM >
+
+CONTENTS:
+=========
+
+1. Cpusets
+ 1.1 What are cpusets ?
+ 1.2 Why are cpusets needed ?
+ 1.3 How are cpusets implemented ?
+ 1.4 How do I use cpusets ?
+2. Usage Examples and Syntax
+ 2.1 Basic Usage
+ 2.2 Adding/removing cpus
+ 2.3 Setting flags
+ 2.4 Attaching processes
+3. Questions
+4. Contact
+
+1. Cpusets
+==========
+
+1.1 What are cpusets ?
+----------------------
+
+Cpusets provide a simple mechanism for assigning a set of CPUs and
+Memory Nodes to a set of tasks.
+
+Cpusets constrains the existing CPU and Memory placement calls to
+only request resources within a tasks current cpuset, and they form a
+nested hierarchy visible in a virtual file system. These are the
+essential hooks, beyond what is already present, required to manage
+dynamic job placement on large systems.
+
+Each task has a pointer to a cpuset. Multiple tasks may reference
+the same cpuset. Requests by a task, using the sched_setaffinity(2)
+system call to include CPUs in its CPU affinity mask, and using the
+mbind(2) and set_mempolicy(2) system calls to include Memory Nodes
+in its memory policy, are both filtered through that tasks cpuset,
+filtering out any CPUs or Memory Nodes not in that cpuset.
+
+If a cpuset is strictly exclusive, no other cpuset, other than a direct
+ancestor or descendent, may share any of the same CPUs or Memory Nodes.
+
+User level code may create and destroy cpusets by name in the cpuset
+virtual file system, manage the attributes and permissions of these
+cpusets and which CPUs and Memory Nodes are assigned to each cpuset,
+specify and query to which cpuset a task is assigned, and list the
+task pids assigned to a cpuset.
+
+
+1.2 Why are cpusets needed ?
+----------------------------
+
+The management of large computer systems, with many processors (CPUs),
+complex memory cache hierarchies and multiple Memory Nodes having
+non-uniform access times (NUMA) presents additional challenges for
+the efficient scheduling and memory placement of processes.
+
+Frequently more modest sized systems can be operated with adequate
+efficiency just by letting the operating sy