Skip to content

Commit

Permalink
[PATCH] mm: PageActive no testset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Mar 22, 2006
1 parent 8d438f9 commit 4c84cac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions include/linux/page-flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
#define PageActive(page) test_bit(PG_active, &(page)->flags)
#define SetPageActive(page) set_bit(PG_active, &(page)->flags)
#define ClearPageActive(page) clear_bit(PG_active, &(page)->flags)
#define TestClearPageActive(page) test_and_clear_bit(PG_active, &(page)->flags)
#define TestSetPageActive(page) test_and_set_bit(PG_active, &(page)->flags)

#define PageSlab(page) test_bit(PG_slab, &(page)->flags)
#define SetPageSlab(page) set_bit(PG_slab, &(page)->flags)
Expand Down
4 changes: 2 additions & 2 deletions mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ void __pagevec_lru_add_active(struct pagevec *pvec)
}
BUG_ON(PageLRU(page));
SetPageLRU(page);
if (TestSetPageActive(page))
BUG();
BUG_ON(PageActive(page));
SetPageActive(page);
add_page_to_active_list(zone, page);
}
if (zone)
Expand Down
5 changes: 3 additions & 2 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,9 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
prefetchw_prev_lru_page(page, &l_inactive, flags);
BUG_ON(PageLRU(page));
SetPageLRU(page);
if (!TestClearPageActive(page))
BUG();
BUG_ON(!PageActive(page));
ClearPageActive(page);

list_move(&page->lru, &zone->inactive_list);
pgmoved++;
if (!pagevec_add(&pvec, page)) {
Expand Down

0 comments on commit 4c84cac

Please sign in to comment.