Commit Graph

6975 Commits

Author SHA1 Message Date
jnemeth
fa6c059bce add KASSERT(p != NULL); to kmem_free() 2009-06-03 22:54:51 +00:00
pooka
48fb37f153 opt for _KERNEL_OPT 2009-06-03 15:07:30 +00:00
pooka
b89c189be7 Declare extern syscallnames in a header. 2009-06-02 23:21:37 +00:00
yamt
de0c01fd1d do_posix_fadvise: turn some KASSERTs into CTASSERTs. 2009-05-31 22:15:13 +00:00
yamt
31a7ec7dc7 sched_pstats_hook: fix estcpu decay.
this makes my desktop usable when running "make -j4".
2009-05-31 04:13:33 +00:00
dyoung
2bc3b9efe1 In config_detach(9), if device deactivation fails with EOPNOTSUPP,
don't treat it as an error.  This should stop the kernel from
panicking in config_detach(9) when sd(4)/wd(4) detach.
2009-05-29 23:27:08 +00:00
yamt
75c4e4fde7 fd_free: reset fd_himap/lomap to make fd_checkmaps comfortable. PR/41487. 2009-05-29 00:10:52 +00:00
yamt
4f22237449 wrap a long line. 2009-05-28 22:17:04 +00:00
pooka
8027ac8f1f Make domaininit() take an argument which determines if it should
add the special PF_ROUTE domain or not (if available).
2009-05-27 23:44:35 +00:00
hannken
5b4e527c76 PR kern/39536: bufq related problem when writing DVDR and DVDRWs.
Remove a race where physio_done() may use memory already freed.

