Commit Graph

6602 Commits

Author SHA1 Message Date
ad
e2a270368e Correction to previous. 2008-11-16 14:55:42 +00:00
ad
d89eff7233 Do not look up any given symbol more than once. Does away with the vast
majority of symbol table lookups.
2008-11-16 11:26:28 +00:00
pooka
e0a026a434 vpp is not logically passed in IN with lookup, so INOUT -> OUT.
No functional change, but consistent with the rest.
2008-11-15 19:08:12 +00:00
skrll
1041d3756c s/process/LWP/ in comments where appropriate. 2008-11-15 10:54:32 +00:00
mrg
c10479b8ff explicitly include <sys/ioctl_compat.h> since we explicitly use
symbols defined in it.  fixes various build issues.
2008-11-15 05:58:33 +00:00
ad
fc5b697224 Regen. 2008-11-14 23:34:23 +00:00
ad
e6a3385171 Make POSIX AIO loadable as a module. 2008-11-14 23:33:45 +00:00
ad
2024f61eff Fix a comment. 2008-11-14 23:13:02 +00:00
ad
57de28fac5 - Move some more compat code into sys/compat.
- Split 4.3BSD ifioctl stuff into its own file.
- Remove some ifdefs that include small fragments of vfs compat code
  which are difficult to relocate elsewhere.
2008-11-14 23:10:57 +00:00
ad
79d9beffc8 - If the system encounters a severe memory shortage, start unloading
unused kernel modules.
- Try to unload any autoloaded kernel modules 10 seconds after their
  load was successful.
- Keep a counter to track module load/unload events.
2008-11-14 23:06:45 +00:00
ad
7cd41bb376 Remove unneeded compat ifdef. 2008-11-14 23:04:42 +00:00
ad
6b88fdc0eb Use NOCHROOT when doing the lookup against the standard module path.
Prevents abuse of chroots to load tainted kernel modules.
2008-11-14 22:00:23 +00:00
ad
d42ef3dc29 Add a NOCHROOT flag for namei(). Looks outside any chroot and performs the
lookup from the root directory if given an absolute path.
2008-11-14 21:57:14 +00:00
ad
7bd1ee08d6 Regen. 2008-11-14 15:50:01 +00:00
ad
18e73e1ebe Replace semid_t with intptr_t. No function change. This is a libc/kernel
private interface and so the name change should not affect any third
party code.
2008-11-14 15:49:20 +00:00
ad
e1623d0beb Update a couple of comments. 2008-11-14 13:35:25 +00:00
ad
8fe49e035f PR kern/39913 exec, fork, exit hooks need locking
Acquire exec_lock where needed.
2008-11-14 13:01:18 +00:00
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