Commit Graph

46 Commits

Author SHA1 Message Date
dsl 5afdebabb4 include cdefs.h before opt_xxx.h 2007-07-19 21:54:51 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
yamt f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +00:00
rmind 67d703cf25 Import of POSIX Asynchronous I/O.
Seems to be quite stable. Some work still left to do.

Please note, that syscalls are not yet MP-safe, because
of the file and vnode subsystems.

Reviewed by: <tech-kern>, <ad>
2007-04-30 14:44:28 +00:00
matt 93feeb1203 Fix lossage from boolean_t -> bool and updated x86 bus_dma. 2007-02-22 04:38:02 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
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
elad 874fef3711 integrate kauth. 2006-05-14 21:19:33 +00:00
uwe adcd5c2d11 db_show_sched_qs: fix pointer cast lint considers troublesome. 2006-01-22 01:08:50 +00:00
uwe 19707b27a5 Add /l to show all procs usage. 2006-01-22 00:50:51 +00:00
uwe 91321511a9 This is not IOCCC. Replace " >"[cp == p] with conditional expression.
Makes lint happy.  Probably generates better code too (does on sh3).
2006-01-22 00:47:50 +00:00
he 1067be953e After addition of "show all pools", we now need <sys/pool.h> here.
Fixes build problem for mac68k.
2005-12-03 22:47:25 +00:00
yamt a004e1d63c add "show all pools" command for ddb. 2005-12-01 13:21:05 +00:00
yamt aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
drochner 4d205d8853 more constification fallout 2005-06-01 12:25:27 +00:00
perry 477853c351 nuke trailing whitespace 2005-02-26 22:58:54 +00:00
nathanw 0ac1c38100 Make ddb's "show sched_qs" aware of big-endian sched_qs arrangements. 2004-07-27 02:15:07 +00:00
thorpej c7a178e4a9 Add a "show sched_qs" command to dump the run queues. Format is:
1	pid.lid (p_comm)
	pid.lid (p_comm)
 ...

If a queue has procs, but no sched_whichqs bit, it shows:
!1	pid.lid (p_comm)
2003-09-20 03:02:03 +00:00
uwe ca90f34170 Widen FLAGS column for ps/l so that all defined l_flag flags fit. 2003-09-07 14:14:36 +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
simonb c9bc6f3a9a Allow the dmesg command to show the last N bytes of the kernel message
buffer.
2003-07-02 07:05:29 +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
atatat b5329c1d85 (1) Don't print the message buffer (via ddb's dmesg command) if the
message buffer has not yet been set up, mimicking code from the top of
the sysctl routine for retrieving the message buffer.

(2) Add a /l modifier to the trace command.  This makes it print the
backtrace using printf() instead of db_printf(), which has the nice
side-effect of also putting it into the message buffer.  A kernel with
ddb in it but disabled (ie, ddb.onpanic set to zero) will print a
backtrace (which ends up in the message buffer) before dumping (or
not, depending on the value of kern.dump_on_panic) and rebooting, but
if ddb is not disabled, the backtrace is not printed, and there's no
way to get it to display a backtrace such that you can retrieve it
after the dump.  The backtrace printed by gdb is sometimes a little
different.

(3) Documentation for the above.
2003-05-15 13:18:18 +00:00
briggs e2391a87b6 Add a rudimentary 'trap to kgdb' command if KGDB is defined. This allows
systems with only one serial port for console, etc., to have at least some
basic access to remote-kgdb-over-serial, even if it is a bit awkward.
2003-04-28 02:49:54 +00:00
thorpej 1b84adbe5f New callout implementation. This is based on callwheel implementation
done by Artur Grabowski and Thomas Nordin for OpenBSD, which is more
efficient in several ways than the callwheel implementation that it is
replacing.  It has been adapted to our pre-existing callout API, and
also provides the slightly more efficient (and much more intuitive)
API (adapted to the callout_*() naming scheme) that the OpenBSD version
provides.

