<feed xmlns='http://www.w3.org/2005/Atom'>
<title>litmus-rt.git/mm, branch linux-tip</title>
<subtitle>The LITMUS^RT kernel.</subtitle>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/'/>
<entry>
<title>Merge branch 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6</title>
<updated>2010-12-06T00:45:02+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-12-06T00:45:02+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=771f8bc71c31c6bd103cdec283012253f352ab1c'/>
<id>771f8bc71c31c6bd103cdec283012253f352ab1c</id>
<content type='text'>
* 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
  slub: Fix a crash during slabinfo -v
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
  slub: Fix a crash during slabinfo -v
</pre>
</div>
</content>
</entry>
<entry>
<title>slub: Fix a crash during slabinfo -v</title>
<updated>2010-12-04T07:53:49+00:00</updated>
<author>
<name>Tero Roponen</name>
<email>tero.roponen@gmail.com</email>
</author>
<published>2010-12-01T18:04:20+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=37d57443d5d810c6ef49e93586b046e7d4774818'/>
<id>37d57443d5d810c6ef49e93586b046e7d4774818</id>
<content type='text'>
Commit f7cb1933621bce66a77f690776a16fe3ebbc4d58 ("SLUB: Pass active
and inactive redzone flags instead of boolean to debug functions")
missed two instances of check_object(). This caused a lot of warnings
during 'slabinfo -v' finally leading to a crash:

  BUG ext4_xattr: Freepointer corrupt
  ...
  BUG buffer_head: Freepointer corrupt
  ...
  BUG ext4_alloc_context: Freepointer corrupt
  ...
  ...
  BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
  IP: [&lt;ffffffff810a291f&gt;] file_sb_list_del+0x1c/0x35
  PGD 79d78067 PUD 79e67067 PMD 0
  Oops: 0002 [#1] SMP
  last sysfs file: /sys/kernel/slab/:t-0000192/validate

This patch fixes the problem by converting the two missed instances.

Acked-by: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Tero Roponen &lt;tero.roponen@gmail.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit f7cb1933621bce66a77f690776a16fe3ebbc4d58 ("SLUB: Pass active
and inactive redzone flags instead of boolean to debug functions")
missed two instances of check_object(). This caused a lot of warnings
during 'slabinfo -v' finally leading to a crash:

  BUG ext4_xattr: Freepointer corrupt
  ...
  BUG buffer_head: Freepointer corrupt
  ...
  BUG ext4_alloc_context: Freepointer corrupt
  ...
  ...
  BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
  IP: [&lt;ffffffff810a291f&gt;] file_sb_list_del+0x1c/0x35
  PGD 79d78067 PUD 79e67067 PMD 0
  Oops: 0002 [#1] SMP
  last sysfs file: /sys/kernel/slab/:t-0000192/validate

This patch fixes the problem by converting the two missed instances.

Acked-by: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Tero Roponen &lt;tero.roponen@gmail.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ksm: annotate ksm_thread_mutex is no deadlock source</title>
<updated>2010-12-02T22:51:15+00:00</updated>
<author>
<name>KOSAKI Motohiro</name>
<email>kosaki.motohiro@jp.fujitsu.com</email>
</author>
<published>2010-12-02T22:31:20+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=a0b0f58cdd32ab363a600a294ddaa90f0c32de8c'/>
<id>a0b0f58cdd32ab363a600a294ddaa90f0c32de8c</id>
<content type='text'>
commit 62b61f611e ("ksm: memory hotremove migration only") caused the
following new lockdep warning.

  =======================================================
  [ INFO: possible circular locking dependency detected ]
  -------------------------------------------------------
  bash/1621 is trying to acquire lock:
   ((memory_chain).rwsem){.+.+.+}, at: [&lt;ffffffff81079339&gt;]
  __blocking_notifier_call_chain+0x69/0xc0

  but task is already holding lock:
   (ksm_thread_mutex){+.+.+.}, at: [&lt;ffffffff8113a3aa&gt;]
  ksm_memory_callback+0x3a/0xc0

  which lock already depends on the new lock.

  the existing dependency chain (in reverse order) is:

  -&gt; #1 (ksm_thread_mutex){+.+.+.}:
       [&lt;ffffffff8108b70a&gt;] lock_acquire+0xaa/0x140
       [&lt;ffffffff81505d74&gt;] __mutex_lock_common+0x44/0x3f0
       [&lt;ffffffff81506228&gt;] mutex_lock_nested+0x48/0x60
       [&lt;ffffffff8113a3aa&gt;] ksm_memory_callback+0x3a/0xc0
       [&lt;ffffffff8150c21c&gt;] notifier_call_chain+0x8c/0xe0
       [&lt;ffffffff8107934e&gt;] __blocking_notifier_call_chain+0x7e/0xc0
       [&lt;ffffffff810793a6&gt;] blocking_notifier_call_chain+0x16/0x20
       [&lt;ffffffff813afbfb&gt;] memory_notify+0x1b/0x20
       [&lt;ffffffff81141b7c&gt;] remove_memory+0x1cc/0x5f0
       [&lt;ffffffff813af53d&gt;] memory_block_change_state+0xfd/0x1a0
       [&lt;ffffffff813afd62&gt;] store_mem_state+0xe2/0xf0
       [&lt;ffffffff813a0bb0&gt;] sysdev_store+0x20/0x30
       [&lt;ffffffff811bc116&gt;] sysfs_write_file+0xe6/0x170
       [&lt;ffffffff8114f398&gt;] vfs_write+0xc8/0x190
       [&lt;ffffffff8114fc14&gt;] sys_write+0x54/0x90
       [&lt;ffffffff810028b2&gt;] system_call_fastpath+0x16/0x1b

  -&gt; #0 ((memory_chain).rwsem){.+.+.+}:
       [&lt;ffffffff8108b5ba&gt;] __lock_acquire+0x155a/0x1600
       [&lt;ffffffff8108b70a&gt;] lock_acquire+0xaa/0x140
       [&lt;ffffffff81506601&gt;] down_read+0x51/0xa0
       [&lt;ffffffff81079339&gt;] __blocking_notifier_call_chain+0x69/0xc0
       [&lt;ffffffff810793a6&gt;] blocking_notifier_call_chain+0x16/0x20
       [&lt;ffffffff813afbfb&gt;] memory_notify+0x1b/0x20
       [&lt;ffffffff81141f1e&gt;] remove_memory+0x56e/0x5f0
       [&lt;ffffffff813af53d&gt;] memory_block_change_state+0xfd/0x1a0
       [&lt;ffffffff813afd62&gt;] store_mem_state+0xe2/0xf0
       [&lt;ffffffff813a0bb0&gt;] sysdev_store+0x20/0x30
       [&lt;ffffffff811bc116&gt;] sysfs_write_file+0xe6/0x170
       [&lt;ffffffff8114f398&gt;] vfs_write+0xc8/0x190
       [&lt;ffffffff8114fc14&gt;] sys_write+0x54/0x90
       [&lt;ffffffff810028b2&gt;] system_call_fastpath+0x16/0x1b

But it's a false positive.  Both memory_chain.rwsem and ksm_thread_mutex
have an outer lock (mem_hotplug_mutex).  So they cannot deadlock.

Thus, This patch annotate ksm_thread_mutex is not deadlock source.

[akpm@linux-foundation.org: update comment, from Hugh]
Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Acked-by: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: 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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 62b61f611e ("ksm: memory hotremove migration only") caused the
following new lockdep warning.

  =======================================================
  [ INFO: possible circular locking dependency detected ]
  -------------------------------------------------------
  bash/1621 is trying to acquire lock:
   ((memory_chain).rwsem){.+.+.+}, at: [&lt;ffffffff81079339&gt;]
  __blocking_notifier_call_chain+0x69/0xc0

  but task is already holding lock:
   (ksm_thread_mutex){+.+.+.}, at: [&lt;ffffffff8113a3aa&gt;]
  ksm_memory_callback+0x3a/0xc0

  which lock already depends on the new lock.

  the existing dependency chain (in reverse order) is:

  -&gt; #1 (ksm_thread_mutex){+.+.+.}:
       [&lt;ffffffff8108b70a&gt;] lock_acquire+0xaa/0x140
       [&lt;ffffffff81505d74&gt;] __mutex_lock_common+0x44/0x3f0
       [&lt;ffffffff81506228&gt;] mutex_lock_nested+0x48/0x60
       [&lt;ffffffff8113a3aa&gt;] ksm_memory_callback+0x3a/0xc0
       [&lt;ffffffff8150c21c&gt;] notifier_call_chain+0x8c/0xe0
       [&lt;ffffffff8107934e&gt;] __blocking_notifier_call_chain+0x7e/0xc0
       [&lt;ffffffff810793a6&gt;] blocking_notifier_call_chain+0x16/0x20
       [&lt;ffffffff813afbfb&gt;] memory_notify+0x1b/0x20
       [&lt;ffffffff81141b7c&gt;] remove_memory+0x1cc/0x5f0
       [&lt;ffffffff813af53d&gt;] memory_block_change_state+0xfd/0x1a0
       [&lt;ffffffff813afd62&gt;] store_mem_state+0xe2/0xf0
       [&lt;ffffffff813a0bb0&gt;] sysdev_store+0x20/0x30
       [&lt;ffffffff811bc116&gt;] sysfs_write_file+0xe6/0x170
       [&lt;ffffffff8114f398&gt;] vfs_write+0xc8/0x190
       [&lt;ffffffff8114fc14&gt;] sys_write+0x54/0x90
       [&lt;ffffffff810028b2&gt;] system_call_fastpath+0x16/0x1b

  -&gt; #0 ((memory_chain).rwsem){.+.+.+}:
       [&lt;ffffffff8108b5ba&gt;] __lock_acquire+0x155a/0x1600
       [&lt;ffffffff8108b70a&gt;] lock_acquire+0xaa/0x140
       [&lt;ffffffff81506601&gt;] down_read+0x51/0xa0
       [&lt;ffffffff81079339&gt;] __blocking_notifier_call_chain+0x69/0xc0
       [&lt;ffffffff810793a6&gt;] blocking_notifier_call_chain+0x16/0x20
       [&lt;ffffffff813afbfb&gt;] memory_notify+0x1b/0x20
       [&lt;ffffffff81141f1e&gt;] remove_memory+0x56e/0x5f0
       [&lt;ffffffff813af53d&gt;] memory_block_change_state+0xfd/0x1a0
       [&lt;ffffffff813afd62&gt;] store_mem_state+0xe2/0xf0
       [&lt;ffffffff813a0bb0&gt;] sysdev_store+0x20/0x30
       [&lt;ffffffff811bc116&gt;] sysfs_write_file+0xe6/0x170
       [&lt;ffffffff8114f398&gt;] vfs_write+0xc8/0x190
       [&lt;ffffffff8114fc14&gt;] sys_write+0x54/0x90
       [&lt;ffffffff810028b2&gt;] system_call_fastpath+0x16/0x1b

But it's a false positive.  Both memory_chain.rwsem and ksm_thread_mutex
have an outer lock (mem_hotplug_mutex).  So they cannot deadlock.

Thus, This patch annotate ksm_thread_mutex is not deadlock source.

[akpm@linux-foundation.org: update comment, from Hugh]
Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Acked-by: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: 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;
</pre>
</div>
</content>
</entry>
<entry>
<title>mem-hotplug: introduce {un}lock_memory_hotplug()</title>
<updated>2010-12-02T22:51:15+00:00</updated>
<author>
<name>KOSAKI Motohiro</name>
<email>kosaki.motohiro@jp.fujitsu.com</email>
</author>
<published>2010-12-02T22:31:19+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=20d6c96b5f1cad5c5da4641945ec17a1d9a1afc8'/>
<id>20d6c96b5f1cad5c5da4641945ec17a1d9a1afc8</id>
<content type='text'>
Presently hwpoison is using lock_system_sleep() to prevent a race with
memory hotplug.  However lock_system_sleep() is a no-op if
CONFIG_HIBERNATION=n.  Therefore we need a new lock.

Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Kamezawa Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Suggested-by: Hugh Dickins &lt;hughd@google.com&gt;
Acked-by: Hugh Dickins &lt;hughd@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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Presently hwpoison is using lock_system_sleep() to prevent a race with
memory hotplug.  However lock_system_sleep() is a no-op if
CONFIG_HIBERNATION=n.  Therefore we need a new lock.

Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Kamezawa Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Suggested-by: Hugh Dickins &lt;hughd@google.com&gt;
Acked-by: Hugh Dickins &lt;hughd@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;
</pre>
</div>
</content>
</entry>
<entry>
<title>vmalloc: eagerly clear ptes on vunmap</title>
<updated>2010-12-02T22:51:15+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2010-12-02T22:31:18+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=64141da587241301ce8638cc945f8b67853156ec'/>
<id>64141da587241301ce8638cc945f8b67853156ec</id>
<content type='text'>
On stock 2.6.37-rc4, running:

  # mount lilith:/export /mnt/lilith
  # find  /mnt/lilith/ -type f -print0 | xargs -0 file

crashes the machine fairly quickly under Xen.  Often it results in oops
messages, but the couple of times I tried just now, it just hung quietly
and made Xen print some rude messages:

    (XEN) mm.c:2389:d80 Bad type (saw 7400000000000001 != exp
    3000000000000000) for mfn 1d7058 (pfn 18fa7)
    (XEN) mm.c:964:d80 Attempt to create linear p.t. with write perms
    (XEN) mm.c:2389:d80 Bad type (saw 7400000000000010 != exp
    1000000000000000) for mfn 1d2e04 (pfn 1d1fb)
    (XEN) mm.c:2965:d80 Error while pinning mfn 1d2e04

Which means the domain tried to map a pagetable page RW, which would
allow it to map arbitrary memory, so Xen stopped it.  This is because
vm_unmap_ram() left some pages mapped in the vmalloc area after NFS had
finished with them, and those pages got recycled as pagetable pages
while still having these RW aliases.

Removing those mappings immediately removes the Xen-visible aliases, and
so it has no problem with those pages being reused as pagetable pages.
Deferring the TLB flush doesn't upset Xen because it can flush the TLB
itself as needed to maintain its invariants.

When unmapping a region in the vmalloc space, clear the ptes
immediately.  There's no point in deferring this because there's no
amortization benefit.

The TLBs are left dirty, and they are flushed lazily to amortize the
cost of the IPIs.

This specific motivation for this patch is an oops-causing regression
since 2.6.36 when using NFS under Xen, triggered by the NFS client's use
of vm_map_ram() introduced in 56e4ebf877b60 ("NFS: readdir with vmapped
pages") .  XFS also uses vm_map_ram() and could cause similar problems.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt;
Cc: Nick Piggin &lt;npiggin@kernel.dk&gt;
Cc: Bryan Schumaker &lt;bjschuma@netapp.com&gt;
Cc: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Cc: Alex Elder &lt;aelder@sgi.com&gt;
Cc: Dave Chinner &lt;david@fromorbit.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On stock 2.6.37-rc4, running:

  # mount lilith:/export /mnt/lilith
  # find  /mnt/lilith/ -type f -print0 | xargs -0 file

crashes the machine fairly quickly under Xen.  Often it results in oops
messages, but the couple of times I tried just now, it just hung quietly
and made Xen print some rude messages:

    (XEN) mm.c:2389:d80 Bad type (saw 7400000000000001 != exp
    3000000000000000) for mfn 1d7058 (pfn 18fa7)
    (XEN) mm.c:964:d80 Attempt to create linear p.t. with write perms
    (XEN) mm.c:2389:d80 Bad type (saw 7400000000000010 != exp
    1000000000000000) for mfn 1d2e04 (pfn 1d1fb)
    (XEN) mm.c:2965:d80 Error while pinning mfn 1d2e04

Which means the domain tried to map a pagetable page RW, which would
allow it to map arbitrary memory, so Xen stopped it.  This is because
vm_unmap_ram() left some pages mapped in the vmalloc area after NFS had
finished with them, and those pages got recycled as pagetable pages
while still having these RW aliases.

Removing those mappings immediately removes the Xen-visible aliases, and
so it has no problem with those pages being reused as pagetable pages.
Deferring the TLB flush doesn't upset Xen because it can flush the TLB
itself as needed to maintain its invariants.

When unmapping a region in the vmalloc space, clear the ptes
immediately.  There's no point in deferring this because there's no
amortization benefit.

The TLBs are left dirty, and they are flushed lazily to amortize the
cost of the IPIs.

This specific motivation for this patch is an oops-causing regression
since 2.6.36 when using NFS under Xen, triggered by the NFS client's use
of vm_map_ram() introduced in 56e4ebf877b60 ("NFS: readdir with vmapped
pages") .  XFS also uses vm_map_ram() and could cause similar problems.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt;
Cc: Nick Piggin &lt;npiggin@kernel.dk&gt;
Cc: Bryan Schumaker &lt;bjschuma@netapp.com&gt;
Cc: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Cc: Alex Elder &lt;aelder@sgi.com&gt;
Cc: Dave Chinner &lt;david@fromorbit.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vmstat: fix dirty threshold ordering</title>
<updated>2010-12-02T22:51:14+00:00</updated>
<author>
<name>Wu Fengguang</name>
<email>fengguang.wu@intel.com</email>
</author>
<published>2010-12-02T22:31:13+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=e172662d113ceb22db727a979bb35b9c02f703b5'/>
<id>e172662d113ceb22db727a979bb35b9c02f703b5</id>
<content type='text'>
The nr_dirty_[background_]threshold fields are misplaced before the
numa_* fields, and users will read strange values.

This is the right order.  Before patch, nr_dirty_background_threshold
will read as 0 (the value from numa_miss).

	numa_hit 128501
	numa_miss 0
	numa_foreign 0
	numa_interleave 7388
	numa_local 128501
	numa_other 0
	nr_dirty_threshold 144291
	nr_dirty_background_threshold 72145

Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
Cc: Michael Rubin &lt;mrubin@google.com&gt;
Reviewed-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Reviewed-by: 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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The nr_dirty_[background_]threshold fields are misplaced before the
numa_* fields, and users will read strange values.

This is the right order.  Before patch, nr_dirty_background_threshold
will read as 0 (the value from numa_miss).

	numa_hit 128501
	numa_miss 0
	numa_foreign 0
	numa_interleave 7388
	numa_local 128501
	numa_other 0
	nr_dirty_threshold 144291
	nr_dirty_background_threshold 72145

Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
Cc: Michael Rubin &lt;mrubin@google.com&gt;
Reviewed-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Reviewed-by: 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;
</pre>
</div>
</content>
</entry>
<entry>
<title>mm/mempolicy.c: add rcu read lock to protect pid structure</title>
<updated>2010-12-02T22:51:14+00:00</updated>
<author>
<name>Zeng Zhaoming</name>
<email>zengzm.kernel@gmail.com</email>
</author>
<published>2010-12-02T22:31:13+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=55cfaa3cbdd29c4919ecb5fb8965c310f357e48c'/>
<id>55cfaa3cbdd29c4919ecb5fb8965c310f357e48c</id>
<content type='text'>
find_task_by_vpid() should be protected by rcu_read_lock(), to prevent
free_pid() reclaiming pid.

Signed-off-by: Zeng Zhaoming &lt;zengzm.kernel@gmail.com&gt;
Cc: "Paul E. McKenney" &lt;paulmck@us.ibm.com&gt;
Cc: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
find_task_by_vpid() should be protected by rcu_read_lock(), to prevent
free_pid() reclaiming pid.

Signed-off-by: Zeng Zhaoming &lt;zengzm.kernel@gmail.com&gt;
Cc: "Paul E. McKenney" &lt;paulmck@us.ibm.com&gt;
Cc: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mm/hugetlb.c: avoid double unlock_page() in hugetlb_fault()</title>
<updated>2010-12-02T22:51:14+00:00</updated>
<author>
<name>Dean Nelson</name>
<email>dnelson@redhat.com</email>
</author>
<published>2010-12-02T22:31:12+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=1f64d69c7ad2e48e697493e45590679f7a69b7b2'/>
<id>1f64d69c7ad2e48e697493e45590679f7a69b7b2</id>
<content type='text'>
Have hugetlb_fault() call unlock_page(page) only if it had previously
called lock_page(page).

Setting CONFIG_DEBUG_VM=y and then running the libhugetlbfs test suite,
resulted in the tripping of VM_BUG_ON(!PageLocked(page)) in
unlock_page() having been called by hugetlb_fault() when page ==
pagecache_page.  This patch remedied the problem.

Signed-off-by: Dean Nelson &lt;dnelson@redhat.com&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Have hugetlb_fault() call unlock_page(page) only if it had previously
called lock_page(page).

Setting CONFIG_DEBUG_VM=y and then running the libhugetlbfs test suite,
resulted in the tripping of VM_BUG_ON(!PageLocked(page)) in
unlock_page() having been called by hugetlb_fault() when page ==
pagecache_page.  This patch remedied the problem.

Signed-off-by: Dean Nelson &lt;dnelson@redhat.com&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mm: remove call to find_vma in pagewalk for non-hugetlbfs</title>
<updated>2010-11-24T21:50:46+00:00</updated>
<author>
<name>David Sterba</name>
<email>dsterba@suse.cz</email>
</author>
<published>2010-11-24T20:57:10+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=5f0af70a25593a9d53b87bc8d31902fb7cc63e40'/>
<id>5f0af70a25593a9d53b87bc8d31902fb7cc63e40</id>
<content type='text'>
Commit d33b9f45 ("mm: hugetlb: fix hugepage memory leak in
walk_page_range()") introduces a check if a vma is a hugetlbfs one and
later in 5dc37642 ("mm hugetlb: add hugepage support to pagemap") it is
moved under #ifdef CONFIG_HUGETLB_PAGE but a needless find_vma call is
left behind and its result is not used anywhere else in the function.

The side-effect of caching vma for @addr inside walk-&gt;mm is neither
utilized in walk_page_range() nor in called functions.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Reviewed-by: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Acked-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Andy Whitcroft &lt;apw@canonical.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Hugh Dickins &lt;hugh.dickins@tiscali.co.uk&gt;
Cc: Lee Schermerhorn &lt;lee.schermerhorn@hp.com&gt;
Cc: Matt Mackall &lt;mpm@selenic.com&gt;
Acked-by: Mel Gorman &lt;mel@csn.ul.ie&gt;
Cc: 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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit d33b9f45 ("mm: hugetlb: fix hugepage memory leak in
walk_page_range()") introduces a check if a vma is a hugetlbfs one and
later in 5dc37642 ("mm hugetlb: add hugepage support to pagemap") it is
moved under #ifdef CONFIG_HUGETLB_PAGE but a needless find_vma call is
left behind and its result is not used anywhere else in the function.

The side-effect of caching vma for @addr inside walk-&gt;mm is neither
utilized in walk_page_range() nor in called functions.

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
Reviewed-by: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Acked-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Andy Whitcroft &lt;apw@canonical.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Hugh Dickins &lt;hugh.dickins@tiscali.co.uk&gt;
Cc: Lee Schermerhorn &lt;lee.schermerhorn@hp.com&gt;
Cc: Matt Mackall &lt;mpm@selenic.com&gt;
Acked-by: Mel Gorman &lt;mel@csn.ul.ie&gt;
Cc: 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;
</pre>
</div>
</content>
</entry>
<entry>
<title>mm/page_alloc.c: fix build_all_zonelist() where percpu_alloc() is wrongly called under stop_machine_run()</title>
<updated>2010-11-24T21:50:45+00:00</updated>
<author>
<name>KAMEZAWA Hiroyuki</name>
<email>kamezawa.hiroyu@jp.fujitsu.com</email>
</author>
<published>2010-11-24T20:57:09+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=e9959f0f37160e1f5351af828cc981712b5066c1'/>
<id>e9959f0f37160e1f5351af828cc981712b5066c1</id>
<content type='text'>
During memory hotplug, build_allzonelists() may be called under
stop_machine_run().  In this function, setup_zone_pageset() is called.
But it's bug because it will do page allocation under stop_machine_run().

Here is a report from Alok Kataria.

  BUG: sleeping function called from invalid context at kernel/mutex.c:94
  in_atomic(): 0, irqs_disabled(): 1, pid: 4, name: migration/0
  Pid: 4, comm: migration/0 Not tainted 2.6.35.6-45.fc14.x86_64 #1
  Call Trace:
   [&lt;ffffffff8103d12b&gt;] __might_sleep+0xeb/0xf0
   [&lt;ffffffff81468245&gt;] mutex_lock+0x24/0x50
   [&lt;ffffffff8110eaa6&gt;] pcpu_alloc+0x6d/0x7ee
   [&lt;ffffffff81048888&gt;] ? load_balance+0xbe/0x60e
   [&lt;ffffffff8103a1b3&gt;] ? rt_se_boosted+0x21/0x2f
   [&lt;ffffffff8103e1cf&gt;] ? dequeue_rt_stack+0x18b/0x1ed
   [&lt;ffffffff8110f237&gt;] __alloc_percpu+0x10/0x12
   [&lt;ffffffff81465e22&gt;] setup_zone_pageset+0x38/0xbe
   [&lt;ffffffff810d6d81&gt;] ? build_zonelists_node.clone.58+0x79/0x8c
   [&lt;ffffffff81452539&gt;] __build_all_zonelists+0x419/0x46c
   [&lt;ffffffff8108ef01&gt;] ? cpu_stopper_thread+0xb2/0x198
   [&lt;ffffffff8108f075&gt;] stop_machine_cpu_stop+0x8e/0xc5
   [&lt;ffffffff8108efe7&gt;] ? stop_machine_cpu_stop+0x0/0xc5
   [&lt;ffffffff8108ef57&gt;] cpu_stopper_thread+0x108/0x198
   [&lt;ffffffff81467a37&gt;] ? schedule+0x5b2/0x5cc
   [&lt;ffffffff8108ee4f&gt;] ? cpu_stopper_thread+0x0/0x198
   [&lt;ffffffff81065f29&gt;] kthread+0x7f/0x87
   [&lt;ffffffff8100aae4&gt;] kernel_thread_helper+0x4/0x10
   [&lt;ffffffff81065eaa&gt;] ? kthread+0x0/0x87
   [&lt;ffffffff8100aae0&gt;] ? kernel_thread_helper+0x0/0x10
  Built 5 zonelists in Node order, mobility grouping on.  Total pages: 289456
  Policy zone: Normal

This patch tries to fix the issue by moving setup_zone_pageset() out from
stop_machine_run(). It's obviously not necessary to be called under
stop_machine_run().

[akpm@linux-foundation.org: remove unneeded local]
Reported-by: Alok Kataria &lt;akataria@vmware.com&gt;
Signed-off-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Petr Vandrovec &lt;petr@vmware.com&gt;
Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Reviewed-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During memory hotplug, build_allzonelists() may be called under
stop_machine_run().  In this function, setup_zone_pageset() is called.
But it's bug because it will do page allocation under stop_machine_run().

Here is a report from Alok Kataria.

  BUG: sleeping function called from invalid context at kernel/mutex.c:94
  in_atomic(): 0, irqs_disabled(): 1, pid: 4, name: migration/0
  Pid: 4, comm: migration/0 Not tainted 2.6.35.6-45.fc14.x86_64 #1
  Call Trace:
   [&lt;ffffffff8103d12b&gt;] __might_sleep+0xeb/0xf0
   [&lt;ffffffff81468245&gt;] mutex_lock+0x24/0x50
   [&lt;ffffffff8110eaa6&gt;] pcpu_alloc+0x6d/0x7ee
   [&lt;ffffffff81048888&gt;] ? load_balance+0xbe/0x60e
   [&lt;ffffffff8103a1b3&gt;] ? rt_se_boosted+0x21/0x2f
   [&lt;ffffffff8103e1cf&gt;] ? dequeue_rt_stack+0x18b/0x1ed
   [&lt;ffffffff8110f237&gt;] __alloc_percpu+0x10/0x12
   [&lt;ffffffff81465e22&gt;] setup_zone_pageset+0x38/0xbe
   [&lt;ffffffff810d6d81&gt;] ? build_zonelists_node.clone.58+0x79/0x8c
   [&lt;ffffffff81452539&gt;] __build_all_zonelists+0x419/0x46c
   [&lt;ffffffff8108ef01&gt;] ? cpu_stopper_thread+0xb2/0x198
   [&lt;ffffffff8108f075&gt;] stop_machine_cpu_stop+0x8e/0xc5
   [&lt;ffffffff8108efe7&gt;] ? stop_machine_cpu_stop+0x0/0xc5
   [&lt;ffffffff8108ef57&gt;] cpu_stopper_thread+0x108/0x198
   [&lt;ffffffff81467a37&gt;] ? schedule+0x5b2/0x5cc
   [&lt;ffffffff8108ee4f&gt;] ? cpu_stopper_thread+0x0/0x198
   [&lt;ffffffff81065f29&gt;] kthread+0x7f/0x87
   [&lt;ffffffff8100aae4&gt;] kernel_thread_helper+0x4/0x10
   [&lt;ffffffff81065eaa&gt;] ? kthread+0x0/0x87
   [&lt;ffffffff8100aae0&gt;] ? kernel_thread_helper+0x0/0x10
  Built 5 zonelists in Node order, mobility grouping on.  Total pages: 289456
  Policy zone: Normal

This patch tries to fix the issue by moving setup_zone_pageset() out from
stop_machine_run(). It's obviously not necessary to be called under
stop_machine_run().

[akpm@linux-foundation.org: remove unneeded local]
Reported-by: Alok Kataria &lt;akataria@vmware.com&gt;
Signed-off-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Petr Vandrovec &lt;petr@vmware.com&gt;
Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Reviewed-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
