mm,ksm: fix endless looping in allocating memory when ksm enable
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / mm / ksm.c
index 7bf748f30aab4f05c9828b6a98ee3400b96515e0..d1b19b9e888e1b83b8319d76a43348cfec02da29 100644 (file)
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -283,7 +283,8 @@ static inline struct rmap_item *alloc_rmap_item(void)
 {
        struct rmap_item *rmap_item;
 
-       rmap_item = kmem_cache_zalloc(rmap_item_cache, GFP_KERNEL);
+       rmap_item = kmem_cache_zalloc(rmap_item_cache, GFP_KERNEL |
+                                               __GFP_NORETRY | __GFP_NOWARN);
        if (rmap_item)
                ksm_rmap_items++;
        return rmap_item;