Merge tag 'v3.10.105' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / mm / ksm.c
index 7bf748f30aab4f05c9828b6a98ee3400b96515e0..84b54b55e13ff9446cde51fb755e3e57ffd7fa12 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;
@@ -1714,7 +1715,9 @@ static int ksmd_should_run(void)
 static int ksm_scan_thread(void *nothing)
 {
        set_freezable();
-       set_user_nice(current, 5);
+       // M: set KSMD's priority to the lowest value
+       set_user_nice(current, 19);
+       //set_user_nice(current, 5);
 
        while (!kthread_should_stop()) {
                mutex_lock(&ksm_thread_mutex);