Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 864b0dd in mainline


Ignore:
Timestamp:
2011-04-21T19:23:00Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
010be476
Parents:
164c653
Message:

Always use reserve_force_alloc() in frame_alloc_generic(), even when
FRAME_ATOMIC was specified. This guarantess that in case of memory shortage,
the frame allocator will attempt to reclaim memory from the slab allocator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/frame.c

    r164c653 r864b0dd  
    10071007         * If not told otherwise, we must first reserve the memory.
    10081008         */
    1009         if (!(flags & FRAME_NO_RESERVE)) {
    1010                 if (flags & FRAME_ATOMIC) {
    1011                         if (!reserve_try_alloc(size))
    1012                                 return NULL;
    1013                 } else {
    1014                         reserve_force_alloc(size);
    1015                 }
    1016         }
    1017        
     1009        if (!(flags & FRAME_NO_RESERVE))
     1010                reserve_force_alloc(size);
     1011
    10181012loop:
    10191013        irq_spinlock_lock(&zones.lock, true);
Note: See TracChangeset for help on using the changeset viewer.