diff options
Diffstat (limited to 'mm/swap.c')
-rw-r--r-- | mm/swap.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -116,7 +116,8 @@ static void pagevec_move_tail(struct pagevec *pvec) | |||
116 | spin_lock(&zone->lru_lock); | 116 | spin_lock(&zone->lru_lock); |
117 | } | 117 | } |
118 | if (PageLRU(page) && !PageActive(page)) { | 118 | if (PageLRU(page) && !PageActive(page)) { |
119 | list_move_tail(&page->lru, &zone->lru[LRU_INACTIVE].list); | 119 | int lru = page_is_file_cache(page); |
120 | list_move_tail(&page->lru, &zone->lru[lru].list); | ||
120 | pgmoved++; | 121 | pgmoved++; |
121 | } | 122 | } |
122 | } | 123 | } |
@@ -157,11 +158,18 @@ void activate_page(struct page *page) | |||
157 | 158 | ||
158 | spin_lock_irq(&zone->lru_lock); | 159 | spin_lock_irq(&zone->lru_lock); |
159 | if (PageLRU(page) && !PageActive(page)) { | 160 | if (PageLRU(page) && !PageActive(page)) { |
160 | del_page_from_inactive_list(zone, page); | 161 | int file = page_is_file_cache(page); |
162 | int lru = LRU_BASE + file; | ||
163 | del_page_from_lru_list(zone, page, lru); | ||
164 | |||
161 | SetPageActive(page); | 165 | SetPageActive(page); |
162 | add_page_to_active_list(zone, page); | 166 | lru += LRU_ACTIVE; |
167 | add_page_to_lru_list(zone, page, lru); | ||
163 | __count_vm_event(PGACTIVATE); | 168 | __count_vm_event(PGACTIVATE); |
164 | mem_cgroup_move_lists(page, true); | 169 | mem_cgroup_move_lists(page, true); |
170 | |||
171 | zone->recent_rotated[!!file]++; | ||
172 | zone->recent_scanned[!!file]++; | ||
165 | } | 173 | } |
166 | spin_unlock_irq(&zone->lru_lock); | 174 | spin_unlock_irq(&zone->lru_lock); |
167 | } | 175 | } |