#
31cee26c |
|
13-Jun-2020 |
Michael Lotz <mmlr@mlotz.ch> |
kernel: Whitespace cleanup only.
|
#
ef9d9a17 |
|
02-Nov-2011 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Add new operator that takes an ObjectCache* and allocation flags and template function object_cache_delete() to be used to delete objects constructed with it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43132 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
ff59ce68 |
|
24-Feb-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* The low resource handler now empties the cache depot's magazines; before, they were never freed unless the cache was destroyed (I just wondered why my system would bury >1G in the magazines). * Made the magazine capacity variable per cache, ie. for larger objects, it's not a good idea to have 64*CPU buffers lying around in the worst case. * Furthermore, the create_object_cache_etc()/object_depot_init() now have arguments for the magazine capacity as well as the maximum number of full unused magazines. * By default, you might want to initialize both to zero, as then some hopefully usable defaults are computed. Otherwise (the only current example is the vm_page_mapping cache) you can just put in the values you'd want there. The page mapping cache uses larger values, as its objects are usually allocated and deleted in larger chunks. * Beware, though, I couldn't test these changes yet as Qemu didn't like to run today. I'll test these changes on another machine now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35601 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
deee8524 |
|
26-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Introduced {malloc,memalign,free}_etc() which take an additional "flags" argument. They replace the previous special-purpose allocation functions (malloc_nogrow(), vip_io_request_malloc()). * Moved the I/O VIP heap to heap.cpp accordingly. * Added quite a bit of passing around of allocation flags in the VM, particularly in the VM*AddressSpace classes. * Fixed IOBuffer::GetNextVirtualVec(): It was ignoring the VIP flag and always allocated on the normal heap. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35316 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
cff6e9e4 |
|
26-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* The system now holds back a small reserve of committable memory and pages. The memory and page reservation functions have a new "priority" parameter that indicates how deep the function may tap into that reserve. The currently existing priority levels are "user", "system", and "VIP". The idea is that user programs should never be able to cause a state that gets the kernel into trouble due to heavy battling for memory. The "VIP" level (not really used yet) is intended for allocations that are required to free memory eventually (in the page writer). More levels are thinkable in the future, like "user real time" or "user system server". * Added "priority" parameters to several VMCache methods. * Replaced the map_backing_store() "unmapAddressRange" parameter by a "flags" parameter. * Added area creation flag CREATE_AREA_PRIORITY_VIP and slab allocator flag CACHE_PRIORITY_VIP indicating the importance of the request. * Changed most code to pass the right priorities/flags. These changes already significantly improve the behavior in low memory situations. I've tested a bit with 64 MB (virtual) RAM and, while not particularly fast and responsive, the system remains at least usable under high memory pressure. As a side effect the slab allocator can now be used as general memory allocator. Not done by default yet, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35295 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
71f65bee |
|
24-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Marked CACHE_UNLOCKED_PAGES as unsupported. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35281 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
8d1316fd |
|
22-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Replaced CACHE_DONT_SLEEP by two new flags CACHE_DONT_WAIT_FOR_MEMORY and CACHE_DONT_LOCK_KERNEL_SPACE. If the former is given, the slab memory manager does not wait when reserving memory or pages. The latter prevents area operations. The new flags add a bit of flexibility. E.g. when allocating page mapping objects for userland areas CACHE_DONT_WAIT_FOR_MEMORY is sufficient, i.e. the allocation will succeed as long as pages are available. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35246 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
86c794e5 |
|
21-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
slab allocator: * Implemented a more elaborated raw memory allocation backend (MemoryManager). We allocate 8 MB areas whose pages we allocate and map when needed. An area is divided into equally-sized chunks which form the basic units of allocation. We have areas with three possible chunk sizes (small, medium, large), which is basically what the ObjectCache implementations were using anyway. * Added "uint32 flags" parameter to several of the slab allocator's object cache and object depot functions. E.g. object_depot_store() potentially wants to allocate memory for a magazine. But also in pure freeing functions it might eventually become useful to have those flags, since they could end up deleting an area, which might not be allowable in all situations. We should introduce specific flags to indicate that. * Reworked the block allocator. Since the MemoryManager allocates block-aligned areas, maintains a hash table for lookup, and maps chunks to object caches, we can quickly find out which object cache a to be freed allocation belongs to and thus don't need the boundary tags anymore. * Reworked the slab boot strap process. We allocate from the initial area only when really necessary, i.e. when the object cache for the respective allocation size has not been created yet. A single page is thus sufficient. other: * vm_allocate_early(): Added boolean "blockAlign" parameter. If true, the semantics is the same as for B_ANY_KERNEL_BLOCK_ADDRESS. * Use an object cache for page mappings. This significantly reduces the contention on the heap bin locks. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35232 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
825566f8 |
|
19-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Split the slab allocator code into separate source files and C++-ified things a bit. * Some style cleanup. * The object depot does now have a cookie that will be passed to the return hook. * Fixed object_cache_return_object_wrapper() using the new cookie. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35174 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
0fc052b4 |
|
19-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Moved the definition of the CACHE_ALIGN_ON_SIZE flag to the header and fixed its value. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35163 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
1cda5944 |
|
20-Aug-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Added object_cache_set_minimum_reserve() which sets the minimal number of free objects an object cache should try to have ready. If the number of free objects drops below the threshold, a new urgent priority thread is asked to asynchronously resize the object cache (pretty similar to the heap grower thread). Such a mechanism is necessary for code paths that are supposed to free pages, but may need memory themselves (like the swap support). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27100 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
5db87665 |
|
05-Aug-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Added object_cache_get_usage() function that returns the memory allocated by an object cache. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26835 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
c6ee79ce |
|
16-Jan-2008 |
Axel Dörfler <axeld@pinc-software.de> |
* vm_create_anonymous_area() now accepts B_ANY_KERNEL_BLOCK_ADDRESS. * As a temporary work-around for the current slab allocator's area usage, I added the CACHE_LARGE_SLAB flag, which will force the allocator to use larger areas. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23564 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
23128566 |
|
21-Oct-2007 |
Axel Dörfler <axeld@pinc-software.de> |
Slab.h no longer includes Depot.h. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22647 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
b623d277 |
|
21-Oct-2007 |
Axel Dörfler <axeld@pinc-software.de> |
Moved Base.h into Slab.h, and removed Base.h. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22646 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
0be6e977 |
|
29-Apr-2007 |
Hugo Santos <hugosantos@nowhere.fake> |
minimal cleanups git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20901 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
11b5020f |
|
28-Apr-2007 |
Hugo Santos <hugosantos@nowhere.fake> |
rewrote the object cache (slab) implementation a bit, preparing for further integration. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20887 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
e6fb3d39 |
|
26-Apr-2007 |
Hugo Santos <hugosantos@nowhere.fake> |
more slab fixes, also introduced a new strategy optimized for medium sized buffers (64 >= x < 512) with lengths other than power of 2 (has an overhead of 2 words per buffer). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20839 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
b8c0d661 |
|
26-Apr-2007 |
Hugo Santos <hugosantos@nowhere.fake> |
gcc 4 compilation fixes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20835 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
81423c91 |
|
25-Apr-2007 |
Hugo Santos <hugosantos@nowhere.fake> |
added initial slab code to the kernel. It is still unused, and there is still no VM interaction. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20832 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
ef9d9a1720573321434f36b5ad1fabfd9f4c519e |
|
02-Nov-2011 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Add new operator that takes an ObjectCache* and allocation flags and template function object_cache_delete() to be used to delete objects constructed with it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43132 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
ff59ce680df5d2032ea5a11c666688269225f033 |
|
24-Feb-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* The low resource handler now empties the cache depot's magazines; before, they were never freed unless the cache was destroyed (I just wondered why my system would bury >1G in the magazines). * Made the magazine capacity variable per cache, ie. for larger objects, it's not a good idea to have 64*CPU buffers lying around in the worst case. * Furthermore, the create_object_cache_etc()/object_depot_init() now have arguments for the magazine capacity as well as the maximum number of full unused magazines. * By default, you might want to initialize both to zero, as then some hopefully usable defaults are computed. Otherwise (the only current example is the vm_page_mapping cache) you can just put in the values you'd want there. The page mapping cache uses larger values, as its objects are usually allocated and deleted in larger chunks. * Beware, though, I couldn't test these changes yet as Qemu didn't like to run today. I'll test these changes on another machine now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35601 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
deee8524b7534d9b586cbcbf366d0660c9769a8e |
|
26-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Introduced {malloc,memalign,free}_etc() which take an additional "flags" argument. They replace the previous special-purpose allocation functions (malloc_nogrow(), vip_io_request_malloc()). * Moved the I/O VIP heap to heap.cpp accordingly. * Added quite a bit of passing around of allocation flags in the VM, particularly in the VM*AddressSpace classes. * Fixed IOBuffer::GetNextVirtualVec(): It was ignoring the VIP flag and always allocated on the normal heap. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35316 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
cff6e9e406132a76bfc20cb35ff5228dd0ba94d8 |
|
26-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* The system now holds back a small reserve of committable memory and pages. The memory and page reservation functions have a new "priority" parameter that indicates how deep the function may tap into that reserve. The currently existing priority levels are "user", "system", and "VIP". The idea is that user programs should never be able to cause a state that gets the kernel into trouble due to heavy battling for memory. The "VIP" level (not really used yet) is intended for allocations that are required to free memory eventually (in the page writer). More levels are thinkable in the future, like "user real time" or "user system server". * Added "priority" parameters to several VMCache methods. * Replaced the map_backing_store() "unmapAddressRange" parameter by a "flags" parameter. * Added area creation flag CREATE_AREA_PRIORITY_VIP and slab allocator flag CACHE_PRIORITY_VIP indicating the importance of the request. * Changed most code to pass the right priorities/flags. These changes already significantly improve the behavior in low memory situations. I've tested a bit with 64 MB (virtual) RAM and, while not particularly fast and responsive, the system remains at least usable under high memory pressure. As a side effect the slab allocator can now be used as general memory allocator. Not done by default yet, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35295 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
71f65beeb3a71537e3f35f577e38f5706c622014 |
|
24-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Marked CACHE_UNLOCKED_PAGES as unsupported. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35281 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
8d1316fd23616f6dac131a0eba5dab08acc6e76d |
|
22-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Replaced CACHE_DONT_SLEEP by two new flags CACHE_DONT_WAIT_FOR_MEMORY and CACHE_DONT_LOCK_KERNEL_SPACE. If the former is given, the slab memory manager does not wait when reserving memory or pages. The latter prevents area operations. The new flags add a bit of flexibility. E.g. when allocating page mapping objects for userland areas CACHE_DONT_WAIT_FOR_MEMORY is sufficient, i.e. the allocation will succeed as long as pages are available. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35246 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
86c794e5c10f1b2d99d672d424a8637639c703dd |
|
21-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
slab allocator: * Implemented a more elaborated raw memory allocation backend (MemoryManager). We allocate 8 MB areas whose pages we allocate and map when needed. An area is divided into equally-sized chunks which form the basic units of allocation. We have areas with three possible chunk sizes (small, medium, large), which is basically what the ObjectCache implementations were using anyway. * Added "uint32 flags" parameter to several of the slab allocator's object cache and object depot functions. E.g. object_depot_store() potentially wants to allocate memory for a magazine. But also in pure freeing functions it might eventually become useful to have those flags, since they could end up deleting an area, which might not be allowable in all situations. We should introduce specific flags to indicate that. * Reworked the block allocator. Since the MemoryManager allocates block-aligned areas, maintains a hash table for lookup, and maps chunks to object caches, we can quickly find out which object cache a to be freed allocation belongs to and thus don't need the boundary tags anymore. * Reworked the slab boot strap process. We allocate from the initial area only when really necessary, i.e. when the object cache for the respective allocation size has not been created yet. A single page is thus sufficient. other: * vm_allocate_early(): Added boolean "blockAlign" parameter. If true, the semantics is the same as for B_ANY_KERNEL_BLOCK_ADDRESS. * Use an object cache for page mappings. This significantly reduces the contention on the heap bin locks. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35232 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
825566f82f652d82ffaf3f0deca0a2bcda1e02c2 |
|
19-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Split the slab allocator code into separate source files and C++-ified things a bit. * Some style cleanup. * The object depot does now have a cookie that will be passed to the return hook. * Fixed object_cache_return_object_wrapper() using the new cookie. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35174 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
0fc052b47dfb40f53cddfb38c9498384b22b5466 |
|
19-Jan-2010 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Moved the definition of the CACHE_ALIGN_ON_SIZE flag to the header and fixed its value. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35163 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
1cda5944ad23e0ee134b13b9e3c0c0fd2f68d6ca |
|
20-Aug-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Added object_cache_set_minimum_reserve() which sets the minimal number of free objects an object cache should try to have ready. If the number of free objects drops below the threshold, a new urgent priority thread is asked to asynchronously resize the object cache (pretty similar to the heap grower thread). Such a mechanism is necessary for code paths that are supposed to free pages, but may need memory themselves (like the swap support). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27100 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
5db876653b9bd56d9cf54f71e28f210f9782d2d1 |
|
05-Aug-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Added object_cache_get_usage() function that returns the memory allocated by an object cache. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26835 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
c6ee79ce388772e847063f6d52111db54b0bbc71 |
|
16-Jan-2008 |
Axel Dörfler <axeld@pinc-software.de> |
* vm_create_anonymous_area() now accepts B_ANY_KERNEL_BLOCK_ADDRESS. * As a temporary work-around for the current slab allocator's area usage, I added the CACHE_LARGE_SLAB flag, which will force the allocator to use larger areas. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23564 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
23128566a45f71c5978e70a84b329f9e96331385 |
|
21-Oct-2007 |
Axel Dörfler <axeld@pinc-software.de> |
Slab.h no longer includes Depot.h. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22647 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
b623d277fa8afb1acebfbfdbd0e527e8b0d8e89a |
|
21-Oct-2007 |
Axel Dörfler <axeld@pinc-software.de> |
Moved Base.h into Slab.h, and removed Base.h. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22646 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
0be6e97788ab8763aeb034c2cd0117df9b1fd408 |
|
29-Apr-2007 |
Hugo Santos <hugosantos@nowhere.fake> |
minimal cleanups git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20901 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
11b5020f2fa2dcc510704cf3fb8dc9c3d3ea1f71 |
|
28-Apr-2007 |
Hugo Santos <hugosantos@nowhere.fake> |
rewrote the object cache (slab) implementation a bit, preparing for further integration. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20887 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
e6fb3d3947b167b0b79b4c6932c481fde9d79c5c |
|
26-Apr-2007 |
Hugo Santos <hugosantos@nowhere.fake> |
more slab fixes, also introduced a new strategy optimized for medium sized buffers (64 >= x < 512) with lengths other than power of 2 (has an overhead of 2 words per buffer). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20839 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
b8c0d6618e66115f951cd2e5191d067711422ebb |
|
26-Apr-2007 |
Hugo Santos <hugosantos@nowhere.fake> |
gcc 4 compilation fixes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20835 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
81423c91c784578220954adf9ed003575f8db8a0 |
|
25-Apr-2007 |
Hugo Santos <hugosantos@nowhere.fake> |
added initial slab code to the kernel. It is still unused, and there is still no VM interaction. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20832 a95241bf-73f2-0310-859d-f6bbb57e9c96
|