|
@@ -36,36 +36,6 @@
|
|
|
|
|
|
#define lru_to_page(_head) (list_entry((_head)->prev, struct page, lru))
|
|
#define lru_to_page(_head) (list_entry((_head)->prev, struct page, lru))
|
|
|
|
|
|
-/*
|
|
|
|
- * Isolate one page from the LRU lists. If successful put it onto
|
|
|
|
- * the indicated list with elevated page count.
|
|
|
|
- *
|
|
|
|
- * Result:
|
|
|
|
- * -EBUSY: page not on LRU list
|
|
|
|
- * 0: page removed from LRU list and added to the specified list.
|
|
|
|
- */
|
|
|
|
-int isolate_lru_page(struct page *page, struct list_head *pagelist)
|
|
|
|
-{
|
|
|
|
- int ret = -EBUSY;
|
|
|
|
-
|
|
|
|
- if (PageLRU(page)) {
|
|
|
|
- struct zone *zone = page_zone(page);
|
|
|
|
-
|
|
|
|
- spin_lock_irq(&zone->lru_lock);
|
|
|
|
- if (PageLRU(page) && get_page_unless_zero(page)) {
|
|
|
|
- ret = 0;
|
|
|
|
- ClearPageLRU(page);
|
|
|
|
- if (PageActive(page))
|
|
|
|
- del_page_from_active_list(zone, page);
|
|
|
|
- else
|
|
|
|
- del_page_from_inactive_list(zone, page);
|
|
|
|
- list_add_tail(&page->lru, pagelist);
|
|
|
|
- }
|
|
|
|
- spin_unlock_irq(&zone->lru_lock);
|
|
|
|
- }
|
|
|
|
- return ret;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* migrate_prep() needs to be called before we start compiling a list of pages
|
|
* migrate_prep() needs to be called before we start compiling a list of pages
|
|
* to be migrated using isolate_lru_page().
|
|
* to be migrated using isolate_lru_page().
|
|
@@ -914,7 +884,9 @@ static int do_move_pages(struct mm_struct *mm, struct page_to_node *pm,
|
|
!migrate_all)
|
|
!migrate_all)
|
|
goto put_and_set;
|
|
goto put_and_set;
|
|
|
|
|
|
- err = isolate_lru_page(page, &pagelist);
|
|
|
|
|
|
+ err = isolate_lru_page(page);
|
|
|
|
+ if (!err)
|
|
|
|
+ list_add_tail(&page->lru, &pagelist);
|
|
put_and_set:
|
|
put_and_set:
|
|
/*
|
|
/*
|
|
* Either remove the duplicate refcount from
|
|
* Either remove the duplicate refcount from
|