Commit 1f2b780e authored by ZhangPeng's avatar ZhangPeng Committed by openeuler-sync-bot
Browse files

userswap: fix kmalloc ENOMEM failed for a large memory

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6CAIM



--------------------------------

If the swapped-out memory is large, such as tens of gigabytes, we will
allocate a large management structure, which may be tens of megabytes or
hundreds of megabytes. So if we use kmalloc to allocate management
structures it may fail.
Fix this by changing kmalloc to kvzalloc and kfree to kvfree.

Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
(cherry picked from commit 6935faf1)
parent e270a13c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment