summaryrefslogtreecommitdiff
path: root/sys/kern/subr_extent.c
AgeCommit message (Collapse)Author
2024-01-19Implement extent_alloc_region_with_descr(9) which is the equivalent ofMark Kettenis
extent_alloc_region(9) that uses a pre-allocated region descriptor. ok patrick@
2022-12-05zap a pile of dangling tabsTheo de Raadt
2020-01-11Convert infinite sleeps to tsleep_nsec(9).Martin Pieuchot
ok bluhm@
2019-09-11Make it possible to free overlapping regions (effectively allowingMark Kettenis
freeing parts of regions that are already free) when the EX_CONFLICTOK flag is passed to extent_free. ok jmatthew@
2019-08-28If the EX_CONFLICTOK flag is given, allow operations that (partly)Mark Kettenis
free space that is already free. ok patrick@
2018-11-14Revert previous, it breaks regress.Martin Pieuchot
2018-11-14Userland malloc(3) & free(3) take only one argument.Martin Pieuchot
2016-09-15all pools have their ipl set via pool_setipl, so fold it into pool_init.David Gwynne
the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
2015-08-28fairly simple sizes for free(); ok teduTheo de Raadt
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2014-11-03pass size argument to free()Theo de Raadt
ok doug tedu
2014-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@
2014-09-13Replace all queue *_END macro calls except CIRCLEQ_END with NULL.Doug Hogan
CIRCLEQ_* is deprecated and not called in the tree. The other queue types have *_END macros which were added for symmetry with CIRCLEQ_END. They are defined as NULL. There's no reason to keep the other *_END macro calls. ok millert@
2014-08-17i broke the userland shim used for the extent regress test when iDavid Gwynne
made it so struct pool was only visible to _KERNEL. tedu broke it too when he added the size argument to the kernel free functions. this fixes both issues. the main change is to provide a local version of struct pool with just the bit (pr_size) needed for extent to run. if extents take advantage of more malloc/pool features (eg, {M,PR}_ZERO then this will need to be updated again. found by and based on a diff from Theo Buehler ok mpi@
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-01-21Add extent_alloc_subregion_with_descr(9) which allows the caller to provideMark Kettenis
a region descriptor such that the extent manager doesn't need to call malloc(9). ok miod@, deraadt@
2014-01-21bzero -> memsetTed Unangst
2013-08-08Uncomment kprintf format attributes for sys/kernSylvestre Gallon
tested on vax (gcc3) 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-01-05use __func__ where possible. shaves 4k and makes indentation much better.Federico G. Schwindt
kettenis@ ok
2010-07-03explicitly specify flags to malloc and pool_get instead of relying on 0.Ted Unangst
This is more clear, and as thib pointed out, the default in softraid was wrong. ok thib.
2010-06-20Add some missing includes, so we do not have implicit functionPeter Hessler
declarations. OK miod@, millert@
2010-01-14fix typos in comments, no code changes;Ingo Schwarze
from Brad Tilley <brad at 16systems dot com>; ok oga@
2009-10-13Make sure we do not loop when allocating an extent region with EX_CONFLICTOKMiod Vallat
and the whole extent is used; the current code computations would wrap. Found the hard way by jsg@, fix discuss with kettenis@, and you get a regress test for free (which will spin if you compile it again an old subr_extent.c)
2009-09-18Make sure we handle all possible ways regions can overlap when EX_CONFLICTOKMark Kettenis
is specified. ok miod@
2009-06-09Fix userland regression tests by providing a #define for pool_setipl()Owain Ainsworth
(just a noop since that doesn't matter in userland). Pointed out by a couple of people, thanks.
2009-06-04don't use splvm ourselves, use pool_setipl on the pool we're allocatingOwain Ainsworth
from and it will do it for us. ok miod@
2009-04-19Add a new EX_FILLED flag to make extent_create() create an extent map thatMark Kettenis
has all space allocated such that we can make holes in it using extent_free(). ok miod@
2009-04-10Add EX_CONFLICTOK flag that allows an allocation to conflict with existingMark Kettenis
allocations, making sure that the union of all space is allocated. ok deraadt@
2009-04-04Make extent_print() use printf to avoid the pagination that db_printfMark Kettenis
provides, while keeping this behaviour for extent_print_all() which is only called by ddb. Based on a diff from deraadt@.
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
2006-06-04In extent_destroy(), only remove the extent from the global extent list ifMiod Vallat
the list is really used, i.e. if option DIAGNOSTIC || option DDB.
2006-03-16Turn EXTENT_ALIGN into an inline function; shaves about 50 to 100 bytesMiod Vallat
on RISC arches, but m68k loses a few bytes; ok deraadt@
2006-02-23Remove unused extent_find(). Then, we can keep the extent list only ifMiod Vallat
option DIAGNOSTIC || option DDB, saves some room on installation media.
2005-12-09ansi and deregister. No binary change.Jonathan Gray
2005-07-08Remove unused extent_insert_and_optimize() parameter 'flags'. SpottedKenneth R Westerback
by lint. ok art@ miod@
2005-04-21Correctly handle allocations of size 1 at an extent boundary; from NetBSD.Miod Vallat
2005-04-21Make the non-_KERNEL compilation usable again, in order to add a regress test.Miod Vallat
2004-12-26Use list and queue macros where applicable to make the code easier to read;Miod Vallat
no change in compiler assembly output.
2002-12-08compile non-DIAGNOSTIC kernelsTheo de Raadt
2002-12-08 - Use LIST_ macros.Artur Grabowski
- Make sure that extent_register is not called more than once on an extent.
2002-06-28Use %b and print the bitmask of the flags in the debugging message for the ↵Jason Wright
extent.
2002-06-11splvm, not splimp.Artur Grabowski
2002-03-21Two patches from NetBSD:Jason Wright
- extent_alloc_subregion shouldn't allocate a region pasts the end of subregion. - extent_alloc_subregion1(): when a candidate region doesn't fit after being rounded up to respect boundary limits, adjust newstart and last before skiping to the next region. Otherwise we may check the same candidate region against the start of the next region, no the one immediatly following the hole, leading to corrupted map.
2002-03-14First round of __P removal in sysTodd C. Miller
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-08-06Use pool to allocate extent region descriptors.Artur Grabowski
2001-07-26In extent_destroy, remove the extent from the list ofArtur Grabowski
all extents.
2001-07-05Get rid of the wrapper macros around extent_alloc*1Artur Grabowski
Pass the right amount of arguments and rename them back to their right names.