<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/mm, branch v3.1</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/mm?h=v3.1</id>
<link rel='self' href='https://git.amat.us/linux/atom/mm?h=v3.1'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-10-20T06:42:58Z</updated>
<entry>
<title>mm: fix race between mremap and removing migration entry</title>
<updated>2011-10-20T06:42:58Z</updated>
<author>
<name>Hugh Dickins</name>
<email>hughd@google.com</email>
</author>
<published>2011-10-19T19:50:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=486cf46f3f9be5f2a966016c1a8fe01e32cde09e'/>
<id>urn:sha1:486cf46f3f9be5f2a966016c1a8fe01e32cde09e</id>
<content type='text'>
I don't usually pay much attention to the stale "? " addresses in
stack backtraces, but this lucky report from Pawel Sikora hints that
mremap's move_ptes() has inadequate locking against page migration.

 3.0 BUG_ON(!PageLocked(p)) in migration_entry_to_page():
 kernel BUG at include/linux/swapops.h:105!
 RIP: 0010:[&lt;ffffffff81127b76&gt;]  [&lt;ffffffff81127b76&gt;]
                       migration_entry_wait+0x156/0x160
  [&lt;ffffffff811016a1&gt;] handle_pte_fault+0xae1/0xaf0
  [&lt;ffffffff810feee2&gt;] ? __pte_alloc+0x42/0x120
  [&lt;ffffffff8112c26b&gt;] ? do_huge_pmd_anonymous_page+0xab/0x310
  [&lt;ffffffff81102a31&gt;] handle_mm_fault+0x181/0x310
  [&lt;ffffffff81106097&gt;] ? vma_adjust+0x537/0x570
  [&lt;ffffffff81424bed&gt;] do_page_fault+0x11d/0x4e0
  [&lt;ffffffff81109a05&gt;] ? do_mremap+0x2d5/0x570
  [&lt;ffffffff81421d5f&gt;] page_fault+0x1f/0x30

mremap's down_write of mmap_sem, together with i_mmap_mutex or lock,
and pagetable locks, were good enough before page migration (with its
requirement that every migration entry be found) came in, and enough
while migration always held mmap_sem; but not enough nowadays, when
there's memory hotremove and compaction.

The danger is that move_ptes() lets a migration entry dodge around
behind remove_migration_pte()'s back, so it's in the old location when
looking at the new, then in the new location when looking at the old.

Either mremap's move_ptes() must additionally take anon_vma lock(), or
migration's remove_migration_pte() must stop peeking for is_swap_entry()
before it takes pagetable lock.

Consensus chooses the latter: we prefer to add overhead to migration
than to mremapping, which gets used by JVMs and by exec stack setup.

Reported-and-tested-by: Paweł Sikora &lt;pluto@agmk.net&gt;
Signed-off-by: Hugh Dickins &lt;hughd@google.com&gt;
Acked-by: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Acked-by: Mel Gorman &lt;mgorman@suse.de&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.dk/linux-block</title>
<updated>2011-09-21T20:20:21Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-09-21T20:20:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fed678dc8a8b839c8189b5d889a94e865cd327dd'/>
<id>urn:sha1:fed678dc8a8b839c8189b5d889a94e865cd327dd</id>
<content type='text'>
* 'for-linus' of git://git.kernel.dk/linux-block:
  floppy: use del_timer_sync() in init cleanup
  blk-cgroup: be able to remove the record of unplugged device
  block: Don't check QUEUE_FLAG_SAME_COMP in __blk_complete_request
  mm: Add comment explaining task state setting in bdi_forker_thread()
  mm: Cleanup clearing of BDI_pending bit in bdi_forker_thread()
  block: simplify force plug flush code a little bit
  block: change force plug flush call order
  block: Fix queue_flag update when rq_affinity goes from 2 to 1
  block: separate priority boosting from REQ_META
  block: remove READ_META and WRITE_META
  xen-blkback: fixed indentation and comments
  xen-blkback: Don't disconnect backend until state switched to XenbusStateClosed.
