diff options
author | Nick Piggin <nickpiggin@yahoo.com.au> | 2006-01-06 03:11:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:27 -0500 |
commit | 9617d95e6e9ffd883cf90a89724fe60d7ab22f9a (patch) | |
tree | 67d555d34d931bd253fbc4959ffdb1e5b904f2b0 /mm/memory.c | |
parent | 224abf92b2f439a9030f21d2926ec8047d1ffcdb (diff) |
[PATCH] mm: rmap optimisation
Optimise rmap functions by minimising atomic operations when we know there
will be no concurrent modifications.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c index e249088908c4..d7ca7de10f4d 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1498,7 +1498,7 @@ gotten: | |||
1498 | update_mmu_cache(vma, address, entry); | 1498 | update_mmu_cache(vma, address, entry); |
1499 | lazy_mmu_prot_update(entry); | 1499 | lazy_mmu_prot_update(entry); |
1500 | lru_cache_add_active(new_page); | 1500 | lru_cache_add_active(new_page); |
1501 | page_add_anon_rmap(new_page, vma, address); | 1501 | page_add_new_anon_rmap(new_page, vma, address); |
1502 | 1502 | ||
1503 | /* Free the old page.. */ | 1503 | /* Free the old page.. */ |
1504 | new_page = old_page; | 1504 | new_page = old_page; |
@@ -1978,7 +1978,7 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
1978 | inc_mm_counter(mm, anon_rss); | 1978 | inc_mm_counter(mm, anon_rss); |
1979 | lru_cache_add_active(page); | 1979 | lru_cache_add_active(page); |
1980 | SetPageReferenced(page); | 1980 | SetPageReferenced(page); |
1981 | page_add_anon_rmap(page, vma, address); | 1981 | page_add_new_anon_rmap(page, vma, address); |
1982 | } else { | 1982 | } else { |
1983 | /* Map the ZERO_PAGE - vm_page_prot is readonly */ | 1983 | /* Map the ZERO_PAGE - vm_page_prot is readonly */ |
1984 | page = ZERO_PAGE(address); | 1984 | page = ZERO_PAGE(address); |
@@ -2109,7 +2109,7 @@ retry: | |||
2109 | if (anon) { | 2109 | if (anon) { |
2110 | inc_mm_counter(mm, anon_rss); | 2110 | inc_mm_counter(mm, anon_rss); |
2111 | lru_cache_add_active(new_page); | 2111 | lru_cache_add_active(new_page); |
2112 | page_add_anon_rmap(new_page, vma, address); | 2112 | page_add_new_anon_rmap(new_page, vma, address); |
2113 | } else { | 2113 | } else { |
2114 | inc_mm_counter(mm, file_rss); | 2114 | inc_mm_counter(mm, file_rss); |
2115 | page_add_file_rmap(new_page); | 2115 | page_add_file_rmap(new_page); |