diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index ee2925998e2e..cfddcd2075b9 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1055,6 +1055,14 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
1055 | do { | 1055 | do { |
1056 | struct page *page; | 1056 | struct page *page; |
1057 | 1057 | ||
1058 | /* | ||
1059 | * If tsk is ooming, cut off its access to large memory | ||
1060 | * allocations. It has a pending SIGKILL, but it can't | ||
1061 | * be processed until returning to user space. | ||
1062 | */ | ||
1063 | if (unlikely(test_tsk_thread_flag(tsk, TIF_MEMDIE))) | ||
1064 | return -ENOMEM; | ||
1065 | |||
1058 | if (write) | 1066 | if (write) |
1059 | foll_flags |= FOLL_WRITE; | 1067 | foll_flags |= FOLL_WRITE; |
1060 | 1068 | ||