</content>
</entry>
<entry>
<title>Merge branch 'slab/urgent' of git://github.com/penberg/linux</title>
<updated>2011-09-19T15:02:41Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-09-19T15:02:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b6a68a5ba4a5111379625d6d921e1c24fc17dc3a'/>
<id>urn:sha1:b6a68a5ba4a5111379625d6d921e1c24fc17dc3a</id>
<content type='text'>
* 'slab/urgent' of git://github.com/penberg/linux:
  slub: add slab with one free object to partial list tail
</content>
</entry>
<entry>
<title>mm: account skipped entries to avoid looping in find_get_pages</title>
<updated>2011-09-15T01:17:56Z</updated>
<author>
<name>Shaohua Li</name>
<email>shaohua.li@intel.com</email>
</author>
<published>2011-09-15T00:45:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cc39c6a9bbdebfcf1a7dee64d83bf302bc38d941'/>
<id>urn:sha1:cc39c6a9bbdebfcf1a7dee64d83bf302bc38d941</id>
<content type='text'>
The found entries by find_get_pages() could be all swap entries.  In
this case we skip the entries, but make sure the skipped entries are
accounted, so we don't keep looping.

Using nr_found &gt; nr_skip to simplify code as suggested by Eric.

Reported-and-tested-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Shaohua Li &lt;shaohua.li@intel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: sync vmalloc address space page tables in alloc_vm_area()</title>
<updated>2011-09-15T01:09:38Z</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@citrix.com</email>
</author>
<published>2011-09-14T23:22:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=461ae488ecb125b140d7ea29ceeedbcce9327003'/>
<id>urn:sha1:461ae488ecb125b140d7ea29ceeedbcce9327003</id>
<content type='text'>
Xen backend drivers (e.g., blkback and netback) would sometimes fail to
map grant pages into the vmalloc address space allocated with
alloc_vm_area().  The GNTTABOP_map_grant_ref would fail because Xen could
not find the page (in the L2 table) containing the PTEs it needed to
update.

(XEN) mm.c:3846:d0 Could not find L1 PTE for address fbb42000

netback and blkback were making the hypercall from a kernel thread where
task-&gt;active_mm != &amp;init_mm and alloc_vm_area() was only updating the page
tables for init_mm.  The usual method of deferring the update to the page
tables of other processes (i.e., after taking a fault) doesn't work as a
fault cannot occur during the hypercall.

This would work on some systems depending on what else was using vmalloc.

