Xu Yu
f8f836100f
mm/huge_memory: do not overkill when splitting huge_zero_page
...
commit 478d134e9506c7e9bfe2830ed03dd85e97966313 upstream.
Kernel panic when injecting memory_failure for the global huge_zero_page,
when CONFIG_DEBUG_VM is enabled, as follows.
Injecting memory failure for pfn 0x109ff9 at process virtual address 0x20ff9000
page:00000000fb053fc3 refcount:2 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109e00
head:00000000fb053fc3 order:9 compound_mapcount:0 compound_pincount:0
flags: 0x17fffc000010001(locked|head|node=0|zone=2|lastcpupid=0x1ffff)
raw: 017fffc000010001 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000002ffffffff 0000000000000000
page dumped because: VM_BUG_ON_PAGE(is_huge_zero_page(head))
------------[ cut here ]------------
kernel BUG at mm/huge_memory.c:2499!
invalid opcode: 0000 [#1 ] PREEMPT SMP PTI
CPU: 6 PID: 553 Comm: split_bug Not tainted 5.18.0-rc1+ #11
Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 3288b3c 04/01/2014
RIP: 0010:split_huge_page_to_list+0x66a/0x880
Code: 84 9b fb ff ff 48 8b 7c 24 08 31 f6 e8 9f 5d 2a 00 b8 b8 02 00 00 e9 e8 fb ff ff 48 c7 c6 e8 47 3c 82 4c b
RSP: 0018:ffffc90000dcbdf8 EFLAGS: 00010246
RAX: 000000000000003c RBX: 0000000000000001 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff823e4c4f RDI: 00000000ffffffff
RBP: ffff88843fffdb40 R08: 0000000000000000 R09: 00000000fffeffff
R10: ffffc90000dcbc48 R11: ffffffff82d68448 R12: ffffea0004278000
R13: ffffffff823c6203 R14: 0000000000109ff9 R15: ffffea000427fe40
FS: 00007fc375a26740(0000) GS:ffff88842fd80000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc3757c9290 CR3: 0000000102174006 CR4: 00000000003706e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
try_to_split_thp_page+0x3a/0x130
memory_failure+0x128/0x800
madvise_inject_error.cold+0x8b/0xa1
__x64_sys_madvise+0x54/0x60
do_syscall_64+0x35/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fc3754f8bf9
Code: 01 00 48 81 c4 80 00 00 00 e9 f1 fe ff ff 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 8
RSP: 002b:00007ffeda93a1d8 EFLAGS: 00000217 ORIG_RAX: 000000000000001c
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fc3754f8bf9
RDX: 0000000000000064 RSI: 0000000000003000 RDI: 0000000020ff9000
RBP: 00007ffeda93a200 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000217 R12: 0000000000400490
R13: 00007ffeda93a2e0 R14: 0000000000000000 R15: 0000000000000000
We think that raising BUG is overkilling for splitting huge_zero_page, the
huge_zero_page can't be met from normal paths other than memory failure,
but memory failure is a valid caller. So we tend to replace the BUG to
WARN + returning -EBUSY, and thus the panic above won't happen again.
Link: https://lkml.kernel.org/r/f35f8b97377d5d3ede1bc5ac3114da888c57cbce.1651052574.git.xuyu@linux.alibaba.com
Fixes: d173d5417fb6 ("mm/memory-failure.c: skip huge_zero_page in memory_failure()")
Fixes: 6a46079cf57a ("HWPOISON: The high level memory error handler in the VM v7")
Signed-off-by: Xu Yu <xuyu@linux.alibaba.com>
Suggested-by: Yang Shi <shy828301@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Reviewed-by: Yang Shi <shy828301@gmail.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-18 10:26:55 +02:00
..
2022-01-05 12:42:39 +01:00
2022-05-09 09:14:41 +02:00
2022-05-01 17:22:28 +02:00
2021-12-14 10:57:11 +01:00
2021-05-07 00:26:35 -07:00
2021-09-03 09:58:14 -07:00
2021-05-05 11:27:21 -07:00
2021-05-05 11:27:24 -07:00
2021-05-05 11:27:24 -07:00
2021-05-05 11:27:24 -07:00
2021-09-08 12:55:35 -07:00
2022-02-08 18:34:05 +01:00
2021-09-24 16:13:35 -07:00
2021-06-29 10:53:52 -07:00
2021-09-08 11:50:24 -07:00
2022-05-01 17:22:28 +02:00
2021-05-05 11:27:27 -07:00
2021-05-05 11:27:26 -07:00
2021-05-05 11:27:26 -07:00
2022-05-15 20:18:53 +02:00
2022-04-13 20:59:21 +02:00
2022-01-27 11:05:43 +01:00
2022-05-18 10:26:55 +02:00
2021-05-05 11:27:22 -07:00
2021-06-30 20:47:26 -07:00
2021-06-30 20:47:25 -07:00
2021-11-25 09:49:07 +01:00
2021-09-03 09:58:15 -07:00
2021-07-08 11:48:21 -07:00
2021-09-03 09:58:16 -07:00
2021-04-30 11:20:38 -07:00
2021-04-30 11:20:39 -07:00
2021-09-08 11:50:24 -07:00
2021-11-25 09:48:43 +01:00
2020-12-15 12:13:46 -08:00
2021-10-28 17:18:55 -07:00
2022-04-20 09:34:18 +02:00
2021-09-13 10:18:28 -07:00
2021-05-05 11:27:23 -07:00
2021-08-20 11:39:25 +01:00
2022-04-08 14:22:56 +02:00
2021-09-08 11:50:24 -07:00
2021-07-01 11:06:02 -07:00
2022-03-02 11:48:10 +01:00
2022-04-27 14:38:57 +02:00
2022-03-08 19:12:48 +01:00
2021-09-08 12:55:35 -07:00
2022-05-18 10:26:55 +02:00
2022-05-15 20:18:52 +02:00
2022-04-13 20:59:22 +02:00
2021-06-04 19:32:21 +01:00
2021-09-08 11:50:23 -07:00
2022-05-15 20:18:52 +02:00
2021-01-24 14:27:16 +01:00
2022-05-15 20:18:53 +02:00
2021-04-30 11:20:42 -07:00
2021-07-23 17:43:28 -07:00
2022-04-27 14:38:57 +02:00
2021-04-16 16:10:36 -07:00
2022-04-27 14:38:58 +02:00
2020-12-15 14:48:04 -08:00
2022-02-23 12:03:03 +01:00
2022-04-13 20:59:22 +02:00
2021-04-30 11:20:37 -07:00
2021-09-04 11:35:47 -07:00
2022-04-27 14:38:58 +02:00
2022-04-27 14:38:50 +02:00
2021-04-30 11:20:38 -07:00
2021-10-18 20:22:02 -10:00
2021-09-08 11:50:24 -07:00
2022-04-20 09:34:18 +02:00
2021-09-08 12:55:35 -07:00
2021-09-08 11:50:22 -07:00
2021-04-30 11:20:36 -07:00
2021-06-29 10:53:47 -07:00
2021-06-29 10:53:47 -07:00
2021-07-01 11:06:03 -07:00
2021-09-03 10:08:28 -07:00
2021-06-29 10:53:49 -07:00
2021-07-01 17:17:24 -07:00
2021-07-04 18:30:17 +00:00
2021-06-05 20:43:15 +00:00
2021-07-04 18:30:17 +00:00
2021-09-08 12:55:35 -07:00
2021-05-07 00:26:35 -07:00
2021-06-16 09:24:42 -07:00
2021-05-05 11:27:27 -07:00
2021-04-16 16:10:37 -07:00
2021-07-13 13:14:27 +02:00
2022-04-13 20:59:14 +02:00
2022-04-20 09:34:18 +02:00
2022-05-15 20:18:53 +02:00
2021-04-16 16:10:36 -07:00
2021-05-22 15:09:07 -10:00
2022-04-27 14:38:51 +02:00
2022-04-27 14:38:51 +02:00
2022-04-27 14:38:51 +02:00
2022-04-27 14:38:51 +02:00
2022-04-27 14:38:51 +02:00
2021-06-30 20:47:26 -07:00
2021-09-03 09:58:15 -07:00
2021-08-28 01:46:17 +02:00
2022-03-23 09:16:41 +01:00
2021-09-24 16:13:35 -07:00
2021-09-03 09:58:12 -07:00
2021-09-03 10:08:28 -07:00
2022-04-08 14:24:14 +02:00
2022-05-15 20:18:53 +02:00
2022-03-08 19:12:44 +01:00
2022-03-08 19:12:38 +01:00
2021-09-03 09:58:17 -07:00
2021-09-08 18:45:53 -07:00
2021-09-08 15:32:34 -07:00
2022-04-27 14:38:57 +02:00
2021-07-01 11:06:03 -07:00
2021-07-01 11:06:03 -07:00
2021-05-07 00:26:35 -07:00
2021-11-18 19:17:10 +01:00
2021-06-30 20:47:31 -07:00