<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/mm/mremap.c, branch linux-4.6.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.6.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.6.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-03-17T22:09:34Z</updated>
<entry>
<title>mm: cleanup *pte_alloc* interfaces</title>
<updated>2016-03-17T22:09:34Z</updated>
<author>
<name>Kirill A. Shutemov</name>
</author>
<published>2016-03-17T21:19:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ed3a4f0ddffece942bb2661924d87be4ce63cb7'/>
<id>urn:sha1:3ed3a4f0ddffece942bb2661924d87be4ce63cb7</id>
<content type='text'>
There are few things about *pte_alloc*() helpers worth cleaning up:

 - 'vma' argument is unused, let's drop it;

 - most __pte_alloc() callers do speculative check for pmd_none(),
   before taking ptl: let's introduce pte_alloc() macro which does
   the check.

   The only direct user of __pte_alloc left is userfaultfd, which has
   different expectation about atomicity wrt pmd.

 - pte_alloc_map() and pte_alloc_map_lock() are redefined using
   pte_alloc().

[sudeep.holla@arm.com: fix build for arm64 hugetlbpage]
[sfr@canb.auug.org.au: fix arch/arm/mm/mmu.c some more]
Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Signed-off-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Acked-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Signed-off-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&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: move max_map_count bits into mm.h</title>
<updated>2016-03-17T22:09:34Z</updated>
<author>
<name>Andrey Ryabinin</name>
</author>
<published>2016-03-17T21:18:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ea606cf5d8df370e7932460dfd960b21f20e7c6d'/>
<id>urn:sha1:ea606cf5d8df370e7932460dfd960b21f20e7c6d</id>
<content type='text'>
max_map_count sysctl unrelated to scheduler. Move its bits from
include/linux/sched/sysctl.h to include/linux/mm.h.

Signed-off-by: Andrey Ryabinin &lt;aryabinin@virtuozzo.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, dax: check for pmd_none() after split_huge_pmd()</title>
<updated>2016-02-12T02:35:48Z</updated>
<author>
<name>Kirill A. Shutemov</name>
</author>
<published>2016-02-12T00:13:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6b9116a652bd9e0e2994505cfaaa5f66deaa2a05'/>
<id>urn:sha1:6b9116a652bd9e0e2994505cfaaa5f66deaa2a05</id>
<content type='text'>
DAX implements split_huge_pmd() by clearing pmd.  This simple approach
reduces memory overhead, as we don't need to deposit page table on huge
page mapping to make split_huge_pmd() never-fail.  PTE table can be
allocated and populated later on page fault from backing store.

But one side effect is that have to check if pmd is pmd_none() after
split_huge_pmd().  In most places we do this already to deal with
parallel MADV_DONTNEED.

But I found two call sites which is not affected by MADV_DONTNEED (due
down_write(mmap_sem)), but need to have the check to work with DAX
properly.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Matthew Wilcox &lt;willy@linux.intel.com&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Ross Zwisler &lt;ross.zwisler@linux.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>mm, thp: remove infrastructure for handling splitting PMDs</title>
<updated>2016-01-16T01:56:32Z</updated>
<author>
<name>Kirill A. Shutemov</name>
</author>
<published>2016-01-16T00:53:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4b471e8898c3d0f5c97a3c73ac32d0549fe01c87'/>
<id>urn:sha1:4b471e8898c3d0f5c97a3c73ac32d0549fe01c87</id>
<content type='text'>
With new refcounting we don't need to mark PMDs splitting.  Let's drop
code to handle this.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Tested-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Tested-by: Aneesh Kumar K.V &lt;aneesh.kumar@linux.vnet.ibm.com&gt;
Acked-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Acked-by: Jerome Marchand &lt;jmarchan@redhat.com&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Mel Gorman &lt;mgorman@suse.de&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Cc: Steve Capper &lt;steve.capper@linaro.org&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Michal Hocko &lt;mhocko@suse.cz&gt;
Cc: Christoph Lameter &lt;cl@linux.com&gt;
Cc: David Rientjes &lt;rientjes@google.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>thp: rename split_huge_page_pmd() to split_huge_pmd()</title>
<updated>2016-01-16T01:56:32Z</updated>
<author>
<name>Kirill A. Shutemov</name>
</author>
<published>2016-01-16T00:52:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=78ddc53473419073ffb2e91178001e87bc513524'/>
<id>urn:sha1:78ddc53473419073ffb2e91178001e87bc513524</id>
<content type='text'>
We are going to decouple splitting THP PMD from splitting underlying
compound page.

