]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/mempolicy.c: fix pgoff in mbind vma merge
authorCaspar Zhang <caspar@casparzhang.com>
Wed, 14 Sep 2011 23:20:58 +0000 (16:20 -0700)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Wed, 6 Jun 2012 18:46:24 +0000 (22:46 +0400)
commit8b628b432ab877c4ccf9bd03a2b99f9ed222635f
tree4b7cf01b150c0a30184afdf187be11d3cd21f61e
parentbe2e2da853edeb2e2429b6e892c73dc3918dae91
mm/mempolicy.c: fix pgoff in mbind vma merge

Orabug:14149364
commit 9d8cebd4bcd7 ("mm: fix mbind vma merge problem") didn't really
fix the mbind vma merge problem due to wrong pgoff value passing to
vma_merge(), which made vma_merge() always return NULL.

Before the patch applied, we are getting a result like:

  addr = 0x7fa58f00c000
  [snip]
  7fa58f00c000-7fa58f00d000 rw-p 00000000 00:00 0
  7fa58f00d000-7fa58f00e000 rw-p 00000000 00:00 0
  7fa58f00e000-7fa58f00f000 rw-p 00000000 00:00 0

here 7fa58f00c000->7fa58f00f000 we get 3 VMAs which are expected to be
merged described as described in commit 9d8cebd.

Re-testing the patched kernel with the reproducer provided in commit
9d8cebd, we get the correct result:

  addr = 0x7ffa5aaa2000
  [snip]
  7ffa5aaa2000-7ffa5aaa6000 rw-p 00000000 00:00 0
  7fffd556f000-7fffd5584000 rw-p 00000000 00:00 0                          [stack]

Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 8aacc9f550feb09c8b26470498345c192996a68e)

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
mm/mempolicy.c