<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/mm, branch v3.9</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/mm?h=v3.9</id>
<link rel='self' href='https://git.amat.us/linux/atom/mm?h=v3.9'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-04-27T20:25:38Z</updated>
<entry>
<title>vm: add no-mmu vm_iomap_memory() stub</title>
<updated>2013-04-27T20:25:38Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-04-27T20:25:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3c0b9de6d37a481673e81001c57ca0e410c72346'/>
<id>urn:sha1:3c0b9de6d37a481673e81001c57ca0e410c72346</id>
<content type='text'>
I think we could just move the full vm_iomap_memory() function into
util.h or similar, but I didn't get any reply from anybody actually
using nommu even to this trivial patch, so I'm not going to touch it any
more than required.

Here's the fairly minimal stub to make the nommu case at least
potentially work.  It doesn't seem like anybody cares, though.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm/vmscan: fix error return in kswapd_run()</title>
<updated>2013-04-17T23:10:45Z</updated>
<author>
<name>Xishi Qiu</name>
<email>qiuxishi@huawei.com</email>
</author>
<published>2013-04-17T22:58:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d72515b85a6583db131ec6032978e3c9d4291d95'/>
<id>urn:sha1:d72515b85a6583db131ec6032978e3c9d4291d95</id>
<content type='text'>
Fix the error return value in kswapd_run().  The bug was introduced by
commit d5dc0ad928fb ("mm/vmscan: fix error number for failed kthread").

Signed-off-by: Xishi Qiu &lt;qiuxishi@huawei.com&gt;
Reviewed-by: Wanpeng Li &lt;liwanp@linux.vnet.ibm.com&gt;
Reviewed-by: Rik van Riel &lt;riel@redhat.com&gt;
Reported-by: Wu Fengguang &lt;fengguang.wu@intel.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>hugetlbfs: add swap entry check in follow_hugetlb_page()</title>
<updated>2013-04-17T23:10:44Z</updated>
<author>
<name>Naoya Horiguchi</name>
<email>n-horiguchi@ah.jp.nec.com</email>
</author>
<published>2013-04-17T22:58:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9cc3a5bd40067b9a0fbd49199d0780463fc2140f'/>
<id>urn:sha1:9cc3a5bd40067b9a0fbd49199d0780463fc2140f</id>
<content type='text'>
With applying the previous patch "hugetlbfs: stop setting VM_DONTDUMP in
initializing vma(VM_HUGETLB)" to reenable hugepage coredump, if a memory
error happens on a hugepage and the affected processes try to access the
error hugepage, we hit VM_BUG_ON(atomic_read(&amp;page-&gt;_count) &lt;= 0) in
get_page().

The reason for this bug is that coredump-related code doesn't recognise
"hugepage hwpoison entry" with which a pmd entry is replaced when a memory
error occurs on a hugepage.

In other words, physical address information is stored in different bit
layout between hugepage hwpoison entry and pmd entry, so
follow_hugetlb_page() which is called in get_dump_page() returns a wrong
page from a given address.

The expected behavior is like this:

  absent   is_swap_pte   FOLL_DUMP   Expected behavior
  -------------------------------------------------------------------
   true     false         false       hugetlb_fault
   false    true          false       hugetlb_fault
   false    false         false       return page
   true     false         true        skip page (to avoid allocation)
   false    true          true        hugetlb_fault
   false    false         true        return page

With this patch, we can call hugetlb_fault() and take proper actions (we
wait for migration entries, fail with VM_FAULT_HWPOISON_LARGE for
hwpoisoned entries,) and as the result we can dump all hugepages except
for hwpoisoned ones.

Signed-off-by: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Cc: HATAYAMA Daisuke &lt;d.hatayama@jp.fujitsu.com&gt;
Acked-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;	[2.6.34+?]
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>vm: add vm_iomap_memory() helper function</title>
<updated>2013-04-16T23:45:45Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-04-16T20:45:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b4cbb197c7e7a68dbad0d491242e3ca67420c13e'/>
<id>urn:sha1:b4cbb197c7e7a68dbad0d491242e3ca67420c13e</id>
<content type='text'>
Various drivers end up replicating the code to mmap() their memory
buffers into user space, and our core memory remapping function may be
very flexible but it is unnecessarily complicated for the common cases
to use.

Our internal VM uses pfn's ("page frame numbers") which simplifies
things for the VM, and allows us to pass physical addresses around in a
denser and more efficient format than passing a "phys_addr_t" around,
and having to shift it up and down by the page size.  But it just means
that drivers end up doing that shifting instead at the interface level.

It also means that drivers end up mucking around with internal VM things
like the vma details (vm_pgoff, vm_start/end) way more than they really
need to.

