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>
#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>
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;