diff options
author | Nick Piggin <npiggin@suse.de> | 2008-10-18 23:26:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 11:52:32 -0400 |
commit | a978d6f521063514812a7094dbe5036e056e4de3 (patch) | |
tree | aaaed7caff558d8f9676f8cfd16b50ae6ca99573 /mm | |
parent | f45840b5c128445da70e7ec33adc47b4a12bdaf4 (diff) |
mm: unlockless reclaim
unlock_page is fairly expensive. It can be avoided in page reclaim
success path. By definition if we have any other references to the page
it would be a bug anyway.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
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 | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 412d7872fc75..3b5860294bb6 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -732,7 +732,14 @@ static unsigned long shrink_page_list(struct list_head *page_list, | |||
732 | if (!mapping || !__remove_mapping(mapping, page)) | 732 | if (!mapping || !__remove_mapping(mapping, page)) |
733 | goto keep_locked; | 733 | goto keep_locked; |
734 | 734 | ||
735 | unlock_page(page); | 735 | /* |
736 | * At this point, we have no other references and there is | ||
737 | * no way to pick any more up (removed from LRU, removed | ||
738 | * from pagecache). Can use non-atomic bitops now (and | ||
739 | * we obviously don't have to worry about waking up a process | ||
740 | * waiting on the page lock, because there are no references. | ||
741 | */ | ||
742 | __clear_page_locked(page); | ||
736 | free_it: | 743 | free_it: |
737 | nr_reclaimed++; | 744 | nr_reclaimed++; |
738 | if (!pagevec_add(&freed_pvec, page)) { | 745 | if (!pagevec_add(&freed_pvec, page)) { |