__list_lru_walk_one() acquires nlru spin lock (nlru->lock) for longer
duration if there are more number of items in the lru list. As per the
current code, it can hold the spin lock for upto maximum UINT_MAX entries
at a time. So if there are more number of items in the lru list, then
"BUG: spinlock lockup suspected" is observed in the below path -
Fix this lockup by reducing the number of entries to be shrinked from the
lru list to 1024 at once. Also, add cond_resched() before processing the
lru list again.
Change-Id: I6df8d74cbc4c5ceac294f2d0784702cf096e84be Link: http://marc.info/?t=149722864900001&r=1&w=2 Link: http://lkml.kernel.org/r/1498707575-2472-1-git-send-email-stummala@codeaurora.org Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> Suggested-by: Jan Kara <jack@suse.cz> Suggested-by: Vladimir Davydov <vdavydov.dev@gmail.com> Cc: Alexander Polakov <apolyakov@beget.ru> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: <stable@vger.kernel.org>
Patch-mainline: linux-mm @ 29/06/17, 09:09:35 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>