summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-netx/nxdkn.c
Commit message (Expand)AuthorAgeFilesLines
* Merge branch 'restart' into for-linusRussell King2012-01-051-0/+1
|\
| * ARM: restart: netx: use new restart hookRussell King2012-01-051-0/+1
* | ARM: netx: convert to MULTI_IRQ_HANDLERJamie Iles2011-11-151-0/+2
|/
* ARM: mach-netx: convert boot_params to atag_offsetNicolas Pitre2011-08-211-1/+1
* arm: remove machine_desc.io_pg_offst and .phys_ioNicolas Pitre2010-10-201-2/+0Star
* [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/machRussell King2008-08-071-3/+3
* [ARM] Remove asm/hardware.h, use asm/arch/hardware.h insteadRussell King2008-08-071-1/+1
* [ARM] 3574/1: netX: board support for NXDKN development boardSascha Hauer2006-06-191-0/+103
nslx/kernel-qcow2-linux.git/diff/mm/migrate.c?h=kernel-qcow2-linux-4.19.y&id=dc386d4d1e98bb39fb967ee156cd456c802fc692'>mm/migrate.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 34d8ada053e4..c8d87221f368 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -632,18 +632,35 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
goto unlock;
wait_on_page_writeback(page);
}
-
/*
- * Establish migration ptes or remove ptes
+ * By try_to_unmap(), page->mapcount goes down to 0 here. In this case,
+ * we cannot notice that anon_vma is freed while we migrates a page.
+ * This rcu_read_lock() delays freeing anon_vma pointer until the end
+ * of migration. File cache pages are no problem because of page_lock()
+ */
+ rcu_read_lock();
+ /*
+ * This is a corner case handling.
+ * When a new swap-cache is read into, it is linked to LRU
+ * and treated as swapcache but has no rmap yet.
+ * Calling try_to_unmap() against a page->mapping==NULL page is
+ * BUG. So handle it here.
*/
+ if (!page->mapping)
+ goto rcu_unlock;
+ /* Establish migration ptes or remove ptes */
try_to_unmap(page, 1);
+
if (!page_mapped(page))
rc = move_to_new_page(newpage, page);
if (rc)
remove_migration_ptes(page, page);
+rcu_unlock:
+ rcu_read_unlock();
unlock:
+
unlock_page(page);
if (rc != -EAGAIN) {