<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/mm/percpu.c, branch v2.6.35-rc4</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>percpu: fix first chunk match in per_cpu_ptr_to_phys()</title>
<updated>2010-06-18T13:07:23+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-06-18T09:44:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=9983b6f0cf8263e51bcf4c8a9dc0c1ef175b3c60'/>
<id>9983b6f0cf8263e51bcf4c8a9dc0c1ef175b3c60</id>
<content type='text'>
per_cpu_ptr_to_phys() determines whether the passed in @addr belongs
to the first_chunk or not by just matching the address against the
address range of the base unit (unit0, used by cpu0).  When an adress
from another cpu was passed in, it will always determine that the
address doesn't belong to the first chunk even when it does.  This
makes the function return a bogus physical address which may lead to
crash.

This problem was discovered by Cliff Wickman while investigating a
crash during kdump on a SGI UV system.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Cliff Wickman &lt;cpw@sgi.com&gt;
Tested-by: Cliff Wickman &lt;cpw@sgi.com&gt;
Cc: stable@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
per_cpu_ptr_to_phys() determines whether the passed in @addr belongs
to the first_chunk or not by just matching the address against the
address range of the base unit (unit0, used by cpu0).  When an adress
from another cpu was passed in, it will always determine that the
address doesn't belong to the first chunk even when it does.  This
makes the function return a bogus physical address which may lead to
crash.

This problem was discovered by Cliff Wickman while investigating a
crash during kdump on a SGI UV system.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Cliff Wickman &lt;cpw@sgi.com&gt;
Tested-by: Cliff Wickman &lt;cpw@sgi.com&gt;
Cc: stable@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu: fix trivial bugs in pcpu_build_alloc_info()</title>
<updated>2010-06-17T08:07:25+00:00</updated>
<author>
<name>Pavel V. Panteleev</name>
<email>pp_84@mail.ru</email>
</author>
<published>2010-06-17T08:07:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=a92d3ff9e5dbd958d8008a3e7a573e988e370ca3'/>
<id>a92d3ff9e5dbd958d8008a3e7a573e988e370ca3</id>
<content type='text'>
Fix the following two trivial bugs in pcpu_build_alloc_info()