Among other things, this shaves a bunch of cycles off rescheduling-in-
the-future a callout which is already scheduled, which the common case
for TCP timers (notably REXMT and KEEP).

The API has been simplified a bit, as well.  The (very confusing to
a good many people) "ACTIVE" state for callouts has gone away.  There
is now only "PENDING" (scheduled to fire in the future) and "EXPIRED"
(has fired, and the function called).

Kernel version bump not done; we'll ride the 1.6N bump that happened
with the malloc(9) change.
2003-02-04 01:21:03 +00:00
pk 58005dc9d3 Zombie procs have no lwps. 2003-01-23 12:41:33 +00:00
thorpej b78f59b443 Merge the nathanw_sa branch. 2003-01-18 08:51:40 +00:00
scw a82718b34d Casting from a pointer, to a db_expr_t, has to go via an intptr_t.
(db_expr_t == int64_t on sh5, for example).
2002-08-26 11:34:27 +00:00
simonb 4eaa4d66a8 ANSIfy, KNF.
Make some variables and functions static when not used outside of a module.
Make variables in headers extern.
Delete the unused db_find_watchpoint() function.
2002-02-15 07:33:48 +00:00
lukem 1ac69d9cb3 add RCSIDs 2001-11-12 22:54:03 +00:00
chs 3fb05f05f8 use a for loop instead of goto. 2001-09-15 18:20:53 +00:00
thorpej 16c229ea7c Optimization suggested by Bill Sommerfeld: Keep a hint as to the
"earliest" firing callout in a bucket.  This allows us to skip
the scan up the bucket if no callouts are due in the bucket.

A cheap O(1) hint update is done at callout insertion (if new callout
is earlier than hint) and removal (is bucket empty).  A thorough
refresh of the hint is done when the bucket is traversed.

This doesn't matter much on machines with small values of hz
(e.g. i386), but on systems with large values of hz (e.g. Alpha),
it has a definite positive effect.

Also, keep the callwheel stats in evcnts, so that you can view them
with "vmstat -e".
2001-09-11 04:32:19 +00:00
atatat 124ae5b65c Add an easy way to dump the message buffer from ddb. 2001-07-31 04:28:16 +00:00
thorpej 366b23111a Make sure values for a %llx are long long. 2000-11-28 21:44:34 +00:00
eeh 6a7e0164dd Implement db_show_callout() again. 2000-11-28 19:20:37 +00:00
jhawk f3528d725d Interface change: db_printsym() takes a third argument, pr, a function
pointer indicating how to print the symbol. This allows db_printsym()
to called in places where db_printf() is not an appropriate output
function.

While straightforward, apologies in advance if I've introduced any minor
syntax errors; I was unable to test compilation this on all the affected
platforms.
2000-05-25 19:57:30 +00:00
kleink 8abfe24915 Cast timeval members to types we know the printf conversions of. 2000-03-26 20:24:12 +00:00
thorpej fc96443d15 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 07:01:25 +00:00
thorpej 40c08923a8 XXX LOCKING XXX of allproc; DDB runs with interrupts blocked, and MD
code should suspend other processors, so this probably isn't a problem,
but the comment is added anyhow.
1999-07-22 21:11:26 +00:00
thorpej 970e60efb8 - Use proclists[], rather than checking allproc and zombproc explicitly.
- Add some comments about locking.
1998-09-08 23:50:13 +00:00
eeh a2dd74ed79 Merge paddr_t changes into the main branch. 1998-08-13 02:10:37 +00:00
ross 9b463a1108 Print more info on ps/w, note the current proc, and properly declare db_maxoff. 1998-01-31 04:14:46 +00:00
chuck e0ced7363a fix printf formatting of "ps" (aka "show all proc") so that lines never
overflow (always hated that).

replaced "/m" flag with:
	/a == show process address info
	/n == show normal process info [currently the default]
	/w == show process wait/emul info
1997-10-24 18:26:36 +00:00
gwr 25bdbcc1dc Move some DDB stuff here from kern_clock.c and kern_proc.c 1997-05-21 19:54:00 +00:00