mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
[PATCH] mempool: NOMEMALLOC and NORETRY
Mempools have 2 problems. The first is that mempool_alloc can possibly get stuck in __alloc_pages when they should opt to fail, and take an element from their reserved pool. The second is that it will happily eat emergency PF_MEMALLOC reserves instead of going to their reserved pools. Fix the first by passing __GFP_NORETRY in the allocation calls in mempool_alloc. Fix the second by introducing a __GFP_MEMPOOL flag which directs the page allocator not to allocate from the reserve pool. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
8e30f272a9
commit
b84a35be02
3 changed files with 23 additions and 12 deletions
|
@ -38,14 +38,16 @@ struct vm_area_struct;
|
|||
#define __GFP_NO_GROW 0x2000u /* Slab internal usage */
|
||||
#define __GFP_COMP 0x4000u /* Add compound page metadata */
|
||||
#define __GFP_ZERO 0x8000u /* Return zeroed page on success */
|
||||
#define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */
|
||||
|
||||
#define __GFP_BITS_SHIFT 16 /* Room for 16 __GFP_FOO bits */
|
||||
#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
|
||||
#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1)
|
||||
|
||||
/* if you forget to add the bitmask here kernel will crash, period */
|
||||
#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
|
||||
__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
|
||||
__GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP)
|
||||
__GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
|
||||
__GFP_NOMEMALLOC)
|
||||
|
||||
#define GFP_ATOMIC (__GFP_HIGH)
|
||||
#define GFP_NOIO (__GFP_WAIT)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue