<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/cpu.c, branch v2.6.28</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.28</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.28'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2008-11-30T18:03:37Z</updated>
<entry>
<title>cpuinit fixes in kernel/*</title>
<updated>2008-11-30T18:03:37Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ftp.linux.org.uk</email>
</author>
<published>2008-11-22T17:36:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8419641450edc838a6ce7cdf0f99d262bf0af2d5'/>
<id>urn:sha1:8419641450edc838a6ce7cdf0f99d262bf0af2d5</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>cpumask: introduce new API, without changing anything</title>
<updated>2008-11-06T08:05:33Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2008-11-05T02:39:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2d3854a37e8b767a51aba38ed6d22817b0631e33'/>
<id>urn:sha1:2d3854a37e8b767a51aba38ed6d22817b0631e33</id>
<content type='text'>
Impact: introduce new APIs

We want to deprecate cpumasks on the stack, as we are headed for
gynormous numbers of CPUs.  Eventually, we want to head towards an
undefined 'struct cpumask' so they can never be declared on stack.

1) New cpumask functions which take pointers instead of copies.
   (cpus_* -&gt; cpumask_*)

2) Several new helpers to reduce requirements for temporary cpumasks
   (cpumask_first_and, cpumask_next_and, cpumask_any_and)

3) Helpers for declaring cpumasks on or offstack for large NR_CPUS
   (cpumask_var_t, alloc_cpumask_var and free_cpumask_var)

4) 'struct cpumask' for explicitness and to mark new-style code.

5) Make iterator functions stop at nr_cpu_ids (a runtime constant),
   not NR_CPUS for time efficiency and for smaller dynamic allocations
   in future.

6) cpumask_copy() so we can allocate less than a full cpumask eventually
   (for alloc_cpumask_var), and so we can eliminate the 'struct cpumask'
   definition eventually.

7) work_on_cpu() helper for doing task on a CPU, rather than saving old
   cpumask for current thread and manipulating it.

8) smp_call_function_many() which is smp_call_function_mask() except
   taking a cpumask pointer.

Note that this patch simply introduces the new functions and leaves
the obsolescent ones in place.  This is to simplify the transition
patches.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>Merge branches 'sched/devel', 'sched/cpu-hotplug', 'sched/cpusets' and 'sched/urgent' into sched/core</title>
<updated>2008-10-08T09:31:02Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-10-08T09:31:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=990d0f2ced23052abc7efa09bd05bff34e00cf73'/>
<id>urn:sha1:990d0f2ced23052abc7efa09bd05bff34e00cf73</id>
<content type='text'>
</content>
</entry>
<entry>
<title>kernel/cpu.c: create a CPU_STARTING cpu_chain notifier</title>
<updated>2008-09-08T17:25:24Z</updated>
<author>
<name>Manfred Spraul</name>
<email>manfred@colorfullife.com</email>
</author>
<published>2008-09-07T14:57:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e545a6140b698b2494daf0b32107bdcc5e901390'/>
<id>urn:sha1:e545a6140b698b2494daf0b32107bdcc5e901390</id>
<content type='text'>
Right now, there is no notifier that is called on a new cpu, before the new
cpu begins processing interrupts/softirqs.
Various kernel function would need that notification, e.g. kvm works around
by calling smp_call_function_single(), rcu polls cpu_online_map.

The patch adds a CPU_STARTING notification. It also adds a helper function
that sends the message to all cpu_chain handlers.

Tested on x86-64.
All other archs are untested. Especially on sparc, I'm not sure if I got
it right.

Signed-off-by: Manfred Spraul &lt;manfred@colorfullife.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>kernel/cpu.c: Move the CPU_DYING notifiers</title>
<updated>2008-09-06T17:13:59Z</updated>
<author>
<name>Manfred Spraul</name>
<email>manfred@colorfullife.com</email>
</author>
<published>2008-08-31T17:58:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3ba35573ad9a149a3af19625b502679283382f6b'/>
<id>urn:sha1:3ba35573ad9a149a3af19625b502679283382f6b</id>
<content type='text'>
When a cpu is taken offline, the CPU_DYING notifiers are called on the
dying cpu. According to &lt;linux/notifiers.h&gt;, the cpu should be "not
running any task, not handling interrupts, soon dead".

For the current implementation, this is not true:
- __cpu_disable can fail. If it fails, then the cpu will remain alive
  and happy.
- At least on x86, __cpu_disable() briefly enables the local interrupts
  to handle any outstanding interrupts.

What about moving CPU_DYING down a few lines, behind the __cpu_disable()
line?
There are only two CPU_DYING handlers in the kernel right now: one in
kvm, one in the scheduler. Both should work with the patch applied
[and: I'm not sure if either one handles a failing __cpu_disable()]

The patch survives simple offlining a cpu. kvm untested due to lack
of a test setup.

Signed-off-By: Manfred Spraul &lt;manfred@colorfullife.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>cpu hotplug: s390 doesn't support additional_cpus anymore.</title>
<updated>2008-08-12T23:07:28Z</updated>
<author>
<name>Heiko Carstens</name>
<email>heiko.carstens@de.ibm.com</email>
</author>
<published>2008-08-12T22:08:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3ee1062b4ee82a56294808a065b64f4bc6781a56'/>
<id>urn:sha1:3ee1062b4ee82a56294808a065b64f4bc6781a56</id>
<content type='text'>
s390 doesn't support the additional_cpus kernel parameter anymore since a
long time.  So we better update the code and documentation to reflect
that.

Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.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>sched, cpu hotplug: fix set_cpus_allowed() use in hotplug callbacks</title>
<updated>2008-08-11T14:32:41Z</updated>
<author>
<name>Dmitry Adamushko</name>
<email>dmitry.adamushko@gmail.com</email>
</author>
<published>2008-07-30T10:34:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=279ef6bbb8308488398c8f33b04c760148428378'/>
<id>urn:sha1:279ef6bbb8308488398c8f33b04c760148428378</id>
<content type='text'>
Mark Langsdorf reported:

&gt; One of my co-workers noticed that the powernow-k8
&gt; driver no longer restarts when a CPU core is
&gt; hot-disabled and then hot-enabled on AMD quad-core
&gt; systems.
&gt;
&gt; The following comands work fine on 2.6.26 and fail
&gt; on 2.6.27-rc1:
&gt;
&gt; echo 0 &gt; /sys/devices/system/cpu/cpu3/online
&gt; echo 1 &gt; /sys/devices/system/cpu/cpu3/online
&gt; find /sys -name cpufreq
&gt;
&gt; For 2.6.26, the find will return a cpufreq
&gt; directory for each processor.  In 2.6.27-rc1,
&gt; the cpu3 directory is missing.
&gt;
&gt; After digging through the code, the following
&gt; logic is failing when the core is hot-enabled
&gt; at runtime.  The code works during the boot
&gt; sequence.
&gt;
&gt;       cpumask_t = current-&gt;cpus_allowed;
&gt;       set_cpus_allowed_ptr(current, &amp;cpumask_of_cpu(cpu));
&gt;       if (smp_processor_id() != cpu)
&gt;               return -ENODEV;

So set the CPU active before calling the CPU_ONLINE notifier chain,
there are a handful of notifiers that use set_cpus_allowed().

This fix also solves the problem with x86-microcode. I've sent
alternative patches for microcode, but as this "rely on
set_cpus_allowed_ptr() being workable in cpu-hotplug(CPU_ONLINE, ...)"
assumption seems to be more broad than what we thought, perhaps this fix
should be applied.

With this patch we define that by the moment CPU_ONLINE is being sent,
a 'cpu' is online and ready for tasks to be migrated onto it.

Signed-off-by: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Reported-by: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt;
Tested-by: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>Merge branch 'linus' into cpus4096</title>
<updated>2008-07-28T21:32:00Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-07-28T21:32:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9e3ee1c39c0cc71222f9980ccbf87fe072897eef'/>
<id>urn:sha1:9e3ee1c39c0cc71222f9980ccbf87fe072897eef</id>
<content type='text'>
Conflicts:

	kernel/stop_machine.c

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>cpu masks: optimize and clean up cpumask_of_cpu()</title>
<updated>2008-07-28T20:20:41Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2008-07-28T18:32:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e56b3bc7942982ac2589c942fb345e38bc7a341a'/>
<id>urn:sha1:e56b3bc7942982ac2589c942fb345e38bc7a341a</id>
<content type='text'>
Clean up and optimize cpumask_of_cpu(), by sharing all the zero words.

Instead of stupidly generating all possible i=0...NR_CPUS 2^i patterns
creating a huge array of constant bitmasks, realize that the zero words
can be shared.

In other words, on a 64-bit architecture, we only ever need 64 of these
arrays - with a different bit set in one single world (with enough zero
words around it so that we can create any bitmask by just offsetting in
that big array). And then we just put enough zeroes around it that we
can point every single cpumask to be one of those things.

So when we have 4k CPU's, instead of having 4k arrays (of 4k bits each,
with one bit set in each array - 2MB memory total), we have exactly 64
arrays instead, each 8k bits in size (64kB total).

And then we just point cpumask(n) to the right position (which we can
calculate dynamically). Once we have the right arrays, getting
"cpumask(n)" ends up being:

  static inline const cpumask_t *get_cpu_mask(unsigned int cpu)
  {
          const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG];
          p -= cpu / BITS_PER_LONG;
          return (const cpumask_t *)p;
  }

This brings other advantages and simplifications as well:

 - we are not wasting memory that is just filled with a single bit in
   various different places

 - we don't need all those games to re-create the arrays in some dense
   format, because they're already going to be dense enough.

if we compile a kernel for up to 4k CPU's, "wasting" that 64kB of memory
is a non-issue (especially since by doing this "overlapping" trick we
probably get better cache behaviour anyway).

[ mingo@elte.hu:

  Converted Linus's mails into a commit. See:

     http://lkml.org/lkml/2008/7/27/156
     http://lkml.org/lkml/2008/7/28/320

  Also applied a family filter - which also has the side-effect of leaving
  out the bits where Linus calls me an idio... Oh, never mind ;-)
]

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Al Viro &lt;viro@ZenIV.linux.org.uk&gt;
Cc: Mike Travis &lt;travis@sgi.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>stop_machine(): stop_machine_run() changed to use cpu mask</title>
<updated>2008-07-28T02:16:30Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2008-07-28T17:16:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eeec4fad963490821348a331cca6102ae1c4a7a3'/>
<id>urn:sha1:eeec4fad963490821348a331cca6102ae1c4a7a3</id>
<content type='text'>
Instead of a "cpu" arg with magic values NR_CPUS (any cpu) and ~0 (all
cpus), pass a cpumask_t.  Allow NULL for the common case (where we
don't care which CPU the function is run on): temporary cpumask_t's
are usually considered bad for stack space.

This deprecates stop_machine_run, to be removed soon when all the
callers are dead.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
</feed>
