summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/systemtap/systemtap/0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/systemtap/systemtap/0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch')
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch b/meta/recipes-kernel/systemtap/systemtap/0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch
new file mode 100644
index 0000000000..4c34d7762b
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/0001-Fix-BZ1285348-by-updating-systemtap-s-memory-flag-us.patch
@@ -0,0 +1,73 @@
1From 3d010295efd215cf83a7d07eecf89137973c154a Mon Sep 17 00:00:00 2001
2Message-Id: <3d010295efd215cf83a7d07eecf89137973c154a.1467836241.git.tom.zanussi@linux.intel.com>
3From: Jesper Brouer <jbrouer@redhat.com>
4Date: Mon, 30 Nov 2015 11:24:29 -0600
5Subject: [PATCH] Fix BZ1285348 by updating systemtap's memory flag usage.
6
7* runtime/linux/runtime_defines.h: Make sure __GFP_WAIT is defined.
8* runtime/stp_utrace.c (utrace_task_alloc): Change GFP_IOFS to
9 STP_ALLOC_FLAGS.
10 (utrace_attach_task): Ditto.
11
12Upstream-Status: Backport
13
14Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
15---
16 runtime/linux/runtime_defines.h | 23 +++++++++++++++++++++++
17 runtime/stp_utrace.c | 5 +++--
18 2 files changed, 26 insertions(+), 2 deletions(-)
19
20diff --git a/runtime/linux/runtime_defines.h b/runtime/linux/runtime_defines.h
21index e69de29..6b44e0d 100644
22--- a/runtime/linux/runtime_defines.h
23+++ b/runtime/linux/runtime_defines.h
24@@ -0,0 +1,23 @@
25+// The following kernel commit renamed __GFP_WAIT to __GRP_RECLAIM:
26+//
27+// commit 71baba4b92dc1fa1bc461742c6ab1942ec6034e9
28+// Author: Mel Gorman <mgorman@techsingularity.net>
29+// Date: Fri Nov 6 16:28:28 2015 -0800
30+//
31+// mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM
32+//
33+// __GFP_WAIT was used to signal that the caller was in atomic
34+// context and could not sleep. Now it is possible to
35+// distinguish between true atomic context and callers that are
36+// not willing to sleep. The latter should clear
37+// __GFP_DIRECT_RECLAIM so kswapd will still wake. As clearing
38+// __GFP_WAIT behaves differently, there is a risk that people
39+// will clear the wrong flags. This patch renames __GFP_WAIT to
40+// __GFP_RECLAIM to clearly indicate what it does -- setting it
41+// allows all reclaim activity, clearing them prevents it.
42+//
43+// Handle the rename by defining __GFP_WAIT as __GFP_RECLAIM.
44+#include <linux/gfp.h>
45+#ifndef __GFP_WAIT
46+#define __GFP_WAIT __GFP_RECLAIM
47+#endif
48diff --git a/runtime/stp_utrace.c b/runtime/stp_utrace.c
49index c69dec1..a8afc0d 100644
50--- a/runtime/stp_utrace.c
51+++ b/runtime/stp_utrace.c
52@@ -511,7 +511,8 @@ static struct utrace *__task_utrace_struct(struct task_struct *task)
53 */
54 static bool utrace_task_alloc(struct task_struct *task)
55 {
56- struct utrace *utrace = kmem_cache_zalloc(utrace_cachep, GFP_IOFS);
57+ struct utrace *utrace = kmem_cache_zalloc(utrace_cachep,
58+ STP_ALLOC_FLAGS);
59 struct utrace *u;
60
61 if (unlikely(!utrace))
62@@ -782,7 +783,7 @@ static struct utrace_engine *utrace_attach_task(
63 utrace = task_utrace_struct(target);
64 }
65
66- engine = kmem_cache_alloc(utrace_engine_cachep, GFP_IOFS);
67+ engine = kmem_cache_alloc(utrace_engine_cachep, STP_ALLOC_FLAGS);
68 if (unlikely(!engine))
69 return ERR_PTR(-ENOMEM);
70
71--
722.5.0
73