summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_mbuf.c
AgeCommit message (Collapse)Author
2007-11-27make the deceptively complicated leading and trailing space into functions.Ted Unangst
this reduces kernel size quite a bit. ok claudio
2007-09-26provide m_inithdr(), which takes an mbuf and gives an initialized M_PKTHDRHenning Brauer
mbuf back. for fixing PR5563 in a few, tested janjaap@stack.nl, ok claudio
2007-07-20Remove the MFREE() macro and replace it with a call to m_free().Claudio Jeker
Also remove the _MEXTREMOVE macro which was only used by MFREE. This time with the uipc_mbuf.c change that I missed last time.
2007-06-02Initialize pkthdr.rcvif.Artur Grabowski
ok claudio@
2007-05-28set a hiwat mark for mbpool. we spend quite a bit of time bouncing pagesTed Unangst
in and out with the very low default. ok dlg henning ryan
2007-05-28double pf performance.Henning Brauer
boring details: pf used to use an mbuf tag to keep track of route-to etc, altq, tags, routing table IDs, packets redirected to localhost etc. so each and every packet going through pf got an mbuf tag. mbuf tags use malloc'd memory, and that is knda slow. instead, stuff the information into the mbuf header directly. bridging soekris with just "pass" as ruleset went from 29 MBit/s to 58 MBit/s with that (before ryan's randomness fix, now it is even betterer) thanks to chris for the test setup! ok ryan ryan ckuethe reyk
2007-05-27Kill the nasty MGET, MGETHDR and MCLGET makros and replace them with normalClaudio Jeker
functions. The world is no longer running on a PDP11 so function call overhead is not an issue. Diff by tbert, tested by many, OK art@
2007-03-15m_prepend() works only for sizes smaller than MHLEN.Claudio Jeker
OK beck@ deraadt@ pyr@
2006-12-29Avoid void * arithmetic, okay deraadt@, suggestions from millert@Pedro Martelletto
2006-11-29We don't use mb_map anymore since a long time already. Remove it.Miod Vallat
2006-10-11Remove unused variable and simplify m_copym0(). Diff from bret.lambert at ↵Marco Pfatschbacher
gmail.com. Kill another unused variable in m_devget(). Pointed out by mcbride. Rename all offset variables from off0 to off. OK markus@, deraadt@
2006-07-14TypoPedro Martelletto
2006-05-07remove drain hooks from pool.Ted Unangst
1. drain hooks and lists of allocators make the code complicated 2. the only hooks in the system are the mbuf reclaim routines 3. if reclaim is actually able to put a meaningful amount of memory back in the system, i think something else is dicked up. ie, if reclaiming your ip fragment buffers makes the difference thrashing swap and not, your system is in a load of trouble. 4. it's a scary amount of code running with very weird spl requirements and i'd say it's pretty much totally untested. raise your hand if your router is running at the edge of swap. 5. the reclaim stuff goes back to when mbufs lived in a tiny vm_map and you could run out of va. that's very unlikely (like impossible) now. ok/tested pedro krw sturm
2006-03-17rev 1.77Brad Smith
m_cat() - if it is safe, copy data portion into 1st mbuf even if 1st mbuf is M_EXT mbuf. rev 1.72 clarify comment on m_cat(). From itojun NetBSD ok claudio@ mcbride@
2006-03-05splimp -> splvmBrad Smith
2006-01-05ansi/deregisterJonathan Gray
2005-12-31Nuke unused variable 'space' found by lint. Eliminate some trailingKenneth R Westerback
whitespace. No binary diff on i386. ok pedro@
2004-05-27change uvm_km_getpage to take waitok argument and sleep if appropriate.Ted Unangst
change both the nointr and default pool allocators to using uvm_km_getpage. change pools to default to a maxpages value of 8, so they hoard less memory. change mbuf pools to use default pool allocator. pools are now more efficient, use less of kmem_map, and a bit faster. tested mcbride, deraadt, pedro, drahn, miod to work everywhere
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
2004-04-19introduce a new km_page allocator that gets pages from kernel_map usingTed Unangst
an interrupt safe thread. use this as the new backend for mbpool and mclpool, eliminating the mb_map. introduce a sysctl kern.maxclusters which controls the limit of clusters allocated. testing by many people, works everywhere but m68k. ok deraadt@ this essentially deprecates the NMBCLUSTERS option, don't use it. this should reduce pressure on the kmem_map and the uvm reserve of static map entries.
2004-04-17Don't forget to apply the M_CLUSTER flag when copying flags in m_pullup2().Ryan Thomas McBride
Fixes pr3740. Confirmed with pb@, ok markus@.
2004-04-01use NULL for ptrs. parts from Joris VinkTed Unangst
2004-01-28oh, i'll happily steal the commit. ok henning@, markus@, otto@ (iirc)Daniel Hartmeier
from KOZUKA Masahiro, fixes PR 3651
2003-08-12src argument to m_copyback() can be a const; itojun@ okMichael 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-04-23Move m_copyback() to uipc_mbuf where it makes some kinda sense; ok dhartmeiJason Wright
2003-02-12Remove commons; inspired by netbsd.Jason Wright
2002-07-03Change all variables definitions (int foo) in sys/sys/*.h to variableMiod Vallat
declarations (extern int foo), and compensate in the appropriate locations.
2002-03-14First round of __P removal in sysTodd C. Miller
2002-02-25Make pool_sethardlimit() check that it doesn't decrease the limit belowDaniel Hartmeier
the current size of the pool. ok art@
2002-02-17Patch from Daniel Lucq <daniel@lucq.org>Mats O Jansson
The patch allows you to change the value of NMBCLUSTERS, BUFCACHEPERCENT and NKMEMPAGES using the config command, instead of recompiling the kernel. This is the kernel part of the patch. I have compiled it on i386, sparc64, alpha and macppc. -moj ok art@ maja@
2002-02-05Zero-ize ext even if it has a free method defined.Angelos D. Keromytis
2002-02-05panic if a read-only mbuf is given to m_zero() --- from art@openbsd.orgAngelos D. Keromytis
2002-02-05Fix m_zero() yet again -- yesterday's fix wasn't sufficient.Angelos D. Keromytis
2002-02-04Also, cleanup any external buffers first (paranoid).Angelos D. Keromytis
2002-02-04Revision 1.37 was borked... This time, fix the casts and address theJason Wright
void * arithmetic problem correctly in m_zero()
2002-01-25Add a drain hook to each pool. This hook is called in three cases.Artur Grabowski
1. When a pool hit the hard limit. Just before bailing out/sleeping. 2. When an allocator fails to allocate memory (with PR_NOWAIT). 3. Just before trying to reclaim some page in pool_reclaim. The function called form the hook should try to free some items to the pool if possible. Convert m_reclaim hooks that were embedded in MCLGET, MGET and MGETHDR into a pool drain hook (making the code much cleaner).
2002-01-23move mb_map allocation to mbinit()Artur Grabowski
2002-01-23move definition of mb_map from zillions of machdep.c to uipc_mbuf.cArtur 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.
2002-01-16Don't include <sys/map.h> when you don't need what's in it.Miod Vallat
2001-12-18NRL license cleaningTheo de Raadt
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-12mbutl no moreArtur Grabowski
2001-06-27remove old vmArtur Grabowski
2001-06-27Update comment.Angelos D. Keromytis
2001-06-27Get rid of M_COPY_* macros; either use M_MOVE_* or M_DUP_*, dependingAngelos D. Keromytis
on how macros should be treated. Code by fgsch@, ok by me and itojun@