diff options
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ae052b5e3315..0f870ba43942 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -1917,6 +1917,15 @@ retry: | |||
1917 | current->flags & PF_EXITING)) | 1917 | current->flags & PF_EXITING)) |
1918 | goto force; | 1918 | goto force; |
1919 | 1919 | ||
1920 | /* | ||
1921 | * Prevent unbounded recursion when reclaim operations need to | ||
1922 | * allocate memory. This might exceed the limits temporarily, | ||
1923 | * but we prefer facilitating memory reclaim and getting back | ||
1924 | * under the limit over triggering OOM kills in these cases. | ||
1925 | */ | ||
1926 | if (unlikely(current->flags & PF_MEMALLOC)) | ||
1927 | goto force; | ||
1928 | |||
1920 | if (unlikely(task_in_memcg_oom(current))) | 1929 | if (unlikely(task_in_memcg_oom(current))) |
1921 | goto nomem; | 1930 | goto nomem; |
1922 | 1931 | ||