<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/mm, branch v3.15.6</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.15.6</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.15.6'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2014-07-17T23:23:09Z</updated>
<entry>
<title>cpuset,mempolicy: fix sleeping function called from invalid context</title>
<updated>2014-07-17T23:23:09Z</updated>
<author>
<name>Gu Zheng</name>
<email>guz.fnst@cn.fujitsu.com</email>
</author>
<published>2014-06-25T01:57:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=55e604757f659afb5a7bbee3c35fae77fd147b87'/>
<id>urn:sha1:55e604757f659afb5a7bbee3c35fae77fd147b87</id>
<content type='text'>
commit 391acf970d21219a2a5446282d3b20eace0c0d7a upstream.

When runing with the kernel(3.15-rc7+), the follow bug occurs:
[ 9969.258987] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:586
[ 9969.359906] in_atomic(): 1, irqs_disabled(): 0, pid: 160655, name: python
[ 9969.441175] INFO: lockdep is turned off.
[ 9969.488184] CPU: 26 PID: 160655 Comm: python Tainted: G       A      3.15.0-rc7+ #85
[ 9969.581032] Hardware name: FUJITSU-SV PRIMEQUEST 1800E/SB, BIOS PRIMEQUEST 1000 Series BIOS Version 1.39 11/16/2012
[ 9969.706052]  ffffffff81a20e60 ffff8803e941fbd0 ffffffff8162f523 ffff8803e941fd18
[ 9969.795323]  ffff8803e941fbe0 ffffffff8109995a ffff8803e941fc58 ffffffff81633e6c
[ 9969.884710]  ffffffff811ba5dc ffff880405c6b480 ffff88041fdd90a0 0000000000002000
[ 9969.974071] Call Trace:
[ 9970.003403]  [&lt;ffffffff8162f523&gt;] dump_stack+0x4d/0x66
[ 9970.065074]  [&lt;ffffffff8109995a&gt;] __might_sleep+0xfa/0x130
[ 9970.130743]  [&lt;ffffffff81633e6c&gt;] mutex_lock_nested+0x3c/0x4f0
[ 9970.200638]  [&lt;ffffffff811ba5dc&gt;] ? kmem_cache_alloc+0x1bc/0x210
[ 9970.272610]  [&lt;ffffffff81105807&gt;] cpuset_mems_allowed+0x27/0x140
[ 9970.344584]  [&lt;ffffffff811b1303&gt;] ? __mpol_dup+0x63/0x150
[ 9970.409282]  [&lt;ffffffff811b1385&gt;] __mpol_dup+0xe5/0x150
[ 9970.471897]  [&lt;ffffffff811b1303&gt;] ? __mpol_dup+0x63/0x150
[ 9970.536585]  [&lt;ffffffff81068c86&gt;] ? copy_process.part.23+0x606/0x1d40
[ 9970.613763]  [&lt;ffffffff810bf28d&gt;] ? trace_hardirqs_on+0xd/0x10
[ 9970.683660]  [&lt;ffffffff810ddddf&gt;] ? monotonic_to_bootbased+0x2f/0x50
[ 9970.759795]  [&lt;ffffffff81068cf0&gt;] copy_process.part.23+0x670/0x1d40
[ 9970.834885]  [&lt;ffffffff8106a598&gt;] do_fork+0xd8/0x380
[ 9970.894375]  [&lt;ffffffff81110e4c&gt;] ? __audit_syscall_entry+0x9c/0xf0
[ 9970.969470]  [&lt;ffffffff8106a8c6&gt;] SyS_clone+0x16/0x20
[ 9971.030011]  [&lt;ffffffff81642009&gt;] stub_clone+0x69/0x90
[ 9971.091573]  [&lt;ffffffff81641c29&gt;] ? system_call_fastpath+0x16/0x1b

