mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-08 18:57:22 +00:00
media: amphion: Use kmalloc instead of vmalloc
Replace vmalloc/vfree with kmalloc/kfree for allocating small driver structures (vpu_inst, vdec_t, venc_t, vpu_cmd_t, and frame objects). vmalloc() is designed for large memory allocations and incurs unnecessary overhead for small objects due to virtual memory mapping. kmalloc() is more appropriate as it allocates physically contiguous memory with lower overhead. ftrace measurements of vpu_alloc_cmd() show significant improvement: Before (vmalloc): 35-72 us (avg ~45.7 us) After (kmalloc): 11-26 us (avg ~16.8 us) This reduces allocation time by approximately 63%. No functional changes are intended. Signed-off-by: Ming Qian <ming.qian@oss.nxp.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
bb22847d11
commit
d79c2165a4
4 changed files with 27 additions and 35 deletions
Loading…
Add table
Add a link
Reference in a new issue