Commit Graph

120 Commits

Author SHA1 Message Date
pooka dd1721fa8d Move global malloc types from kern_malloc into a separate module. 2008-09-25 16:23:45 +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
yamt 2129f3c054 malloc: fix freelist corruption. 2008-01-03 01:21:08 +00:00
ad 598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
yamt e43896bb4f free: fix size passed to LOCKDEBUG_MEM_CHECK. 2007-11-26 11:48:55 +00:00
matt 11910619f7 Change some initialization of static queues to compile time.
(xxx_INIT to xxx_HEAD_INITIALIZER).  Drop code which inits
non-auto (global or static) variables to 0 since that's
already implied by being non-auto.  Init some static/global
cpu_simple_locks at compile time.
2007-11-11 23:22:23 +00:00
ad 57b6b02535 Merge from vmlocking. 2007-11-06 19:13:49 +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
yamt 3829d825af malloc: fix a deadlock. 2007-04-19 11:03:44 +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
ad 3fcdeca2cc Use mutexes. 2007-03-12 16:42:14 +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
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
chs 164df76537 remove details of the kernel malloc() implementation from header files:
- change MALLOC() and FREE() to just call their function equivalents.
 - remove references to other malloc()-related constants.
2006-10-02 02:59:38 +00:00
yamt 696edc2b76 use ASSERT_SLEEPABLE where appropriate. 2006-07-21 10:08:41 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
jmmv 060dc147c7 Fix wording in a comment. 2005-08-05 13:18:32 +00:00
chs 3f15e64c3c rename "kbucket" to "kmembuckets", for greater clarity.
don't forget to update vmstat this time.
2005-05-30 23:04:53 +00:00
christos f63d439f2a finish bucket -> kbucket change 2005-05-30 04:15:17 +00:00
yamt 6b2d8b66a4 merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
2005-04-01 11:59:21 +00:00
perry da8abec863 nuke trailing whitespace 2005-02-26 21:34:55 +00:00
christos 201de1bdd0 Cast nkmempages to vsize_t before shifting to avoid overflow. Requested
by soda.
XXX: should be pulled up to 2.0.
2005-01-14 17:03:58 +00:00
yamt 48355cdf13 kmeminit_nkmempages: don't limit the size of kmem_map to physmem/4
because, while there's little benefit to do so, it easily causes
"out of space in kmem_map" panic on machines with small memory.
2005-01-13 11:49:09 +00:00
yamt a880e5e2b5 in the case of !PMAP_MAP_POOLPAGE, gather pool backend allocations to
large chunks for kernel_map and kmem_map to ease kva fragmentation.
2005-01-01 21:08:02 +00:00
yamt 95c82bfee4 introduce vm_map_kernel, a subclass of vm_map, and
move some kernel-only members of vm_map to it.
2005-01-01 21:02:12 +00:00
simonb 60e6b50deb Spell "available" correctly. 2005-01-01 03:24:43 +00:00
manu 6e3c639957 IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
2004-09-04 23:29:44 +00:00
simonb b6abb6ab1d Remove some assigned-to but otherwise unused variables. 2003-10-30 01:58:17 +00:00
mycroft ad3b20a692 A nit I ran into while copying this code for something else... 2003-09-27 23:10:47 +00:00
thorpej f0d728e698 Avoid a type punning warning in the MALLOC_DEBUG case. 2003-09-23 16:36:59 +00:00
ragge 76d3da2d68 Do correct pointer casts. 2003-09-03 11:13:14 +00:00
fvdl 6c4d7c0fee Fix error in previous commit: the first vaddr_t argument to uvm_km_suballoc
is in/out, so it must be zeroed out before passing it, otherwise the
uvm_km_suballoc call would get stack garbage, and fail randomly.
2003-08-31 12:59:05 +00:00
ragge b20fe4bd92 Do not cast a pointer to a pointer with different basic type when given
as function argument. It makes assumptions about pointer internals
that do not necessarily have to be true.
2003-08-30 07:54:32 +00:00
enami 2340975258 Use vm_map_{min,max}() rather than accessing struct vm_map.header.{start,end}
directly.
2003-08-28 14:54:32 +00:00
manu e3ce76f536 Added a malloc freelist sanity check function, for debugging purposes 2003-08-26 21:48:53 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
manu 06da3d32ba Build again with MALLOCLOG 2003-08-02 07:08:02 +00:00
fvdl 65770cf2e9 In the KMEMSTATS && DIAGNOSTIC case, add a check for inuse already being 0
at free() time. This will at least catch an alloc/free mismatch early in
boot, rather than having it hang hard because of a wrapped ks_limit.
2003-05-06 18:07:57 +00:00
pk 9ca040e74e Make the memory allocation code MP-safe. 2003-02-14 21:51:36 +00:00
thorpej b193480908 Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
2003-02-01 06:23:35 +00:00
thorpej e0fb587e4e Avoid signed/unsigned comparison and strict alias warnings. 2002-11-10 03:35:31 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
thorpej 71404bb533 Don't include <sys/map.h>. 2002-09-25 22:21:01 +00:00
chs 9672ac098f add a new km flag UVM_KMF_CANFAIL, which causes uvm_km_kmemalloc() to
return failure if swap is full and there are no free physical pages.
have malloc() use this flag if M_CANFAIL is passed to it.
use M_CANFAIL to allow amap_extend() to fail when memory is scarce.
this should prevent most of the remaining hangs in low-memory situations.
2002-09-15 16:54:26 +00:00
thorpej 5f7ccd1634 Fix a signed/unsigned comparison warning from GCC 3.3. 2002-08-25 21:19:41 +00:00
fvdl 8cc2d64d7a Include opt_malloc_debug.h so that debug_malloc will actually be used
when enabled, thankyouverymuch.
2002-04-03 09:45:22 +00:00