]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/xfs/kmem.h
Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszer...
[mirror_ubuntu-bionic-kernel.git] / fs / xfs / kmem.h
index d6ea520162b26530bbb560b667d925b6c6690b63..4d85992d75b225968d0055aec9d48888dfdd2dd8 100644 (file)
@@ -54,6 +54,16 @@ kmem_flags_convert(xfs_km_flags_t flags)
                        lflags &= ~__GFP_FS;
        }
 
+       /*
+        * Default page/slab allocator behavior is to retry for ever
+        * for small allocations. We can override this behavior by using
+        * __GFP_RETRY_MAYFAIL which will tell the allocator to retry as long
+        * as it is feasible but rather fail than retry forever for all
+        * request sizes.
+        */
+       if (flags & KM_MAYFAIL)
+               lflags |= __GFP_RETRY_MAYFAIL;
+
        if (flags & KM_ZERO)
                lflags |= __GFP_ZERO;