linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/migrate: Avoid migrate mmaped compound pages
@ 2015-05-27 23:52 Jovi Zhangwei
  0 siblings, 0 replies; 2+ messages in thread
From: Jovi Zhangwei @ 2015-05-27 23:52 UTC (permalink / raw)
  To: inux-kernel, mgorman, Sasha Levin, n-horiguchi, Andrew Morton,
	hughd, linux-mm, vbabka, rientjes

[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]

Below kernel vm bug can be triggered by tcpdump which mmaped a lot of pages
with GFP_COMP flag.

[Mon May 25 05:29:33 2015] page:ffffea0015414000 count:66 mapcount:1
mapping:          (null) index:0x0
[Mon May 25 05:29:33 2015] flags: 0x20047580004000(head)
[Mon May 25 05:29:33 2015] page dumped because:
VM_BUG_ON_PAGE(compound_order(page) && !PageTransHuge(page))
[Mon May 25 05:29:33 2015] ------------[ cut here ]------------
[Mon May 25 05:29:33 2015] kernel BUG at mm/migrate.c:1661!
[Mon May 25 05:29:33 2015] invalid opcode: 0000 [#1] SMP

The fix is simply disallow migrate mmaped compound pages, return 0 instead
of
report vm bug.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
---
 mm/migrate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index f53838f..839adef 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1606,7 +1606,8 @@ static int numamigrate_isolate_page(pg_data_t *pgdat,
struct page *page)
 {
  int page_lru;

- VM_BUG_ON_PAGE(compound_order(page) && !PageTransHuge(page), page);
+ if (compound_order(page) && !PageTransHuge(page))
+ return 0;

  /* Avoid migrating to a node that is nearly full */
  if (!migrate_balanced_pgdat(pgdat, 1UL << compound_order(page)))
-- 
1.9.1

[-- Attachment #2: Type: text/html, Size: 2025 bytes --]

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

* [PATCH] mm/migrate: Avoid migrate mmaped compound pages
@ 2015-05-27 23:54 Jovi Zhangwei
  0 siblings, 0 replies; 2+ messages in thread
From: Jovi Zhangwei @ 2015-05-27 23:54 UTC (permalink / raw)
  To: LKML, mgorman, Sasha Levin, n-horiguchi, Andrew Morton, hughd,
	linux-mm, vbabka, rientjes

[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]

Below kernel vm bug can be triggered by tcpdump which mmaped a lot of pages
with GFP_COMP flag.

[Mon May 25 05:29:33 2015] page:ffffea0015414000 count:66 mapcount:1
mapping:          (null) index:0x0
[Mon May 25 05:29:33 2015] flags: 0x20047580004000(head)
[Mon May 25 05:29:33 2015] page dumped because:
VM_BUG_ON_PAGE(compound_order(page) && !PageTransHuge(page))
[Mon May 25 05:29:33 2015] ------------[ cut here ]------------
[Mon May 25 05:29:33 2015] kernel BUG at mm/migrate.c:1661!
[Mon May 25 05:29:33 2015] invalid opcode: 0000 [#1] SMP

The fix is simply disallow migrate mmaped compound pages, return 0 instead
of
report vm bug.

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>
---
 mm/migrate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index f53838f..839adef 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1606,7 +1606,8 @@ static int numamigrate_isolate_page(pg_data_t *pgdat,
struct page *page)
 {
  int page_lru;

- VM_BUG_ON_PAGE(compound_order(page) && !PageTransHuge(page), page);
+ if (compound_order(page) && !PageTransHuge(page))
+ return 0;

  /* Avoid migrating to a node that is nearly full */
  if (!migrate_balanced_pgdat(pgdat, 1UL << compound_order(page)))
-- 
1.9.1

[-- Attachment #2: Type: text/html, Size: 3418 bytes --]

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

end of thread, other threads:[~2015-05-27 23:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-27 23:52 [PATCH] mm/migrate: Avoid migrate mmaped compound pages Jovi Zhangwei
2015-05-27 23:54 Jovi Zhangwei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).