|
@@ -1118,10 +1118,13 @@ out:
|
|
|
* If migration is successful, decrease refcount of the newpage
|
|
* If migration is successful, decrease refcount of the newpage
|
|
|
* which will not free the page because new page owner increased
|
|
* which will not free the page because new page owner increased
|
|
|
* refcounter. As well, if it is LRU page, add the page to LRU
|
|
* refcounter. As well, if it is LRU page, add the page to LRU
|
|
|
- * list in here.
|
|
|
|
|
|
|
+ * list in here. Use the old state of the isolated source page to
|
|
|
|
|
+ * determine if we migrated a LRU page. newpage was already unlocked
|
|
|
|
|
+ * and possibly modified by its owner - don't rely on the page
|
|
|
|
|
+ * state.
|
|
|
*/
|
|
*/
|
|
|
if (rc == MIGRATEPAGE_SUCCESS) {
|
|
if (rc == MIGRATEPAGE_SUCCESS) {
|
|
|
- if (unlikely(__PageMovable(newpage)))
|
|
|
|
|
|
|
+ if (unlikely(!is_lru))
|
|
|
put_page(newpage);
|
|
put_page(newpage);
|
|
|
else
|
|
else
|
|
|
putback_lru_page(newpage);
|
|
putback_lru_page(newpage);
|