Commit Graph

168 Commits

Author SHA1 Message Date
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
mrg baafcdbb23 make the bpendtsleep: label only active if KERN_SYNCH_BPENDTSLEEP_LABEL
is defined.  if this option is present in the Makefile CFLAGS and we are
using GCC4, build kern_synch.c with -fno-reorder-blocks, so that this
actually works.

XXX be nice if KERN_SYNCH_BPENDTSLEEP_LABEL was a normal 'defflag' option
XXX but for now take the easy way out and make it checkable in CFLAGS.
2006-09-07 18:41:28 +00:00
christos 9802793325 deal with empty if bodies 2006-09-02 06:32:09 +00:00
tsutsui 79d3499096 Disable asm statement which defines bpendtsleep symbol as "handy breakpoint"
on all m68k ports since it may cause a multiple symble definition error
by code duplication of gcc4 optimizer. Also note about this in comment.
2006-08-30 17:28:32 +00:00
christos 35ca6c8b5b Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!
2006-08-17 17:11:27 +00:00
matt 34b5f92bac Don't define bpendtsleep on vax (gcc4 optimizer will duplicate the asm
that contains it result in a multiple symbol definition in gas).
2006-07-08 00:23:29 +00:00
mrg 8075fe8705 don't put the bpendtsleep handy breakpoint in sun2 kernels as the
output asm includes it twice causing multiply-defined symbols.
2006-06-24 05:23:06 +00:00
elad 215bd95ba4 integrate kauth. 2006-05-14 21:15:11 +00:00
chs 0545b6e0cb changes for making DIAGNOSTIC not change the kernel ABI:
- for structure fields that are conditionally present,
   make those fields always present.
 - for functions which are conditionally inline, make them never inline.
 - remove some other functions which are conditionally defined but
   don't actually do anything anymore.
 - make a lock-debugging function conditional on only LOCKDEBUG.

as discussed on tech-kern some time back.
2005-12-27 04:06:45 +00:00
perry 144515ce1a u_intN_t -> uintN_t 2005-12-26 18:41:36 +00:00
perry a2cd732268 Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 19:12:23 +00:00
yamt 6454c469ea fix a long-standing scheduler problem that p_estcpu is doubled
for each fork-wait cycles.

- updatepri: factor out the code to decay estcpu so that it can be used
  by scheduler_wait_hook.
- scheduler_fork_hook: record how much estcpu is inherited from
  the parent process.
- scheduler_wait_hook: don't add back inherited estcpu to the parent.
2005-12-24 12:57:14 +00:00
rpaulo b37b6e42f6 Fix comments for preempt() using rev. 1.101.2.31 log of nathanw_sa by thorpej. 2005-12-20 19:26:15 +00:00
yamt d369d69d2f updatepri:
- don't compare a scaled value with a unscaled value.
- actually, 7 times the loadfactor is necessary to decay p_estcpu enough,
  even before the recent p_estcpu changes.
  after the recent p_estcpu change, 8 times loadavg decay is needed.
- fix a comment to match with the recent reality.
2005-12-15 13:43:49 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt 8ab7495c2d make scheduler work better when a system has many runnable processes
by making p_estcpu fixpt_t.  PR/31542.

1. schedcpu() decreases p_estcpu of all processes
   every seconds, by at least 1 regardless of load average.
2. schedclock() increases p_estcpu of curproc by 1,
   at about 16 hz.

in the consequence, if a system has >16 processes
with runnable lwps, their p_estcpu are not likely increased.

