summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_extent.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Convert infinite sleeps to tsleep_nsec(9).mpi2020-01-111-8/+9
| | | | ok bluhm@
* Make it possible to free overlapping regions (effectively allowingkettenis2019-09-111-5/+26
| | | | | | | freeing parts of regions that are already free) when the EX_CONFLICTOK flag is passed to extent_free. ok jmatthew@
* If the EX_CONFLICTOK flag is given, allow operations that (partly)kettenis2019-08-281-2/+8
| | | | | | free space that is already free. ok patrick@
* Revert previous, it breaks regress.mpi2018-11-141-3/+3
|
* Userland malloc(3) & free(3) take only one argument.mpi2018-11-141-3/+3
|
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-5/+3
| | | | | | | | | | | | | | | | | | | | | | 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);
* fairly simple sizes for free(); ok teduderaadt2015-08-281-2/+2
|
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* pass size argument to free()deraadt2014-11-031-2/+2
| | | | ok doug tedu
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* Replace all queue *_END macro calls except CIRCLEQ_END with NULL.doug2014-09-131-4/+3
| | | | | | | | 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@
* i broke the userland shim used for the extent regress test when idlg2014-08-171-8/+15
| | | | | | | | | | | | | | | 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@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-3/+3
| | | | after discussions with beck deraadt kettenis.
* Add extent_alloc_subregion_with_descr(9) which allows the caller to providekettenis2014-01-211-17/+50
| | | | | | | a region descriptor such that the extent manager doesn't need to call malloc(9). ok miod@, deraadt@
* bzero -> memsettedu2014-01-211-2/+2
|
* Uncomment kprintf format attributes for sys/kernsyl2013-08-081-3/+3
| | | | tested on vax (gcc3) ok miod@
* Comment out recently added __attribute__((__format__(__kprintf__))) annotationsmiod2013-02-171-3/+3
| | | | | | 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.
* Add explicit __attribute__ ((__format__(__kprintf__)))) to the functions andmiod2013-02-091-3/+5
| | | | | | function pointer arguments which are {used as,} wrappers around the kernel printf function. No functional change.
* use __func__ where possible. shaves 4k and makes indentation much better.fgsch2011-01-051-58/+55
| | | | kettenis@ ok
* explicitly specify flags to malloc and pool_get instead of relying on 0.tedu2010-07-031-2/+3
| | | | | This is more clear, and as thib pointed out, the default in softraid was wrong. ok thib.
* Add some missing includes, so we do not have implicit functionphessler2010-06-201-1/+2
| | | | | | declarations. OK miod@, millert@
* fix typos in comments, no code changes;schwarze2010-01-141-3/+3
| | | | | from Brad Tilley <brad at 16systems dot com>; ok oga@
* Make sure we do not loop when allocating an extent region with EX_CONFLICTOKmiod2009-10-131-7/+11
| | | | | | | 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)
* Make sure we handle all possible ways regions can overlap when EX_CONFLICTOKkettenis2009-09-181-9/+26
| | | | | | is specified. ok miod@
* Fix userland regression tests by providing a #define for pool_setipl()oga2009-06-091-2/+2
| | | | | | (just a noop since that doesn't matter in userland). Pointed out by a couple of people, thanks.
* don't use splvm ourselves, use pool_setipl on the pool we're allocatingoga2009-06-041-11/+2
| | | | | | from and it will do it for us. ok miod@
* Add a new EX_FILLED flag to make extent_create() create an extent map thatkettenis2009-04-191-1/+13
| | | | | | has all space allocated such that we can make holes in it using extent_free(). ok miod@
* Add EX_CONFLICTOK flag that allows an allocation to conflict with existingkettenis2009-04-101-1/+34
| | | | | | allocations, making sure that the union of all space is allocated. ok deraadt@
* Make extent_print() use printf to avoid the pagination that db_printfkettenis2009-04-041-9/+17
| | | | | provides, while keeping this behaviour for extent_print_all() which is only called by ddb. Based on a diff from deraadt@.
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-8/+1
| | | | | | | | | 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@
* In extent_destroy(), only remove the extent from the global extent list ifmiod2006-06-041-1/+3
| | | | the list is really used, i.e. if option DIAGNOSTIC || option DDB.
* Turn EXTENT_ALIGN into an inline function; shaves about 50 to 100 bytesmiod2006-03-161-9/+12
| | | | on RISC arches, but m68k loses a few bytes; ok deraadt@
* Remove unused extent_find(). Then, we can keep the extent list only ifmiod2006-02-231-22/+6
| | | | option DIAGNOSTIC || option DDB, saves some room on installation media.
* ansi and deregister. No binary change.jsg2005-12-091-38/+15
|
* Remove unused extent_insert_and_optimize() parameter 'flags'. Spottedkrw2005-07-081-6/+5
| | | | | | by lint. ok art@ miod@
* Correctly handle allocations of size 1 at an extent boundary; from NetBSD.miod2005-04-211-3/+3
|
* Make the non-_KERNEL compilation usable again, in order to add a regress test.miod2005-04-211-3/+14
|
* Use list and queue macros where applicable to make the code easier to read;miod2004-12-261-22/+19
| | | | no change in compiler assembly output.
* compile non-DIAGNOSTIC kernelsderaadt2002-12-081-1/+3
|
* - Use LIST_ macros.art2002-12-081-10/+17
| | | | - Make sure that extent_register is not called more than once on an extent.
* Use %b and print the bitmask of the flags in the debugging message for the extent.jason2002-06-281-3/+3
|
* splvm, not splimp.art2002-06-111-4/+4
|
* Two patches from NetBSD:jason2002-03-211-16/+25
| | | | | | | | | - 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.
* First round of __P removal in sysmillert2002-03-141-8/+7
|
* Pool deals fairly well with physical memory shortage, but it doesn't dealart2002-01-231-2/+2
| | | | | | | | | | | | | | | | | | 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.
* Use pool to allocate extent region descriptors.art2001-08-061-7/+29
|
* In extent_destroy, remove the extent from the list ofart2001-07-261-1/+4
| | | | all extents.
* Get rid of the wrapper macros around extent_alloc*1art2001-07-051-2/+2
| | | | Pass the right amount of arguments and rename them back to their right names.
* KNFderaadt2001-06-221-6/+7
|
* correct 1 printf.fgsch2001-05-081-3/+3
|