diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-08-28 02:18:01 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-11 00:56:30 +0200 |
commit | 5cedf721a7cdb54e9222133516c916210d836470 (patch) | |
tree | ad88b1e86956e75c173fe70206fa9c40d3d2a86f /net/packet | |
parent | list_lru: per-node list infrastructure (diff) | |
download | linux-5cedf721a7cdb54e9222133516c916210d836470.tar.xz linux-5cedf721a7cdb54e9222133516c916210d836470.zip |
list_lru: fix broken LRU_RETRY behaviour
The LRU_RETRY code assumes that the list traversal status after we have
dropped and regained the list lock. Unfortunately, this is not a valid
assumption, and that can lead to racing traversals isolating objects that
the other traversal expects to be the next item on the list.
This is causing problems with the inode cache shrinker isolation, with
races resulting in an inode on a dispose list being "isolated" because a
racing traversal still thinks it is on the LRU. The inode is then never
reclaimed and that causes hangs if a subsequent lookup on that inode
occurs.
Fix it by always restarting the list walk on a LRU_RETRY return from the
isolate callback. Avoid the possibility of livelocks the current code was
trying to avoid by always decrementing the nr_to_walk counter on retries
so that even if we keep hitting the same item on the list we'll eventually
stop trying to walk and exit out of the situation causing the problem.
Reported-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Cc: Glauber Costa <glommer@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/packet')
0 files changed, 0 insertions, 0 deletions