by making p_estcpu fixpt_t, we can decay it more slowly
when loadavg is high.  (ie. solve #1.)

i left kinfo_proc2::p_estcpu (ie. ps -O cpu) scaled because i have
no idea about its absolute value's usage other than debugging,
for which raw values are more valuable.
2005-11-01 09:07:53 +00:00
yamt a9894b0f08 - localize some definitions.
- use PPQ macro where appropriate.
2005-10-30 20:28:56 +00:00
yamt 2975f576b9 uninline scheduler hooks. 2005-10-06 07:02:13 +00:00
chs 7c02feca68 avoid calling into the pool code while holding sched_lock
since both pool_get() and pool_put() can call wakeup().
instead, allocate the struct sadata_upcall before taking
sched_lock in mi_switch() and free it after releasing sched_lock.

clean up some modularity warts by adding a callback to
struct sadata_upcall for freeing sa_arg.
2005-10-02 17:51:27 +00:00
christos efb6943313 - add const.
- remove unnecessary casts.
- add __UNCONST casts and mark them with XXXUNCONST as necessary.
2005-05-29 22:24:14 +00:00
mycroft b9c71ccc7a Copyright maintenance. 2005-03-02 11:05:34 +00:00
perry da8abec863 nuke trailing whitespace 2005-02-26 21:34:55 +00:00
matt 108f8fbc51 Add some debug code to validate the runqueues if RQDEBUG is defined. 2004-12-09 21:52:24 +00:00
yamt 0994e6acb8 introduce a function, proclist_foreach_call, to iterate all procs on
a proclist and call the specified function for each of them.
primarily to fix a procfs locking problem, but i think that it's useful for
others as well.

while i'm here, introduce PROCLIST_FOREACH macro, which is similar to
LIST_FOREACH but skips marker entries which are used by proclist_foreach_call.
2004-10-01 16:30:52 +00:00
yamt efc80878d1 use lockstatus() instead of L_BIGLOCK to check if we're holding a biglock.
fix PR/25595.
2004-05-18 11:59:11 +00:00
yamt 054ed3afcb use callout_schedule() for schedcpu(). 2004-05-12 20:13:58 +00:00
cl ea5ec0212d add kernel part of concurrency support for SA on MP systems
- move per VP data into struct sadata_vp referenced from l->l_savp
  * VP id
  * lock on VP data
  * LWP on VP
  * recently blocked LWP on VP
  * queue of LWPs woken which ran on this VP before sleep
  * faultaddr
  * LWP cache for upcalls
  * upcall queue
- add current concurrency and requested concurrency variables
- make process exit run LWP on all VPs
- make signal delivery consider all VPs
- make timer events consider all VPs
- add sa_newsavp to allocate new sadata_vp structure
- add sa_increaseconcurrency to prepare new VP
- make sys_sa_setconcurrency request new VP or wakeup idle VP
- make sa_yield lower current concurrency
- set sa_cpu = VP id in upcalls
- maintain cached LWPs per VP
2004-03-14 01:08:47 +00:00
wiz d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
kleink 1b16e3f0a3 ; may be a comment character in assembly, use \n as a separator instead. 2004-01-04 13:27:53 +00:00
cl 350dd95eff Cleanup signal delivery for SA processes:
General idea:  only consider the LWP on the VP for signal delivery, all
other LWPs are either asleep or running from waking up until repossessing
the VP.

- in kern_sig.c:kpsignal2: handle all states the LWP on the VP can be in
- in kern_sig.c:proc_stop: only try to stop the LWP on the VP.  All other
  LWPs will suspend in sa_vp_repossess() until the VP-LWP donates the VP.
  Restore original behaviour (before SA-specific hacks were added) for
  non-SA processes.
- in kern_sig.c:proc_unstop: only return the LWP on the VP
- handle sa_yield as case 0 in sa_switch instead of clearing L_SA, add an
  L_SA_YIELD flag
- replace sa_idle by L_SA_IDLE flag since it was either NULL or == sa_vp

Also don't output itimerfire overrun warning if the process is already
exiting.
Also g/c sa_woken because it's not used.
Also g/c some #if 0 code.
2003-11-02 16:26:10 +00:00
fvdl 404fa205d1 Fix (bogus) unitialized variable warning. 2003-10-26 20:55:57 +00:00
itojun 311078a035 truncated output from pty problem. fix by enami
http://mail-index.netbsd.org/tech-kern/2003/09/06/0002.html
2003-09-08 11:14:18 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
matt 79fccc7527 Improve _lwp_wakeup so when it wakes a thread, the target thread thinks
ltsleep has been interrupted and thus the target will not think it was
a spurious wakeup.  (this makes syscalls cancellable for libpthread).
2003-07-28 23:35:20 +00:00
matt 0c7a583f3a Add support for storing the priority mask in sched_whichqs in MSB order
(enabled by defining __HAVE_BIGENDIAN_BITOPS in <machine/types.h>).  The
default is still LSB ordering.  This change will allow the powerpc MD
implementations of setrunqueue/remrunqueue to be nuked.
2003-07-18 01:02:31 +00:00
fvdl 4bd1a8dcf8 Changes from Stephan Uphoff to patch problems with LWPs blocking when they
shouldn't, and MP.
2003-07-17 18:16:58 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
nathanw 08cf80dc5c Whitespace police. 2003-06-26 02:09:27 +00:00
nathanw 169a6757eb For now, disable voluntary mid-operation preempt() for SA processes;
it doesn't interact well with SA's idea of what's running.
2003-06-26 02:08:19 +00:00
simonb 8ba8e8a81b Sprinkle a little white-space. 2003-05-20 13:48:08 +00:00
matt d97fd7e0ed In setrunnable, give more infomrmation in the panic message so we can
figure out WTF went wrong.
2003-05-08 02:04:11 +00:00
pk e148067544 ltsleep(): deal with PNOEXITERR after re-taking the interlock (if necessary). 2003-02-04 20:15:59 +00:00
yamt 05628fc8d1 constify wait channels of ltsleep/wakeup. they are never dereferenced. 2003-02-04 13:41:48 +00:00
yamt 41ad61ee76 make KSTACK_CHECK_* compile after sa merge. 2003-01-22 12:52:14 +00:00
christos d00d441811 step 4: don't de-reference l, if you are going to test if it is NULL a couple
of lines below.
2003-01-21 00:02:07 +00:00
thorpej e0d8d366df Merge the nathanw_sa branch. 2003-01-18 10:06:22 +00:00
thorpej b9cdec841a Pass the process priority we want to compare to resched_proc(). Restores
resetpriority() behavior.  Thanks to Enami Tsugutomo for pointing out my
mistake.
2003-01-15 07:12:20 +00:00
pk da40c6dd43 schedcpu(): after updating the process CPU tick counters, we no longer need
to run at splstatclock(); continue at splsched().
2003-01-12 01:48:56 +00:00
thorpej 85c31b11c3 * Move the resched check from setrunnable() and resetpriority() to
a new inline, resched_proc().
* When performing the resched check, check the priority against the
  current priority on the CPU the process last ran on, not always the
  current CPU.
2002-12-29 17:40:26 +00:00