Created attachment 498 [details] kernel crash stack info I make 1 kpatch at drop_caches_sysctl_handler() that changes drop_caches string to DROP_CACHES. Loaded successfully,but kernel crash when I do 'echo 3 > >/proc/sys/vm/drop_caches ' and the stack just like below: why?
echo 3 > /proc/sys/vm/drop_caches and the patch diff: From 39f418471abaa0d70375581ef8f5acf8a588f185 Mon Sep 17 00:00:00 2001 From: root <root@localhost.localdomain> Date: Tue, 29 Nov 2022 21:31:04 -0500 Subject: [PATCH] drop_caches: Change lowercase to uppercase Signed-off-by: root <root@localhost.localdomain> --- fs/drop_caches.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/drop_caches.c b/fs/drop_caches.c index dc1a1d5d8..4a2025a99 100644 --- a/fs/drop_caches.c +++ b/fs/drop_caches.c @@ -46,7 +46,7 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused) iput(toput_inode); } -int drop_caches_sysctl_handler(struct ctl_table *table, int write, +__always_inline int drop_caches_sysctl_handler(struct ctl_table *table, int write, void __user *buffer, size_t *length, loff_t *ppos) { int ret; @@ -66,7 +66,7 @@ int drop_caches_sysctl_handler(struct ctl_table *table, int write, count_vm_event(DROP_SLAB); } if (!stfu) { - pr_info("%s (%d): drop_caches: %d\n", + pr_info("%s (%d): DROP_CACHES: %d\n", current->comm, task_pid_nr(current), sysctl_drop_caches); } -- 2.31.1
hi wangchuanguo 帮忙上传更vmcore-dmesg文件
Created attachment 503 [details] vmcore-dmesg
My kernel crash problem was circumvent by removing the __always_inline flag. Please check why adding the __always_inline flag causes the kernel to crash. Thanks!