<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/mm/percpu.c, branch v3.10.2</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/mm/percpu.c?h=v3.10.2</id>
<link rel='self' href='https://git.amat.us/linux/atom/mm/percpu.c?h=v3.10.2'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-12-02T14:23:04Z</updated>
<entry>
<title>mm, percpu: Make sure percpu_alloc early parameter has an argument</title>
<updated>2012-12-02T14:23:04Z</updated>
<author>
<name>Cyrill Gorcunov</name>
<email>gorcunov@openvz.org</email>
</author>
<published>2012-11-24T21:17:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5479c78ac6f688ea5ea8c49b44cf90ea87b63931'/>
<id>urn:sha1:5479c78ac6f688ea5ea8c49b44cf90ea87b63931</id>
<content type='text'>
Otherwise we are getting a nil dereference if percpu_alloc kernel boot
argument is specified without value.

 | [    0.000000] BUG: unable to handle kernel NULL pointer dereference at           (null)
 | [    0.000000] IP: [&lt;ffffffff81391360&gt;] strcmp+0x10/0x30

Signed-off-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>percpu: make pcpu_free_chunk() use pcpu_mem_free() instead of kfree()</title>
<updated>2012-10-29T15:49:47Z</updated>
<author>
<name>Joonsoo Kim</name>
<email>js1304@gmail.com</email>
</author>
<published>2012-10-29T13:59:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b4916cb17c261a6043bcb2a98d0d6512497a7cf8'/>
<id>urn:sha1:b4916cb17c261a6043bcb2a98d0d6512497a7cf8</id>
<content type='text'>
commit 099a19d9('allow limited allocation before slab is online') made
pcpu_alloc_chunk() use pcpu_mem_zalloc() but forgot to update
pcpu_free_chunk() accordingly.  This doesn't cause any immediate
problema, but fix it for consistency.

tj: commit message updated

Signed-off-by: Joonsoo Kim &lt;js1304@gmail.com&gt;
Cc: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>sections: fix section conflicts in mm/percpu.c</title>
<updated>2012-10-05T18:04:44Z</updated>
<author>
<name>Andi Kleen</name>
<email>ak@linux.intel.com</email>
</author>
<published>2012-10-05T00:12:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=17f3609c21706b377ad80b5251558ed700c2af17'/>
<id>urn:sha1:17f3609c21706b377ad80b5251558ed700c2af17</id>
<content type='text'>
Signed-off-by: Andi Kleen &lt;ak@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>kmemleak: Fix the kmemleak tracking of the percpu areas with !SMP</title>
<updated>2012-05-09T17:13:29Z</updated>
<author>
<name>Catalin Marinas</name>
<email>catalin.marinas@arm.com</email>
</author>
<published>2012-05-09T15:55:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=100d13c3b5b9410f604b86f5e0a34da64b8cf659'/>
<id>urn:sha1:100d13c3b5b9410f604b86f5e0a34da64b8cf659</id>
<content type='text'>
Kmemleak tracks the percpu allocations via a specific API and the
originally allocated areas must be removed from kmemleak (via
kmemleak_free). The code was already doing this for SMP systems.

Reported-by: Sami Liedes &lt;sami.liedes@iki.fi&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>percpu: pcpu_embed_first_chunk() should free unused parts after all allocs are complete</title>
<updated>2012-05-09T17:08:16Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-04-27T15:42:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=42b64281453249dac52861f9b97d18552a7ec62b'/>
<id>urn:sha1:42b64281453249dac52861f9b97d18552a7ec62b</id>
<content type='text'>
pcpu_embed_first_chunk() allocates memory for each node, copies percpu
data and frees unused portions of it before proceeding to the next
group.  This assumes that allocations for different nodes doesn't
overlap; however, depending on memory topology, the bootmem allocator
may end up allocating memory from a different node than the requested
one which may overlap with the portion freed from one of the previous
percpu areas.  This leads to percpu groups for different nodes
overlapping which is a serious bug.

This patch separates out copy &amp; partial free from the allocation loop
such that all allocations are complete before partial frees happen.

This also fixes overlapping frees which could happen on allocation
failure path - out_free_areas path frees whole groups but the groups
could have portions freed at that point.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: stable@vger.kernel.org
Reported-by: "Pavel V. Panteleev" &lt;pp_84@mail.ru&gt;
Tested-by: "Pavel V. Panteleev" &lt;pp_84@mail.ru&gt;
LKML-Reference: &lt;E1SNhwY-0007ui-V7.pp_84-mail-ru@f220.mail.ru&gt;
</content>
</entry>
<entry>
<title>percpu: use KERN_CONT in pcpu_dump_alloc_info()</title>
<updated>2012-03-29T16:45:58Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-03-29T16:45:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cb129820f1e6ccf309510f4eb28df45cb0742005'/>
<id>urn:sha1:cb129820f1e6ccf309510f4eb28df45cb0742005</id>
<content type='text'>
pcpu_dump_alloc_info() was printing continued lines without KERN_CONT.
Use it.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'kmemleak' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux</title>
<updated>2012-01-15T02:11:11Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-01-15T02:11:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=892d208bcf79e4e1058707786a7b6d486697cd78'/>
<id>urn:sha1:892d208bcf79e4e1058707786a7b6d486697cd78</id>
<content type='text'>
Kmemleak patches

