summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_malloc.c
Commit message (Collapse)AuthorAgeFilesLines
...
* KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCPshin1999-11-221-2/+5
| | | | | | | | | | for IPv6 yet) With this patch, you can assigne IPv6 addr automatically, and can reply to IPv6 ping. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* Before we start to mess with the VFS name-cache clean things up a little bit:phk1999-10-031-1/+1
| | | | Isolate the namecache in its own file, and give it a dedicated malloc type.
* KASSERT that we cannot use M_WAITOK in interrupt context.phk1999-09-191-0/+9
| | | | Reviewed by: bde
* Get rid of MALLOC_INSTANTIATE and MALLOC_MAKE_TYPE(). Just handle the 3bde1999-09-111-1/+4
| | | | malloc types declared in <sys/malloc.h> like other global malloc types.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Move the initialisation/tuning of nmbclusters from param.c/machdep.cmsmith1999-07-051-8/+7
| | | | | | | | | | | | | | | into uipc_mbuf.c. This reduces three sets of identical tunable code to one set, and puts the initialisation with the mbuf code proper. Make NMBUFs tunable as well. Move the nmbclusters sysctl here as well. Move the initialisation of maxsockets from param.c to uipc_socket2.c, next to its corresponding sysctl. Use the new tunable macros for the kern.vm.kmem.size tunable (this should have been in a separate commit, whoops).
* Fixed corruption of the kmemstatistcs list. The first malloc()bde1999-05-121-5/+9
| | | | | | | | | | | | with malloc type at the tail of the list changed the list from linear to circular. This seemed to cause surprisingly few problems, but it now causes weird output from `vmstat -m', probably because a more important malloc type is now at the tail of the list. Fix it by abusing ks_limit instead of ks_next as a flag for being on the list. Don't forget to clear the flag when a malloc type is uninit'ed. Uninit'ing is still fundamentally broken -- it loses history.
* Add sufficient braces to keep egcs happy about potentially ambiguouspeter1999-05-061-2/+3
| | | | if/else nesting.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-3/+3
| | | | kernel compile
* Allow VM_KMEM_SIZE to be tuned from the kernel environment. This tuningmsmith1999-01-211-1/+6
| | | | value *completely* overrides any value precalculated by the kernel.
* This is a rather large commit that encompasses the new swapper,dillon1999-01-211-5/+31
| | | | | | | | | | changes to the VM system to support the new swapper, VM bug fixes, several VM optimizations, and some additional revamping of the VM code. The specific bug fixes will be documented with additional forced commits. This commit is somewhat rough in regards to code cleanup issues. Reviewed by: "John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>
* KNFize, by bde.eivind1999-01-101-6/+5
|
* Split DIAGNOSTIC -> DIAGNOSTIC, INVARIANTS, and INVARIANT_SUPPORT aseivind1999-01-081-24/+19
| | | | | | | | | discussed on -hackers. Introduce 'KASSERT(assertion, ("panic message", args))' for simple check + panic. Reviewed by: msmith
* Have MALLOC_DECLARE() initialize malloc types explicitly, and have thempeter1998-11-101-6/+34
| | | | | | | | removed at module unload (if in a module of course). However; this introduces a new dependency on <sys/kernel.h> for things that use MALLOC_DECLARE(). Bruce told me it is better to add sys/kernel.h to the handful of files that need it rather than add an extra include to sys/malloc.h for kernel compiles. Updates to follow in subsequent commits.
* Nitpicking and dusting performed on a train. Removes trivial warningsphk1998-10-251-3/+1
| | | | about unused variables, labels and other lint.
* Use [u]intptr_t instead of [u_]long for casts between pointers andbde1998-08-161-3/+3
| | | | integers. Don't forget to cast to (void *) as well.
* Fixed printf format errors.bde1998-07-291-7/+8
|
* Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)julian1998-03-081-3/+3
| | | | | Submitted by: Kirk McKusick (mcKusick@mckusick.com) Obtained from: WHistle development tree
* Try to dynamically size the VM_KMEM_SIZE (but is still able to be overriddendyson1998-02-231-10/+39
| | | | | | | | in a way identically as before.) I had problems with the system properly handling the number of vnodes when there is alot of system memory, and the default VM_KMEM_SIZE. Two new options "VM_KMEM_SIZE_SCALE" and "VM_KMEM_SIZE_MAX" have been added to support better auto-sizing for systems with greater than 128MB.
* Staticize.eivind1998-02-091-2/+2
|
* Back out DIAGNOSTIC changes.eivind1998-02-061-3/+1
|
* 1) Start using a cleaner and more consistant page allocator insteaddyson1998-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | of the various ad-hoc schemes. 2) When bringing in UPAGES, the pmap code needs to do another vm_page_lookup. 3) When appropriate, set the PG_A or PG_M bits a-priori to both avoid some processor errata, and to minimize redundant processor updating of page tables. 4) Modify pmap_protect so that it can only remove permissions (as it originally supported.) The additional capability is not needed. 5) Streamline read-only to read-write page mappings. 6) For pmap_copy_page, don't enable write mapping for source page. 7) Correct and clean-up pmap_incore. 8) Cluster initial kern_exec pagin. 9) Removal of some minor lint from kern_malloc. 10) Correct some ioopt code. 11) Remove some dead code from the MI swapout routine. 12) Correct vm_object_deallocate (to remove backing_object ref.) 13) Fix dead object handling, that had problems under heavy memory load. 14) Add minor vm_page_lookup improvements. 15) Some pages are not in objects, and make sure that the vm_page.c can properly support such pages. 16) Add some more page deficit handling. 17) Some minor code readability improvements.
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+3
|
* VM level code cleanups.dyson1998-01-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Start using TSM. Struct procs continue to point to upages structure, after being freed. Struct vmspace continues to point to pte object and kva space for kstack. u_map is now superfluous. 2) vm_map's don't need to be reference counted. They always exist either in the kernel or in a vmspace. The vmspaces are managed by reference counts. 3) Remove the "wired" vm_map nonsense. 4) No need to keep a cache of kernel stack kva's. 5) Get rid of strange looking ++var, and change to var++. 6) Change more data structures to use our "zone" allocator. Added struct proc, struct vmspace and struct vnode. This saves a significant amount of kva space and physical memory. Additionally, this enables TSM for the zone managed memory. 7) Keep ioopt disabled for now. 8) Remove the now bogus "single use" map concept. 9) Use generation counts or id's for data structures residing in TSM, where it allows us to avoid unneeded restart overhead during traversals, where blocking might occur. 10) Account better for memory deficits, so the pageout daemon will be able to make enough memory available (experimental.) 11) Fix some vnode locking problems. (From Tor, I think.) 12) Add a check in ufs_lookup, to avoid lots of unneeded calls to bcmp. (experimental.) 13) Significantly shrink, cleanup, and make slightly faster the vm_fault.c code. Use generation counts, get rid of unneded collpase operations, and clean up the cluster code. 14) Make vm_zone more suitable for TSM. This commit is partially as a result of discussions and contributions from other people, including DG, Tor Egge, PHK, and probably others that I have forgotten to attribute (so let me know, if I forgot.) This is not the infamous, final cleanup of the vnode stuff, but a necessary step. Vnode mgmt should be correct, but things might still change, and there is still some missing stuff (like ioopt, and physical backing of non-merged cache files, debugging of layering concepts.)
* Some fixes from John Hood:dyson1997-12-051-1/+4
| | | | | | | | 1) Fix the initialization of malloc structure that changed due to perf opt. 2) Remove unneeded include. 3) An initialization assert added to malloc. Submitted by: John Hood <cgull@smoke.marlboro.vt.us>
* Remove the long description from the in-kernel datastructure.phk1997-10-281-1/+4
| | | | | Put a magic field in there instead, to help catch uninitialized malloc types.
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-1/+3
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Freeing with unknown type is a panic kind of thing.phk1997-10-111-2/+2
|
* Remove a debug printf entirely.phk1997-10-111-4/+1
|
* Disable an extremely annoying printf.peter1997-10-111-1/+3
|
* Rename "struct kmemstats" to "struct malloc_type" it makes more sense now.phk1997-10-101-11/+11
| | | | Fix type argument to hashinit() and phashinit()
* Make malloc more extensible. The malloc type is now a pointer tophk1997-10-101-59/+41
| | | | | | | | | | | | | | the struct kmemstats that describes the type. This allows subsystems to declare their malloc types locally and <sys/malloc.h> doesn't need tweaked everytime somebody gets an idea. You can even have a type local to a lkm... I don't know if we really need the longdesc, comments welcome. TODO: There is a single nit in ext2fs, that will be fixed later, and I intend to remove all unused malloc types and distribute the rest closer to their use.
* Fixed staticization. buckets[] was staticized but was still declaredbde1997-09-161-6/+17
| | | | | | | | | | | extern in <sys/malloc.h> and it should not have been staticized for the !(KMEMSTATS || DIAGNOSTIC) case. Fixed the !(KMEMSTATS || DIAGNOSTIC) case. The MALLOC() and FREE() macros are evil, but code generally doesn't allow for this and some code involving else clauses did not compile. Finished staticization.
* Removed unused #includes.bde1997-09-021-2/+1
|
* Get rid of the ad-hoc memory allocator for vm_map_entries, in lieu ofdyson1997-08-051-1/+5
| | | | | a simple, clean zone type allocator. This new allocator will also be used for machine dependent pmap PV entries.
* Killed bogus kernacc() call in malloc() DIAGNOSTIC code. kernacc() bydg1997-06-241-8/+1
| | | | | it's nature, locks the kernal_map, and this is deadly if kernal_map had been locked previous to a (net) interrupt.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* The check for multiple freed items were bogus. fixed.phk1996-08-041-7/+12
|
* Minor performance improvement to kern_malloc.c that increases thedyson1996-05-181-1/+17
| | | | | probability of reuse of recently freed memory. This improves cache hit stats on cached memory, and improves at least fork speed consistancy.
* Allocate mbufs from a separate submap so that NMBCLUSTERS works aswollman1996-05-101-6/+8
| | | | expected.
* removed:phk1996-05-021-4/+4
| | | | | | | | | CLBYTES PD_SHIFT PGSHIFT NBPG PGOFSET CLSIZELOG2 CLSIZE pdei() ptei() kvtopte() ptetov() ispt() ptetoav() &c &c new: NPDEPG Major macro cleanup.
* First pass at cleaning up macros relating to pages, clusters and all that.phk1996-05-021-7/+7
|
* Implement what I mentioned in rev 1.18: limit per-bucket allocations todg1996-01-291-3/+7
| | | | 60% of physical memory or 60% of malloc area size, whichever is smaller.
* Fixed two bugs in the calculation of the malloc area (kmem_map) size:dg1996-01-291-7/+9
| | | | | | | | | | | 1) The calculation didn't account for NMBCLUSTERS, so if a large number of clusters was specified, it would leave little or no space for kernel malloc. 2) It was bogusly restricted to v_page_count. This doesn't take into account the sparseness of the malloc area and would have caused problems on machines with small amounts of memory. It should probably instead be changed to set the malloc limit to be constrained by the amount of memory, but I didn't do this.
* A Major staticize sweep. Generates a couple of warnings that I'll dealphk1995-12-141-3/+3
| | | | | | with later. A number of unused vars removed. A number of unused procs removed or #ifdefed.
* Untangled the vm.h include file spaghetti.dg1995-12-071-1/+4
|
* Finished (?) cleaning up sysinit stuff.bde1995-12-021-8/+3
|
* Fixed init functions argument type - caddr_t -> void *. Fixed a couple ofdg1995-09-091-4/+4
| | | | compiler warnings.
* Reviewed by: julian with quick glances by bruce and othersjulian1995-08-281-3/+13
| | | | | | | | | | | | | | | | | | | | | | Submitted by: terry (terry lambert) This is a composite of 3 patch sets submitted by terry. they are: New low-level init code that supports loadbal modules better some cleanups in the namei code to help terry in 16-bit character support some changes to the mount-root code to make it a little more modular.. NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able to test those cases.. certainly mounting root of disk still works just fine.. mfs should work but is untested. (tomorrows task) The low level init stuff includes a total rewrite of init_main.c to make it possible for new modules to have an init phase by simply adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can be added to the kernel without editing any other files other than the 'files' file.
OpenPOWER on IntegriCloud