]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/util.c
Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / mm / util.c
index 21ddf90f883d9fe8cf4c3d6f993100a4ca1559fd..7b07ec852e01fa931b2b302e8df5cff9f17f62d6 100644 (file)
--- a/mm/util.c
+++ b/mm/util.c
@@ -363,9 +363,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.
  */
@@ -390,13 +390,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;
        }