mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 10:46:33 +00:00
mm: migrate: Drop the misplaced pages reference count if the target node is full
If we have to avoid migrating to a node that is nearly full, put page and return zero. Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Mel Gorman <mgorman@suse.de>
This commit is contained in:
parent
7039e1dbec
commit
149c33e1c9
17
mm/migrate.c
17
mm/migrate.c
@ -1489,18 +1489,21 @@ int migrate_misplaced_page(struct page *page, int node)
|
|||||||
}
|
}
|
||||||
isolated = 1;
|
isolated = 1;
|
||||||
|
|
||||||
/*
|
|
||||||
* Page is isolated which takes a reference count so now the
|
|
||||||
* callers reference can be safely dropped without the page
|
|
||||||
* disappearing underneath us during migration
|
|
||||||
*/
|
|
||||||
put_page(page);
|
|
||||||
|
|
||||||
page_lru = page_is_file_cache(page);
|
page_lru = page_is_file_cache(page);
|
||||||
inc_zone_page_state(page, NR_ISOLATED_ANON + page_lru);
|
inc_zone_page_state(page, NR_ISOLATED_ANON + page_lru);
|
||||||
list_add(&page->lru, &migratepages);
|
list_add(&page->lru, &migratepages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Page is either isolated or there is not enough space on the target
|
||||||
|
* node. If isolated, then it has taken a reference count and the
|
||||||
|
* callers reference can be safely dropped without the page
|
||||||
|
* disappearing underneath us during migration. Otherwise the page is
|
||||||
|
* not to be migrated but the callers reference should still be
|
||||||
|
* dropped so it does not leak.
|
||||||
|
*/
|
||||||
|
put_page(page);
|
||||||
|
|
||||||
if (isolated) {
|
if (isolated) {
|
||||||
int nr_remaining;
|
int nr_remaining;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user