Commit Graph

19 Commits

Author SHA1 Message Date
njoly
425fc32da6 s/Minimal/Maximal/ in kern.sched.pri_max sysctl node description. 2008-03-05 12:47:13 +00:00
elad
67470a76a1 Factor out the guts of get/setparam so it can be used from the compat code.
Make the FreeBSD and Linux compat code convert the parameters to their
native representation and call the native routines.

Remove KAUTH_PROCESS_SCHEDULER_GET/SET.

Update documentation and examples.

XXX: For now, only the Linux compat code does the priority conversion
XXX: right.

Linux priority conversion code from yamt@, thanks!

Okay yamt@.
2008-02-28 16:09:18 +00:00
ad
9a0b455f25 - Add a one line comment indicating what this file does.
- Move the check for PK_SYSTEM to a more sane place.
2008-02-22 23:10:12 +00:00
rmind
9850c0557d sys__sched_getparam and sys__sched_getaffinity: Do not assume that LWP
with LID=1 exists, use LIST_FIRST(&p->p_lwps) instead.
Fixes PR/37987 by <yamt>.

While here, adjust license.
2008-02-22 22:32:49 +00:00
drochner
cc0caabca7 fix sched_setparam() error reporting (broken by recent kauth changes) 2008-02-19 19:38:18 +00:00
yamt
aa57485fe2 sys__sched_setparam: fix a lock leak. 2008-02-19 09:44:26 +00:00
yamt
146e2f8297 sys__sched_setparam: use a correct lwp. 2008-02-18 02:00:08 +00:00
elad
0bb7f5ccb3 PR/37986: YAMAMOTO Takashi: any user can hog the all cpu with
_sched_setparam.

Pass proper context to kauth(9) for a decision to made based on the
scheduling policy and priority.
2008-02-17 19:22:35 +00:00
elad
e99760e7e4 Fold KAUTH_REQ_PROCESS_SCHEDULER_* to KAUTH_PROCESS_SCHEDULER_*. In other
words, don't pass an action and a request, and just use a single action to
indicate what is the operation in question.

This is the first step in fixing PR/37986, which calls for policy/priority
checking in the secmodel code. Right now we're lacking room for another
parameter required to make a decision, and this change makes room for such.
2008-02-16 16:39:34 +00:00
yamt
16b042cbdb from rmind@,
- revert struct sched_param changes to restore ABI.
- instead, add 'policy' arguments to _sched_{get,set}param syscalls.
  (this is an API/ABI change.)
- correct kauth_authorize_process arguments.

while i'm here,
- don't bother to kmem_alloc for 4-byte structure.
2008-02-09 16:58:01 +00:00
elad
17bc624c06 EACCES -> EPERM. 2008-01-31 01:21:17 +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
b5e9addd22 sched_setparam: fix the case when incorrect (according to the class)
in-kernel priority is used.  Reported by <drochner>.

Minor fixes for scheduling calls to conform the POSIX:
- If pid is equal to zero, use the calling process;
- In case of permission problem, return EPERM instead of EACESS;
- sched_setscheduler() should return previously used policy;
- pthread_* calls should return the error code or zero;

Should fix the namespace problems (and builds of some packages):
- Move cpuset_t defintion from pset.h to sched.h;
- Remove the #include of pset.h in pthread.h;
2008-01-26 17:55:29 +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
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
dsl
7e2790cf6f Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
2007-12-20 23:02:38 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
dogcow
8f871f1a8d #include <sys/sa.h> to get sys_upcall_t def. 2007-01-16 20:12:40 +00:00
ad
606e323b3e Add sched_yield(). 2007-01-16 05:28:45 +00:00