summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_cpuset.c
Commit message (Collapse)AuthorAgeFilesLines
* When constructing a new cpuset, apply the parent cpuset's mask to the newjhb2011-03-081-4/+4
| | | | | | | | set's mask rather than the root mask. This was causing the root mask to be modified incorrectly. Reviewed by: jeff MFC after: 1 week
* Use integer for size of cpuset, as it won't be bigger than INT_MAX,davidxu2010-11-011-0/+4
| | | | | | This is requested by bge. Also move the sysctl into file kern_cpuset.c, because it should always be there, it is independent of thread scheduler.
* - Revert r214409.davidxu2010-10-271-4/+0
| | | | - Use long word to figure out sizeof kernel cpuset, hope it works.
* If input parameter cpusetsize is zero, give userland size of cpuset maskdavidxu2010-10-271-0/+4
| | | | kernel is using.
* Use function tdfind() to find a thread.davidxu2010-10-251-11/+2
|
* Another nit that both I and ispell missed.jhb2009-10-261-1/+1
| | | | Submitted by: Ben Kaduk minimarmot of gmail
* Fix some spelling nits.jhb2009-10-261-5/+5
|
* Remove unnecessary/redundant includes.jamie2009-06-231-1/+0
| | | | Approved by: bz (mentor)
* Add hierarchical jails. A jail may further virtualize its environmentjamie2009-05-271-38/+14
| | | | | | | | | | | | | | | | | | | | | | by creating a child jail, which is visible to that jail and to any parent jails. Child jails may be restricted more than their parents, but never less. Jail names reflect this hierarchy, being MIB-style dot-separated strings. Every thread now points to a jail, the default being prison0, which contains information about the physical system. Prison0's root directory is the same as rootvnode; its hostname is the same as the global hostname, and its securelevel replaces the global securelevel. Note that the variable "securelevel" has actually gone away, which should not cause any problems for code that properly uses securelevel_gt() and securelevel_ge(). Some jail-related permissions that were kept in global variables and set via sysctls are now per-jail settings. The sysctls still exist for backward compatibility, used only by the now-deprecated jail(2) system call. Approved by: bz (mentor)
* Prevent a superuser inside a jail from modifying the dedicatedbz2009-04-281-0/+9
| | | | | | | | | | | | | root cpuset of that jail. Processes inside the jail will still be able to change child sets. A superuser outside of a jail will still be able to change the jail cpuset and thus limit the number of cpus available to the jail. Problem reported by: 000.fbsd@quip.cz (Miroslav Lachman) PR: kern/134050 Reviewed by: jeff MFC after: 3 weeks X-MFC: backout r191596
* Correct a comment: the function name given had never existed in anybz2009-04-221-1/+2
| | | | | | (relevant) version of this file orany of my patches. MFC after: 1 month
* MFp4:bz2008-11-291-4/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add a `show cpusets' DDB command to print numbered root andbz2008-07-071-0/+33
| | | | | | assigned CPU affinity sets. Reviewed by: brooks
* Move cpuset_refroot and cpuset_refbase functions up, grouping thebz2008-07-071-32/+32
| | | | | | cpuset_ref* functions together. Will make it easier to read and add code without forward declarations. No functional changes.
* Add a new priv 'PRIV_SCHED_CPUSET' to check if manipulating cpusets isbz2008-06-291-1/+1
| | | | | | allowed and replace the suser() call. Do not allow it in jails. Reviewed by: rwatson
* Take into account possible overflow when multiplying. The casuality iskib2008-05-261-2/+2
| | | | | | | the malloc call later, panicing kernel due to the oversized allocation. Reported by: pho Reviewed by: jeff
* - Add the interrupt vector number to intr_event_create so MI code canjeff2008-04-111-0/+16
| | | | | | | | | | | | lookup hard interrupt events by number. Ignore the irq# for soft intrs. - Add support to cpuset for binding hardware interrupts. This has the side effect of binding any ithread associated with the hard interrupt. As per restrictions imposed by MD code we can only bind interrupts to a single cpu presently. Interrupts can be 'unbound' by binding them to all cpus. Reviewed by: jhb Sponsored by: Nokia
* - Add a Nokia copyright to cpuset to reflect their generousjeff2008-04-041-0/+3
| | | | contribution to this work.
* - Consistently return EDEADLK when presented with a new set that isjeff2008-03-301-20/+27
| | | | | | | | | | | | incompatible with existing bindings. - Try to copyout the setid in cpuset() before migrating the proc to the setid in case the user has supplied a bad buffer. - Rename cpuset_root() and cpuset_base() to cpuset_ref{root,base} to be more descriptive and free cpuset_root to be used as a different type of symbol. - Make cpuset_root the cpuset_t set of all cpus in the system. This should contain the same bitmask as all_cpus presently. - Add a CPU_CMP() macro to compare two sets.
* Fixed type of the fourth argument of cpuset_{get,set}affinity(2) to be size_t.ru2008-03-251-11/+10
| | | | Prodded by: davidxu
* - Relax requirements for p_numthreads, p_threads, p_swtick, and p_nice fromjeff2008-03-191-10/+2
| | | | | | | requiring the per-process spinlock to only requiring the process lock. - Reflect these changes in the proc.h documentation and consumers throughout the kernel. This is a substantial reduction in locking cost for these fields and was made possible by recent changes to threading support.
* - Add a missing unlock to cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID)jeff2008-03-061-0/+1
| | | | Found by: gallatin
* - Don't overwrite the recently allocated 'nset' in cpuset_setthread() byjeff2008-03-051-1/+1
| | | | | | | | passing it to cpuset_which(). Pass in 'set' instead. This argument is not used but for convenience cpuset_which() nulls all incoming parameters. Submitted by: davidxu
* - Verify that when a user supplies a mask that is bigger than the kerneljeff2008-03-051-26/+78
| | | | | | | | | | mask none of the upper bits are set. - Be more careful about enforcing the boundaries of masks and child sets. - Introduce a few more CPU_* macros for implementing these tests. - Change the cpusetsize argument to be bytes rather than bits to match other apis. Sponsored by: Nokia
* Add cpuset, an api for thread to cpu binding and cpu resource groupingjeff2008-03-021-0/+907
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
OpenPOWER on IntegriCloud