diff options
author | Nick Piggin <nickpiggin@yahoo.com.au> | 2006-01-06 03:11:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:29 -0500 |
commit | a74609fafa2e5cc31d558012abaaa55ec9ad9da4 (patch) | |
tree | 0be653692864d99da345b575dfe2083994ee1d21 /mm/rmap.c | |
parent | d3cb487149bd706aa6aeb02042332a450978dc1c (diff) |
[PATCH] mm: page_state opt
Optimise page_state manipulations by introducing interrupt unsafe accessors
to page_state fields. Callers must provide their own locking (either
disable interrupts or not update from interrupt context).
Switch over the hot callsites that can easily be moved under interrupts off
sections.
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/rmap.c')
-rw-r--r-- | mm/rmap.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -451,7 +451,11 @@ static void __page_set_anon_rmap(struct page *page, | |||
451 | 451 | ||
452 | page->index = linear_page_index(vma, address); | 452 | page->index = linear_page_index(vma, address); |
453 | 453 | ||
454 | inc_page_state(nr_mapped); | 454 | /* |
455 | * nr_mapped state can be updated without turning off | ||
456 | * interrupts because it is not modified via interrupt. | ||
457 | */ | ||
458 | __inc_page_state(nr_mapped); | ||
455 | } | 459 | } |
456 | 460 | ||
457 | /** | 461 | /** |
@@ -498,7 +502,7 @@ void page_add_file_rmap(struct page *page) | |||
498 | BUG_ON(!pfn_valid(page_to_pfn(page))); | 502 | BUG_ON(!pfn_valid(page_to_pfn(page))); |
499 | 503 | ||
500 | if (atomic_inc_and_test(&page->_mapcount)) | 504 | if (atomic_inc_and_test(&page->_mapcount)) |
501 | inc_page_state(nr_mapped); | 505 | __inc_page_state(nr_mapped); |
502 | } | 506 | } |
503 | 507 | ||
504 | /** | 508 | /** |
@@ -522,7 +526,7 @@ void page_remove_rmap(struct page *page) | |||
522 | */ | 526 | */ |
523 | if (page_test_and_clear_dirty(page)) | 527 | if (page_test_and_clear_dirty(page)) |
524 | set_page_dirty(page); | 528 | set_page_dirty(page); |
525 | dec_page_state(nr_mapped); | 529 | __dec_page_state(nr_mapped); |
526 | } | 530 | } |
527 | } | 531 | } |
528 | 532 | ||