Commit Graph

5590 Commits

Author SHA1 Message Date
pooka 8e1de16f54 fix comment: suspendsched() removes user process*es* from the runqueue 2007-11-04 17:31:16 +00:00
pooka c71057099f fix typo in comment (greetings to ad, someone read your longwinded
prattling dissertation)
2007-11-04 17:26:02 +00:00
rmind 823cbaa23b Fix sysctl_createv "pasto" in previous. 2007-11-04 14:15:34 +00:00
yamt b53fa282d6 fix deadlocks. 2007-11-04 13:09:32 +00:00
rmind fc4b6513fa - sched_setup: use ilog2() for min_catch, which fixes the case when count
of CPU is non-power of 2.  Fixes PR/37244.
- sched_enqueue: initialize sl_lrtime, when it is zero (new thread).
  Part of PR/37245.
- Fix the mints/maxts sysctl helpers, use mstohz() for the checks.  Also,
  I meant miliseconds, not microseconds.  Found by <bjs>.
2007-11-04 12:36:01 +00:00
rmind 7c0340a739 - Migrate all threads when the state of CPU is changed to offline;
- Fix inverted logic with r_mcount in M2;
- setrunnable: perform sched_takecpu() when making the LWP runnable;
- setrunnable: l_mutex cannot be spc_mutex here;

This makes cpuctl(8) work with SCHED_M2.

OK by <ad>.
2007-11-04 11:43:07 +00:00
rmind defb3f5b28 Support for dynamic changing of SysV message queues and semaphores limits.
Also fixes the alignment problem, which was here forever.  Thanks for <uwe>
for discussion and <martin> for testing.

Reviewed by: <tech-kern>, <gdt>
2007-11-04 11:20:34 +00:00
pooka 38bc08f047 Wrap parts dealing with kernel_lock behind #ifndef _RUMPKERNEL.
I don't like doing this, but there's too much pain to get this file
to compile clean due to how SPINLOCK_{BACKOFF,SPIN}_HOOK and
mb_write() are spread out in weird weird places throughout MD code.
2007-10-31 15:36:07 +00:00
yamt 94c0a71eb1 reduce dependencies on opt_sched.h. 2007-10-29 12:16:54 +00:00
ad dde5d75e78 Fix spelling. 2007-10-27 01:23:25 +00:00
ad f7b1ea2b3f Tweak comments. 2007-10-27 01:22:53 +00:00
ad 630552ea77 ras_sync: deal with spurious wakeup and add comments. 2007-10-26 17:28:37 +00:00
ad 70b8c6f297 Fix debug builds. 2007-10-24 21:50:09 +00:00
pooka 86beec80f0 80col & whitespace police. no functional change. 2007-10-24 15:28:55 +00:00
ad bccf777b72 Make ras_lookup() lockless. 2007-10-24 14:50:38 +00:00
ad 2d1592ce20 Clear VV_LOCKSWORK from the correct field. 2007-10-23 19:40:53 +00:00
pooka 85f641f339 Don't take a reference to the vfsops structure in mount_domount().
It is now taken when the vfs structure is received instead of having
to randomly add references in random places.  Fixes at least vfs
lkm unload.
2007-10-23 16:16:26 +00:00
yamt 1b559b4c2c proc0_init: change lwp0's priority from PRIBIO to PUSER so that
init and its children has a user priority.  uvm_scheduler adjusts
its own priority later.
2007-10-23 14:15:48 +00:00
yamt 1ea0b1c177 vmem_rehash_all: remove no longer unnecessary splvm/splx pairs. 2007-10-23 11:29:06 +00:00
martin 7f15a337b2 Fix vm.bufmem* sysctl nodes for 64bit archs by making them uint64_t,
as discussed on tech-kern. No requests for binary compat - so don't
bother to version them.
2007-10-21 23:27:16 +00:00
simonb e7d1e5e9ea Adjust a comment. In NetBSD the time-related kernel function prototypes
are in <sys/timevar.h>, not <sys/time.h> like they are in FreeBSD.
2007-10-21 14:55:09 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
joerg d238692c3e Initialise the callbacks for tty.t_rstrt_ch in ttymalloc
as all drivers but Sun/SPARC's kd.c use the same arguments.
Separate callout_reset into callout_schedule and the initial
callout_setfunc using that.
2007-10-18 18:54:56 +00:00
ad 55ec699f95 Fix reversed args to memset. From Iain Hibbert. 2007-10-17 17:50:07 +00:00
ad 933b05e877 Use __SIMPLELOCK_LOCKED_P(). 2007-10-17 17:22:19 +00:00
christos a9a5cf56c3 Don't fail to produce the argument vector if the program has modified it
by deleting arguments. This is a popular practice, and failing means that
ps(1) prints (programname). For example this is what XtOpenDisplay() with
-geometry. This used to work before 2.0H, and the behavior is allowed and
hinted by POSIX. Found out by Anon Ymous.
2007-10-16 16:10:59 +00:00
christos e221af6ac2 - fix comment sentence capitalization.
- whitespace cleanup.
No functional changes.
2007-10-16 16:05:50 +00:00
ad 9c3109d6c5 Add _SC_NPROCESSORS_ONLN and _SC_NPROCESSORS_CONF for sysconf(). These
are extensions but are provided by many Unix systems.
2007-10-15 14:12:54 +00:00
yamt 568c54c442 sleepq_remove: remove a stale comment. 2007-10-14 14:23:12 +00:00
yamt 2171d72e8b fix typos in a comment. 2007-10-14 13:56:32 +00:00
yamt 2ea5c00ae9 sched_wakeup: remove a wrong assertion. 2007-10-13 12:05:32 +00:00
rmind aa9301c8f4 sysctl_kern_lwp: Use a correct variable when rechecking if LWP still
exists after relocking.  Found via CID: 4689.  OK by <dsl>.
2007-10-13 10:04:08 +00:00
rmind 6673d94694 - Fix a comment: LSIDL is covered by spc_mutex, not spc_lwplock.
- mi_switch: Add a comment that spc_lwplock might not necessary be held.
2007-10-13 00:30:26 +00:00
rmind 337692921d sleepq_remove: Do not call sched_wakeup() when thread is running.
This fixes a locking problem, when l_cpu is changed in LSONPROC state.
Possible case was noted by <ad>.
2007-10-13 00:13:05 +00:00
ad 0256cc1d6a Merge from vmlocking: fix a deadlock with (threaded) soft interrupts and
process exit.
2007-10-12 14:29:37 +00:00
ad 78e4c5b083 Merge from vmlocking:
- uiomove: don't bother dropping kernel_lock if moving less than 1k.
- Catch up with vfsops reference counting changes (for LKMs).
- Add crit_enter()/crit_exit(). These bound critical sections in which
  kernel preemption is to be disabled. Better names welcome.
