diff options
author | Nick Piggin <npiggin@suse.de> | 2006-03-22 03:08:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:53:57 -0500 |
commit | 4c84cacfa424264f7ad5287298d3ea4a3e935278 (patch) | |
tree | 8cefe97dfd0cdfbdebe5636ccc68b14ab3ae1207 | |
parent | 8d438f96d2b8eade6cbcd8adfc22dae6f5cbd6c0 (diff) |
[PATCH] mm: PageActive no testset
PG_active is protected by zone->lru_lock, it does not need TestSet/TestClear
operations.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/page-flags.h | 2 | ||||
-rw-r--r-- | mm/swap.c | 4 | ||||
-rw-r--r-- | mm/vmscan.c | 5 |
3 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 58856c823f8b..5d1e7bd85107 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -246,8 +246,6 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
246 | #define PageActive(page) test_bit(PG_active, &(page)->flags) | 246 | #define PageActive(page) test_bit(PG_active, &(page)->flags) |
247 | #define SetPageActive(page) set_bit(PG_active, &(page)->flags) | 247 | #define SetPageActive(page) set_bit(PG_active, &(page)->flags) |
248 | #define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) | 248 | #define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) |
249 | #define TestClearPageActive(page) test_and_clear_bit(PG_active, &(page)->flags) | ||
250 | #define TestSetPageActive(page) test_and_set_bit(PG_active, &(page)->flags) | ||
251 | 249 | ||
252 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) | 250 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) |
253 | #define SetPageSlab(page) set_bit(PG_slab, &(page)->flags) | 251 | #define SetPageSlab(page) set_bit(PG_slab, &(page)->flags) |
@@ -374,8 +374,8 @@ void __pagevec_lru_add_active(struct pagevec *pvec) | |||
374 | } | 374 | } |
375 | BUG_ON(PageLRU(page)); | 375 | BUG_ON(PageLRU(page)); |
376 | SetPageLRU(page); | 376 | SetPageLRU(page); |
377 | if (TestSetPageActive(page)) | 377 | BUG_ON(PageActive(page)); |
378 | BUG(); | 378 | SetPageActive(page); |
379 | add_page_to_active_list(zone, page); | 379 | add_page_to_active_list(zone, page); |
380 | } | 380 | } |
381 | if (zone) | 381 | if (zone) |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 40fb37828e8c..8e477b1a4838 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1280,8 +1280,9 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc) | |||
1280 | prefetchw_prev_lru_page(page, &l_inactive, flags); | 1280 | prefetchw_prev_lru_page(page, &l_inactive, flags); |
1281 | BUG_ON(PageLRU(page)); | 1281 | BUG_ON(PageLRU(page)); |
1282 | SetPageLRU(page); | 1282 | SetPageLRU(page); |
1283 | if (!TestClearPageActive(page)) | 1283 | BUG_ON(!PageActive(page)); |
1284 | BUG(); | 1284 | ClearPageActive(page); |
1285 | |||
1285 | list_move(&page->lru, &zone->inactive_list); | 1286 | list_move(&page->lru, &zone->inactive_list); |
1286 | pgmoved++; | 1287 | pgmoved++; |
1287 | if (!pagevec_add(&pvec, page)) { | 1288 | if (!pagevec_add(&pvec, page)) { |