The cause is that cpuset_mems_allowed() try to take
mutex_lock(&amp;callback_mutex) under the rcu_read_lock(which was hold in
__mpol_dup()). And in cpuset_mems_allowed(), the access to cpuset is
under rcu_read_lock, so in __mpol_dup, we can reduce the rcu_read_lock
protection region to protect the access to cpuset only in
current_cpuset_is_being_rebound(). So that we can avoid this bug.

This patch is a temporary solution that just addresses the bug
mentioned above, can not fix the long-standing issue about cpuset.mems
rebinding on fork():

"When the forker's task_struct is duplicated (which includes
 -&gt;mems_allowed) and it races with an update to cpuset_being_rebound
 in update_tasks_nodemask() then the task's mems_allowed doesn't get
 updated. And the child task's mems_allowed can be wrong if the
 cpuset's nodemask changes before the child has been added to the
 cgroup's tasklist."

Signed-off-by: Gu Zheng &lt;guz.fnst@cn.fujitsu.com&gt;
Acked-by: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mm: fix crashes from mbind() merging vmas</title>
<updated>2014-07-09T18:21:32Z</updated>
<author>
<name>Hugh Dickins</name>
<email>hughd@google.com</email>
</author>
<published>2014-06-23T20:22:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c09f7a75080da636c3df74565c5a42308a0928d7'/>
<id>urn:sha1:c09f7a75080da636c3df74565c5a42308a0928d7</id>
<content type='text'>
commit d05f0cdcbe6388723f1900c549b4850360545201 upstream.

In v2.6.34 commit 9d8cebd4bcd7 ("mm: fix mbind vma merge problem")
introduced vma merging to mbind(), but it should have also changed the
convention of passing start vma from queue_pages_range() (formerly
check_range()) to new_vma_page(): vma merging may have already freed
that structure, resulting in BUG at mm/mempolicy.c:1738 and probably
worse crashes.

Fixes: 9d8cebd4bcd7 ("mm: fix mbind vma merge problem")
Reported-by: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Tested-by: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Signed-off-by: Hugh Dickins &lt;hughd@google.com&gt;
Acked-by: Christoph Lameter &lt;cl@linux.com&gt;
Cc: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;


</content>
</entry>
<entry>
<title>mm/numa: Remove BUG_ON() in __handle_mm_fault()</title>
<updated>2014-07-09T18:21:32Z</updated>
<author>
<name>Rik van Riel</name>
<email>riel@redhat.com</email>
</author>
<published>2014-04-29T19:36:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3bb0aa773f1918e0da5346e12aec05aaacbf2441'/>
<id>urn:sha1:3bb0aa773f1918e0da5346e12aec05aaacbf2441</id>
<content type='text'>
commit 107437febd495a50e2cd09c81bbaa84d30e57b07 upstream.

Changing PTEs and PMDs to pte_numa &amp; pmd_numa is done with the
mmap_sem held for reading, which means a pmd can be instantiated
and turned into a numa one while __handle_mm_fault() is examining
the value of old_pmd.

If that happens, __handle_mm_fault() should just return and let
the page fault retry, instead of throwing an oops. This is
handled by the test for pmd_trans_huge(*pmd) below.

Signed-off-by: Rik van Riel &lt;riel@redhat.com&gt;
Reviewed-by: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Reported-by: Sunil Pandey &lt;sunil.k.pandey@intel.com&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Mel Gorman &lt;mgorman@suse.de&gt;
Cc: linux-mm@kvack.org
Cc: lwoodman@redhat.com
Cc: dave.hansen@intel.com
Link: http://lkml.kernel.org/r/20140429153615.2d72098e@annuminas.surriel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Patrick McLean &lt;chutzpah@gentoo.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mm: page_alloc: fix CMA area initialisation when pageblock &gt; MAX_ORDER</title>
<updated>2014-07-09T18:21:30Z</updated>
<author>
<name>Michal Nazarewicz</name>
<email>mina86@mina86.com</email>
</author>
<published>2014-07-02T22:22:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8c9cf1d9f8e5aea42022db8a4789feafeb2be839'/>
<id>urn:sha1:8c9cf1d9f8e5aea42022db8a4789feafeb2be839</id>
<content type='text'>
commit dc78327c0ea7da5186d8cbc1647bd6088c5c9fa5 upstream.

