linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] CMA/HOTPLUG: clear buffer-head lru before page migration
@ 2014-07-31  2:22 Gioh Kim
  2014-07-31 22:57 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Gioh Kim @ 2014-07-31  2:22 UTC (permalink / raw)
  To: Andrew Morton, '김준수',
	Marek Szyprowski, Minchan Kim
  Cc: Laura Abbott, Michal Nazarewicz, Alexander Viro, Johannes Weiner,
	linux-kernel, linux-mm, ?????????, 'Chanho Min'

The previous PATCH inserts invalidate_bh_lrus() only into CMA code.
HOTPLUG needs also dropping bh of lru.
So v2 inserts invalidate_bh_lrus() into both of CMA and HOTPLUG.


---------------------------- 8< ----------------------------
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 sometimes costs more than invalidating entire lru.

Signed-off-by: Gioh Kim <gioh.kim@lge.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
---
 mm/memory_hotplug.c |    1 +
 mm/page_alloc.c     |    2 ++
 2 files changed, 3 insertions(+)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index a3797d3..1c5454f 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1672,6 +1672,7 @@ repeat:
                lru_add_drain_all();
                cond_resched();
                drain_all_pages();
+               invalidate_bh_lrus();
        }

        pfn = scan_movable_pages(start_pfn, end_pfn);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b99643d4..c00dedf 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6369,6 +6369,8 @@ int alloc_contig_range(unsigned long start, unsigned long end,
        if (ret)
                return ret;

+       invalidate_bh_lrus();
+
        ret = __alloc_contig_migrate_range(&cc, start, end);
        if (ret)
                goto done;
--
1.7.9.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCHv2] CMA/HOTPLUG: clear buffer-head lru before page migration
@ 2014-07-21  2:33 Gioh Kim
  0 siblings, 0 replies; 5+ messages in thread
From: Gioh Kim @ 2014-07-21  2:33 UTC (permalink / raw)
  To: Andrew Morton, '김준수',
	Laura Abbott, Minchan Kim, Michal Nazarewicz, Marek Szyprowski
  Cc: Alexander Viro, Johannes Weiner, Mel Gorman, linux-kernel,
	linux-mm, 이건호, 'Chanho Min'

I removed checking migratetype of v1: https://lkml.org/lkml/2014/7/18/82.
Thanks a lot.


---------------------------- 8< ------------------------------

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-06  7:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-31  2:22 [PATCHv2] CMA/HOTPLUG: clear buffer-head lru before page migration Gioh Kim
2014-07-31 22:57 ` Andrew Morton
2014-08-01  0:12   ` Gioh Kim
2014-08-06  7:37     ` Joonsoo Kim
  -- strict thread matches above, loose matches on Subject: below --
2014-07-21  2:33 Gioh Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox