diff options
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 374ef2fcb722..73d476d690b1 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -2218,17 +2218,15 @@ again: | |||
2218 | pte_t pte; | 2218 | pte_t pte; |
2219 | 2219 | ||
2220 | pte = *ptep; | 2220 | pte = *ptep; |
2221 | pfn = pte_pfn(pte); | ||
2222 | 2221 | ||
2223 | if (pte_none(pte)) { | 2222 | if (pte_none(pte)) { |
2224 | mpfn = MIGRATE_PFN_MIGRATE; | 2223 | mpfn = MIGRATE_PFN_MIGRATE; |
2225 | migrate->cpages++; | 2224 | migrate->cpages++; |
2226 | pfn = 0; | ||
2227 | goto next; | 2225 | goto next; |
2228 | } | 2226 | } |
2229 | 2227 | ||
2230 | if (!pte_present(pte)) { | 2228 | if (!pte_present(pte)) { |
2231 | mpfn = pfn = 0; | 2229 | mpfn = 0; |
2232 | 2230 | ||
2233 | /* | 2231 | /* |
2234 | * Only care about unaddressable device page special | 2232 | * Only care about unaddressable device page special |
@@ -2245,10 +2243,10 @@ again: | |||
2245 | if (is_write_device_private_entry(entry)) | 2243 | if (is_write_device_private_entry(entry)) |
2246 | mpfn |= MIGRATE_PFN_WRITE; | 2244 | mpfn |= MIGRATE_PFN_WRITE; |
2247 | } else { | 2245 | } else { |
2246 | pfn = pte_pfn(pte); | ||
2248 | if (is_zero_pfn(pfn)) { | 2247 | if (is_zero_pfn(pfn)) { |
2249 | mpfn = MIGRATE_PFN_MIGRATE; | 2248 | mpfn = MIGRATE_PFN_MIGRATE; |
2250 | migrate->cpages++; | 2249 | migrate->cpages++; |
2251 | pfn = 0; | ||
2252 | goto next; | 2250 | goto next; |
2253 | } | 2251 | } |
2254 | page = vm_normal_page(migrate->vma, addr, pte); | 2252 | page = vm_normal_page(migrate->vma, addr, pte); |
@@ -2258,10 +2256,9 @@ again: | |||
2258 | 2256 | ||
2259 | /* FIXME support THP */ | 2257 | /* FIXME support THP */ |
2260 | if (!page || !page->mapping || PageTransCompound(page)) { | 2258 | if (!page || !page->mapping || PageTransCompound(page)) { |
2261 | mpfn = pfn = 0; | 2259 | mpfn = 0; |
2262 | goto next; | 2260 | goto next; |
2263 | } | 2261 | } |
2264 | pfn = page_to_pfn(page); | ||
2265 | 2262 | ||
2266 | /* | 2263 | /* |
2267 | * By getting a reference on the page we pin it and that blocks | 2264 | * By getting a reference on the page we pin it and that blocks |