With a kernel configured with ARM64_64K_PAGES &amp;&amp; !TRANSPARENT_HUGEPAGE,
the following is triggered at early boot:

  SMP: Total of 8 processors activated.
  devtmpfs: initialized
  Unable to handle kernel NULL pointer dereference at virtual address 00000008
  pgd = fffffe0000050000
  [00000008] *pgd=00000043fba00003, *pmd=00000043fba00003, *pte=00e0000078010407
  Internal error: Oops: 96000006 [#1] SMP
  Modules linked in:
  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.15.0-rc864k+ #44
  task: fffffe03bc040000 ti: fffffe03bc080000 task.ti: fffffe03bc080000
  PC is at __list_add+0x10/0xd4
  LR is at free_one_page+0x270/0x638
  ...
  Call trace:
    __list_add+0x10/0xd4
    free_one_page+0x26c/0x638
    __free_pages_ok.part.52+0x84/0xbc
    __free_pages+0x74/0xbc
    init_cma_reserved_pageblock+0xe8/0x104
    cma_init_reserved_areas+0x190/0x1e4
    do_one_initcall+0xc4/0x154
    kernel_init_freeable+0x204/0x2a8
    kernel_init+0xc/0xd4

This happens because init_cma_reserved_pageblock() calls
__free_one_page() with pageblock_order as page order but it is bigger
than MAX_ORDER.  This in turn causes accesses past zone-&gt;free_list[].

Fix the problem by changing init_cma_reserved_pageblock() such that it
splits pageblock into individual MAX_ORDER pages if pageblock is bigger
than a MAX_ORDER page.

In cases where !CONFIG_HUGETLB_PAGE_SIZE_VARIABLE, which is all
architectures expect for ia64, powerpc and tile at the moment, the
âpageblock_order &gt; MAX_ORDERâ condition will be optimised out since both
sides of the operator are constants.  In cases where pageblock size is
variable, the performance degradation should not be significant anyway
since init_cma_reserved_pageblock() is called only at boot time at most
MAX_CMA_AREAS times which by default is eight.

Signed-off-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Reported-by: Mark Salter &lt;msalter@redhat.com&gt;
Tested-by: Mark Salter &lt;msalter@redhat.com&gt;
Tested-by: Christopher Covington &lt;cov@codeaurora.org&gt;
Cc: Mel Gorman &lt;mgorman@suse.de&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mm, pcp: allow restoring percpu_pagelist_fraction default</title>
<updated>2014-07-09T18:21:28Z</updated>
<author>
<name>David Rientjes</name>
<email>rientjes@google.com</email>
</author>
<published>2014-06-23T20:22:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7c5c66f2d1406aa6f28f5de68970ae41907f4dca'/>
<id>urn:sha1:7c5c66f2d1406aa6f28f5de68970ae41907f4dca</id>
<content type='text'>
commit 7cd2b0a34ab8e4db971920eef8982f985441adfb upstream.

Oleg reports a division by zero error on zero-length write() to the
percpu_pagelist_fraction sysctl:

    divide error: 0000 [#1] SMP DEBUG_PAGEALLOC
    CPU: 1 PID: 9142 Comm: badarea_io Not tainted 3.15.0-rc2-vm-nfs+ #19
    Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    task: ffff8800d5aeb6e0 ti: ffff8800d87a2000 task.ti: ffff8800d87a2000
    RIP: 0010: percpu_pagelist_fraction_sysctl_handler+0x84/0x120
    RSP: 0018:ffff8800d87a3e78  EFLAGS: 00010246
    RAX: 0000000000000f89 RBX: ffff88011f7fd000 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000010
    RBP: ffff8800d87a3e98 R08: ffffffff81d002c8 R09: ffff8800d87a3f50
    R10: 000000000000000b R11: 0000000000000246 R12: 0000000000000060
    R13: ffffffff81c3c3e0 R14: ffffffff81cfddf8 R15: ffff8801193b0800
    FS:  00007f614f1e9740(0000) GS:ffff88011f440000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 00007f614f1fa000 CR3: 00000000d9291000 CR4: 00000000000006e0
    Call Trace:
      proc_sys_call_handler+0xb3/0xc0
      proc_sys_write+0x14/0x20
      vfs_write+0xba/0x1e0
      SyS_write+0x46/0xb0
      tracesys+0xe1/0xe6

However, if the percpu_pagelist_fraction sysctl is set by the user, it
is also impossible to restore it to the kernel default since the user
cannot write 0 to the sysctl.

This patch allows the user to write 0 to restore the default behavior.
It still requires a fraction equal to or larger than 8, however, as
stated by the documentation for sanity.  If a value in the range [1, 7]
is written, the sysctl will return EINVAL.

This successfully solves the divide by zero issue at the same time.

Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
Reported-by: Oleg Drokin &lt;green@linuxhacker.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>hugetlb: fix copy_hugetlb_page_range() to handle migration/hwpoisoned entry</title>
<updated>2014-07-09T18:21:28Z</updated>
<author>
<name>Naoya Horiguchi</name>
<email>n-horiguchi@ah.jp.nec.com</email>
</author>
<published>2014-06-23T20:22:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fafacf16ffa48065f69657fe036a2ebfb25edbde'/>
<id>urn:sha1:fafacf16ffa48065f69657fe036a2ebfb25edbde</id>
<content type='text'>
commit 4a705fef986231a3e7a6b1a6d3c37025f021f49f upstream.

There's a race between fork() and hugepage migration, as a result we try
to "dereference" a swap entry as a normal pte, causing kernel panic.
The cause of the problem is that copy_hugetlb_page_range() can't handle
"swap entry" family (migration entry and hwpoisoned entry) so let's fix
it.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Acked-by: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mm: nommu: per-thread vma cache fix</title>
<updated>2014-07-09T18:21:28Z</updated>
<author>
<name>Steven Miao</name>
<email>realmz6@gmail.com</email>
</author>
<published>2014-06-23T20:22:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e50eba3c09f636933ad01ad8e51f7d6d88890b88'/>
<id>urn:sha1:e50eba3c09f636933ad01ad8e51f7d6d88890b88</id>
<content type='text'>
commit e020d5bd8a730757b565b18d620240f71c3e21fe upstream.

mm could be removed from current task struct, using previous vma-&gt;vm_mm

It will crash on blackfin after updated to Linux 3.15.  The commit "mm:
per-thread vma caching" caused the crash.  mm could be removed from
current task struct before

  mmput()-&gt;
    exit_mmap()-&gt;
      delete_vma_from_mm()

the detailed fault information:

    NULL pointer access
    Kernel OOPS in progress
    Deferred Exception context
    CURRENT PROCESS:
    COMM=modprobe PID=278  CPU=0
    invalid mm
    return address: [0x000531de]; contents of:
    0x000531b0:  c727  acea  0c42  181d  0000  0000  0000  a0a8
    0x000531c0:  b090  acaa  0c42  1806  0000  0000  0000  a0e8
    0x000531d0:  b0d0  e801  0000  05b3  0010  e522  0046 [a090]
    0x000531e0:  6408  b090  0c00  17cc  3042  e3ff  f37b  2fc8

    CPU: 0 PID: 278 Comm: modprobe Not tainted 3.15.0-ADI-2014R1-pre-00345-gea9f446 #25
    task: 0572b720 ti: 0569e000 task.ti: 0569e000
    Compiled for cpu family 0x27fe (Rev 0), but running on:0x0000 (Rev 0)
    ADSP-BF609-0.0 500(MHz CCLK) 125(MHz SCLK) (mpu off)
    Linux version 3.15.0-ADI-2014R1-pre-00345-gea9f446 (steven@steven-OptiPlex-390) (gcc version 4.3.5 (ADI-trunk/svn-5962) ) #25 Tue Jun 10 17:47:46 CST 2014

    SEQUENCER STATUS:		Not tainted
     SEQSTAT: 00000027  IPEND: 8008  IMASK: ffff  SYSCFG: 2806
      EXCAUSE   : 0x27
      physical IVG3 asserted : &lt;0xffa00744&gt; { _trap + 0x0 }
      physical IVG15 asserted : &lt;0xffa00d68&gt; { _evt_system_call + 0x0 }
      logical irq   6 mapped  : &lt;0xffa003bc&gt; { _bfin_coretmr_interrupt + 0x0 }
      logical irq   7 mapped  : &lt;0x00008828&gt; { _bfin_fault_routine + 0x0 }
      logical irq  11 mapped  : &lt;0x00007724&gt; { _l2_ecc_err + 0x0 }
      logical irq  13 mapped  : &lt;0x00008828&gt; { _bfin_fault_routine + 0x0 }
      logical irq  39 mapped  : &lt;0x00150788&gt; { _bfin_twi_interrupt_entry + 0x0 }
      logical irq  40 mapped  : &lt;0x00150788&gt; { _bfin_twi_interrupt_entry + 0x0 }
     RETE: &lt;0x00000000&gt; /* Maybe null pointer? */
     RETN: &lt;0x0569fe50&gt; /* kernel dynamic memory (maybe user-space) */
     RETX: &lt;0x00000480&gt; /* Maybe fixed code section */
     RETS: &lt;0x00053384&gt; { _exit_mmap + 0x28 }
     PC  : &lt;0x000531de&gt; { _delete_vma_from_mm + 0x92 }
    DCPLB_FAULT_ADDR: &lt;0x00000008&gt; /* Maybe null pointer? */
    ICPLB_FAULT_ADDR: &lt;0x000531de&gt; { _delete_vma_from_mm + 0x92 }
    PROCESSOR STATE:
     R0 : 00000004    R1 : 0569e000    R2 : 00bf3db4    R3 : 00000000
     R4 : 057f9800    R5 : 00000001    R6 : 0569ddd0    R7 : 0572b720
     P0 : 0572b854    P1 : 00000004    P2 : 00000000    P3 : 0569dda0
     P4 : 0572b720    P5 : 0566c368    FP : 0569fe5c    SP : 0569fd74
     LB0: 057f523f    LT0: 057f523e    LC0: 00000000
     LB1: 0005317c    LT1: 00053172    LC1: 00000002
     B0 : 00000000    L0 : 00000000    M0 : 0566f5bc    I0 : 00000000
     B1 : 00000000    L1 : 00000000    M1 : 00000000    I1 : ffffffff
     B2 : 00000001    L2 : 00000000    M2 : 00000000    I2 : 00000000
     B3 : 00000000    L3 : 00000000    M3 : 00000000    I3 : 057f8000
    A0.w: 00000000   A0.x: 00000000   A1.w: 00000000   A1.x: 00000000
    USP : 056ffcf8  ASTAT: 02003024

    Hardware Trace:
       0 Target : &lt;0x00003fb8&gt; { _trap_c + 0x0 }
         Source : &lt;0xffa006d8&gt; { _exception_to_level5 + 0xa0 } JUMP.L
       1 Target : &lt;0xffa00638&gt; { _exception_to_level5 + 0x0 }
         Source : &lt;0xffa004f2&gt; { _bfin_return_from_exception + 0x6 } RTX
       2 Target : &lt;0xffa004ec&gt; { _bfin_return_from_exception + 0x0 }
         Source : &lt;0xffa00590&gt; { _ex_trap_c + 0x70 } JUMP.S
       3 Target : &lt;0xffa00520&gt; { _ex_trap_c + 0x0 }
         Source : &lt;0xffa0076e&gt; { _trap + 0x2a } JUMP (P4)
       4 Target : &lt;0xffa00744&gt; { _trap + 0x0 }
          FAULT : &lt;0x000531de&gt; { _delete_vma_from_mm + 0x92 } P0 = W[P2 + 2]
         Source : &lt;0x000531da&gt; { _delete_vma_from_mm + 0x8e } P2 = [P4 + 0x18]
       5 Target : &lt;0x000531da&gt; { _delete_vma_from_mm + 0x8e }
         Source : &lt;0x00053176&gt; { _delete_vma_from_mm + 0x2a } IF CC JUMP pcrel
       6 Target : &lt;0x0005314c&gt; { _delete_vma_from_mm + 0x0 }
         Source : &lt;0x00053380&gt; { _exit_mmap + 0x24 } JUMP.L
       7 Target : &lt;0x00053378&gt; { _exit_mmap + 0x1c }
         Source : &lt;0x00053394&gt; { _exit_mmap + 0x38 } IF !CC JUMP pcrel (BP)
       8 Target : &lt;0x00053390&gt; { _exit_mmap + 0x34 }
         Source : &lt;0xffa020e0&gt; { __cond_resched + 0x20 } RTS
       9 Target : &lt;0xffa020c0&gt; { __cond_resched + 0x0 }
         Source : &lt;0x0005338c&gt; { _exit_mmap + 0x30 } JUMP.L
      10 Target : &lt;0x0005338c&gt; { _exit_mmap + 0x30 }
         Source : &lt;0x0005333a&gt; { _delete_vma + 0xb2 } RTS
      11 Target : &lt;0x00053334&gt; { _delete_vma + 0xac }
         Source : &lt;0x0005507a&gt; { _kmem_cache_free + 0xba } RTS
      12 Target : &lt;0x00055068&gt; { _kmem_cache_free + 0xa8 }
         Source : &lt;0x0005505e&gt; { _kmem_cache_free + 0x9e } IF !CC JUMP pcrel (BP)
      13 Target : &lt;0x00055052&gt; { _kmem_cache_free + 0x92 }
         Source : &lt;0x0005501a&gt; { _kmem_cache_free + 0x5a } IF CC JUMP pcrel
      14 Target : &lt;0x00054ff4&gt; { _kmem_cache_free + 0x34 }
         Source : &lt;0x00054fce&gt; { _kmem_cache_free + 0xe } IF CC JUMP pcrel (BP)
      15 Target : &lt;0x00054fc0&gt; { _kmem_cache_free + 0x0 }
         Source : &lt;0x00053330&gt; { _delete_vma + 0xa8 } JUMP.L
    Kernel Stack
    Stack info:
     SP: [0x0569ff24] &lt;0x0569ff24&gt; /* kernel dynamic memory (maybe user-space) */
     Memory from 0x0569ff20 to 056a0000
    0569ff20: 00000001 [04e8da5a] 00008000  00000000  00000000  056a0000  04e8da5a  04e8da5a
    0569ff40: 04eb9eea  ffa00dce  02003025  04ea09c5  057f523f  04ea09c4  057f523e  00000000
    0569ff60: 00000000  00000000  00000000  00000000  00000000  00000000  00000001  00000000
    0569ff80: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000
    0569ffa0: 0566f5bc  057f8000  057f8000  00000001  04ec0170  056ffcf8  056ffd04  057f9800
    0569ffc0: 04d1d498  057f9800  057f8fe4  057f8ef0  00000001  057f928c  00000001  00000001
    0569ffe0: 057f9800  00000000  00000008  00000007  00000001  00000001  00000001 &lt;00002806&gt;
    Return addresses in stack:
        address : &lt;0x00002806&gt; { _show_cpuinfo + 0x2d2 }
    Modules linked in:
    Kernel panic - not syncing: Kernel exception
    [ end Kernel panic - not syncing: Kernel exception

Signed-off-by: Steven Miao &lt;realmz6@gmail.com&gt;
Acked-by: Davidlohr Bueso &lt;davidlohr@hp.com&gt;
Reviewed-by: Rik van Riel &lt;riel@redhat.com&gt;
Acked-by: 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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: fix data integrity sync in ordered mode</title>
<updated>2014-07-01T03:13:56Z</updated>
<author>
<name>Namjae Jeon</name>
<email>namjae.jeon@samsung.com</email>
</author>
<published>2014-05-12T12:12:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ba6eb3c3ac56bf4097820f7f54ea562b5c5e018d'/>
<id>urn:sha1:ba6eb3c3ac56bf4097820f7f54ea562b5c5e018d</id>
<content type='text'>
commit 1c8349a17137b93f0a83f276c764a6df1b9a116e upstream.

When we perform a data integrity sync we tag all the dirty pages with
PAGECACHE_TAG_TOWRITE at start of ext4_da_writepages.  Later we check
for this tag in write_cache_pages_da and creates a struct
mpage_da_data containing contiguously indexed pages tagged with this
tag and sync these pages with a call to mpage_da_map_and_submit.  This
process is done in while loop until all the PAGECACHE_TAG_TOWRITE
pages are synced. We also do journal start and stop in each iteration.
journal_stop could initiate journal commit which would call
ext4_writepage which in turn will call ext4_bio_write_page even for
delayed OR unwritten buffers. When ext4_bio_write_page is called for
such buffers, even though it does not sync them but it clears the
PAGECACHE_TAG_TOWRITE of the corresponding page and hence these pages
are also not synced by the currently running data integrity sync. We
will end up with dirty pages although sync is completed.

This could cause a potential data loss when the sync call is followed
by a truncate_pagecache call, which is exactly the case in
collapse_range.  (It will cause generic/127 failure in xfstests)

To avoid this issue, we can use set_page_writeback_keepwrite instead of
set_page_writeback, which doesn't clear TOWRITE tag.

Signed-off-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Ashish Sangwan &lt;a.sangwan@samsung.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mm: vmscan: clear kswapd's special reclaim powers before exiting</title>
<updated>2014-07-01T03:13:55Z</updated>
<author>
<name>Johannes Weiner</name>
<email>hannes@cmpxchg.org</email>
</author>
<published>2014-06-06T21:35:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0077982f8d0fa1f0f32ef5909e28bca0784c34e7'/>
<id>urn:sha1:0077982f8d0fa1f0f32ef5909e28bca0784c34e7</id>
<content type='text'>
commit 71abdc15adf8c702a1dd535f8e30df50758848d2 upstream.

When kswapd exits, it can end up taking locks that were previously held
by allocating tasks while they waited for reclaim.  Lockdep currently
warns about this:

On Wed, May 28, 2014 at 06:06:34PM +0800, Gu Zheng wrote:
&gt;  inconsistent {RECLAIM_FS-ON-W} -&gt; {IN-RECLAIM_FS-R} usage.
&gt;  kswapd2/1151 [HC0[0]:SC0[0]:HE1:SE1] takes:
&gt;   (&amp;sig-&gt;group_rwsem){+++++?}, at: exit_signals+0x24/0x130
&gt;  {RECLAIM_FS-ON-W} state was registered at:
&gt;     mark_held_locks+0xb9/0x140
&gt;     lockdep_trace_alloc+0x7a/0xe0
&gt;     kmem_cache_alloc_trace+0x37/0x240
&gt;     flex_array_alloc+0x99/0x1a0
&gt;     cgroup_attach_task+0x63/0x430
&gt;     attach_task_by_pid+0x210/0x280
&gt;     cgroup_procs_write+0x16/0x20
&gt;     cgroup_file_write+0x120/0x2c0
&gt;     vfs_write+0xc0/0x1f0
&gt;     SyS_write+0x4c/0xa0
&gt;     tracesys+0xdd/0xe2
&gt;  irq event stamp: 49
&gt;  hardirqs last  enabled at (49):  _raw_spin_unlock_irqrestore+0x36/0x70
&gt;  hardirqs last disabled at (48):  _raw_spin_lock_irqsave+0x2b/0xa0
&gt;  softirqs last  enabled at (0):  copy_process.part.24+0x627/0x15f0
&gt;  softirqs last disabled at (0):            (null)
&gt;
&gt;  other info that might help us debug this:
&gt;   Possible unsafe locking scenario:
&gt;
&gt;         CPU0
&gt;         ----
&gt;    lock(&amp;sig-&gt;group_rwsem);
&gt;    &lt;Interrupt&gt;
&gt;      lock(&amp;sig-&gt;group_rwsem);
&gt;
&gt;   *** DEADLOCK ***
&gt;
&gt;  no locks held by kswapd2/1151.
&gt;
&gt;  stack backtrace:
&gt;  CPU: 30 PID: 1151 Comm: kswapd2 Not tainted 3.10.39+ #4
&gt;  Call Trace:
&gt;    dump_stack+0x19/0x1b
&gt;    print_usage_bug+0x1f7/0x208
&gt;    mark_lock+0x21d/0x2a0
&gt;    __lock_acquire+0x52a/0xb60
&gt;    lock_acquire+0xa2/0x140
&gt;    down_read+0x51/0xa0
&gt;    exit_signals+0x24/0x130
&gt;    do_exit+0xb5/0xa50
&gt;    kthread+0xdb/0x100
&gt;    ret_from_fork+0x7c/0xb0

This is because the kswapd thread is still marked as a reclaimer at the
time of exit.  But because it is exiting, nobody is actually waiting on
it to make reclaim progress anymore, and it's nothing but a regular
thread at this point.  Be tidy and strip it of all its powers
(PF_MEMALLOC, PF_SWAPWRITE, PF_KSWAPD, and the lockdep reclaim state)
before returning from the thread function.

Signed-off-by: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Reported-by: Gu Zheng &lt;guz.fnst@cn.fujitsu.com&gt;
Cc: Yasuaki Ishimatsu &lt;isimatu.yasuaki@jp.fujitsu.com&gt;
Cc: Tang Chen &lt;tangchen@cn.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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mm: fix sleeping function warning from __put_anon_vma</title>
<updated>2014-07-01T03:13:55Z</updated>
<author>
<name>Hugh Dickins</name>
<email>hughd@google.com</email>
</author>
<published>2014-06-04T23:05:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=693b69e663ce0a9f0b8af7e16498092d62f1031a'/>
<id>urn:sha1:693b69e663ce0a9f0b8af7e16498092d62f1031a</id>
<content type='text'>
commit 7f39dda9d86fb4f4f17af0de170decf125726f8c upstream.

Trinity reports BUG:

  sleeping function called from invalid context at kernel/locking/rwsem.c:47
  in_atomic(): 0, irqs_disabled(): 0, pid: 5787, name: trinity-c27

__might_sleep &lt; down_write &lt; __put_anon_vma &lt; page_get_anon_vma &lt;
migrate_pages &lt; compact_zone &lt; compact_zone_order &lt; try_to_compact_pages ..

Right, since conversion to mutex then rwsem, we should not put_anon_vma()
from inside an rcu_read_lock()ed section: fix the two places that did so.
And add might_sleep() to anon_vma_free(), as suggested by Peter Zijlstra.

Fixes: 88c22088bf23 ("mm: optimize page_lock_anon_vma() fast-path")
Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