2007-10-12 13:00:18 +00:00
ad 4c92a21547 Remove LOCK_ASSERT(!simple_lock_held(&foo)); 2007-10-11 19:53:37 +00:00
ad 11dc639958 Merge from vmlocking:
- G/C spinlockmgr() and simple_lock debugging.
- Always include the kernel_lock functions, for LKMs.
- Slightly improved subr_lockdebug code.
- Keep sizeof(struct lock) the same if LOCKDEBUG.
2007-10-11 19:45:24 +00:00
rmind a416e41211 sched_catchlwp: Estimate the pointers of CPU structures, not spc_mutex'es,
when double-locking the runqueues.
2007-10-10 22:21:17 +00:00
rmind 03d447f116 sched_tick: There is no need to re-schedule in a case when
CURCPU_IDLE_P() is true.  Simplify a little bit.

OK by <ad>.
2007-10-10 21:24:53 +00:00
ad 7dad9f7391 Merge from vmlocking:
- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
2007-10-10 20:42:20 +00:00
ad 5a5a78fb02 Kill transferlockers() now that it's unused. 2007-10-10 17:37:40 +00:00
rmind a21233e46b Import of SCHED_M2 - the implementation of new scheduler, which is based
on the original approach of SVR4 with some inspirations about balancing
and migration from Solaris.  It implements per-CPU runqueues, provides a
real-time (RT) and time-sharing (TS) queues, ready to support a POSIX
real-time extensions, and also prepared for the support of CPU affinity.

The following lines in the kernel config enables the SCHED_M2:

no options SCHED_4BSD
options SCHED_M2

The scheduler seems to be stable.  Further work will come soon.

http://mail-index.netbsd.org/tech-kern/2007/10/04/0001.html
http://www.netbsd.org/~rmind/m2/mysql_bench_ro_4x_local.png
Thanks <ad> for the benchmarks!
2007-10-09 19:00:13 +00:00
rmind f07012313b mq_receive1: Handle the possible dereference, when cv_timedwait_sig() awakes
normally (without the error) and MQ_UNLINK is set.
From CID: 4565.
2007-10-09 18:27:00 +00:00
rmind 662df2e4ad - Style, consistency;
- Replace most panic() checks with KASSERT();
- msgrcv1: Improve readability;
- Remove #ifdef ENOMSG;

No function changes of the interface are intented.
2007-10-09 03:27:37 +00:00
ad 36a1712707 Merge run time accounting changes from the vmlocking branch. These make
the LWP "start time" per-thread instead of per-CPU.
2007-10-08 20:06:17 +00:00
ad 0a0689eebd Merge from vmlocking: fix LWP reference counting problems. 2007-10-08 18:11:11 +00:00
ad 16598eeedf Merge from vmlocking: don't hold scheduler locks across copyout(). 2007-10-08 18:09:37 +00:00
ad 9f56dfa520 Merge brelse() changes from the vmlocking branch. 2007-10-08 18:02:53 +00:00
ad 6eb1b4f21a Include sys/cpu.h for archs that don't have CPU_INFO_ITERATOR. Spotted
by dsieger@.
2007-10-08 17:26:40 +00:00