6% of physical RAM is info.totalram >> 4 not info.totalram << 4.

Signed-off-by: Chris Webb <[email protected]>
---

Sorry Kent, I'm afraid I didn't spot this embarrassing typo until
after I'd sent the original patch to the list!

 linux/shrinker.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux/shrinker.c b/linux/shrinker.c
index 8a24565..8806976 100644
--- a/linux/shrinker.c
+++ b/linux/shrinker.c
@@ -71,7 +71,7 @@ void run_shrinkers(gfp_t gfp_mask, bool allocation_failed)
        si_meminfo(&info);
 
        /* Aim for 6% of physical RAM free without anything in swap */
-       want_shrink = (info.totalram << 4) - info.freeram
+       want_shrink = (info.totalram >> 4) - info.freeram
                        + info.totalswap - info.freeswap;
        if (want_shrink <= 0)
                return;

Reply via email to