Commit Graph

6585 Commits

Author SHA1 Message Date
ad
ae2b96cc5e Regen. 2008-11-12 14:34:42 +00:00
ad
0b7375c9af Allow the POSIX semaphore code to be loaded as a module. 2008-11-12 14:32:34 +00:00
ad
119366618e Atomic insertion/removal of groups of system call vectors at runtime with
a basic facility for rollback.

Proposed on tech-kern@.
2008-11-12 14:29:31 +00:00
ad
307004b54f Don't try appending ".o" to the module path. 2008-11-12 14:22:17 +00:00
ad
0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
rmind
9204531a37 - Optimise by avoiding few memory barriers, when atomic operations
performs that for us.  OK by <matt>.
- Add RCS ID, and a bit of KNF.
2008-11-11 21:45:33 +00:00
snj
351a2e6266 Fix a couple spelling mistakes in comments. 2008-11-11 20:37:15 +00:00
matt
c8d306e353 Add generic producer/consumer queue code. 2008-11-11 20:17:27 +00:00
ad
9b4d249497 Avoid recursive mutex_enter() when the system is low on KVA.
Should fix crash reported by riz on current-users.
2008-11-11 16:13:03 +00:00
joerg
b9400f6fd4 Move WAPL replay handling from bread() into ufs_strategy.
This changes the order of hook processing as the copy-on-write handlers
are called after the journal processing. This makes more sense as the
journal overwrite is logically part of the disk IO.
2008-11-11 08:29:58 +00:00
dyoung
94d985722a It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled.  So I have made two changes:

1 Do not call pmf_system_shutdown() from doshutdownhooks().  Instead,
change every call to doshutdownhooks() to a call to doshutdownhooks()
followed by a call to pmf_system_shutdown().  No functional change
is intended by this change.

2 Make i386 re-enable interrupts briefly while it calls
pmf_system_shutdown().  I leave it to others either to fix the
other ports, or to factor out some MI shutdown code, as joerg@
suggests, and fix that.  Note that a functional change *is* intended
by this change.

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.
2008-11-11 06:46:40 +00:00
joerg
d1cd6d3433 If the size of the buffer didn't change, don't bother updating the WAPBL
accounting as it won't change either.
2008-11-10 21:02:15 +00:00
joerg
8800d320f1 Define wapbl_flush_fn_t only for the kernel. 2008-11-10 20:30:31 +00:00
joerg
3fbdfc8af9 Reduce internals of WAPBL exposed to the rest of the system. 2008-11-10 20:12:13 +00:00
bouyer
5da863e7e9 Assert that bp->b_error == 0 if all data have been transfered in
physio_biodone(). We have more chance to have the fauly code in the
stack trace when doing the check here than in physio_done().
2008-11-09 12:18:07 +00:00
cegger
83fde857cc buildfix: use PRIxPTR rather %lx. 2008-11-07 19:50:00 +00:00
rafal
ca70a1c015 Pass / log return address in a few more places; proposed on tech-kern and
ok'd by ad@ about 6 months ago.
2008-11-07 02:40:35 +00:00
rmind
9d3a4ed2de cpuctl_ioctl: use cpu_index(), instead of cpuid.
Fixes cpuctl(8) on some processors.
2008-11-06 16:48:51 +00:00
reinoud
97c1950356 Don't dereference bp->b_vp->v_mount if its vnode type is VT_VNON. I dont
know if this masks a bug but with a machine having a ffs+wapbl mount, NFS
mounts and a ntfs mount this paniced the machine on suspend.
2008-11-04 16:08:41 +00:00
wrstuden
ab61b53b27 Adjust the sleeps in lwpcache and lwpublk. Make them uninterruptable
for now. This will prevent signals from waking them. Adjust
exit_lwps() to explicitly add LW_SINTR to all of them, so that
the process exit code can wake them up.

This is needed as threads in both of these wait channels die once
they are woken. So they aren't interruptable in the typical sense.

