summaryrefslogtreecommitdiff
path: root/sys/kern/kern_malloc.c
AgeCommit message (Collapse)Author
2009-02-22Don't enforce a minimum size for nkmempages by default; if the computedMiod Vallat
value (based on physmem) is below NKMEMPAGES_MIN, we are on a low memory machine and can not afford more anyway. ok deraadt@ tedu@
2008-10-18Revert the change to use pools for <= PAGE_SIZE allocations. ItMark Kettenis
changes the pressure on the uvm system, uncovering several bugs. Some of those bugs result in provable deadlocks. We'll have to reconsider integrating this diff again after fixing those bugs. ok art@
2008-10-11Since malloc_page_alloc() is a pool allocator it should check for PR_WAITOKMark Kettenis
instead of M_NOWAIT. Checking for M_NOWAIT made many malloc calls that used that flag actually wait. This probably explains many if the strange hangs people have seen recently. ok miod@
2008-10-05In malloc_page_free(), restore the correct wire_count value.Miod Vallat
2008-09-29Use pools to do allocations for all sizes <= PAGE_SIZE.Artur Grabowski
This will allow us to escape the limitations of kmem_map. At this moment, the per-type limits are still enforced for all sizes, but we might loosen that limit in the future after some thinking. Original diff from Mickey in kernel/5761 , I massaged it a little to obey the per-type limits. miod@ ok
2008-02-21Prevent possible free list corruption when malloc(9) sleeps.Mark Kettenis
From NetBSD, kindly pointed out by YAMAMOTO Takashi. ok miod@
2007-09-15replace ctob and btoc with ptoa and atop respectivelyMartin Reindl
help and ok miod@ thib@
2007-09-07Add the long requested M_ZERO flag to malloc(9).Artur Grabowski
But the reason for this isn't some kind of "we can make it use the pre-zeroed pages and zero the freelist in the idle loop and OMG I can has optimisatiuns" which would require tons of infrastructure and make everything slower. The reason is that it shrinks other code. And that's good. dlg@ ok, henning@ ok (before he read the diff)
2007-09-01replace the machine dependant bytes-to-clicks macro by the MI ptoa()Martin Reindl
version for i386 more architectures and ctob() replacement is being worked on prodded by and ok miod
2007-05-29Add a name argument to the RWLOCK_INITIALIZER macro.Thordur I. Bjornsson
Pick reasonble names for the locks involved.. ok tedu@, art@
2007-04-12Allow machine-dependant overrides for the ``deadbeef'' sentinel values,Miod Vallat
and make sure that nothing can ever be mapped at theses addresses. Only i386 overrides the default for now. From mickey@, ok art@ 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-03-25remove a few void * casts that are uselessTed Unangst
2007-01-12Switch some lockmgr locks to rwlocks.Artur Grabowski
In this commit: - gdt lock on amd64 - sysctl lock - malloc sysctl lock - disk sysctl lock - swap syscall lock miod@, pedro@ ok (and "looks good" others@)
2006-11-28Make malloc() print out a warning message when returning NULL due toPedro Martelletto
M_CANFAIL, idea from miod@, okay deraadt@
2006-11-22If M_CANFAIL is set and the malloc() size is to bigThordur I. Bjornsson
return NULL instead of panic()'ing. ok pedro@, deraadt@
2006-09-30no malloc debug but configured kmemstats allow 'sh mal' to print smth ↵Michael Shalayeff
useful; miod@ ok
2005-11-28ansi/deregister.Jonathan Gray
'go for it' deraadt@
2005-11-19Remove unnecessary lockmgr() archaism that was costing too much in termsPedro Martelletto
of panics and bugfixes. Access curproc directly, do not expect a process pointer as an argument. Should fix many "process context required" bugs. Incentive and okay millert@, okay marc@. Various testing, thanks.
2005-09-12Change the NKMEMPAGES range to 4-64MB for 32bit arches, and 8-128MB for 64bitMiod Vallat
arches; except on sparc where the range is 4-8 for !sun4m and 4-64 for sun4m, selected at runtime.
2004-12-30Import M_CANFAIL support from NetBSD, removes a nasty panic during low-mem ↵Niklas Hallqvist
scenarios, instead generating an ENOMEM backfeed, ok tedu@, prodded by many
2004-05-23bad stuff escaped by accidentTed Unangst
2004-05-23according to fork1(9), retval is optional. make it so.Ted Unangst
from form@pdp-11.org.ru via mpech. ok millert
2003-12-28make check for too large allocations earlier, instead of fiddling with it.Ted Unangst
less error prone (no wraparound). no real functional change though. ok markus tdeval
2003-07-21remove caddr_t casts. it's just silly to cast something when the functionTed Unangst
takes a void *. convert uiomove to take a void * as well. ok deraadt@
2003-06-26addrmask canbe constMichael Shalayeff
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-06-01uvm_km_suballoc passes the 'min' argument untouched to uvm_map. uvm_mapArtur Grabowski
uses it as a hint for where to steal space from the parent map. We've been passing random stack garbage as that hint for ages. It's a wonder it didn't break things until we started working on Hammer. noone objected for at least a week.
2003-05-03string fixes; tedu okTheo de Raadt
2003-04-10woah. last commit contained way too much. revert, and apply only the ↵Ted Unangst
change intended.
2003-04-10off by one bounds check in diag code. ok art.Ted Unangst
2002-06-11splvm, not splimpArtur Grabowski
2002-02-12malloc_roundup to calculate allocation size malloc will use; from netbsd;Niels Provos
okay art@
2002-01-16Don't include <sys/map.h> when you don't need what's in it.Miod Vallat
2001-12-19UBC was a disaster. It worked very good when it worked, but on someArtur Grabowski
machines or some configurations or in some phase of the moon (we actually don't know when or why) files disappeared. Since we've not been able to track down the problem in two weeks intense debugging and we need -current to be stable, back out everything to a state it had before UBC. We apologise for the inconvenience.
2001-12-05If we assume (just pure speculation) that there will be a pmap sometime inArtur Grabowski
the future that wants to allocate pv entries for every pmap_enter and wants to allocate those pv entries from kmem_map, it might be a good idea to init the kmem_map before initializing the kmemusage struct (because kmemusage allocates memory).
2001-12-05make nkmempages dynamic based on memory. okay art@ from netbsd:Niels Provos
date: 2000/02/11 19:22:52; author: thorpej; Add some very simple code to auto-size the kmem_map. We take the amount of physical memory, divide it by 4, and then allow machine dependent code to place upper and lower bounds on the size. Export the computed value to userspace via the new "vm.nkmempages" sysctl. NKMEMCLUSTERS is now deprecated and will generate an error if you attempt to use it. The new option, should you choose to use it, is called NKMEMPAGES, and two new options NKMEMPAGES_MIN and NKMEMPAGES_MAX allow the user to configure the bounds in the kernel config file.
2001-11-28Sync in more uvm from NetBSD. Mostly just cosmetic stuff.Artur Grabowski
Contains also support for page coloring.
2001-11-28zap some typedefs.Artur Grabowski
vm_map_t -> struct vm_map * vm_map_entry_t -> struct vm_map_entry * simple_lock_data_t -> struct simplelock (uvm not done yet, coming in the next commit)
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-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-08-02Sysctl for finding out how many pages there are in kmem_map.Artur Grabowski
2001-07-26Print "data modified on freelist" sizes in hex.Artur Grabowski
I know at least of two cases where people got confused by this and used the wrong size to the malloc debugger.
2001-06-27remove old vmArtur Grabowski
2001-06-22KNFTheo de Raadt
2001-06-21Canonicalize panic messageNiklas Hallqvist
2001-06-21Panic if we free stuff not in malloc region. (ifdef DIAGNOSTIC)Niklas Hallqvist
2001-05-14Use lockmgr locks for kern.malloc.kmemstat andAngelos D. Keromytis
hw.diskstats/hw.disknames.
2001-05-14Be more paranoid about zapping trailing comma.Angelos D. Keromytis