Commit Graph

5203 Commits

Author SHA1 Message Date
mrg
3a04ec414c change an error message from:
Mutex error: sched_unlock_idle: sched_unlock_idle
to
	Mutex error: sched_unlock_idle: sched_mutex not locked
2007-03-04 21:06:13 +00:00
ad
681b77eb72 lwp_userret: if the process is exiting, don't bother looking for signals. 2007-03-04 20:59:00 +00:00
yamt
95ef0a2720 fix a fallout from caddr_t changes. 2007-03-04 14:33:57 +00:00
christos
2058fdeab3 add a lockpanic function that prints more detailed error messages. 2007-03-04 06:20:25 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
itohy
d2585a8c91 Remove extra space so that symbol renaming works properly. 2007-03-03 10:08:18 +00:00
ad
61a2eec6c3 _lwp_wakeup: set the cancellation pending if the LWP is not sleeping. 2007-03-02 21:06:27 +00:00
ad
4cbc498383 sys__lwp_park: explicitly drop the kernel lock, for the benefit of compat32.
XXX The stack gap stuff is not MP or MT safe and needs to go away.
2007-03-02 16:14:37 +00:00
ad
8a9f592723 sys__lwp_park: on a !MULTIPROCESSOR kernel the LWP is already locked. 2007-03-02 16:09:53 +00:00
itohy
cdbe0f0296 kern_mutex.c:190: macro `MUTEX_RECEIVE' used without args
kern_mutex.c:199: macro `MUTEX_RECEIVE' used without args
kern_mutex.c:206: macro `MUTEX_GIVE' used without args
2007-03-02 13:14:12 +00:00
yamt
6d6b100a95 kmem_backend_alloc: fix a null dereference. 2007-03-02 12:30:53 +00:00
martin
dd8b45ebc6 Split the disklabel checksum function into two, so we can pass the
length separately.
Use this for foreign-endianess labels in wedge autodiscovery, and
calculate the checksum of those before we swap various fields in the
label.
2007-03-01 21:30:50 +00:00
ad
0bffc80584 Fix a couple of races with LWP park/unpark. 2007-03-01 14:55:06 +00:00
pooka
f7ed04a6ff simplify previous a bit. no functional change. 2007-03-01 10:02:31 +00:00
pooka
428270cc03 avoid lock leak in error branch of sys_fchdir()
thanks to Tom Spindler and Greg Oster in helping find the cure
2007-02-28 20:39:06 +00:00
ad
a76d1d298c Further avoid unnecessary trips through lwp_userret()/issignal(). 2007-02-27 15:19:54 +00:00
yamt
c574bfa378 typedef pri_t and use it instead of int and u_char. 2007-02-27 15:07:28 +00:00
ad
72b15048da turnstile_wakeup(): on a !MULTIPROCESSOR kernel the LWP is already locked. 2007-02-27 12:17:55 +00:00
ad
cbe547e6a7 - Nuke mutex_owner()
- mutex_getowner() -> mutex_owner()
2007-02-26 19:11:28 +00:00
ad
f944608c11 Add a comment. 2007-02-26 19:06:10 +00:00
drochner
b68dbc6775 regen 2007-02-26 12:20:03 +00:00
drochner
8b8213b508 sync with lwp.h: _lwp_unpark_all() returns ssize_t 2007-02-26 12:19:00 +00:00
yamt
e781af39bd implement priority inheritance. 2007-02-26 09:20:52 +00:00
christos
2a84b2c2c1 Revert the kauth_impl.h change. Elad is going to maintain this. Asked by core@ 2007-02-24 20:41:33 +00:00
ad
9501d652a0 setrunnable(): don't require that sleeps be interruptable. This breaks
smbfs. Fixes PR/35787.
2007-02-23 16:51:47 +00:00
thorpej
4f3d5a9cc0 TRUE -> true, FALSE -> false 2007-02-22 06:34:42 +00:00
matt
93feeb1203 Fix lossage from boolean_t -> bool and updated x86 bus_dma. 2007-02-22 04:38:02 +00:00
thorpej
dd962f8680 Pick up some additional files that were missed before due to conflicts
with newlock2 merge:

Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 23:48:10 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
ad
67323d2552 When sending signals, only boost the priority of the receiving LWP if
the process is being killed.
2007-02-20 17:47:03 +00:00
ad
cebcfebbd2 kernel_lock():
- Fix error in previous.
- Call LOCKDEBUG_WANTLOCK() so the "exclusive wanted" count isn't off.
2007-02-20 16:10:10 +00:00
ad
723654a989 _kernel_lock(): we can recurse here if we take an interrupt while spinning.
Don't double book the time spent with lockstat.
2007-02-20 15:56:59 +00:00
dsl
1736f4ea10 Revert 'optimisation' added in rev 1.179.
On i386 (at least) gcc manages two generate two forwards branches which are not
usually taken for the old code, and one forwards branch that is usually taken
for my 'improved version'.  Since (IIRC) both athlon and P4 will predict
forwards branches 'not taken' the old code is likely to be faster :-(
Faster variants exist, especially ones using the cmov instruction.
2007-02-19 22:14:15 +00:00
cube
632ece3eaf Introduce a new member to struct emul, e_startlwp, to be used by
sys__lwp_create.  It allows using the said syscall under COMPAT_NETBSD32.

The libpthread regression tests now pass on amd64 and sparc64.
2007-02-19 15:10:02 +00:00
matt
44109561cb Convert to structure initializers. Use __arraycount 2007-02-18 23:16:59 +00:00
pooka
2da757310f if doing VOP_CREATE via sys_mknod, set va_rdev to VNOVAL instead of 0 2007-02-18 20:36:36 +00:00
pooka
2deb71d45f Support creating regular files with mknod(2) to match Linux/Solaris
behaviour.  This happens if mode contains S_IFREG.  mknod(2) is
still restricted to the superuser.

no objections from tech-kern
2007-02-18 19:57:29 +00:00
dsl
d64834e4f1 Add code to support per-system call statistics:
option SYSCALL_STATS	counts the number of times each system call is made
option SYSCALL_TIMES	counts the amount of time spent in each system call
Currently the counting hooks have only been added to the i386 system call
handler, and the time spent in interrupts is not subtracted.
It ought also be possible to add the times to the processes profiling
counters in order to get a more accurate user/system/interrupt split.
The counts themselves are readable via the sysctl interface.
2007-02-18 16:58:15 +00:00
dsl
ff6d800c8f Optimise canonicalisation of l_rtime for the case when the start and stop
times are in the same second.
2007-02-18 16:03:06 +00:00
dsl
6209b5bbf3 The pre-kauth 'struct ucread' and 'struct pcred' are now only used in the
(depracted some time ago) 'struct kinfo_proc' returned by sysctl.
Move the definitions to sys/syctl.h and rename in order to ensure all the
users are located.
2007-02-18 15:20:34 +00:00
dyoung
5493f188c7 KNF: de-__P, bzero -> memset, bcmp -> memcmp. Remove extraneous
parentheses in return statements.

Cosmetic: don't open-code TAILQ_FOREACH().

Cosmetic: change types of variables to avoid oodles of casts: in
   in6_src.c, avoid casts by changing several route_in6 pointers
   to struct route pointers.  Remove unnecessary casts to caddr_t
   elsewhere.

Pave the way for eliminating address family-specific route caches:
   soon, struct route will not embed a sockaddr, but it will hold
   a reference to an external sockaddr, instead.  We will set the
   destination sockaddr using rtcache_setdst().  (I created a stub
   for it, but it isn't used anywhere, yet.)  rtcache_free() will
   free the sockaddr.  I have extracted from rtcache_free() a helper
   subroutine, rtcache_clear().  rtcache_clear() will "forget" a
   cached route, but it will not forget the destination by releasing
   the sockaddr.  I use rtcache_clear() instead of rtcache_free()
   in rtcache_update(), because rtcache_update() is not supposed
   to forget the destination.

Constify:

   1 Introduce const accessor for route->ro_dst, rtcache_getdst().

   2 Constify the 'dst' argument to ifnet->if_output().  This
     led me to constify a lot of code called by output routines.

   3 Constify the sockaddr argument to protosw->pr_ctlinput.  This
     led me to constify a lot of code called by ctlinput routines.

   4 Introduce const macros for converting from a generic sockaddr
     to family-specific sockaddrs, e.g., sockaddr_in: satocsin6,
     satocsin, et cetera.
2007-02-17 22:34:07 +00:00
pavel
934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
dsl
bcedbf7f41 Acquire proclist_lock in pgid_in_session() so we don't reference potentially
stale proc & pgrp pointers.
2007-02-17 21:46:13 +00:00
dsl
c8a3495cd1 Acquire proclist_lock across the p_find() and pg_find() calls while
processing FIOSETOWN and TIOCSPGRP ioctls.
2007-02-17 21:43:08 +00:00
hannken
198beb0314 Make fstrans(9) the default helper for file system suspension.
Replaces the now obsolete vn_start_write()/vn_finished_write().
2007-02-16 17:23:53 +00:00
ad
3363855a4a Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
2007-02-16 02:53:43 +00:00
ad
57aa4fbf3b proc_free() was returning a NULL rusage pointer to wait() when a traced
process was reparented. Change proc_free() to copy the rusage to a buffer
on the stack if required, so it can be passed both to the debugger and
to the real parent process.

Fixes kern/35582 (kernel panics with gdb).
2007-02-16 00:39:16 +00:00
ad
a72414e44c lwp_free(): pass curlwp to KERNEL_LOCK(), not 'l'. 2007-02-16 00:35:45 +00:00
ad
2b011d2fa7 sigswitch(): don't blat the kernel_lock count that sleepq_block() saved
earlier.
2007-02-16 00:35:20 +00:00
ad
087fdb9080 Count the number of CPUs at boot and stash in 'ncpu'. Eventually should
have each CPU register at attach, so we can figure out the topology for
the scheduler.
2007-02-15 20:32:47 +00:00