So this just exports a function to map a certain physical memory range
into user space (using a phys_addr_t based interface that is much more
natural for a driver) and hides all the complexity from the driver.
Some drivers will still end up tweaking the vm_page_prot details for
things like prefetching or cacheability etc, but that's actually
relevant to the driver, rather than caring about what the page offset of
the mapping is into the particular IO memory region.

Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>x86-32: Fix possible incomplete TLB invalidate with PAE pagetables</title>
<updated>2013-04-12T23:56:47Z</updated>
<author>
<name>Dave Hansen</name>
<email>dave@sr71.net</email>
</author>
<published>2013-04-12T23:23:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1de14c3c5cbc9bb17e9dcc648cda51c0c85d54b9'/>
<id>urn:sha1:1de14c3c5cbc9bb17e9dcc648cda51c0c85d54b9</id>
<content type='text'>
This patch attempts to fix:

	https://bugzilla.kernel.org/show_bug.cgi?id=56461

The symptom is a crash and messages like this:

	chrome: Corrupted page table at address 34a03000
	*pdpt = 0000000000000000 *pde = 0000000000000000
	Bad pagetable: 000f [#1] PREEMPT SMP

Ingo guesses this got introduced by commit 611ae8e3f520 ("x86/tlb:
enable tlb flush range support for x86") since that code started to free
unused pagetables.

On x86-32 PAE kernels, that new code has the potential to free an entire
PMD page and will clear one of the four page-directory-pointer-table
(aka pgd_t entries).

The hardware aggressively "caches" these top-level entries and invlpg
does not actually affect the CPU's copy.  If we clear one we *HAVE* to
do a full TLB flush, otherwise we might continue using a freed pmd page.
(note, we do this properly on the population side in pud_populate()).

This patch tracks whenever we clear one of these entries in the 'struct
mmu_gather', and ensures that we follow up with a full tlb flush.

BTW, I disassembled and checked that:

	if (tlb-&gt;fullmm == 0)
and
	if (!tlb-&gt;fullmm &amp;&amp; !tlb-&gt;need_flush_all)

generate essentially the same code, so there should be zero impact there
to the !PAE case.

Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Artem S Tashkinov &lt;t.artem@mailcity.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: prevent mmap_cache race in find_vma()</title>
<updated>2013-04-04T18:46:28Z</updated>
<author>
<name>Jan Stancek</name>
<email>jstancek@redhat.com</email>
</author>
<published>2013-04-04T18:35:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b6a9b7f6b1f21735a7456d534dc0e68e61359d2c'/>
<id>urn:sha1:b6a9b7f6b1f21735a7456d534dc0e68e61359d2c</id>
<content type='text'>
find_vma() can be called by multiple threads with read lock
held on mm-&gt;mmap_sem and any of them can update mm-&gt;mmap_cache.
Prevent compiler from re-fetching mm-&gt;mmap_cache, because other
readers could update it in the meantime:

               thread 1                             thread 2
                                        |
  find_vma()                            |  find_vma()
    struct vm_area_struct *vma = NULL;  |
    vma = mm-&gt;mmap_cache;               |
    if (!(vma &amp;&amp; vma-&gt;vm_end &gt; addr     |
        &amp;&amp; vma-&gt;vm_start &lt;= addr)) {    |
                                        |    mm-&gt;mmap_cache = vma;
    return vma;                         |
     ^^ compiler may optimize this      |
        local variable out and re-read  |
        mm-&gt;mmap_cache                  |

This issue can be reproduced with gcc-4.8.0-1 on s390x by running
mallocstress testcase from LTP, which triggers:

  kernel BUG at mm/rmap.c:1088!
    Call Trace:
     ([&lt;000003d100c57000&gt;] 0x3d100c57000)
      [&lt;000000000023a1c0&gt;] do_wp_page+0x2fc/0xa88
      [&lt;000000000023baae&gt;] handle_pte_fault+0x41a/0xac8
      [&lt;000000000023d832&gt;] handle_mm_fault+0x17a/0x268
      [&lt;000000000060507a&gt;] do_protection_exception+0x1e2/0x394
      [&lt;0000000000603a04&gt;] pgm_check_handler+0x138/0x13c
      [&lt;000003fffcf1f07a&gt;] 0x3fffcf1f07a
    Last Breaking-Event-Address:
      [&lt;000000000024755e&gt;] page_add_new_anon_rmap+0xc2/0x168

Thanks to Jakub Jelinek for his insight on gcc and helping to
track this down.

Signed-off-by: Jan Stancek &lt;jstancek@redhat.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Hugh Dickins &lt;hughd@google.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "mm: introduce VM_POPULATE flag to better deal with racy userspace programs"</title>
<updated>2013-03-29T00:45:51Z</updated>
<author>
<name>Michel Lespinasse</name>
<email>walken@google.com</email>
</author>
<published>2013-03-28T23:26:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=09a9f1d27892255cfb9c91203f19476765e2d8d1'/>
<id>urn:sha1:09a9f1d27892255cfb9c91203f19476765e2d8d1</id>
<content type='text'>
This reverts commit 186930500985 ("mm: introduce VM_POPULATE flag to
better deal with racy userspace programs").

VM_POPULATE only has any effect when userspace plays racy games with
vmas by trying to unmap and remap memory regions that mmap or mlock are
operating on.

Also, the only effect of VM_POPULATE when userspace plays such games is
that it avoids populating new memory regions that get remapped into the
address range that was being operated on by the original mmap or mlock
calls.

Let's remove VM_POPULATE as there isn't any strong argument to mandate a
new vm_flag.

Signed-off-by: Michel Lespinasse &lt;walken@google.com&gt;
Signed-off-by: Hugh Dickins &lt;hughd@google.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm/hotplug: only free wait_table if it's allocated by vmalloc</title>
<updated>2013-03-22T23:41:20Z</updated>
<author>
<name>Jianguo Wu</name>
<email>wujianguo@huawei.com</email>
</author>
<published>2013-03-22T22:04:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ca4b3f302c90de5e516296e581c31c80125cd24b'/>
<id>urn:sha1:ca4b3f302c90de5e516296e581c31c80125cd24b</id>
<content type='text'>
zone-&gt;wait_table may be allocated from bootmem, it can not be freed.

Signed-off-by: Jianguo Wu &lt;wujianguo@huawei.com&gt;
Reviewed-by: Tang Chen &lt;tangchen@cn.fujitsu.com&gt;
Cc: Tang Chen &lt;tangchen@cn.fujitsu.com&gt;
Cc: Jiang Liu &lt;jiang.liu@huawei.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/hugetlb: fix total hugetlbfs pages count when using memory overcommit accouting</title>
<updated>2013-03-22T23:41:20Z</updated>
<author>
<name>Wanpeng Li</name>
<email>liwanp@linux.vnet.ibm.com</email>
</author>
<published>2013-03-22T22:04:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d00285884c0892bb1310df96bce6056e9ce9b9d9'/>
<id>urn:sha1:d00285884c0892bb1310df96bce6056e9ce9b9d9</id>
<content type='text'>
hugetlb_total_pages is used for overcommit calculations but the current
implementation considers only the default hugetlb page size (which is
either the first defined hugepage size or the one specified by
default_hugepagesz kernel boot parameter).

If the system is configured for more than one hugepage size, which is
possible since commit a137e1cc6d6e ("hugetlbfs: per mount huge page
sizes") then the overcommit estimation done by __vm_enough_memory()
(resp.  shown by meminfo_proc_show) is not precise - there is an
impression of more available/allowed memory.  This can lead to an
unexpected ENOMEM/EFAULT resp.  SIGSEGV when memory is accounted.

Testcase:
  boot: hugepagesz=1G hugepages=1
  the default overcommit ratio is 50
  before patch:

    egrep 'CommitLimit' /proc/meminfo
    CommitLimit:     55434168 kB

  after patch:

    egrep 'CommitLimit' /proc/meminfo
    CommitLimit:     54909880 kB

[akpm@linux-foundation.org: coding-style tweak]
Signed-off-by: Wanpeng Li &lt;liwanp@linux.vnet.ibm.com&gt;
Acked-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Cc: "Aneesh Kumar K.V" &lt;aneesh.kumar@linux.vnet.ibm.com&gt;
Cc: Hillf Danton &lt;dhillf@gmail.com&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;		[3.0+]
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/fremap.c: fix possible oops on error path</title>
<updated>2013-03-15T00:00:39Z</updated>
<author>
<name>Michel Lespinasse</name>
<email>walken@google.com</email>
</author>
<published>2013-03-14T23:50:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a2362d24764a4e9a3187fc46b14e1d2cd0657700'/>
<id>urn:sha1:a2362d24764a4e9a3187fc46b14e1d2cd0657700</id>
<content type='text'>
The vm_flags introduced in 6d7825b10dbe ("mm/fremap.c: fix oops on error
path") is supposed to avoid a compiler warning about unitialized
vm_flags without changing the generated code.

However I am concerned that this is going to be very brittle, and fail
with some compiler versions. The failure could be either of:

- compiler could actually load vma-&gt;vm_flags before checking for the
  !vma condition, thus reintroducing the oops

- compiler could optimize out the !vma check, since the pointer just got
  dereferenced shortly before (so the compiler knows it can't be NULL!)

I propose reversing this part of the change and initializing vm_flags to 0
just to avoid the bogus uninitialized use warning.

Signed-off-by: Michel Lespinasse &lt;walken@google.com&gt;
Cc: Tommi Rantala &lt;tt.rantala@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>
