]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - mm/util.c
Merge tag 'pm-fixes-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[karo-tx-linux.git] / mm / util.c
index 26be6407abd7efe452a585d341a8d7e5b53d2b32..ee250e2cde344ef586a65661f8c51271cfe6e648 100644 (file)
--- a/mm/util.c
+++ b/mm/util.c
@@ -339,9 +339,9 @@ EXPORT_SYMBOL(vm_mmap);
  * Uses kmalloc to get the memory but if the allocation fails then falls back
  * to the vmalloc allocator. Use kvfree for freeing the memory.
  *
- * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL are not supported. __GFP_REPEAT
- * is supported only for large (>32kB) allocations, and it should be used only if
- * kmalloc is preferable to the vmalloc fallback, due to visible performance drawbacks.
+ * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL are not supported.
+ * __GFP_RETRY_MAYFAIL is supported, and it should be used only if kmalloc is
+ * preferable to the vmalloc fallback, due to visible performance drawbacks.
  *
  * Any use of gfp flags outside of GFP_KERNEL should be consulted with mm people.
  */
@@ -366,13 +366,7 @@ void *kvmalloc_node(size_t size, gfp_t flags, int node)
        if (size > PAGE_SIZE) {
                kmalloc_flags |= __GFP_NOWARN;
 
-               /*
-                * We have to override __GFP_REPEAT by __GFP_NORETRY for !costly
-                * requests because there is no other way to tell the allocator
-                * that we want to fail rather than retry endlessly.
-                */
-               if (!(kmalloc_flags & __GFP_REPEAT) ||
-                               (size <= PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER))
+               if (!(kmalloc_flags & __GFP_RETRY_MAYFAIL))
                        kmalloc_flags |= __GFP_NORETRY;
        }