Re: [PATCH -mm] vmscan: merge duplicate code in shrink_active_list()

KOSAKI Motohiro
2009-05-12T02:58:43Z

> +void move_active_pages_to_lru(enum lru_list lru, struct list_head *list)

it can be static?

> +{
> + unsigned long pgmoved = 0;
> +
> + while (!list_empty(&list)) {
> + page = lru_to_page(&list);
> + prefetchw_prev_lru_page(page, &list, flags);
> +
> + VM_BUG_ON(PageLRU(page));
> + SetPageLRU(page);
> +
> + VM_BUG_ON(!PageActive(page));
> + if (lru < LRU_ACTIVE)
> + ClearPageActive(page);
> +
> + list_move(&page->lru, &zone->lru[lru].list);
> + mem_cgroup_add_lru_list(page, lru);
> + pgmoved++;
> + if (!pagevec_add(&pvec, page)) {
> + spin_unlock_irq(&zone->lru_lock);
> + if (buffer_heads_over_limit)
> + pagevec_strip(&pvec);
> + __pagevec_release(&pvec);
> + spin_lock_irq(&zone->lru_lock);
> + }
> + }
> + __mod_zone_page_state(zone, NR_LRU_BASE + lru, pgmoved);
> + if (lru < LRU_ACTIVE)
> + __count_vm_events(PGDEACTIVATE, pgmoved);
> +}