Commit 7925322e authored by Andrea Righi's avatar Andrea Righi Committed by Zheng Zengkai
Browse files

module/decompress: use kvmalloc() consistently

stable inclusion
from stable-v6.6.2
commit ada57fd312cbbb4a387f6627c91260160bea7f7b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8IW7G

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ada57fd312cbbb4a387f6627c91260160bea7f7b



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

[ Upstream commit 17fc8084aa8f9d5235f252fc3978db657dd77e92 ]

We consistently switched from kmalloc() to vmalloc() in module
decompression to prevent potential memory allocation failures with large
modules, however vmalloc() is not as memory-efficient and fast as
kmalloc().

Since we don't know in general the size of the workspace required by the
decompression algorithm, it is more reasonable to use kvmalloc()
consistently, also considering that we don't have special memory
requirements here.

Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Tested-by: default avatarAndrea Righi <andrea.righi@canonical.com>
Signed-off-by: default avatarAndrea Righi <andrea.righi@canonical.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent cdaccd5d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment