diff options
author | Hugh Dickins <hughd@google.com> | 2015-09-08 18:03:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-08 18:35:28 -0400 |
commit | 7fadc820222497eac234d1d51a66517c00a6ca4c (patch) | |
tree | a4e8a91b85b33fc9532c808dee54dda46f5f380c /mm | |
parent | 26f5d7609f03ad8d6dc552458e4e371a62416b37 (diff) |
mm, vmscan: unlock page while waiting on writeback
This is merely a politeness: I've not found that shrink_page_list()
leads to deadlock with the page it holds locked across
wait_on_page_writeback(); but nevertheless, why hold others off by
keeping the page locked there?
And while we're at it: remove the mistaken "not " from the commentary on
this Case 3 (and a distracting blank line from Case 2, if I may).
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/vmscan.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 8276a3a615ca..2d978b28a410 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -985,7 +985,7 @@ static unsigned long shrink_page_list(struct list_head *page_list, | |||
985 | * __GFP_IO|__GFP_FS for this reason); but more thought | 985 | * __GFP_IO|__GFP_FS for this reason); but more thought |
986 | * would probably show more reasons. | 986 | * would probably show more reasons. |
987 | * | 987 | * |
988 | * 3) Legacy memcg encounters a page that is not already marked | 988 | * 3) Legacy memcg encounters a page that is already marked |
989 | * PageReclaim. memcg does not have any dirty pages | 989 | * PageReclaim. memcg does not have any dirty pages |
990 | * throttling so we could easily OOM just because too many | 990 | * throttling so we could easily OOM just because too many |
991 | * pages are in writeback and there is nothing else to | 991 | * pages are in writeback and there is nothing else to |
@@ -1015,12 +1015,15 @@ static unsigned long shrink_page_list(struct list_head *page_list, | |||
1015 | */ | 1015 | */ |
1016 | SetPageReclaim(page); | 1016 | SetPageReclaim(page); |
1017 | nr_writeback++; | 1017 | nr_writeback++; |
1018 | |||
1019 | goto keep_locked; | 1018 | goto keep_locked; |
1020 | 1019 | ||
1021 | /* Case 3 above */ | 1020 | /* Case 3 above */ |
1022 | } else { | 1021 | } else { |
1022 | unlock_page(page); | ||
1023 | wait_on_page_writeback(page); | 1023 | wait_on_page_writeback(page); |
1024 | /* then go back and try same page again */ | ||
1025 | list_add_tail(&page->lru, page_list); | ||
1026 | continue; | ||
1024 | } | 1027 | } |
1025 | } | 1028 | } |
1026 | 1029 | ||