diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-03-09 16:17:28 -0800 |
|---|---|---|
| committer | Paul Lawrence <paullawrence@google.com> | 2017-12-14 08:25:05 -0800 |
| commit | 97bf1066e3a5095ded03a0329e2dfce9282daa5e (patch) | |
| tree | a438cf854726e7e9e102c8dd618dcf0386af22b2 /lib/test_kasan.c | |
| parent | 16a34d5679f2a77800af894a3ac2e654bce788ab (diff) | |
UPSTREAM: kasan: resched in quarantine_remove_cache()
We see reported stalls/lockups in quarantine_remove_cache() on machines
with large amounts of RAM. quarantine_remove_cache() needs to scan
whole quarantine in order to take out all objects belonging to the
cache. Quarantine is currently 1/32-th of RAM, e.g. on a machine with
256GB of memory that will be 8GB. Moreover quarantine scanning is a
walk over uncached linked list, which is slow.
Add cond_resched() after scanning of each non-empty batch of objects.
Batches are specifically kept of reasonable size for quarantine_put().
On a machine with 256GB of RAM we should have ~512 non-empty batches,
each with 16MB of objects.
Link: http://lkml.kernel.org/r/20170308154239.25440-1-dvyukov@google.com
Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Bug: 64145065
(cherry-picked from 68fd814a3391c7e017ae6ace8855788748edd981)
Change-Id: I8a38466a9b9544bb303202c94bfba6201251e3f3
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Diffstat (limited to 'lib/test_kasan.c')
0 files changed, 0 insertions, 0 deletions
