Commit Graph

155 Commits

Author SHA1 Message Date
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
yamt 3c433fc395 implement PR_NOALIGN. (allow unaligned pages)
to be used by vmem quantum cache.
2006-08-20 09:35:25 +00:00
yamt 8f01bd288f pool_init: in the case of PR_NOTOUCH, don't bump item size to
sizeof(struct pool_item).
2006-08-19 14:01:15 +00:00
yamt 696edc2b76 use ASSERT_SLEEPABLE where appropriate. 2006-07-21 10:08:41 +00:00
kardel de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
yamt c24f70bcad move wait points for kva from upper layers to vm_map. PR/33185 #1.
XXX there is a concern about interaction with kva fragmentation.
see: http://mail-index.NetBSD.org/tech-kern/2006/05/11/0000.html
2006-05-25 14:27:28 +00:00
simonb 727facb192 Add a DEBUG check that panics if pool_init() is called more than
once on the same pool.

As discussed on tech-kern a few months ago.
2006-04-15 14:23:11 +00:00
christos d269a5fa4d Coverity CID 760: Protect against NULL deref. 2006-04-15 04:47:11 +00:00
yamt c61cfbc7ca pool_grow: don't increase pr_minpages. (fix a mistake in 1.113) 2006-04-02 13:25:34 +00:00
yamt 848da92913 make duplicated code fragments into a function, pool_grow. 2006-03-17 10:09:25 +00:00
bjh21 70c82cfa56 Medium-sized overhaul of POOL_SUBPAGE support so that:
1: I can understand it, and
2: It works.
Notable externally-visible changes are that POOL_SUBPAGE now has to be a
compile-time constant, and that trying to initialise a pool whose objects are
larger than POOL_SUBPAGE automatically generates a pool that doesn't use
subpages.

NetBSD/acorn26 now boots multi-user again.
2006-02-24 11:46:20 +00:00
christos dfd8bc48f7 PR/32631: Yves-Emmanuel JUTARD: Fix DIAGNOSTIC panic in the pool code. At
the time pool_get() calls pool_catchup(), pp has been free'd but it is still
in the "entered" state. The chain pool_catchup() -> pool_allocator_alloc()
-> pool_reclaim() on pp fails because pp is still in the "entered" state.
Call pr_leave() before calling calling pool_catchup() to avoid this.

Thanks for the excellent analysis!
2006-01-26 15:07:25 +00:00
perry a2cd732268 Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 19:12:23 +00:00
christos 7799813507 Commit temporary fix against kva starvation from yamt:
- pool_allocator_alloc: drain ourselves as well,
  so that pool_cache on us is drained as well.
- pool_cache_put_paddr: destruct objects if underlying pool is starved.
- pool_get: on kva starvation, wake up once a second and try again.

Fixes:
PR/32287: Processes hang in "mclpl"
PR/32330: shark kernel hangs under memory load.
2005-12-20 15:52:14 +00:00
yamt a004e1d63c add "show all pools" command for ddb. 2005-12-01 13:21:05 +00:00
yamt e81a08ca3f pool_printit: don't keep a lock when printing info.
we can't clean it up if ddb pager is quitted.
2005-11-02 14:32:54 +00:00
christos c4dfab8cf0 Make the grouplist invalidate function take a grouplist instead of a group.
Suggested by yamt.
2005-10-16 02:55:18 +00:00