summaryrefslogtreecommitdiff
path: root/linux/shrinker.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-08-17 20:22:13 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-08-18 00:17:11 -0400
commit905297ad0fab4b2a2b48acfde9392f1abf4ce8fa (patch)
tree3432f3b961b4947ea6b571fda650c33573f6b8f8 /linux/shrinker.c
parentc1c4d03aa6923dadc7cc31fcff37a6243b51d0b4 (diff)
Update bcachefs sources to d863521e4078 bcachefs: BCH_IOCTL_DISK_SET_STATE_v2
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'linux/shrinker.c')
-rw-r--r--linux/shrinker.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux/shrinker.c b/linux/shrinker.c
index ca34ebc7..c0098cad 100644
--- a/linux/shrinker.c
+++ b/linux/shrinker.c
@@ -116,10 +116,15 @@ static int shrinker_thread(void *arg)
}
struct task_struct *shrinker_task;
+unsigned long _totalram_pages;
__attribute__((constructor(103)))
static void shrinker_thread_init(void)
{
+ struct sysinfo info;
+ si_meminfo(&info);
+ _totalram_pages = info.totalram >> PAGE_SHIFT;
+
shrinker_task = kthread_run(shrinker_thread, NULL, "shrinkers");
BUG_ON(IS_ERR(shrinker_task));
}