Commit Graph

6349 Commits

Author SHA1 Message Date
christos
20d8fbfbe4 typo 2008-06-16 00:54:10 +00:00
christos
88c08e3b98 regen 2008-06-16 00:32:23 +00:00
christos
5c45905c42 adjust prototypes for the affinity calls. 2008-06-16 00:31:17 +00:00
rmind
a6092d3c4a gencpuset: avoid returning of unitialized error.
sched_setaffinity: instead of E2BIG, return EINVAL in a case of invalid
CPU, which is more consistent.
2008-06-15 23:29:09 +00:00
christos
f30b5785d5 Don't expose struct cpuset, share the l_affinity flag and only allocate it
if we need to. This is not a compatible change, but the syscalls are new
enough and they don't need to be versioned. Approved by rmind.
2008-06-15 20:32:57 +00:00
chris
44d939d150 Fix for biowait hangs, and possibly other condvar hangs. Also should fix
PR kern/38761.

The condvar must access the sleepq with the sleepq lock held, doing so
is causing inconsistent sleepq state to be read.

This is because some accesses to the sleepq don't come via the cv code,
but are call directly into sleepq_changepri and sleepq_lendpri, which take
the sleepq lock, and removes then re-inserts lwps into the sleepq.

Running a build.sh with -j8 now completes on my quad-core, also tested by
Simon@ on a 8-core server and matt@ on a quad-core.

I believe there is room to be more efficient with this, as we now take the
sleepq lock for all cv_broadcast and cv_signal calls. I'll look into this
and post a diff to tech-kern.
2008-06-15 09:56:18 +00:00
drochner
a748803de9 tighten type checking: use device_t instead of void* at some places 2008-06-11 15:56:11 +00:00
ad
62c877a460 Don't call uvm_pageidlezero() if the CPU is marked offline. 2008-06-11 13:42:02 +00:00
drochner
520a61068b remove the hacks around fakemdrootdev[] which should be unnecessary now
that "md" devices show up in the "alldevs" list
2008-06-11 10:40:21 +00:00
dyoung
1e479b72f8 In device_pmf_driver_deregister, postpone deleting a device_t's
reference to the PMF private data until the private data has no
more waiters.  This protects against a NULL dereference.

In device_pmf_lock1(), test a device_t for PMF registration before
dereferencing its PMF private data.
2008-06-11 06:26:32 +00:00
simonb
a0f8ee25d3 In mount_domount() there is no need to initialise "mp" if the first time
we use it we set it.
2008-06-10 14:14:01 +00:00
ad
06da5288fa There can be existing waiters on a socket's condition variables when we
change socket::so_lock, and they rely on the old lock to synchronize.
Wake them up whenever we change so_lock so they can restart their waits.
2008-06-10 11:49:11 +00:00
ad
f77c704577 Fix error in previous. 2008-06-09 11:49:40 +00:00
ad
c862aeca6f ras_purgeall: avoid taking p_auxlock. 2008-06-09 11:46:34 +00:00
ad
5ab3329550 Correct previous. 2008-06-08 12:23:18 +00:00
ad
7304342b50 cdev_tty: don't acquire kernel lock, as we may need to call this with
tty_lock already held (and it would reverse the usual lock order).
2008-06-08 12:22:39 +00:00
ad
d78b3bf8f2 PR kern/38881 execve(2) panic: lock error, with path argument > PATH_MAX 2008-06-06 22:21:11 +00:00
drochner
598d615d27 add a KASSERT to catch missing locators 2008-06-06 17:52:40 +00:00
ad
6a33531fe1 - Make getiobuf() return buffers marked BUSY.
- Sprinkle more assertions.
2008-06-06 12:49:15 +00:00
cegger
6e390579fc make this build 2008-06-05 21:55:51 +00:00
ad
b91062326d Avoid "free vnode isn't" assertion. 2008-06-05 12:32:57 +00:00
ad
13c7f6ff40 Move lib/libkern/rb.h to sys/rb.h, so it can be used by kernel header
files.
2008-06-04 14:31:15 +00:00
rmind
af4e8e9ea7 Check the result of allocation in the cases where size is passed by user. 2008-06-04 13:02:41 +00:00
ad
cbbf514e2c - vm_page: put listq, pageq into a union alongside a LIST_ENTRY, so we can
use both types of list.

- Make page coloring and idle zero state per-CPU.

- Maintain per-CPU page freelists. When freeing, put pages onto the local
  CPU's lists and the global lists. When allocating, prefer to take pages
  from the local CPU. If none are available take from the global list as
  done now. Proposed on tech-kern@.
