Commit 6935faf1 authored by ZhangPeng's avatar ZhangPeng Committed by Peng Zhang
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>
parent 9f98927f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment