<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/kernel/setup_percpu.c, branch linux-2.6.30.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.30.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.30.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-05-25T03:37:55Z</updated>
<entry>
<title>x86: Remove remap percpu allocator for the time being</title>
<updated>2009-05-25T03:37:55Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-05-25T03:01:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=71c9d8b68b299bef614afc7907393564a9f1476f'/>
<id>urn:sha1:71c9d8b68b299bef614afc7907393564a9f1476f</id>
<content type='text'>
Remap percpu allocator has subtle bug when combined with page
attribute changing.  Remap percpu allocator aliases PMD pages for the
first chunk and as pageattr doesn't know about the alias it ends up
updating page attributes of the original mapping thus leaving the
alises in inconsistent state which might lead to subtle data
corruption.  Please read the following threads for more information:

  http://thread.gmane.org/gmane.linux.kernel/835783

The following is the proposed fix which teaches pageattr about percpu
aliases.

  http://thread.gmane.org/gmane.linux.kernel/837157

However, the above changes are deemed too pervasive for upstream
inclusion for 2.6.30 release, so this patch essentially disables
the remap allocator for the time being.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
LKML-Reference: &lt;4A1A0A27.4050301@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86: remove duplicated code with pcpu_need_numa()</title>
<updated>2009-04-02T04:08:05Z</updated>
<author>
<name>Yinghai Lu</name>
</author>
<published>2009-04-01T07:27:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3de46fda4c104deef17ec70f85361f5c6b84ce0e'/>
<id>urn:sha1:3de46fda4c104deef17ec70f85361f5c6b84ce0e</id>
<content type='text'>
Impact: clean up

those code pcpu_need_numa(), should be removed.

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: David Miller &lt;davem@davemloft.net&gt;
LKML-Reference: &lt;49D31770.9090502@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86,percpu: fix inverted NUMA test in setup_pcpu_remap()</title>
<updated>2009-04-02T04:08:05Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-04-01T06:06:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb12ce60c81826a99eadbc56401e08ceb37a0cc2'/>
<id>urn:sha1:eb12ce60c81826a99eadbc56401e08ceb37a0cc2</id>
<content type='text'>
setup_percpu_remap() is for NUMA machines yet it bailed out with
-EINVAL if pcpu_need_numa().  Fix the inverted condition.

This problem was reported by David Miller and verified by Yinhai Lu.

Reported-by: David Miller &lt;davem@davemloft.net&gt;
Reported-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
LKML-Reference: &lt;49D30469.8020006@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>percpu: generalize embedding first chunk setup helper</title>
<updated>2009-03-10T07:27:48Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-03-10T07:27:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=66c3a75772247c31feabefb724e082220a1ab060'/>
<id>urn:sha1:66c3a75772247c31feabefb724e082220a1ab060</id>
<content type='text'>
Impact: code reorganization

Separate out embedding first chunk setup helper from x86 embedding
first chunk allocator and put it in mm/percpu.c.  This will be used by
the default percpu first chunk allocator and possibly by other archs.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>percpu: more flexibility for @dyn_size of pcpu_setup_first_chunk()</title>
<updated>2009-03-10T07:27:48Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-03-10T07:27:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6074d5b0a319fe8400ff079a3c289406ca024321'/>
<id>urn:sha1:6074d5b0a319fe8400ff079a3c289406ca024321</id>
<content type='text'>
Impact: cleanup, more flexibility for first chunk init

Non-negative @dyn_size used to be allowed iff @unit_size wasn't auto.
This restriction stemmed from implementation detail and made things a
bit less intuitive.  This patch allows @dyn_size to be specified
regardless of @unit_size and swaps the positions of @dyn_size and
@unit_size so that the parameter order makes more sense (static,
reserved and dyn sizes followed by enclosing unit_size).

While at it, add @unit_size &gt;= PCPU_MIN_UNIT_SIZE sanity check.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86, percpu: setup reserved percpu area for x86_64</title>
<updated>2009-03-06T05:33:59Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-03-06T05:33:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6b19b0c2400437a3c10059ede0e59b517092e1bd'/>
<id>urn:sha1:6b19b0c2400437a3c10059ede0e59b517092e1bd</id>
<content type='text'>
Impact: fix relocation overflow during module load

x86_64 uses 32bit relocations for symbol access and static percpu
symbols whether in core or modules must be inside 2GB of the percpu
segement base which the dynamic percpu allocator doesn't guarantee.
This patch makes x86_64 reserve PERCPU_MODULE_RESERVE bytes in the
first chunk so that module percpu areas are always allocated from the
first chunk which is always inside the relocatable range.

This problem exists for any percpu allocator but is easily triggered
when using the embedding allocator because the second chunk is located
beyond 2GB on it.

This patch also changes the meaning of PERCPU_DYNAMIC_RESERVE such
that it only indicates the size of the area to reserve for dynamic
allocation as static and dynamic areas can be separate.  New
PERCPU_DYNAMIC_RESERVED is increased by 4k for both 32 and 64bits as
the reserved area separation eats away some allocatable space and
having slightly more headroom (currently between 4 and 8k after
minimal boot sans module area) makes sense for common case
performance.

x86_32 can address anywhere from anywhere and doesn't need reserving.

Mike Galbraith first reported the problem first and bisected it to the
embedding percpu allocator commit.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Mike Galbraith &lt;efault@gmx.de&gt;
Reported-by: Jaswinder Singh Rajput &lt;jaswinder@kernel.org&gt;
</content>
</entry>
<entry>
<title>percpu, module: implement reserved allocation and use it for module percpu variables</title>
<updated>2009-03-06T05:33:59Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-03-06T05:33:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=edcb463997ed7b2ffa3bac76e3e75957318f2e01'/>
<id>urn:sha1:edcb463997ed7b2ffa3bac76e3e75957318f2e01</id>
<content type='text'>
Impact: add reserved allocation functionality and use it for module
	percpu variables

This patch implements reserved allocation from the first chunk.  When
setting up the first chunk, arch can ask to set aside certain number
of bytes right after the core static area which is available only
through a separate reserved allocator.  This will be used primarily
for module static percpu variables on architectures with limited
relocation range to ensure that the module perpcu symbols are inside
the relocatable range.

If reserved area is requested, the first chunk becomes reserved and
isn't available for regular allocation.  If the first chunk also
includes piggy-back dynamic allocation area, a separate chunk mapping
the same region is created to serve dynamic allocation.  The first one
is called static first chunk and the second dynamic first chunk.
Although they share the page map, their different area map
initializations guarantee they serve disjoint areas according to their
purposes.

If arch doesn't setup reserved area, reserved allocation is handled
like any other allocation.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86: make embedding percpu allocator return excessive free space</title>
<updated>2009-03-06T05:33:59Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-03-06T05:33:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9a4f8a878b68d5a5d9ee60908a52cf6a55e1b823'/>
<id>urn:sha1:9a4f8a878b68d5a5d9ee60908a52cf6a55e1b823</id>
<content type='text'>
Impact: reduce unnecessary memory usage on certain configurations

Embedding percpu allocator allocates unit_size *
smp_num_possible_cpus() bytes consecutively and use it for the first
chunk.  However, if the static area is small, this can result in
excessive prellocated free space in the first chunk due to
PCPU_MIN_UNIT_SIZE restriction.

This patch makes embedding percpu allocator preallocate only what's
necessary as described by PERPCU_DYNAMIC_RESERVE and return the
leftover to the bootmem allocator.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>percpu: use negative for auto for pcpu_setup_first_chunk() arguments</title>
<updated>2009-03-06T05:33:59Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-03-06T05:33:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cafe8816b217b98dc3f268d3b77445da498beb4f'/>
<id>urn:sha1:cafe8816b217b98dc3f268d3b77445da498beb4f</id>
<content type='text'>
Impact: argument semantic cleanup

In pcpu_setup_first_chunk(), zero @unit_size and @dyn_size meant
auto-sizing.  It's okay for @unit_size as 0 doesn't make sense but 0
dynamic reserve size is valid.  Alos, if arch @dyn_size is calculated
from other parameters, it might end up passing in 0 @dyn_size and
malfunction when the size is automatically adjusted.

This patch makes both @unit_size and @dyn_size ssize_t and use -1 for
auto sizing.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86, percpu: fix minor bugs in setup_percpu.c</title>
<updated>2009-02-25T01:38:10Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-02-25T01:38:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24ff954233ecfd45801383f831626f88937ebe6f'/>
<id>urn:sha1:24ff954233ecfd45801383f831626f88937ebe6f</id>
<content type='text'>
Recent changes in setup_percpu.c made a now meaningless DBG()
statement fail to compile and introduced a
comparison-of-different-types warning.  Fix them.

Compile failure is reported by Ingo Molnar.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
