mm: zero hash tables in allocator
authorPavel Tatashin <[email protected]>
Thu, 6 Jul 2017 22:39:08 +0000 (15:39 -0700)
committerLinus Torvalds <[email protected]>
Thu, 6 Jul 2017 23:24:33 +0000 (16:24 -0700)
commit3749a8f008eac3355a9e50b366ba08317a7e9cf8
tree448dc6eaf19a3838cdc2ab497c529729168def2b
parentf7fb506fef6e8701bdb0ea7bb4f01148efd7416c
mm: zero hash tables in allocator

Add a new flag HASH_ZERO which when provided grantees that the hash
table that is returned by alloc_large_system_hash() is zeroed.  In most
cases that is what is needed by the caller.  Use page level allocator's
__GFP_ZERO flags to zero the memory.  It is using memset() which is
efficient method to zero memory and is optimized for most platforms.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Pavel Tatashin <[email protected]>
Reviewed-by: Babu Moger <[email protected]>
Cc: David Miller <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/bootmem.h
mm/page_alloc.c