Commit Graph

15 Commits

Author SHA1 Message Date
rmind 3c507045e2 Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour.  Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.
2010-07-01 02:38:26 +00:00
ad caac34d32b MAXCPUS -> maxcpus 2010-04-25 11:49:22 +00:00
elad 40cc528a28 Move psets security policy back to the subsystem and keep suser logic only
in the suser secmodel code.
2009-10-02 21:56:28 +00:00
rmind 4f1720c349 lwp_create: fix the locking bugs on affinity ingerition path (mea culpa).
pset_assign: traverse the list of LWPs safely.
sched_setaffinity: free cpuset (unused path) outside the lock.

Reviewed (with feedback) by <ad>.
2009-03-03 21:55:06 +00:00
rmind 9e43fad609 sys__pset_bind: obviously, sched_takecpu() should take "t" LWP, not "l". 2009-01-23 13:58:08 +00:00
rmind 909e7f4259 - Make thread-affinity and processor-set interfaces mutually exlusive.
- pset_assign: when CPU is assigned, migrate out all LWPs from it.
2009-01-20 01:57:35 +00:00
rmind ae626d791a - Schedule bound threads even if CPU is offline. Might be revisited later,
when decision what to do with already bound threads will be made.
- Do not allow to assign offline CPU to the processor-set.

Quick fix for PR/39349.
2008-09-30 16:28:45 +00:00
ad 53db9954a3 - Ensure that at least one cpu stays in the default pset, otherwise the
system will lock up.
- Use cpu_lock, there's no need for a seperate psets_lock.
- Add a sysctl to return the list of psets as a string.
2008-06-22 12:59:18 +00:00
rmind 06171502fc Adjust and thus unify my license. 2008-05-26 17:45:51 +00:00
ad 284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
ad 6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +00:00
elad fb37bad459 Use proper kauth(9) actions/requests for native scheduler stuff and the
recently introduced processor-sets.

Discussed with and okay rmind@, yamt@, and christos@.
2008-01-30 17:54:55 +00:00
rmind aa633f0365 Fix the return values to conform the standard and/or be compatible with
other systems.  Reported by <drochner>.
2008-01-24 14:41:12 +00:00
yamt 183f0fa9f2 sys__pset_bind: don't leave pset busy. 2008-01-15 09:11:29 +00:00
rmind 5c71a4d49f Implementation of processor-sets, affinity and POSIX real-time extensions.
Add schedctl(8) - a program to control scheduling of processes and threads.

Notes:
- This is supported only by SCHED_M2;
- Migration of LWP mechanism will be revisited;

Proposed on: <tech-kern>. Reviewed by: <ad>.
2008-01-15 03:37:10 +00:00