]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.25/patches.suse/SoN-13-mm-page_alloc-GFP_EMERGENCY.patch
Revert "Move xen patchset to new version's subdir."
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.suse / SoN-13-mm-page_alloc-GFP_EMERGENCY.patch
diff --git a/src/patches/suse-2.6.27.25/patches.suse/SoN-13-mm-page_alloc-GFP_EMERGENCY.patch b/src/patches/suse-2.6.27.25/patches.suse/SoN-13-mm-page_alloc-GFP_EMERGENCY.patch
new file mode 100644 (file)
index 0000000..725c4b9
--- /dev/null
@@ -0,0 +1,52 @@
+From: Peter Zijlstra <a.p.zijlstra@chello.nl> 
+Subject: mm: __GFP_MEMALLOC
+Patch-mainline: No
+References: FATE#303834
+
+__GFP_MEMALLOC will allow the allocation to disregard the watermarks, 
+much like PF_MEMALLOC.
+
+It allows one to pass along the memalloc state in object related allocation
+flags as opposed to task related flags, such as sk->sk_allocation.
+
+Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Acked-by: Neil Brown <neilb@suse.de>
+Acked-by: Suresh Jayaraman <sjayaraman@suse.de>
+
+---
+ include/linux/gfp.h |    3 ++-
+ mm/page_alloc.c     |    4 +++-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+--- a/include/linux/gfp.h
++++ b/include/linux/gfp.h
+@@ -43,6 +43,7 @@ struct vm_area_struct;
+ #define __GFP_REPEAT  ((__force gfp_t)0x400u) /* See above */
+ #define __GFP_NOFAIL  ((__force gfp_t)0x800u) /* See above */
+ #define __GFP_NORETRY ((__force gfp_t)0x1000u)/* See above */
++#define __GFP_MEMALLOC  ((__force gfp_t)0x2000u)/* Use emergency reserves */
+ #define __GFP_COMP    ((__force gfp_t)0x4000u)/* Add compound page metadata */
+ #define __GFP_ZERO    ((__force gfp_t)0x8000u)/* Return zeroed page on success */
+ #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */
+@@ -88,7 +89,7 @@ struct vm_area_struct;
+ /* Control page allocator reclaim behavior */
+ #define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\
+                       __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\
+-                      __GFP_NORETRY|__GFP_NOMEMALLOC)
++                      __GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC)
+ /* Control allocation constraints */
+ #define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE)
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
+@@ -1480,7 +1480,9 @@ int gfp_to_alloc_flags(gfp_t gfp_mask)
+               alloc_flags |= ALLOC_HARDER;
+       if (likely(!(gfp_mask & __GFP_NOMEMALLOC))) {
+-              if (!in_irq() && (p->flags & PF_MEMALLOC))
++              if (gfp_mask & __GFP_MEMALLOC)
++                      alloc_flags |= ALLOC_NO_WATERMARKS;
++              else if (!in_irq() && (p->flags & PF_MEMALLOC))
+                       alloc_flags |= ALLOC_NO_WATERMARKS;
+               else if (!in_interrupt() &&
+                               unlikely(test_thread_flag(TIF_MEMDIE)))