Add cpuset, an api for thread to cpu binding and cpu resource grouping
and assignment.
- Add a reference to a struct cpuset in each thread that is inherited from
the thread that created it.
- Release the reference when the thread is destroyed.
- Add prototypes for syscalls and macros for manipulating cpusets in
sys/cpuset.h
- Add syscalls to create, get, and set new numbered cpusets:
cpuset(), cpuset_{get,set}id()
- Add syscalls for getting and setting affinity masks for cpusets or
individual threads: cpuid_{get,set}affinity()
- Add types for the 'level' and 'which' parameters for the cpuset. This
will permit expansion of the api to cover cpu masks for other objects
identifiable with an id_t integer. For example, IRQs and Jails may be
coming soon.
- The root set 0 contains all valid cpus. All thread initially belong to
cpuset 1. This permits migrating all threads off of certain cpus to
reserve them for special applications.
Sponsored by: Nokia
Discussed with: arch, rwatson, brooks, davidxu, deischen
Reviewed by: antoine
2008-03-02 07:39:22 +00:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 2008, Jeffrey Roberson <jeff@freebsd.org>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
2008-04-04 01:22:04 +00:00
|
|
|
* Copyright (c) 2008 Nokia Corporation
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
Add cpuset, an api for thread to cpu binding and cpu resource grouping
and assignment.
- Add a reference to a struct cpuset in each thread that is inherited from
the thread that created it.
- Release the reference when the thread is destroyed.
- Add prototypes for syscalls and macros for manipulating cpusets in
sys/cpuset.h
- Add syscalls to create, get, and set new numbered cpusets:
cpuset(), cpuset_{get,set}id()
- Add syscalls for getting and setting affinity masks for cpusets or
individual threads: cpuid_{get,set}affinity()
- Add types for the 'level' and 'which' parameters for the cpuset. This
will permit expansion of the api to cover cpu masks for other objects
identifiable with an id_t integer. For example, IRQs and Jails may be
coming soon.
- The root set 0 contains all valid cpus. All thread initially belong to
cpuset 1. This permits migrating all threads off of certain cpus to
reserve them for special applications.
Sponsored by: Nokia
Discussed with: arch, rwatson, brooks, davidxu, deischen
Reviewed by: antoine
2008-03-02 07:39:22 +00:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice unmodified, this list of conditions, and the following
|
|
|
|
* disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SYS_CPUSET_H_
|
|
|
|
#define _SYS_CPUSET_H_
|
|
|
|
|
|
|
|
#ifdef _KERNEL
|
|
|
|
#define CPU_SETSIZE MAXCPU
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define CPU_MAXSIZE 128
|
|
|
|
|
|
|
|
#ifndef CPU_SETSIZE
|
|
|
|
#define CPU_SETSIZE CPU_MAXSIZE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define _NCPUBITS (sizeof(long) * NBBY) /* bits per mask */
|
|
|
|
#define _NCPUWORDS howmany(CPU_SETSIZE, _NCPUBITS)
|
|
|
|
|
|
|
|
typedef struct _cpuset {
|
|
|
|
long __bits[howmany(CPU_SETSIZE, _NCPUBITS)];
|
|
|
|
} cpuset_t;
|
|
|
|
|
|
|
|
#define __cpuset_mask(n) ((long)1 << ((n) % _NCPUBITS))
|
|
|
|
#define CPU_CLR(n, p) ((p)->__bits[(n)/_NCPUBITS] &= ~__cpuset_mask(n))
|
|
|
|
#define CPU_COPY(f, t) (void)(*(t) = *(f))
|
|
|
|
#define CPU_ISSET(n, p) (((p)->__bits[(n)/_NCPUBITS] & __cpuset_mask(n)) != 0)
|
|
|
|
#define CPU_SET(n, p) ((p)->__bits[(n)/_NCPUBITS] |= __cpuset_mask(n))
|
|
|
|
#define CPU_ZERO(p) do { \
|
|
|
|
__size_t __i; \
|
|
|
|
for (__i = 0; __i < _NCPUWORDS; __i++) \
|
|
|
|
(p)->__bits[__i] = 0; \
|
|
|
|
} while (0)
|
|
|
|
|
2009-06-23 06:57:46 +00:00
|
|
|
#define CPU_FILL(p) do { \
|
|
|
|
__size_t __i; \
|
|
|
|
for (__i = 0; __i < _NCPUWORDS; __i++) \
|
|
|
|
(p)->__bits[__i] = -1; \
|
|
|
|
} while (0)
|
|
|
|
|
2008-03-05 01:49:20 +00:00
|
|
|
/* Is p empty. */
|
Add cpuset, an api for thread to cpu binding and cpu resource grouping
and assignment.
- Add a reference to a struct cpuset in each thread that is inherited from
the thread that created it.
- Release the reference when the thread is destroyed.
- Add prototypes for syscalls and macros for manipulating cpusets in
sys/cpuset.h
- Add syscalls to create, get, and set new numbered cpusets:
cpuset(), cpuset_{get,set}id()
- Add syscalls for getting and setting affinity masks for cpusets or
individual threads: cpuid_{get,set}affinity()
- Add types for the 'level' and 'which' parameters for the cpuset. This
will permit expansion of the api to cover cpu masks for other objects
identifiable with an id_t integer. For example, IRQs and Jails may be
coming soon.
- The root set 0 contains all valid cpus. All thread initially belong to
cpuset 1. This permits migrating all threads off of certain cpus to
reserve them for special applications.
Sponsored by: Nokia
Discussed with: arch, rwatson, brooks, davidxu, deischen
Reviewed by: antoine
2008-03-02 07:39:22 +00:00
|
|
|
#define CPU_EMPTY(p) __extension__ ({ \
|
|
|
|
__size_t __i; \
|
|
|
|
for (__i = 0; __i < _NCPUWORDS; __i++) \
|
|
|
|
if ((p)->__bits[__i]) \
|
|
|
|
break; \
|
|
|
|
__i == _NCPUWORDS; \
|
|
|
|
})
|
|
|
|
|
2008-03-05 01:49:20 +00:00
|
|
|
/* Is c a subset of p. */
|
|
|
|
#define CPU_SUBSET(p, c) __extension__ ({ \
|
|
|
|
__size_t __i; \
|
|
|
|
for (__i = 0; __i < _NCPUWORDS; __i++) \
|
|
|
|
if (((c)->__bits[__i] & \
|
|
|
|
(p)->__bits[__i]) != \
|
|
|
|
(c)->__bits[__i]) \
|
|
|
|
break; \
|
|
|
|
__i == _NCPUWORDS; \
|
|
|
|
})
|
|
|
|
|
|
|
|
/* Are there any common bits between b & c? */
|
|
|
|
#define CPU_OVERLAP(p, c) __extension__ ({ \
|
|
|
|
__size_t __i; \
|
|
|
|
for (__i = 0; __i < _NCPUWORDS; __i++) \
|
|
|
|
if (((c)->__bits[__i] & \
|
|
|
|
(p)->__bits[__i]) != 0) \
|
|
|
|
break; \
|
|
|
|
__i != _NCPUWORDS; \
|
|
|
|
})
|
|
|
|
|
2008-03-30 11:31:14 +00:00
|
|
|
/* Compare two sets, returns 0 if equal 1 otherwise. */
|
|
|
|
#define CPU_CMP(p, c) __extension__ ({ \
|
|
|
|
__size_t __i; \
|
|
|
|
for (__i = 0; __i < _NCPUWORDS; __i++) \
|
|
|
|
if (((c)->__bits[__i] != \
|
|
|
|
(p)->__bits[__i])) \
|
|
|
|
break; \
|
|
|
|
__i != _NCPUWORDS; \
|
|
|
|
})
|
|
|
|
|
Add cpuset, an api for thread to cpu binding and cpu resource grouping
and assignment.
- Add a reference to a struct cpuset in each thread that is inherited from
the thread that created it.
- Release the reference when the thread is destroyed.
- Add prototypes for syscalls and macros for manipulating cpusets in
sys/cpuset.h
- Add syscalls to create, get, and set new numbered cpusets:
cpuset(), cpuset_{get,set}id()
- Add syscalls for getting and setting affinity masks for cpusets or
individual threads: cpuid_{get,set}affinity()
- Add types for the 'level' and 'which' parameters for the cpuset. This
will permit expansion of the api to cover cpu masks for other objects
identifiable with an id_t integer. For example, IRQs and Jails may be
coming soon.
- The root set 0 contains all valid cpus. All thread initially belong to
cpuset 1. This permits migrating all threads off of certain cpus to
reserve them for special applications.
Sponsored by: Nokia
Discussed with: arch, rwatson, brooks, davidxu, deischen
Reviewed by: antoine
2008-03-02 07:39:22 +00:00
|
|
|
#define CPU_OR(d, s) do { \
|
|
|
|
__size_t __i; \
|
|
|
|
for (__i = 0; __i < _NCPUWORDS; __i++) \
|
|
|
|
(d)->__bits[__i] |= (s)->__bits[__i]; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define CPU_AND(d, s) do { \
|
|
|
|
__size_t __i; \
|
|
|
|
for (__i = 0; __i < _NCPUWORDS; __i++) \
|
|
|
|
(d)->__bits[__i] &= (s)->__bits[__i]; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define CPU_NAND(d, s) do { \
|
|
|
|
__size_t __i; \
|
|
|
|
for (__i = 0; __i < _NCPUWORDS; __i++) \
|
|
|
|
(d)->__bits[__i] &= ~(s)->__bits[__i]; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Valid cpulevel_t values.
|
|
|
|
*/
|
|
|
|
#define CPU_LEVEL_ROOT 1 /* All system cpus. */
|
|
|
|
#define CPU_LEVEL_CPUSET 2 /* Available cpus for which. */
|
|
|
|
#define CPU_LEVEL_WHICH 3 /* Actual mask/id for which. */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Valid cpuwhich_t values.
|
|
|
|
*/
|
|
|
|
#define CPU_WHICH_TID 1 /* Specifies a thread id. */
|
|
|
|
#define CPU_WHICH_PID 2 /* Specifies a process id. */
|
|
|
|
#define CPU_WHICH_CPUSET 3 /* Specifies a set id. */
|
2008-04-11 03:26:41 +00:00
|
|
|
#define CPU_WHICH_IRQ 4 /* Specifies an irq #. */
|
MFp4:
Bring in updated jail support from bz_jail branch.
This enhances the current jail implementation to permit multiple
addresses per jail. In addtion to IPv4, IPv6 is supported as well.
Due to updated checks it is even possible to have jails without
an IP address at all, which basically gives one a chroot with
restricted process view, no networking,..
SCTP support was updated and supports IPv6 in jails as well.
Cpuset support permits jails to be bound to specific processor
sets after creation.
Jails can have an unrestricted (no duplicate protection, etc.) name
in addition to the hostname. The jail name cannot be changed from
within a jail and is considered to be used for management purposes
or as audit-token in the future.
DDB 'show jails' command was added to aid debugging.
Proper compat support permits 32bit jail binaries to be used on 64bit
systems to manage jails. Also backward compatibility was preserved where
possible: for jail v1 syscalls, as well as with user space management
utilities.
Both jail as well as prison version were updated for the new features.
A gap was intentionally left as the intermediate versions had been
used by various patches floating around the last years.
Bump __FreeBSD_version for the afore mentioned and in kernel changes.
Special thanks to:
- Pawel Jakub Dawidek (pjd) for his multi-IPv4 patches
and Olivier Houchard (cognet) for initial single-IPv6 patches.
- Jeff Roberson (jeff) and Randall Stewart (rrs) for their
help, ideas and review on cpuset and SCTP support.
- Robert Watson (rwatson) for lots and lots of help, discussions,
suggestions and review of most of the patch at various stages.
- John Baldwin (jhb) for his help.
- Simon L. Nielsen (simon) as early adopter testing changes
on cluster machines as well as all the testers and people
who provided feedback the last months on freebsd-jail and
other channels.
- My employer, CK Software GmbH, for the support so I could work on this.
Reviewed by: (see above)
MFC after: 3 months (this is just so that I get the mail)
X-MFC Before: 7.2-RELEASE if possible
2008-11-29 14:32:14 +00:00
|
|
|
#define CPU_WHICH_JAIL 5 /* Specifies a jail id. */
|
Add cpuset, an api for thread to cpu binding and cpu resource grouping
and assignment.
- Add a reference to a struct cpuset in each thread that is inherited from
the thread that created it.
- Release the reference when the thread is destroyed.
- Add prototypes for syscalls and macros for manipulating cpusets in
sys/cpuset.h
- Add syscalls to create, get, and set new numbered cpusets:
cpuset(), cpuset_{get,set}id()
- Add syscalls for getting and setting affinity masks for cpusets or
individual threads: cpuid_{get,set}affinity()
- Add types for the 'level' and 'which' parameters for the cpuset. This
will permit expansion of the api to cover cpu masks for other objects
identifiable with an id_t integer. For example, IRQs and Jails may be
coming soon.
- The root set 0 contains all valid cpus. All thread initially belong to
cpuset 1. This permits migrating all threads off of certain cpus to
reserve them for special applications.
Sponsored by: Nokia
Discussed with: arch, rwatson, brooks, davidxu, deischen
Reviewed by: antoine
2008-03-02 07:39:22 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Reserved cpuset identifiers.
|
|
|
|
*/
|
|
|
|
#define CPUSET_INVALID -1
|
|
|
|
#define CPUSET_DEFAULT 0
|
|
|
|
|
|
|
|
#ifdef _KERNEL
|
|
|
|
LIST_HEAD(setlist, cpuset);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* cpusets encapsulate cpu binding information for one or more threads.
|
|
|
|
*
|
|
|
|
* a - Accessed with atomics.
|
|
|
|
* s - Set at creation, never modified. Only a ref required to read.
|
|
|
|
* c - Locked internally by a cpuset lock.
|
|
|
|
*
|
|
|
|
* The bitmask is only modified while holding the cpuset lock. It may be
|
|
|
|
* read while only a reference is held but the consumer must be prepared
|
|
|
|
* to deal with inconsistent results.
|
|
|
|
*/
|
|
|
|
struct cpuset {
|
|
|
|
cpuset_t cs_mask; /* bitmask of valid cpus. */
|
|
|
|
volatile u_int cs_ref; /* (a) Reference count. */
|
|
|
|
int cs_flags; /* (s) Flags from below. */
|
|
|
|
cpusetid_t cs_id; /* (s) Id or INVALID. */
|
|
|
|
struct cpuset *cs_parent; /* (s) Pointer to our parent. */
|
|
|
|
LIST_ENTRY(cpuset) cs_link; /* (c) All identified sets. */
|
|
|
|
LIST_ENTRY(cpuset) cs_siblings; /* (c) Sibling set link. */
|
|
|
|
struct setlist cs_children; /* (c) List of children. */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define CPU_SET_ROOT 0x0001 /* Set is a root set. */
|
|
|
|
#define CPU_SET_RDONLY 0x0002 /* No modification allowed. */
|
|
|
|
|
2008-03-30 11:31:14 +00:00
|
|
|
extern cpuset_t *cpuset_root;
|
2009-05-27 14:11:23 +00:00
|
|
|
struct prison;
|
MFp4:
Bring in updated jail support from bz_jail branch.
This enhances the current jail implementation to permit multiple
addresses per jail. In addtion to IPv4, IPv6 is supported as well.
Due to updated checks it is even possible to have jails without
an IP address at all, which basically gives one a chroot with
restricted process view, no networking,..
SCTP support was updated and supports IPv6 in jails as well.
Cpuset support permits jails to be bound to specific processor
sets after creation.
Jails can have an unrestricted (no duplicate protection, etc.) name
in addition to the hostname. The jail name cannot be changed from
within a jail and is considered to be used for management purposes
or as audit-token in the future.
DDB 'show jails' command was added to aid debugging.
Proper compat support permits 32bit jail binaries to be used on 64bit
systems to manage jails. Also backward compatibility was preserved where
possible: for jail v1 syscalls, as well as with user space management
utilities.
Both jail as well as prison version were updated for the new features.
A gap was intentionally left as the intermediate versions had been
used by various patches floating around the last years.
Bump __FreeBSD_version for the afore mentioned and in kernel changes.
Special thanks to:
- Pawel Jakub Dawidek (pjd) for his multi-IPv4 patches
and Olivier Houchard (cognet) for initial single-IPv6 patches.
- Jeff Roberson (jeff) and Randall Stewart (rrs) for their
help, ideas and review on cpuset and SCTP support.
- Robert Watson (rwatson) for lots and lots of help, discussions,
suggestions and review of most of the patch at various stages.
- John Baldwin (jhb) for his help.
- Simon L. Nielsen (simon) as early adopter testing changes
on cluster machines as well as all the testers and people
who provided feedback the last months on freebsd-jail and
other channels.
- My employer, CK Software GmbH, for the support so I could work on this.
Reviewed by: (see above)
MFC after: 3 months (this is just so that I get the mail)
X-MFC Before: 7.2-RELEASE if possible
2008-11-29 14:32:14 +00:00
|
|
|
struct proc;
|
2008-03-30 11:31:14 +00:00
|
|
|
|
Add cpuset, an api for thread to cpu binding and cpu resource grouping
and assignment.
- Add a reference to a struct cpuset in each thread that is inherited from
the thread that created it.
- Release the reference when the thread is destroyed.
- Add prototypes for syscalls and macros for manipulating cpusets in
sys/cpuset.h
- Add syscalls to create, get, and set new numbered cpusets:
cpuset(), cpuset_{get,set}id()
- Add syscalls for getting and setting affinity masks for cpusets or
individual threads: cpuid_{get,set}affinity()
- Add types for the 'level' and 'which' parameters for the cpuset. This
will permit expansion of the api to cover cpu masks for other objects
identifiable with an id_t integer. For example, IRQs and Jails may be
coming soon.
- The root set 0 contains all valid cpus. All thread initially belong to
cpuset 1. This permits migrating all threads off of certain cpus to
reserve them for special applications.
Sponsored by: Nokia
Discussed with: arch, rwatson, brooks, davidxu, deischen
Reviewed by: antoine
2008-03-02 07:39:22 +00:00
|
|
|
struct cpuset *cpuset_thread0(void);
|
|
|
|
struct cpuset *cpuset_ref(struct cpuset *);
|
2008-03-30 11:31:14 +00:00
|
|
|
void cpuset_rel(struct cpuset *);
|
|
|
|
int cpuset_setthread(lwpid_t id, cpuset_t *);
|
2009-05-27 14:11:23 +00:00
|
|
|
int cpuset_create_root(struct prison *, struct cpuset **);
|
MFp4:
Bring in updated jail support from bz_jail branch.
This enhances the current jail implementation to permit multiple
addresses per jail. In addtion to IPv4, IPv6 is supported as well.
Due to updated checks it is even possible to have jails without
an IP address at all, which basically gives one a chroot with
restricted process view, no networking,..
SCTP support was updated and supports IPv6 in jails as well.
Cpuset support permits jails to be bound to specific processor
sets after creation.
Jails can have an unrestricted (no duplicate protection, etc.) name
in addition to the hostname. The jail name cannot be changed from
within a jail and is considered to be used for management purposes
or as audit-token in the future.
DDB 'show jails' command was added to aid debugging.
Proper compat support permits 32bit jail binaries to be used on 64bit
systems to manage jails. Also backward compatibility was preserved where
possible: for jail v1 syscalls, as well as with user space management
utilities.
Both jail as well as prison version were updated for the new features.
A gap was intentionally left as the intermediate versions had been
used by various patches floating around the last years.
Bump __FreeBSD_version for the afore mentioned and in kernel changes.
Special thanks to:
- Pawel Jakub Dawidek (pjd) for his multi-IPv4 patches
and Olivier Houchard (cognet) for initial single-IPv6 patches.
- Jeff Roberson (jeff) and Randall Stewart (rrs) for their
help, ideas and review on cpuset and SCTP support.
- Robert Watson (rwatson) for lots and lots of help, discussions,
suggestions and review of most of the patch at various stages.
- John Baldwin (jhb) for his help.
- Simon L. Nielsen (simon) as early adopter testing changes
on cluster machines as well as all the testers and people
who provided feedback the last months on freebsd-jail and
other channels.
- My employer, CK Software GmbH, for the support so I could work on this.
Reviewed by: (see above)
MFC after: 3 months (this is just so that I get the mail)
X-MFC Before: 7.2-RELEASE if possible
2008-11-29 14:32:14 +00:00
|
|
|
int cpuset_setproc_update_set(struct proc *, struct cpuset *);
|
2008-03-30 11:31:14 +00:00
|
|
|
|
Add cpuset, an api for thread to cpu binding and cpu resource grouping
and assignment.
- Add a reference to a struct cpuset in each thread that is inherited from
the thread that created it.
- Release the reference when the thread is destroyed.
- Add prototypes for syscalls and macros for manipulating cpusets in
sys/cpuset.h
- Add syscalls to create, get, and set new numbered cpusets:
cpuset(), cpuset_{get,set}id()
- Add syscalls for getting and setting affinity masks for cpusets or
individual threads: cpuid_{get,set}affinity()
- Add types for the 'level' and 'which' parameters for the cpuset. This
will permit expansion of the api to cover cpu masks for other objects
identifiable with an id_t integer. For example, IRQs and Jails may be
coming soon.
- The root set 0 contains all valid cpus. All thread initially belong to
cpuset 1. This permits migrating all threads off of certain cpus to
reserve them for special applications.
Sponsored by: Nokia
Discussed with: arch, rwatson, brooks, davidxu, deischen
Reviewed by: antoine
2008-03-02 07:39:22 +00:00
|
|
|
#else
|
|
|
|
__BEGIN_DECLS
|
|
|
|
int cpuset(cpusetid_t *);
|
|
|
|
int cpuset_setid(cpuwhich_t, id_t, cpusetid_t);
|
|
|
|
int cpuset_getid(cpulevel_t, cpuwhich_t, id_t, cpusetid_t *);
|
2008-03-25 09:11:53 +00:00
|
|
|
int cpuset_getaffinity(cpulevel_t, cpuwhich_t, id_t, size_t, cpuset_t *);
|
|
|
|
int cpuset_setaffinity(cpulevel_t, cpuwhich_t, id_t, size_t, const cpuset_t *);
|
Add cpuset, an api for thread to cpu binding and cpu resource grouping
and assignment.
- Add a reference to a struct cpuset in each thread that is inherited from
the thread that created it.
- Release the reference when the thread is destroyed.
- Add prototypes for syscalls and macros for manipulating cpusets in
sys/cpuset.h
- Add syscalls to create, get, and set new numbered cpusets:
cpuset(), cpuset_{get,set}id()
- Add syscalls for getting and setting affinity masks for cpusets or
individual threads: cpuid_{get,set}affinity()
- Add types for the 'level' and 'which' parameters for the cpuset. This
will permit expansion of the api to cover cpu masks for other objects
identifiable with an id_t integer. For example, IRQs and Jails may be
coming soon.
- The root set 0 contains all valid cpus. All thread initially belong to
cpuset 1. This permits migrating all threads off of certain cpus to
reserve them for special applications.
Sponsored by: Nokia
Discussed with: arch, rwatson, brooks, davidxu, deischen
Reviewed by: antoine
2008-03-02 07:39:22 +00:00
|
|
|
__END_DECLS
|
|
|
|
#endif
|
|
|
|
#endif /* !_SYS_CPUSET_H_ */
|