* we should memset group_cnt to 0 by size of group_cnt, not size of
  group_map (both are of the same size, so the bug isn't dangerous)

* we can delete useless variable group_cnt_max.

Signed-off-by: Pavel V. Panteleev &lt;pp_84@mail.ru&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix the following two trivial bugs in pcpu_build_alloc_info()

* we should memset group_cnt to 0 by size of group_cnt, not size of
  group_map (both are of the same size, so the bug isn't dangerous)

* we can delete useless variable group_cnt_max.

Signed-off-by: Pavel V. Panteleev &lt;pp_84@mail.ru&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu: implement kernel memory based chunk allocation</title>
<updated>2010-05-01T06:30:50+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-04-09T09:57:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=b0c9778b1d07ed3aa7e411db201275553527b1b1'/>
<id>b0c9778b1d07ed3aa7e411db201275553527b1b1</id>
<content type='text'>
Implement an alternate percpu chunk management based on kernel memeory
for nommu SMP architectures.  Instead of mapping into vmalloc area,
chunks are allocated as a contiguous kernel memory using
alloc_pages().  As such, percpu allocator on nommu will have the
following restrictions.

* It can't fill chunks on-demand page-by-page.  It has to allocate
  each chunk fully upfront.

* It can't support sparse chunk for NUMA configurations.  SMP w/o mmu
  is crazy enough.  Let's hope no one does NUMA w/o mmu.  :-P

* If chunk size isn't power-of-two multiple of PAGE_SIZE, the
  unaligned amount will be wasted on each chunk.  So, archs which use
  this better align chunk size.

For instructions on how to use this, read the comment on top of
mm/percpu-km.c.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Graff Yang &lt;graff.yang@gmail.com&gt;
Cc: Sonic Zhang &lt;sonic.adi@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement an alternate percpu chunk management based on kernel memeory
for nommu SMP architectures.  Instead of mapping into vmalloc area,
chunks are allocated as a contiguous kernel memory using
alloc_pages().  As such, percpu allocator on nommu will have the
following restrictions.

* It can't fill chunks on-demand page-by-page.  It has to allocate
  each chunk fully upfront.

* It can't support sparse chunk for NUMA configurations.  SMP w/o mmu
  is crazy enough.  Let's hope no one does NUMA w/o mmu.  :-P

* If chunk size isn't power-of-two multiple of PAGE_SIZE, the
  unaligned amount will be wasted on each chunk.  So, archs which use
  this better align chunk size.

For instructions on how to use this, read the comment on top of
mm/percpu-km.c.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Graff Yang &lt;graff.yang@gmail.com&gt;
Cc: Sonic Zhang &lt;sonic.adi@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu: move vmalloc based chunk management into percpu-vm.c</title>
<updated>2010-05-01T06:30:50+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-04-09T09:57:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=9f6455325618821dcf6775d7972881fde32e77c5'/>
<id>9f6455325618821dcf6775d7972881fde32e77c5</id>
<content type='text'>
Separate out and move chunk management (creation/desctruction and
[de]population) code into percpu-vm.c which is included by percpu.c
and compiled together.  The interface for chunk management is defined
as follows.

 * pcpu_populate_chunk		- populate the specified range of a chunk
 * pcpu_depopulate_chunk	- depopulate the specified range of a chunk
 * pcpu_create_chunk		- create a new chunk
 * pcpu_destroy_chunk		- destroy a chunk, always preceded by full depop
 * pcpu_addr_to_page		- translate address to physical address
 * pcpu_verify_alloc_info	- check alloc_info is acceptable during init

Other than wrapping vmalloc_to_page() inside pcpu_addr_to_page() and
dummy pcpu_verify_alloc_info() implementation, this patch only moves
code around.  This separation is to allow alternate chunk management
implementation.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Graff Yang &lt;graff.yang@gmail.com&gt;
Cc: Sonic Zhang &lt;sonic.adi@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Separate out and move chunk management (creation/desctruction and
[de]population) code into percpu-vm.c which is included by percpu.c
and compiled together.  The interface for chunk management is defined
as follows.

 * pcpu_populate_chunk		- populate the specified range of a chunk
 * pcpu_depopulate_chunk	- depopulate the specified range of a chunk
 * pcpu_create_chunk		- create a new chunk
 * pcpu_destroy_chunk		- destroy a chunk, always preceded by full depop
 * pcpu_addr_to_page		- translate address to physical address
 * pcpu_verify_alloc_info	- check alloc_info is acceptable during init

Other than wrapping vmalloc_to_page() inside pcpu_addr_to_page() and
dummy pcpu_verify_alloc_info() implementation, this patch only moves
code around.  This separation is to allow alternate chunk management
implementation.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Graff Yang &lt;graff.yang@gmail.com&gt;
Cc: Sonic Zhang &lt;sonic.adi@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu: misc preparations for nommu support</title>
<updated>2010-05-01T06:30:50+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-04-09T09:57:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=88999a898b565960690f18e4a13a1e8a9fa4dfef'/>
<id>88999a898b565960690f18e4a13a1e8a9fa4dfef</id>
<content type='text'>
Make the following misc preparations for percpu nommu support.

* Remove refernces to vmalloc in common comments as nommu percpu won't
  use it.

* Rename chunk-&gt;vms to chunk-&gt;data and make it void *.  Its use is
  determined by chunk management implementation.

* Relocate utility functions and add __maybe_unused to functions which
  might not be used by different chunk management implementations.

This patch doesn't cause any functional change.  This is to allow
alternate chunk management implementation for percpu nommu support.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Graff Yang &lt;graff.yang@gmail.com&gt;
Cc: Sonic Zhang &lt;sonic.adi@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the following misc preparations for percpu nommu support.

* Remove refernces to vmalloc in common comments as nommu percpu won't
  use it.

* Rename chunk-&gt;vms to chunk-&gt;data and make it void *.  Its use is
  determined by chunk management implementation.

* Relocate utility functions and add __maybe_unused to functions which
  might not be used by different chunk management implementations.

This patch doesn't cause any functional change.  This is to allow
alternate chunk management implementation for percpu nommu support.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Graff Yang &lt;graff.yang@gmail.com&gt;
Cc: Sonic Zhang &lt;sonic.adi@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu: reorganize chunk creation and destruction</title>
<updated>2010-05-01T06:30:50+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-04-09T09:57:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=6081089fd6f216b0eb8849205ad0c350cd5ed9bc'/>
<id>6081089fd6f216b0eb8849205ad0c350cd5ed9bc</id>
<content type='text'>
Reorganize alloc/free_pcpu_chunk() such that chunk struct alloc/free
live in pcpu_alloc/free_chunk() and the rest in
pcpu_create/destroy_chunk().  While at it, add missing error handling
for chunk-&gt;map allocation failure.

This is to allow alternate chunk management implementation for percpu
nommu support.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Graff Yang &lt;graff.yang@gmail.com&gt;
Cc: Sonic Zhang &lt;sonic.adi@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reorganize alloc/free_pcpu_chunk() such that chunk struct alloc/free
live in pcpu_alloc/free_chunk() and the rest in
pcpu_create/destroy_chunk().  While at it, add missing error handling
for chunk-&gt;map allocation failure.

This is to allow alternate chunk management implementation for percpu
nommu support.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Graff Yang &lt;graff.yang@gmail.com&gt;
Cc: Sonic Zhang &lt;sonic.adi@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu: factor out pcpu_addr_in_first/reserved_chunk() and update per_cpu_ptr_to_phys()</title>
<updated>2010-05-01T06:30:49+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-04-09T09:57:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=020ec6537aa65c18e9084c568d7b94727f2026fd'/>
<id>020ec6537aa65c18e9084c568d7b94727f2026fd</id>
<content type='text'>
Factor out pcpu_addr_in_first/reserved_chunk() from
pcpu_chunk_addr_search() and use it to update per_cpu_ptr_to_phys()
such that it handles first chunk differently from the rest.

This patch doesn't cause any functional change and is to prepare for
percpu nommu support.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Graff Yang &lt;graff.yang@gmail.com&gt;
Cc: Sonic Zhang &lt;sonic.adi@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Factor out pcpu_addr_in_first/reserved_chunk() from
pcpu_chunk_addr_search() and use it to update per_cpu_ptr_to_phys()
such that it handles first chunk differently from the rest.

This patch doesn't cause any functional change and is to prepare for
percpu nommu support.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Graff Yang &lt;graff.yang@gmail.com&gt;
Cc: Sonic Zhang &lt;sonic.adi@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu, module: implement and use is_kernel/module_percpu_address()</title>
<updated>2010-03-29T14:07:12+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-03-10T09:57:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=10fad5e46f6c7bdfb01b1a012380a38e3c6ab346'/>
<id>10fad5e46f6c7bdfb01b1a012380a38e3c6ab346</id>
<content type='text'>
lockdep has custom code to check whether a pointer belongs to static
percpu area which is somewhat broken.  Implement proper
is_kernel/module_percpu_address() and replace the custom code.

On UP, percpu variables are regular static variables and can't be
distinguished from them.  Always return %false on UP.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
lockdep has custom code to check whether a pointer belongs to static
percpu area which is somewhat broken.  Implement proper
is_kernel/module_percpu_address() and replace the custom code.

On UP, percpu variables are regular static variables and can't be
distinguished from them.  Always return %false on UP.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu: add __percpu sparse annotations to core kernel subsystems</title>
<updated>2010-02-17T02:17:38+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-02-02T05:38:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=43cf38eb5cea91245502df3fcee4dbfc1c74dd1c'/>
<id>43cf38eb5cea91245502df3fcee4dbfc1c74dd1c</id>
<content type='text'>
Add __percpu sparse annotations to core subsystems.

These annotations are to make sparse consider percpu variables to be
in a different address space and warn if accessed without going
through percpu accessors.  This patch doesn't affect normal builds.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: linux-mm@kvack.org
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Dipankar Sarma &lt;dipankar@in.ibm.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Eric Biederman &lt;ebiederm@xmission.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add __percpu sparse annotations to core subsystems.

These annotations are to make sparse consider percpu variables to be
in a different address space and warn if accessed without going
through percpu accessors.  This patch doesn't affect normal builds.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Acked-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: linux-mm@kvack.org
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Dipankar Sarma &lt;dipankar@in.ibm.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Eric Biederman &lt;ebiederm@xmission.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' into percpu</title>
<updated>2010-02-02T05:38:15+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-02-02T05:38:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=ab386128f20c44c458a90039ab1bdc265ac474c9'/>
<id>ab386128f20c44c458a90039ab1bdc265ac474c9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