This patch renames split_huge_page_pmd*() functions to split_huge_pmd*()
to reflect the fact that it doesn't imply page splitting, only PMD.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Tested-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Tested-by: Aneesh Kumar K.V &lt;aneesh.kumar@linux.vnet.ibm.com&gt;
Acked-by: Jerome Marchand &lt;jmarchan@redhat.com&gt;
Acked-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Mel Gorman &lt;mgorman@suse.de&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Cc: Steve Capper &lt;steve.capper@linaro.org&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Michal Hocko &lt;mhocko@suse.cz&gt;
Cc: Christoph Lameter &lt;cl@linux.com&gt;
Cc: David Rientjes &lt;rientjes@google.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: rework virtual memory accounting</title>
<updated>2016-01-15T00:00:49Z</updated>
<author>
<name>Konstantin Khlebnikov</name>
</author>
<published>2016-01-14T23:22:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84638335900f1995495838fe1bd4870c43ec1f67'/>
<id>urn:sha1:84638335900f1995495838fe1bd4870c43ec1f67</id>
<content type='text'>
When inspecting a vague code inside prctl(PR_SET_MM_MEM) call (which
testing the RLIMIT_DATA value to figure out if we're allowed to assign
new @start_brk, @brk, @start_data, @end_data from mm_struct) it's been
commited that RLIMIT_DATA in a form it's implemented now doesn't do
anything useful because most of user-space libraries use mmap() syscall
for dynamic memory allocations.

Linus suggested to convert RLIMIT_DATA rlimit into something suitable
for anonymous memory accounting.  But in this patch we go further, and
the changes are bundled together as:

 * keep vma counting if CONFIG_PROC_FS=n, will be used for limits
 * replace mm-&gt;shared_vm with better defined mm-&gt;data_vm
 * account anonymous executable areas as executable
 * account file-backed growsdown/up areas as stack
 * drop struct file* argument from vm_stat_account
 * enforce RLIMIT_DATA for size of data areas

This way code looks cleaner: now code/stack/data classification depends
only on vm_flags state:

 VM_EXEC &amp; ~VM_WRITE            -&gt; code  (VmExe + VmLib in proc)
 VM_GROWSUP | VM_GROWSDOWN      -&gt; stack (VmStk)
 VM_WRITE &amp; ~VM_SHARED &amp; !stack -&gt; data  (VmData)

The rest (VmSize - VmData - VmStk - VmExe - VmLib) could be called
"shared", but that might be strange beast like readonly-private or VM_IO
area.

 - RLIMIT_AS            limits whole address space "VmSize"
 - RLIMIT_STACK         limits stack "VmStk" (but each vma individually)
 - RLIMIT_DATA          now limits "VmData"