Fix this by reverting ef691947d8a3 ("vmalloc: remove vmalloc_sync_all()
from alloc_vm_area()") and add a comment to explain why it's needed.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Cc: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: Ian Campbell &lt;Ian.Campbell@citrix.com&gt;
Cc: Keir Fraser &lt;keir.xen@gmail.com&gt;
Cc: &lt;stable@kernel.org&gt;		[3.0.x]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>memcg: Revert "memcg: add memory.vmscan_stat"</title>
<updated>2011-09-15T01:09:38Z</updated>
<author>
<name>Johannes Weiner</name>
<email>jweiner@redhat.com</email>
</author>
<published>2011-09-14T23:21:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=185efc0f9a1f2d6ad6d4782c5d9e529f3290567f'/>
<id>urn:sha1:185efc0f9a1f2d6ad6d4782c5d9e529f3290567f</id>
<content type='text'>
Revert the post-3.0 commit 82f9d486e59f5 ("memcg: add
memory.vmscan_stat").

The implementation of per-memcg reclaim statistics violates how memcg
hierarchies usually behave: hierarchically.

The reclaim statistics are accounted to child memcgs and the parent
hitting the limit, but not to hierarchy levels in between.  Usually,
hierarchical statistics are perfectly recursive, with each level
representing the sum of itself and all its children.

Since this exports statistics to userspace, this may lead to confusion
and problems with changing things after the release, so revert it now,
we can try again later.

Signed-off-by: Johannes Weiner &lt;jweiner@redhat.com&gt;
Acked-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Daisuke Nishimura &lt;nishimura@mxp.nes.nec.co.jp&gt;
Cc: Michal Hocko &lt;mhocko@suse.cz&gt;
Cc: Ying Han &lt;yinghan@google.com&gt;
Cc: Balbir Singh &lt;bsingharora@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: vmscan: fix force-scanning small targets without swap</title>
<updated>2011-09-15T01:09:37Z</updated>
<author>
<name>Johannes Weiner</name>
<email>jweiner@redhat.com</email>
</author>
<published>2011-09-14T23:21:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a4d3e9e76337059406fcf3ead288c0df22a790e9'/>
<id>urn:sha1:a4d3e9e76337059406fcf3ead288c0df22a790e9</id>
<content type='text'>
Without swap, anonymous pages are not scanned.  As such, they should not
count when considering force-scanning a small target if there is no swap.

Otherwise, targets are not force-scanned even when their effective scan
number is zero and the other conditions--kswapd/memcg--apply.

This fixes 246e87a93934 ("memcg: fix get_scan_count() for small
targets").

[akpm@linux-foundation.org: fix comment]
Signed-off-by: Johannes Weiner &lt;jweiner@redhat.com&gt;
Acked-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Reviewed-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Cc: Ying Han &lt;yinghan@google.com&gt;
Cc: Balbir Singh &lt;bsingharora@gmail.com&gt;
Cc: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: Daisuke Nishimura &lt;nishimura@mxp.nes.nec.co.jp&gt;
Acked-by: Mel Gorman &lt;mel@csn.ul.ie&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>numa: fix NUMA compile error when sysfs and procfs are disabled</title>
<updated>2011-09-15T01:09:37Z</updated>
<author>
<name>David Rientjes</name>
<email>rientjes@google.com</email>
</author>
<published>2011-09-14T23:21:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0d6617c7732c083659566117ca620eda6f1a87af'/>
<id>urn:sha1:0d6617c7732c083659566117ca620eda6f1a87af</id>
<content type='text'>
The vmstat_text array is only defined for CONFIG_SYSFS or CONFIG_PROC_FS,
yet it is referenced for per-node vmstat with CONFIG_NUMA:

	drivers/built-in.o: In function `node_read_vmstat':
	node.c:(.text+0x1106df): undefined reference to `vmstat_text'

Introduced in commit fa25c503dfa2 ("mm: per-node vmstat: show proper
vmstats").

Define the array for CONFIG_NUMA as well.

[akpm@linux-foundation.org: remove unneeded ifdefs]
Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
Reported-by: Cong Wang &lt;amwang@redhat.com&gt;
Acked-by: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm/mempolicy.c: make copy_from_user() provably correct</title>
<updated>2011-09-15T01:09:36Z</updated>
<author>
<name>KAMEZAWA Hiroyuki</name>
<email>kamezawa.hiroyu@jp.fujitsu.com</email>
</author>
<published>2011-09-14T23:21:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2bbff6c761e31b4642d297513cd3e0e89bc68ff7'/>
<id>urn:sha1:2bbff6c761e31b4642d297513cd3e0e89bc68ff7</id>
<content type='text'>
When compiling mm/mempolicy.c with struct user copy checks the following
warning is shown:

  In file included from arch/x86/include/asm/uaccess.h:572,
                   from include/linux/uaccess.h:5,
                   from include/linux/highmem.h:7,
                   from include/linux/pagemap.h:10,
                   from include/linux/mempolicy.h:70,
                   from mm/mempolicy.c:68:
  In function `copy_from_user',
      inlined from `compat_sys_get_mempolicy' at mm/mempolicy.c:1415:
  arch/x86/include/asm/uaccess_64.h:64: warning: call to `copy_from_user_overflow' declared with attribute warning: copy_from_user() buffer size is not provably correct
    LD      mm/built-in.o

Fix this by passing correct buffer size value.

Signed-off-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm/mempolicy.c: fix pgoff in mbind vma merge</title>
<updated>2011-09-15T01:09:36Z</updated>
<author>
<name>Caspar Zhang</name>
<email>caspar@casparzhang.com</email>
</author>
<published>2011-09-14T23:20:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8aacc9f550feb09c8b26470498345c192996a68e'/>
<id>urn:sha1:8aacc9f550feb09c8b26470498345c192996a68e</id>
<content type='text'>
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-&gt;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 &lt;caspar@casparzhang.com&gt;
Cc: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: Hugh Dickins &lt;hugh.dickins@tiscali.co.uk&gt;
Cc: Mel Gorman &lt;mel@csn.ul.ie&gt;
Cc: Lee Schermerhorn &lt;lee.schermerhorn@hp.com&gt;
Cc: Minchan Kim &lt;minchan.kim@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
