]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
CMA/HOTPLUG: clear buffer-head lru before page migration
authorKrishna Reddy <vdumpa@nvidia.com>
Fri, 5 Sep 2014 20:22:19 +0000 (13:22 -0700)
committerKrishna Reddy <vdumpa@nvidia.com>
Tue, 9 Sep 2014 02:02:15 +0000 (19:02 -0700)
The bh must be free to migrate a page at which bh is mapped.
The reference count of bh is increased when it is installed
into lru so that the bh of lru must be freed before migrating the page.

This frees every bh of lru. We could free only bh of migrating page.
But searching lru costs more than invalidating entire lru.

Change-Id: I756fb6f86731df50a2d4b3a3768ebff2f125ae91
Signed-off-by: Gioh Kim <gioh.kim@lge.com>
Acked-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/496633
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
mm/page_alloc.c

index 48c90b99a4cbaecf826969fa4c5e7d5ea8106588..7bdae75c8a8b58e5ee76d361e4f2fb5430cd2826 100644 (file)
@@ -61,6 +61,7 @@
 #include <linux/page-debug-flags.h>
 #include <linux/hugetlb.h>
 #include <linux/sched/rt.h>
+#include <linux/buffer_head.h>
 
 #include <asm/tlbflush.h>
 #include <asm/div64.h>
@@ -5997,6 +5998,9 @@ int alloc_contig_range(unsigned long start, unsigned long end,
        if (ret)
                return ret;
 
+       if (migratetype == MIGRATE_CMA || migratetype == MIGRATE_MOVABLE)
+               invalidate_bh_lrus();
+
        ret = __alloc_contig_migrate_range(&cc, start, end);
        if (ret)
                goto done;