Signed-off-by: Konstantin Khlebnikov &lt;koct9i@gmail.com&gt;
Signed-off-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt;
Cc: Quentin Casasnovas &lt;quentin.casasnovas@oracle.com&gt;
Cc: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Willy Tarreau &lt;w@1wt.eu&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Kees Cook &lt;keescook@google.com&gt;
Cc: Vladimir Davydov &lt;vdavydov@virtuozzo.com&gt;
Cc: Pavel Emelyanov &lt;xemul@virtuozzo.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&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>x86/mm/pat: Add untrack_pfn_moved for mremap</title>
<updated>2016-01-05T10:10:05Z</updated>
<author>
<name>Toshi Kani</name>
</author>
<published>2015-12-23T00:54:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9fe4fab11976e56b2e992980bf6ce948bdf02ac'/>
<id>urn:sha1:d9fe4fab11976e56b2e992980bf6ce948bdf02ac</id>
<content type='text'>
mremap() with MREMAP_FIXED on a VM_PFNMAP range causes the following
WARN_ON_ONCE() message in untrack_pfn().

  WARNING: CPU: 1 PID: 3493 at arch/x86/mm/pat.c:985 untrack_pfn+0xbd/0xd0()
  Call Trace:
  [&lt;ffffffff817729ea&gt;] dump_stack+0x45/0x57
  [&lt;ffffffff8109e4b6&gt;] warn_slowpath_common+0x86/0xc0
  [&lt;ffffffff8109e5ea&gt;] warn_slowpath_null+0x1a/0x20
  [&lt;ffffffff8106a88d&gt;] untrack_pfn+0xbd/0xd0
  [&lt;ffffffff811d2d5e&gt;] unmap_single_vma+0x80e/0x860
  [&lt;ffffffff811d3725&gt;] unmap_vmas+0x55/0xb0
  [&lt;ffffffff811d916c&gt;] unmap_region+0xac/0x120
  [&lt;ffffffff811db86a&gt;] do_munmap+0x28a/0x460
  [&lt;ffffffff811dec33&gt;] move_vma+0x1b3/0x2e0
  [&lt;ffffffff811df113&gt;] SyS_mremap+0x3b3/0x510
  [&lt;ffffffff817793ee&gt;] entry_SYSCALL_64_fastpath+0x12/0x71

MREMAP_FIXED moves a pfnmap from old vma to new vma.  untrack_pfn() is
called with the old vma after its pfnmap page table has been removed,
which causes follow_phys() to fail.  The new vma has a new pfnmap to
the same pfn &amp; cache type with VM_PAT set.  Therefore, we only need to
clear VM_PAT from the old vma in this case.

Add untrack_pfn_moved(), which clears VM_PAT from a given old vma.
move_vma() is changed to call this function with the old vma when
VM_PFNMAP is set.  move_vma() then calls do_munmap(), and untrack_pfn()
is a no-op since VM_PAT is cleared.

Reported-by: Stas Sergeev &lt;stsp@list.ru&gt;
Signed-off-by: Toshi Kani &lt;toshi.kani@hpe.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/1450832064-10093-2-git-send-email-toshi.kani@hpe.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>mm/mremap: use offset_in_page macro</title>
<updated>2015-11-06T03:34:48Z</updated>
<author>
<name>Alexander Kuleshov</name>
</author>
<published>2015-11-06T02:46:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f19cb115a25f3f25752fdc56340e7433462157ba'/>
<id>urn:sha1:f19cb115a25f3f25752fdc56340e7433462157ba</id>
<content type='text'>
linux/mm.h provides offset_in_page() macro.  Let's use already predefined
macro instead of (addr &amp; ~PAGE_MASK).

Signed-off-by: Alexander Kuleshov &lt;kuleshovmail@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>mremap: simplify the "overlap" check in mremap_to()</title>
<updated>2015-09-04T23:54:41Z</updated>
<author>
<name>Oleg Nesterov</name>
</author>
<published>2015-09-04T22:48:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9943242ca468149c4ce30d4633524c0866d4a87b'/>
<id>urn:sha1:9943242ca468149c4ce30d4633524c0866d4a87b</id>
<content type='text'>
Minor, but this check is overcomplicated.  Two half-intervals do NOT
overlap if END1 &lt;= START2 || END2 &lt;= START1, mremap_to() just needs to
negate this check.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Cc: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Cc: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Laurent Dufour &lt;ldufour@linux.vnet.ibm.com&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.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>mremap: don't do uneccesary checks if new_len == old_len</title>
<updated>2015-09-04T23:54:41Z</updated>
<author>
<name>Oleg Nesterov</name>
</author>
<published>2015-09-04T22:48:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1d3916869798755968b3cd764ab21f2bb86ffff7'/>
<id>urn:sha1:1d3916869798755968b3cd764ab21f2bb86ffff7</id>
<content type='text'>
The "new_len &gt; old_len" branch in vma_to_resize() looks very confusing.
It only covers the VM_DONTEXPAND/pgoff checks but everything below is
equally unneeded if new_len == old_len.

Change this code to return if "new_len == old_len", new_len &lt; old_len is
not possible, otherwise the code below is wrong anyway.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Cc: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Cc: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Laurent Dufour &lt;ldufour@linux.vnet.ibm.com&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.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>