I am now able to suspend & resume firefox successfully now.
2008-11-01 05:59:33 +00:00
reinoud
54977cd016 Clarify the dirhash locking protocol and remove unnessiary #ifdef DEBUG
flag.
2008-10-31 16:04:59 +00:00
reinoud
a2a624b32c Protect the dirhash_queue when purging hashed directories on memory
overflow situations.
2008-10-31 15:48:39 +00:00
reinoud
afc9c8a1c7 Remove old KASSERTS that were commented out. Since the dirhash structure is
considered part of the vnode/*_node structure it sure has to be locked or
the code using it is playing russian roulette.
2008-10-31 15:13:55 +00:00
reinoud
4ea6ec31b8 Cleanup dirhash and make use of the standard hash32_strn() instead of the
handcrafted one.

Note it uses hash32_strn() since arguments can be passed from namei
arguments and thus don't have to be null terminated.
2008-10-31 15:01:12 +00:00
rmind
8f1873ea3b - Avoid the race with CPU online/offline state changes, when setting the
affinity (cpu_lock protects these operations now).
- Disallow setting of state of CPU to to offline, if there are bound LWPs,
  which have no CPU to migrate.
- Disallow setting of affinity for the LWP(s), if all CPUs in the dynamic
  CPU-set are offline.
- sched_setaffinity: fix invalid check of kcpuset_isset().
- Rename cpu_setonline() to cpu_setstate().

Should fix PR/39349.
2008-10-31 00:36:22 +00:00
reinoud
a41684bca5 Remove old sysctl numbers not used anymore. 2008-10-30 17:19:18 +00:00
reinoud
d7a1bfe693 Make some variables static that ought to have been from the start. 2008-10-30 16:41:18 +00:00
reinoud
02fc60fc46 Add sysctl's using CTL_CREATE to query and set the memory use of the
generic vfs dirhash code.
2008-10-30 16:17:53 +00:00
smb
2b64d5012d Fix a type -- a comment started with /m instead of /* .... 2008-10-29 21:35:27 +00:00
skrll
f20d7f011d Typo in comment. 2008-10-29 20:18:20 +00:00
wrstuden
04ca26c586 Tweak change to move SA support from userret() to lwp_userret().
1) Since we want to check for upcalls only once, take LW_SA_UPCALL
out of the while(l->l_flags & LW_USERRET) loop.

2) since the goal is to keep SA code out of userret() (and especially
all the emulations that include userret() but will never do SA),
ALWAYS set LW_SA_UPCALL when we set SAVP_FLAG_NOUPCALLS. Drop the
test for it in lwp_userret() since it will never be set bare.

3) Adapt sa_upcall_userret() to clear LW_SA_UPCALL if it's no longer
needed. If we have gained upcalls since sa_yield(), we will deliver
them next time around.

Tested by skrll at.
2008-10-28 22:11:36 +00:00
tsutsui
4423d2e025 On the prompt for init path, print a simple usage line
if input strings are not valid path or command.
Per comments from perry@ and pgoyette@.
2008-10-28 15:33:10 +00:00
erh
75072b1c6f Change the order of error checks in shmget so EEXIST is returned before
EINVAL or EACCESS so callers have a more reliable way to tell if a
 shared memory segment already exists.
2008-10-27 15:40:56 +00:00
blymn
811c38a41c Extend the information that MALLOCLOG outputs to include the preceding
buffer.  This can be helpful in the case where a buffer overrun in the
preceding region stomps on the following regions data.
2008-10-26 12:23:28 +00:00
apb
a02cace51f Use ${TOOL_SED} instead of plain "sed" in "!=" assignments.
This may need more work to prevent warning messages during
"make cleandir" when the commands in "!=" assignments are executed
even though tools may not have been built.
2008-10-25 22:35:36 +00:00
tsutsui
f6cc315b29 - if no usable init(8) program (listed in *initpaths[]) can be found,
set the RB_ASKNAME flag and prompt users for the init path, rather than
  panicking with "no init".
- when prompting for the init path, support the special strings
  "halt", "reboot", and "ddb", as well as a prompt for the root device.

Dissussed and no objection on tech-kern.  Changes summary by apb@.
2008-10-25 15:40:59 +00:00
yamt
ea8f5a99d5 cache_lookup_raw: update "goodhits" statistics to be less confused.
add an XXX comment.
2008-10-25 14:20:17 +00:00
yamt
2fb0334ca1 add assertions. 2008-10-25 14:18:18 +00:00
yamt
fab66c36d6 exit1: update a comment. 2008-10-25 14:10:26 +00:00
dyoung
37dcd495a0 Change 'return (expr);' to 'return expr;'. Change (type *)0 to
NULL.  No functional change intended.
2008-10-24 22:23:20 +00:00
wrstuden
0a30ab777e toall signals really are toall. The fact we're sa doesn't matter.
They are start/stop signals, and need to impact more than just
blessed lwps.
2008-10-24 18:07:36 +00:00
christos
bc44c7d780 don't hold locks in ddb (call ksyms_getval_unlocked()), pointed out by ad. 2008-10-24 13:55:42 +00:00
christos
ff0507541f don't expose ksyms_lock 2008-10-23 20:41:13 +00:00
blymn
57614abcf2 Conditionalise bypass of veriexec routines on veriexec_strict to prevent
loophole if tables fail to load and strict is then raised.
2008-10-23 13:18:14 +00:00
ad
71781b4471 Set kern.posix_semaphores are runtime so it can be a module.
(Picked wrong header the last time.)
2008-10-22 11:25:19 +00:00
ad
52e9644b6b Make MODCTL_LOAD_FORCE do something. 2008-10-22 11:19:15 +00:00
ad
c81717a5e1 Set kern.posix_semaphores are runtime so it can be a module. 2008-10-22 11:17:08 +00:00
ad
7b228b5a9c - Be clear about whether module load is explicit or system initiated (auto).
- Require that module_lock is held to autoload, so that any preconditions
  can be safely checked.
2008-10-22 11:16:29 +00:00
matt
8f23ec634b Only define/use saemul_netbsd if KERN_SA is defined. (maybe this should be
moved to compat_sa.c)
2008-10-21 20:52:11 +00:00
matt
6e1d2d17ef Only init ksyms mutex if ksyms is present in the kernel 2008-10-21 20:51:11 +00:00