OSDN Git Service

kernfs: Avoid dynamic memory allocation for small write buffers
authorSultan Alsawaf <sultan@kerneltoast.com>
Tue, 30 Jul 2019 21:21:10 +0000 (14:21 -0700)
committer0ranko0P <ranko0p@outlook.com>
Sat, 7 Dec 2019 10:22:17 +0000 (18:22 +0800)
commita8641f089621749394a74f34f372589733a47ce8
treeb093cf43c3d7459982ff8579d1e5adc578631033
parent7c30c640ea889303077ce45aab48a5dac5db2cd8
kernfs: Avoid dynamic memory allocation for small write buffers

Most write buffers are rather small and can fit on the stack,
eliminating the need to allocate them dynamically. Reserve a 4 KiB
stack buffer for this purpose to avoid the overhead of dynamic
memory allocation.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
fs/kernfs/file.c