Observed by Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>.
2009-05-26 14:59:31 +00:00
jnemeth
d73b80a12b Move all namei flags handling into kobj_load_file().
When I originally wrote this, I was going for maximum flexibility.
However, after a private discussion with dholland@, I see how this
will cause problems with the future world order of namei whenever
that might be.  At the moment, I don't need the extra flexibility,
but if something comes up this may have to be revisited.
2009-05-26 08:34:22 +00:00
elad
ae660023a4 PR/41489: Stathis Kamperis: etpriority(2) returns EACCES instead of EPERM
Per discussion on the PR's audit trail, put back original checks for now.
2009-05-26 06:57:38 +00:00
ad
0913d2e2f5 PR kern/41487: kern_descrip.c assertion failure
Remove bogus assertion.
2009-05-26 00:42:33 +00:00
rmind
75f55a05eb - Slightly rework the way permissions are checked. Neither mq_receive() not
mq_send() should fail due to permissions.  Noted by Stathis Kamperis!
- Check for empty message queue name (POSIX does not allow this for regular
  files, and it's weird), check for DTYPE_MQUEUE, fix permission check in
  mq_unlink(), clean up.
2009-05-26 00:39:14 +00:00
jnemeth
a15ece476a Phase 0.5 of my options MODULAR enhancements. As suggested by ad@,
these commits move all path handling into module_do_load() from
kobj_load_file().  This way the final path used to load a module
is available for loading <module>.plist, which will store parameters
for a module.  The end goal of this project is good support for
MODULAR device drivers.
2009-05-25 22:33:00 +00:00
ad
d991fcb3b6 More changes to improve kern_descrip.c.
- Avoid atomics in more places.
- Remove the per-descriptor mutex, and just use filedesc_t::fd_lock.
  It was only being used to synchronize close, and in any case we needed
  to take fd_lock to free the descriptor slot.
- Optimize certain paths for the <NDFDFILE case.
- Sprinkle more comments and assertions.
- Cache more stuff in filedesc_t.
- Fix numerous minor bugs spotted along the way.
- Restructure how the open files array is maintained, for clarity and so
  that we can eliminate the membar_consumer() call in fd_getfile().  This is
  mostly syntactic sugar; the main functional change is that fd_nfiles now
  lives alongside the open file array.

Some measurements with libmicro:

- simple file syscalls are like close() are between 1 to 10% faster.
- some nice improvements, e.g. poll(1000) which is ~50% faster.
2009-05-24 21:41:25 +00:00
ad
193d553767 Split out kobj structures so crash/ddb can get at them. 2009-05-24 15:00:24 +00:00
ad
27695c89cb ddb: don't try to stat builtin modules. 2009-05-24 14:54:17 +00:00
ad
7d20bf2a9e Bus scans can make it appear as if the system has paused, so
twiddle constantly while config_interrupts() jobs are running.
2009-05-24 12:27:50 +00:00
ad
3cb7a24bec Make descriptor access and file allocation cheaper in many cases,
mostly by avoiding a bunch of atomic operations.
2009-05-23 18:28:05 +00:00
ad
f0545a5e5b - Add lwp_pctr(), get an LWP's preemption/ctxsw counter.
- Fix a preemption bug in CURCPU_IDLE_P() that can lead to a bogus
  assertion failure on DEBUG kernels.
- Fix MP/preemption races with timecounter detachment.
2009-05-23 18:21:20 +00:00
ad
2fc2b08001 - Add lwp_pctr(), get an LWP's preemption/ctxsw counter.
- Fix a preemption bug in CURCPU_IDLE_P() that can lead to a bogus
  assertion failure on DEBUG kernels.
- Fix MP/preemption races with timecounter detachment.
2009-05-23 17:08:04 +00:00
ad
cb95ab6e35 Fix a crash observed when trying to load a corrupted ELF image. 2009-05-23 15:13:57 +00:00
dyoung
85d8d1fcdd On second thought, let's call disk_predetach() disk_begindetach().
Verbs are good.
2009-05-20 03:26:21 +00:00
dyoung
a76a7fd159 Encapsulate the checks that I do before detaching a disk(9) provider
in a pre-detachment routine, disk_predetach().
2009-05-19 23:42:05 +00:00
bouyer
8ebd73cde8 Back out rev 1.27 now that MD implementations of spl*() have been fixed
to be a memory barrier.
2009-05-18 21:31:27 +00:00
ad
77e6671be0 - Remove unneded uvm_lwp_hold(), uvm_lwp_rele().
- Make physio_concurrency tuneable via crash(8).
- Update comments.
2009-05-18 21:12:33 +00:00
ad
92ee1731b0 Updates to f_flag need to be made with atomics. 2009-05-17 10:08:38 +00:00
yamt
7e13bf31c7 remove FILE_LOCK and FILE_UNLOCK. 2009-05-17 05:54:42 +00:00
rmind
ba3fa2c82f sys_mq_open: remove broken access flag check.
Noted by Stathis Kamperis.
2009-05-16 23:58:09 +00:00
yamt
5368015c69 sysctl_doeproc:
- simplify.
	- KERN_PROC: fix possible stale proc pointer dereference.
	- KERN_PROC: don't do copyout with proc_lock held.
2009-05-16 12:02:00 +00:00
yamt
805df27570 rw_vector_exit: remove a redundant condition. 2009-05-16 08:36:32 +00:00
yamt
513f4955a7 put a flag bit into v_usecount to prevent vtryget during getcleanvnode.
this fixes the following deadlock.

	a thread doing getcleanvnode:
	pick a vnode
	acqure v_interlock
	v_usecount++
	call vclean

		now, another thread doing cache_lookup:
		picks the vnode
		vtryget succeed
		vn_lock succeed

	now in vclean:
	set VI_XLOCK (too late to be noticed by the competing thread)
	wait on the vnode lock (this might violate locking order)

the use of a flag bit was suggested by Andrew Doran.  PR/41374.
2009-05-16 08:29:53 +00:00
pooka
e8f5dfa79e regen: pad -> PAD 2009-05-15 15:52:39 +00:00
pooka
6c68c84345 Use argname PAD to signal that an argument is used only for padding
and not part of the C interface.  Use this information for rump
syscalls to generate syscall interfaces without the extra parameter.
2009-05-15 15:51:27 +00:00
pooka
500fdd36a7 In addition to off_t alignment, check for dev_t and time_t too
(we don't currently have any syscalls passing time_t, though)
2009-05-15 14:52:47 +00:00
yamt
d4da6c3d2e don't forget to skip marker processes. 2009-05-12 11:42:12 +00:00
yamt
bed2400e59 lockdebug fixes for rw_tryupgrade/rw_downgrade. 2009-05-09 03:33:10 +00:00
yamt
9031548af6 exit1: fix a race with do_sys_wait/proc_free. 2009-05-08 13:32:59 +00:00
bouyer
f48b5c49cc Declare sh_flags volatile.
Without it, on ports where splhigh() is inline, the compiler will optimise
the second SOFTINT_PENDING test in softint_schedule(). A dissasembly
of softint_schedule() with and without the volatile sh_flags confirm this
on sparc.
Because of this there is a race that could lead to the softhand_t
being enqueued twice on si_q, leading to a corrupted queue and
some handler being SOFTINT_PENDING but never called.

Should fix PR kern/38637
2009-05-05 20:26:36 +00:00
yamt
183ff8793d sysctl_doeproc: fix a bug in rev.1.135.
don't forget to mark our marker process PK_MARKER.
this fixes crashes in sched_pstats, etc.
2009-05-04 14:52:33 +00:00
yamt
6f0983460b when freeing cn_pnbuf, make it NULL if DIAGNOSTIC. 2009-05-04 06:05:19 +00:00
yamt
706e6928e0 tweak some assertions on so_head to make them more meaningful. 2009-05-04 06:02:40 +00:00
elad
414eb0a314 Move dovfsusermount to secmodel_bsd44, where it really belongs.
The secmodel code now creates the same knob in two places: both under the
secmodel itself, as well as the widely known location.

Mailing list references:

    http://mail-index.netbsd.org/source-changes/2009/05/02/msg220641.html
    http://mail-index.netbsd.org/tech-kern/2009/05/03/msg005015.html
2009-05-03 21:25:44 +00:00
pooka
ec3ee0abf9 Include some debug print routines if DEBUGPRINT is defined. This
way they can be included without having to include DDB.
(arguably all print routines should be behind #ifdef DEBUGPRINT
and options DDB should define that macro, but I'll tackle that later)
2009-05-03 16:52:54 +00:00
elad
b1bd59c577 Fix locking around mountlist usage, as pointed out by ad@ in:
http://mail-index.netbsd.org/source-changes-d/2009/04/22/msg000322.html
  http://mail-index.netbsd.org/tech-kern/2009/04/22/msg004897.html

Use vfs_busy() and vfs_unbusy(), and properly iterate the mountlist.
2009-05-02 21:47:12 +00:00
pooka
fb42667d02 Move dovfsusermount from vfs_syscalls.c to param.c: secmodel bsd44
depends on it and we can't isolate it in vfs.
(no, it doesn't really belong in param.c, but I couldn't figure out
a better place for it)
2009-05-02 14:13:28 +00:00
cegger
f2c0b025dc remove useless parenthesis 2009-05-01 08:27:41 +00:00
ad
922436b4c6 PR kern/41311: Mutex error: mutex_vector_enter: locking against myself 2009-04-30 20:41:33 +00:00
dyoung
662437b2c3 Remove extraneous parentheses. Fix spelling/grammar. No functional
change intended.
2009-04-30 20:39:08 +00:00