lkml.org 
[lkml]   [2017]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 10/18] vchecker: Use __GFP_ATOMIC to save stacktrace
Date
From: Namhyung Kim <namhyung@kernel.org>

Since we're finding a cause of broken data, it'd be desired not to miss
any suspects. It doesn't use GFP_ATOMIC since it includes __GFP_HIGH
which is for system making forward progress.

It also adds a WARN_ON whenever it fails to allocate pages even with
__GFP_ATOMIC.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
---
mm/kasan/vchecker.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/mm/kasan/vchecker.c b/mm/kasan/vchecker.c
index 6b3824f..df480d5 100644
--- a/mm/kasan/vchecker.c
+++ b/mm/kasan/vchecker.c
@@ -301,13 +301,20 @@ static noinline depot_stack_handle_t save_stack(int skip, bool *is_new)
.max_entries = VCHECKER_STACK_DEPTH,
.skip = skip,
};
+ depot_stack_handle_t handle;

save_stack_trace(&trace);
if (trace.nr_entries != 0 &&
trace.entries[trace.nr_entries-1] == ULONG_MAX)
trace.nr_entries--;

- return depot_save_stack(NULL, &trace, GFP_NOWAIT, is_new);
+ if (trace.nr_entries == 0)
+ return 0;
+
+ handle = depot_save_stack(NULL, &trace, __GFP_ATOMIC, is_new);
+ WARN_ON(!handle);
+
+ return handle;
}

static ssize_t vchecker_type_write(struct file *filp, const char __user *ubuf,
--
2.7.4
\
 
 \ /
  Last update: 2017-11-28 08:50    [W:0.154 / U:2.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site