2008-06-04 12:45:28 +00:00
ad
621389e8b2 Fix broken enable test; fixes random coredumps. 2008-06-04 12:26:20 +00:00
ad
65b594ff61 Make sure the PAX flags are copied/zeroed correctly. 2008-06-04 12:16:06 +00:00
ad
8dd7771d61 Disable the wakeup assertion for the time being because the tty code
triggers it.
2008-06-04 11:22:55 +00:00
ad
cee82bbafa Don't use proc specificdata for the PAX stuff. Speeds up mmap() and others. 2008-06-03 22:15:14 +00:00
ad
d191ae6b1b Don't use proc specificdata. Speeds up mmap() and others. 2008-06-03 22:14:24 +00:00
ad
1b23b70818 vfs_cache:
- Don't use goto in critical paths, it can confuse the compiler.
- Sprinkle some branch hints.
- Make namecache stats per-CPU and collate once per second.
- Use vtryget().
2008-06-03 15:50:22 +00:00
ad
457a3f8942 vtryget: try to get an initial reference to a vnode without taking its
interlock. Only works if v_usecount is already non-zero, which is nearly
always true for busy files like libc.so or ld_elf.so.
2008-06-03 14:54:12 +00:00
dyoung
b5bf86befb Before freeing a ktr_desc, destroy its condition variables. 2008-06-03 05:53:09 +00:00
ad
a51fec9810 Avoid assertion failures. From drochner@. 2008-06-02 22:56:09 +00:00
drochner
99cb76cad6 adjust a KASSERT to reality after atomic vnode usecount changes 2008-06-02 19:20:22 +00:00
ad
3a8db3158e Use atomics to maintain v_usecount. 2008-06-02 16:25:34 +00:00
ad
30115e937a Most contention on proc_lock is from getppid(), so cache the parent's PID. 2008-06-02 16:18:09 +00:00
ad
fb8c6fcc83 Don't needlessly acquire v_interlock. 2008-06-02 16:16:27 +00:00
ad
0d151db6c9 Don't needlessly acquire v_interlock. 2008-06-02 16:00:33 +00:00
ad
8ad974fae5 vn_marktext, vn_lock: don't needlessly acquire v_interlock. 2008-06-02 15:29:18 +00:00
ad
ea8a92578d If vfork(), we want the LWP to run fast and on the same CPU
as its parent, so that it can reuse the VM context and cache
footprint on the local CPU.
2008-06-02 13:58:07 +00:00
ad
c3e93e738f Make trap counters per-cpu, like syscalls. 2008-06-01 21:24:15 +00:00
ad
736a4d9b78 Kill devsw_lock and just use specfs_lock. The two would need merging
in order to prevent unload of modules when a device that they provide
is still open.
2008-05-31 21:34:42 +00:00
ad
2feabc3836 PR kern/38812 race between lwp_exit_switchaway and exit1/coredump
Move the LWP RUNNING and TIMEINTR flags into the thread-private flag word.
2008-05-31 21:26:01 +00:00
dyoung
8f34c216d0 Add printf_tolog(), which writes to the kernel message buffer,
only.  I believe this is the safest way to log serious conditions
indicated by NMI.
2008-05-31 20:27:24 +00:00
ad
4c57df4a3c - Put in place module compatibility check against __NetBSD_Version__,
as discussed on tech-kern.

- Remove unused module_jettison().
2008-05-31 20:14:38 +00:00
ad
bda19becba Fix wmesg for !LOCKDEBUG. 2008-05-31 16:25:23 +00:00
ad
506130b087 biodone2: if the buffer is async or has a callback method, assert that
there are no waiters on b_done (threads in biowait()).
2008-05-31 13:41:44 +00:00
ad
7442154bd9 - Give each condition variable its own sleep queue head. Helps the system
to scale more gracefully when there are thousands of active threads.
  Proposed on tech-kern@.

- Use LOCKDEBUG to catch some errors in the use of condition variables:

  freeing an active CV
  re-initializing an active CV
  using multiple distinct mutexes during concurrent waits
  not holding the interlocking mutex when calling cv_broadcast/cv_signal
  waking waiters and destroying the CV before they run and exit it
2008-05-31 13:36:25 +00:00
ad
e10320350c Use __noinline. 2008-05-31 13:31:25 +00:00
ad
a6f1414cd1 tsleep -> kpause 2008-05-31 13:26:29 +00:00