summaryrefslogtreecommitdiff
path: root/linux/shrinker.c
diff options
context:
space:
mode:
authorChris Webb <chris@arachsys.com>2023-12-10 07:28:31 +0000
committerKent Overstreet <kent.overstreet@linux.dev>2023-12-10 12:14:23 -0500
commitb44629a3dbe35f9ef84d3fa61b9d9f1a08b47075 (patch)
tree616a18958e970cbb2385748eb2c2c755f053c7e5 /linux/shrinker.c
parentcc98a16776669fee837daa37e127848915386058 (diff)
bcachefs-tools: Fix typo in 872cd43
6% of physical RAM is info.totalram >> 4 not info.totalram << 4. Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'linux/shrinker.c')
-rw-r--r--linux/shrinker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux/shrinker.c b/linux/shrinker.c
index 8a24565f..88069769 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;