Commit Graph

171 Commits

Author SHA1 Message Date
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
ad 1ec58d56ef - Rename cpu_lookup_byindex() to cpu_lookup(). The hardware ID isn't of
interest to MI code. No functional change.
- Change /dev/cpu to operate on cpu index, not hardware ID. Now cpuctl
  shouldn't print confused output.
2008-10-15 08:13:17 +00:00
yamt a5cd2e50c6 make pcg_dummy const to catch bugs earlier. 2008-08-11 02:48:42 +00:00
yamt 53d1c25e34 add some KASSERTs. 2008-08-11 02:46:40 +00:00
skrll e7901782b3 Comment whitespace. 2008-08-08 16:58:01 +00:00
yamt e4fb48bcaf pool_do_put: fix a pool corruption bug discovered by
the recent exec_pool changes.
2008-07-09 02:43:53 +00:00
yamt 03bb7555b4 fix pool corruption bugs in subr_pool.c 1.162. 2008-07-07 12:27:19 +00:00
ad 6c6c91b240 Move an assignment later. 2008-07-04 16:41:00 +00:00
ad 46587f3717 - Keep cache locked while allocating a cache group - later we might want
to automatically tune the group sizes at run time.
- Fix broken assertion.
- Avoid another test+branch.
2008-07-04 16:38:59 +00:00
ad 9d573e640e Remove a bunch of conditional branches from the pool_cache fast path. 2008-07-04 13:28:08 +00:00
ad e10320350c Use __noinline. 2008-05-31 13:31:25 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad 4c7ba24481 Add MI code to support in-kernel preemption. Preemption is deferred by
one of the following:

- Holding kernel_lock (indicating that the code is not MT safe).
- Bracketing critical sections with kpreempt_disable/kpreempt_enable.
- Holding the interrupt priority level above IPL_NONE.

Statistics on kernel preemption are reported via event counters, and
where preemption is deferred for some reason, it's also reported via
lockstat. The LWP priority at which preemption is triggered is tuneable
via sysctl.
2008-04-28 15:36:01 +00:00
ad 27168d9d58 - Rename crit_enter/crit_exit to kpreempt_disable/kpreempt_enable.
DragonflyBSD uses the crit names for something quite different.
- Add a kpreempt_disabled function for diagnostic assertions.
- Add inline versions of kpreempt_enable/kpreempt_disable for primitives.
- Make some more changes for preemption safety to the x86 pmap.
2008-04-27 11:37:48 +00:00
ad 15e29e981b Merge the socket locking patch:
- Socket layer becomes MP safe.
- Unix protocols become MP safe.
- Allows protocol processing interrupts to safely block on locks.
- Fixes a number of race conditions.

With much feedback from matt@ and plunky@.
2008-04-24 11:38:36 +00:00
ad feb4783fdf Replace use of CACHE_LINE_SIZE in some obvious places. 2008-03-27 18:30:15 +00:00
ad ad4f28d1e9 Make them compile again. 2008-03-17 17:05:54 +00:00
yamt a67bae0b7b - simplify ASSERT_SLEEPABLE.
- move it from proc.h to systm.h.
- add some more checks.
- make it a little more lkm friendly.
2008-03-17 08:27:50 +00:00
martin d8788e7fd7 Use cpu index instead of the machine dependend, not very expressive
cpuid when naming user-visible kernel entities.
2008-03-10 22:20:14 +00:00
yamt 59a00111af pool_do_put: remove pa_starved_p check for now as it seems to cause
more problems than it solves.  PR/37993 from Greg A. Woods.
2008-03-02 12:19:58 +00:00
yamt 8ae4ab89dd use time_uptime instead of getmicrotime() for ph_time. 2008-02-14 11:45:24 +00:00
skrll fa0da8dc36 Revert previous as requested by yamt. 2008-02-05 10:11:19 +00:00
skrll 6b8ce99a9e Check alignment against pp->pr_align not pp->pr_alloc->pa_pagesz.
DIAGNOSTIC kernels on hppa boot again.

OK'd by ad.
2008-02-02 20:21:55 +00:00
yamt 4ad8bf4c8a pool_cache_get_paddr: don't bother to clear pcgo_va unless DIAGNOSTIC. 2008-01-28 10:26:12 +00:00
ad 0664a0459b Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
2008-01-04 21:17:40 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
ad ea3f10f7e0 Merge more changes from vmlocking2, mainly:
- Locking improvements.
- Use pool_cache for more items.
2007-12-26 16:01:34 +00:00
yamt 9108a50874 pool_in_cg: don't bother to check slots past pcg_avail. 2007-12-22 04:31:34 +00:00
yamt 0ce2491bde pool_whatis: print cached items as well. 2007-12-22 03:28:48 +00:00
ad 73157b0e11 - Support two different sizes of pool_cache group. The default has 14 or 15
items, and the new large groups (for busy caches) have 62 or 63 items.
- Add PR_LARGECACHE flag as a hint that a pool_cache should use large groups.
  This should be eventually be tuned at runtime.
- Report group size for vmstat -C.
2007-12-20 23:49:10 +00:00
yamt 0c38201391 add ddb "whatis" command. inspired from solaris ::whatis dcmd. 2007-12-13 02:45:09 +00:00
yamt b839442793 don't forget to initialize ph_off for PR_NOTOUCH. 2007-12-13 01:22:50 +00:00
ad 7b8aa25abc Change the ncpu test to work when a pool_cache or softint is initialized
between mi_cpu_attach() and attachment of the boot CPU. Suggested by mrg@.
2007-12-11 19:07:27 +00:00
ad 8cd835a351 pool_init, pool_cache_init: hack around IP input processing which can
not yet safely block without severely confusing soo_write() and friends.
If the pool's IPL is IPL_SOFTNET, initialize the mutex at IPL_VM so that
it's a spinlock. To be dealt with correctly in the near future.
2007-12-05 06:52:01 +00:00
ad 82a0bcef97 Work around issues with pool_cache on sparc. 2007-11-18 16:27:42 +00:00
yamt d2f81c7a05 fix freecheck. 2007-11-14 11:14:13 +00:00
yamt d4b8e5537d for PR_NOTOUCH pool_item_header, use a bitmap rather than a freelist.
it saves some space and allows more items per a page.
2007-11-10 07:29:28 +00:00
ad d18c6ca4de Merge from vmlocking:
- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
2007-11-07 00:23:13 +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
ad 6b79143ab0 pool_drain: add a comment. 2007-08-18 00:37:14 +00:00
ad e492e656cc pool_do_cache_invalidate_grouplist: drop locks while calling the destructor.
XXX Expensive - to be revisited.
2007-08-18 00:33:38 +00:00
ad 59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
thorpej 4f3d5a9cc0 TRUE -> true, FALSE -> false 2007-02-22 06:34:42 +00:00
thorpej 712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
yamt 1a7bc55dcc remove some __unused from function parameters. 2006-11-01 10:17:58 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos e2ea4b04bb avoid empty else statement 2006-09-03 06:25:19 +00:00