Changeset e5a015b in mainline for kernel/generic/include/mm/reserve.h


Ignore:
Timestamp:
2011-04-16T20:45:36Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a7dbd49
Parents:
b2fb47f (diff), 9e953bda (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge the memory reservation feature (Phase 1) from
lp:~jakub/helenos/mm.

This merge makes the testcase from ticket #114 non-reproducible. The
testcase is now available as tester's malloc2 test. It also seems to me
that this merge makes it harder for the system to run out of memory
during kconsole 'test *' and 'tester *', even though I did see several
hangs already with this feature in place. See below for what is still
missing to make the hangs even less probable or even impossible.

In Phase 1, I am targeting just the low-hanging fruits. In particular,
only anonymous and ELF backend pages are reserved physical memory at
time of as_area_create() and as_area_resize(). Memory is unreserved on
as_area_destroy(). In all other cases, memory is reserved at the same
time as it is allocated, making those calls subject to infinite
blocking if FRAME_ATOMIC is not used.

Possible sources of memory overcommit not addressed in this merge:

  • As mentioned above, only backend pages are reserved; pages for supporting structures such as B+tree nodes, TTEs are not reserved or handled otherwise. Kernel heap allocator fragmentation is not included in the reservations either.
  • The initial amount of reservable memory is fed from zone_construct(). Zone merging is not taken into account, which can make the reservable memory tracking inaccurate.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/reserve.h

    rb2fb47f re5a015b  
    11/*
    2  * Copyright (c) 2006 Jakub Jermar
     2 * Copyright (c) 2011 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup sparc64mm       
     29/** @addtogroup genericmm
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef KERN_sparc64_CACHE_H_
    36 #define KERN_sparc64_CACHE_H_
     35#ifndef KERN_RESERVE_H_
     36#define KERN_RESERVE_H_
    3737
    38 #include <mm/page.h>
    39 #include <mm/frame.h>
     38#include <typedefs.h>
     39
     40extern bool reserve_try_alloc(size_t);
     41extern void reserve_force_alloc(size_t);
     42extern void reserve_free(size_t);
    4043
    4144#endif
Note: See TracChangeset for help on using the changeset viewer.