]> sourceware.org Git - systemtap.git/commitdiff
Fix BZ1285348 by updating systemtap's memory flag usage.
authorJesper Brouer <jbrouer@redhat.com>
Mon, 30 Nov 2015 17:24:29 +0000 (11:24 -0600)
committerDavid Smith <dsmith@redhat.com>
Mon, 30 Nov 2015 17:24:29 +0000 (11:24 -0600)
* runtime/linux/runtime_defines.h: Make sure __GFP_WAIT is defined.
* runtime/stp_utrace.c (utrace_task_alloc): Change GFP_IOFS to
  STP_ALLOC_FLAGS.
  (utrace_attach_task): Ditto.

runtime/linux/runtime_defines.h
runtime/stp_utrace.c

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6b44e0dea2a4b10a8b3ae6f0c0da84faf78ed4e9 100644 (file)
@@ -0,0 +1,23 @@
+// The following kernel commit renamed __GFP_WAIT to __GRP_RECLAIM:
+//
+//   commit 71baba4b92dc1fa1bc461742c6ab1942ec6034e9
+//   Author: Mel Gorman <mgorman@techsingularity.net>
+//   Date:   Fri Nov 6 16:28:28 2015 -0800
+// 
+//       mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM
+//     
+//       __GFP_WAIT was used to signal that the caller was in atomic
+//       context and could not sleep.  Now it is possible to
+//       distinguish between true atomic context and callers that are
+//       not willing to sleep.  The latter should clear
+//       __GFP_DIRECT_RECLAIM so kswapd will still wake.  As clearing
+//       __GFP_WAIT behaves differently, there is a risk that people
+//       will clear the wrong flags.  This patch renames __GFP_WAIT to
+//       __GFP_RECLAIM to clearly indicate what it does -- setting it
+//       allows all reclaim activity, clearing them prevents it.
+//
+// Handle the rename by defining __GFP_WAIT as __GFP_RECLAIM.
+#include <linux/gfp.h>
+#ifndef __GFP_WAIT
+#define __GFP_WAIT __GFP_RECLAIM
+#endif
index c69dec1e7c1c884a878fede7c29220d97e029364..a8afc0df1567551204dc8a0c019f37bfec1f8b81 100644 (file)
@@ -511,7 +511,8 @@ static struct utrace *__task_utrace_struct(struct task_struct *task)
  */
 static bool utrace_task_alloc(struct task_struct *task)
 {
-       struct utrace *utrace = kmem_cache_zalloc(utrace_cachep, GFP_IOFS);
+       struct utrace *utrace = kmem_cache_zalloc(utrace_cachep,
+                                                 STP_ALLOC_FLAGS);
        struct utrace *u;
 
        if (unlikely(!utrace))
@@ -782,7 +783,7 @@ static struct utrace_engine *utrace_attach_task(
                utrace = task_utrace_struct(target);
        }
 
-       engine = kmem_cache_alloc(utrace_engine_cachep, GFP_IOFS);
+       engine = kmem_cache_alloc(utrace_engine_cachep, STP_ALLOC_FLAGS);
        if (unlikely(!engine))
                return ERR_PTR(-ENOMEM);
 
This page took 0.035149 seconds and 5 git commands to generate.