[RAMEN9610-11162] mm: get rid of vmacache_flush_all() entirely
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Sep 2018 09:57:48 +0000 (23:57 -1000)
committerhskang <hs1218.kang@samsung.com>
Mon, 21 Jan 2019 16:43:27 +0000 (01:43 +0900)
commitb5ca6007660e0faf3eab7eeec172177bb9012b08
treeafa4e7b8586d0185de60ac81947794ea62a652fe
parent977dc3ec67356a37d96dcf845a26a929c8f1f5bc
[RAMEN9610-11162] mm: get rid of vmacache_flush_all() entirely

Jann Horn points out that the vmacache_flush_all() function is not only
potentially expensive, it's buggy too.  It also happens to be entirely
unnecessary, because the sequence number overflow case can be avoided by
simply making the sequence number be 64-bit.  That doesn't even grow the
data structures in question, because the other adjacent fields are
already 64-bit.

So simplify the whole thing by just making the sequence number overflow
case go away entirely, which gets rid of all the complications and makes
the code faster too.  Win-win.

[ Oleg Nesterov points out that the VMACACHE_FULL_FLUSHES statistics
  also just goes away entirely with this ]

Change-Id: Iac9601279d5da67ae906712693c4e48e76e62a3c
Reported-by: Jann Horn <jannh@google.com>
Suggested-by: Will Deacon <will.deacon@arm.com>
Acked-by: Davidlohr Bueso <dave@stgolabs.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/mm_types.h
include/linux/mm_types_task.h
include/linux/vm_event_item.h
include/linux/vmacache.h
mm/debug.c
mm/vmacache.c