]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Revert "Return -1 from arc_shrinker_func()"
authorPrakash Surya <surya1@llnl.gov>
Mon, 23 Dec 2013 19:34:20 +0000 (11:34 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 22 Feb 2014 00:10:49 +0000 (16:10 -0800)
This reverts commit c11a12bc3b2e5ee9a6bd74e26f1a396b6025fbd4.

Out of memory events were fixed by reverting this patch.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #2110

module/zfs/arc.c

index 68496783d65bc16198fb451bb796da5b38b67688..ad2e8a92d42edc1ac028e4e446421e9627a0fa35 100644 (file)
@@ -2583,8 +2583,10 @@ __arc_shrinker_func(struct shrinker *shrink, struct shrink_control *sc)
         */
        if (pages > 0) {
                arc_kmem_reap_now(ARC_RECLAIM_AGGR, ptob(sc->nr_to_scan));
+               pages = btop(arc_evictable_memory());
        } else {
                arc_kmem_reap_now(ARC_RECLAIM_CONS, ptob(sc->nr_to_scan));
+               pages = -1;
        }
 
        /*
@@ -2604,7 +2606,7 @@ __arc_shrinker_func(struct shrinker *shrink, struct shrink_control *sc)
 
        mutex_exit(&arc_reclaim_thr_lock);
 
-       return (-1);
+       return (pages);
 }
 SPL_SHRINKER_CALLBACK_WRAPPER(arc_shrinker_func);