Main features:
- Handle percpu memory allocations (only scanning them, not actually
  reporting).
- Memory hotplug support.

Usability improvements:
- Show the origin of early allocations.
- Report previously found leaks even if kmemleak has been disabled by
  some error.

* tag 'kmemleak' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux:
  kmemleak: Add support for memory hotplug
  kmemleak: Handle percpu memory allocation
  kmemleak: Report previously found leaks even after an error
  kmemleak: When the early log buffer is exceeded, report the actual number
  kmemleak: Show where early_log issues come from
</content>
</entry>
<entry>
<title>percpu: fix per_cpu_ptr_to_phys() handling of non-page-aligned addresses</title>
<updated>2011-12-15T19:41:40Z</updated>
<author>
<name>Eugene Surovegin</name>
<email>ebs@ebshome.net</email>
</author>
<published>2011-12-15T19:25:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9f57bd4d6dc69a4e3bf43044fa00fcd24dd363e3'/>
<id>urn:sha1:9f57bd4d6dc69a4e3bf43044fa00fcd24dd363e3</id>
<content type='text'>
per_cpu_ptr_to_phys() incorrectly rounds up its result for non-kmalloc
case to the page boundary, which is bogus for any non-page-aligned
address.

This affects the only in-tree user of this function - sysfs handler
for per-cpu 'crash_notes' physical address.  The trouble is that the
crash_notes per-cpu variable is not page-aligned:

crash_notes = 0xc08e8ed4
PER-CPU OFFSET VALUES:
 CPU 0: 3711f000
 CPU 1: 37129000
 CPU 2: 37133000
 CPU 3: 3713d000

So, the per-cpu addresses are:
 crash_notes on CPU 0: f7a07ed4 =&gt; phys 36b57ed4
 crash_notes on CPU 1: f7a11ed4 =&gt; phys 36b4ded4
 crash_notes on CPU 2: f7a1bed4 =&gt; phys 36b43ed4
 crash_notes on CPU 3: f7a25ed4 =&gt; phys 36b39ed4

However, /sys/devices/system/cpu/cpu*/crash_notes says:
 /sys/devices/system/cpu/cpu0/crash_notes: 36b57000
 /sys/devices/system/cpu/cpu1/crash_notes: 36b4d000
 /sys/devices/system/cpu/cpu2/crash_notes: 36b43000
 /sys/devices/system/cpu/cpu3/crash_notes: 36b39000

As you can see, all values are rounded down to a page
boundary. Consequently, this is where kexec sets up the NOTE segments,
and thus where the secondary kernel is looking for them. However, when
the first kernel crashes, it saves the notes to the unaligned
addresses, where they are not found.

Fix it by adding offset_in_page() to the translated page address.

-tj: Combined Eugene's and Petr's commit messages.

Signed-off-by: Eugene Surovegin &lt;ebs@ebshome.net&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Petr Tesarik &lt;ptesarik@suse.cz&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>kmemleak: Handle percpu memory allocation</title>
<updated>2011-12-02T16:12:42Z</updated>
<author>
<name>Catalin Marinas</name>
<email>catalin.marinas@arm.com</email>
</author>
<published>2011-09-26T16:12:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f528f0b8e53d73b18be71e96693cfab9322f33c7'/>
<id>urn:sha1:f528f0b8e53d73b18be71e96693cfab9322f33c7</id>
<content type='text'>
This patch adds kmemleak callbacks from the percpu allocator, reducing a
number of false positives caused by kmemleak not scanning such memory
blocks. The percpu chunks are never reported as leaks because of current
kmemleak limitations with the __percpu pointer not pointing directly to
the actual chunks.

Reported-by: Huajun Li &lt;huajun.li.lee@gmail.com&gt;
Acked-by: Christoph Lameter &lt;cl@gentwo.org&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
</content>
</entry>
<entry>
<title>percpu: explain why per_cpu_ptr_to_phys() is more complicated than necessary</title>
<updated>2011-11-23T16:20:53Z</updated>
<author>
<name>Dave Young</name>
<email>dyoung@redhat.com</email>
</author>
<published>2011-11-23T16:20:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=67589c71456b0346500629967292dea3802230b6'/>
<id>urn:sha1:67589c71456b0346500629967292dea3802230b6</id>
<content type='text'>
Add comments about current per_cpu_ptr_to_phys implementation to
explain why the logic is more complicated than necessary.

-tj: relocated comment into kerneldoc comment

Signed-off-by: Dave Young &lt;dyoung@redhat.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
</feed>
