mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
[PATCH] page migration: fail if page is in a vma flagged VM_LOCKED
page migration currently simply retries a couple of times if try_to_unmap() fails without inspecting the return code. However, SWAP_FAIL indicates that the page is in a vma that has the VM_LOCKED flag set (if ignore_refs ==1). We can check for that return code and avoid retrying the migration. migrate_page_remove_references() now needs to return a reason why the failure occured. So switch migrate_page_remove_references to use -Exx style error messages. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
e843e280cb
commit
4983da07f1
2 changed files with 16 additions and 8 deletions
|
|
@ -3060,6 +3060,7 @@ int buffer_migrate_page(struct page *newpage, struct page *page)
|
|||
{
|
||||
struct address_space *mapping = page->mapping;
|
||||
struct buffer_head *bh, *head;
|
||||
int rc;
|
||||
|
||||
if (!mapping)
|
||||
return -EAGAIN;
|
||||
|
|
@ -3069,8 +3070,9 @@ int buffer_migrate_page(struct page *newpage, struct page *page)
|
|||
|
||||
head = page_buffers(page);
|
||||
|
||||
if (migrate_page_remove_references(newpage, page, 3))
|
||||
return -EAGAIN;
|
||||
rc = migrate_page_remove_references(newpage, page, 3);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
bh = head;
|
||||
do {
|
||||
|
|
|
|||
Loading…
Reference in a new issue