summaryrefslogtreecommitdiff
path: root/linux/shrinker.c
diff options
context:
space:
mode:
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));
}