diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2018-04-11 02:31:52 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-11 20:28:34 +0300 |
commit | b4884f23331ae31e9ecb617956986c3b76ab9a91 (patch) | |
tree | 2f25f7337f1aedbfed4fa18b1b26ffa208136544 /tools/testing/selftests/proc/proc-self-map-files-002.c | |
parent | c4219edf1de2af44fd98903f72f6e1ceb7f3c701 (diff) | |
download | linux-b4884f23331ae31e9ecb617956986c3b76ab9a91.tar.xz |
proc: move "struct proc_dir_entry" into kmem cache
"struct proc_dir_entry" is variable sized because of 0-length trailing
array for name, however, because of SLAB padding allocations it is
possible to make "struct proc_dir_entry" fixed sized and allocate same
amount of memory.
It buys fine-grained debugging with poisoning and usercopy protection
which is not possible with kmalloc-* caches.
Currently, on 32-bit 91+ byte allocations go into kmalloc-128 and on
64-bit 147+ byte allocations go to kmalloc-192 anyway.
Additional memory is allocated only for 38/46+ byte long names which are
rare or may not even exist in the wild.
Link: http://lkml.kernel.org/r/20180223205504.GA17139@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/proc/proc-self-map-files-002.c')
0 files changed, 0 insertions, 0 deletions