summaryrefslogtreecommitdiff
path: root/sys/kern/kern_malloc_debug.c
AgeCommit message (Collapse)Author
2014-11-16Replace a plethora of historical protection options with justTheo de Raadt
PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
2014-03-28Reduce uvm include madness. Use <uvm/uvm_extern.h> instead ofMartin Pieuchot
<uvm/uvm.h> if possible and remove double inclusions. ok beck@, mlarkin@, deraadt@
2013-08-08Uncomment kprintf format attributes for sys/kernSylvestre Gallon
tested on vax (gcc3) ok miod@
2013-06-25allow kernel to compile with MALLOC_DEBUG.syl
ok miod@
2013-02-17Comment out recently added __attribute__((__format__(__kprintf__))) annotationsMiod Vallat
in MI code; gcc 2.95 does not accept such annotation for function pointer declarations, only function prototypes. To be uncommented once gcc 2.95 bites the dust.
2013-02-09Add explicit __attribute__ ((__format__(__kprintf__)))) to the functions andMiod Vallat
function pointer arguments which are {used as,} wrappers around the kernel printf function. No functional change.
2011-07-28Kill integer from pointer warning when compiling with MALLOC_DEBUG.Ryan Thomas McBride
ok kettenis
2009-04-24Change format strings to allow 64 bit addresses to display properly,Jonathan Gray
and add a missing argument to one of the printf calls. ok art@
2007-04-13While splitting flags and pqflags might have been a good idea in theoryArtur Grabowski
to separate locking, on most modern machines this is not enough since operations on short types touch other short types that share the same word in memory. Merge pg_flags and pqflags again and now use atomic operations to change the flags. Also bump wire_count to an int and pg_version might go int as well, just for alignment. tested by many, many. ok miod@
2007-04-11Instead of managing pages for intrsafe maps in special objects (aka.Artur Grabowski
kmem_object) just so that we can remove them, just use pmap_extract to get the pages to free and simplify a lot of code to not deal with the list of intrsafe maps, intrsafe objects, etc. miod@ ok
2007-04-04Mechanically rename the "flags" and "version" fields in struct vm_pageArtur Grabowski
to "pg_flags" and "pg_version", so that they are a bit easier to work with. Whoever uses generic names like this for a popular struct obviously doesn't read much code. Most architectures compile and there are no functionality changes. deraadt@ ok ("if something fails to compile, we fix that by hand")
2004-06-20Fix inversed logic in handling the "nowait/waitok" flags. Bugs in two placesArtur Grabowski
in malloc_debug. Also, add an assert-like function to sprinkle in code you're debugging at the moment. Those asserts are _not_ supposed to be ever comitted, just use them while debugging. beck@ ok
2003-06-03license cleaning.Artur Grabowski
2002-12-20Add a special malloc type M_DEBUG.Artur Grabowski
If the kernel is compiled with MALLOC_DEBUG, M_DEBUG will force the allocation to be done through malloc_debug.
2002-12-05Hmm.. I don't think we want the default to be to debug every allocation.Artur Grabowski
2002-12-05Do not use debug_malloc if it hasn't been initialized.Artur Grabowski
This can happen when debug_malloc_init calls pool_init which calls malloc (because the kernel is built with POOL_DIAGNOSTIC) which in turn calls debug_malloc and debug_malloc just happens to trigger on all memory allocations. This allows us to run a kernel debugging _all_ allocations.
2002-07-01Don't abuse VM_PROT_ALL. Use VM_PROT_READ|VM_PROT_WRITE here.Artur Grabowski
We'll never want to exec code in malloc mappings.
2002-06-11splassert where neededArtur Grabowski
2002-01-23Pool deals fairly well with physical memory shortage, but it doesn't dealArtur Grabowski
well (not at all) with shortages of the vm_map where the pages are mapped (usually kmem_map). Try to deal with it: - group all information the backend allocator for a pool in a separate struct. The pool will only have a pointer to that struct. - change the pool_init API to reflect that. - link all pools allocating from the same allocator on a linked list. - Since an allocator is responsible to wait for physical memory it will only fail (waitok) when it runs out of its backing vm_map, carefully drain pools using the same allocator so that va space is freed. (see comments in code for caveats and details). - change pool_reclaim to return if it actually succeeded to free some memory, use that information to make draining easier and more efficient. - get rid of PR_URGENT, noone uses it.
2001-12-08Sprinkle pmap_update calls where relevant and some otherArtur Grabowski
misc pmap usage fixes.
2001-11-06Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.Miod Vallat
(Look ma, I might have broken the tree)
2001-09-19merge vm/vm_kern.h into uvm/uvm_extern.h; art@ okMichael Shalayeff
2001-08-30typo in the comment.Mike Pechkin
2001-08-17When this code was imported to NetBSD by Jason Thorpe he did a bunch ofArtur Grabowski
useful changes (and a lot of cleanup). Bring in them.
2001-07-26Be more careful with ranges.Artur Grabowski
From Heikki Korpela <heko@iki.fi>
2001-07-18Typo.Artur Grabowski
Noted by: Heikki Korpela <heko@iki.fi>
2001-07-18Get rid of the PMAP_NEW option by making it mandatory for all archs.Artur Grabowski
The archs that didn't have a proper PMAP_NEW now have a dummy implementation with wrappers around the old functions.
2001-07-17Since normal malloc reports "data modified on free list" withArtur Grabowski
the size we are trying to allocate and not the size of the bucket and malloc_debug is not capable of debugging a prticular bucket, only a size, add a possibility to specify a size range.
2001-06-27remove old vmArtur Grabowski
2000-06-07Allow passing an address to 'show malloc' and print out some information aboutArtur Grabowski
that address.
2000-06-07Change debug_malloc_print so that it can be called from ddb.Artur Grabowski
2000-06-07Default type and size to -1.Artur Grabowski
2000-06-06This code will not work without UVM.Artur Grabowski
Add an #error instead of breaking while compiling.
2000-06-06malloc debugging code. Enabled by option MALLOC_DEBUG.Artur Grabowski
Make sure you read the docs (malloc(9)) before use.