<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/smp.c, branch v2.6.34</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.34</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.34'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2010-03-30T13:02:32Z</updated>
<entry>
<title>include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h</title>
<updated>2010-03-30T13:02:32Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-03-24T08:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5a0e3ad6af8660be21ca98a971cd00f331318c05'/>
<id>urn:sha1:5a0e3ad6af8660be21ca98a971cd00f331318c05</id>
<content type='text'>
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -&gt; slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Guess-its-ok-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Lee Schermerhorn &lt;Lee.Schermerhorn@hp.com&gt;
</content>
</entry>
<entry>
<title>generic-ipi: Optimize accesses by using DEFINE_PER_CPU_SHARED_ALIGNED for IPI data</title>
<updated>2010-01-18T08:02:59Z</updated>
<author>
<name>Milton Miller</name>
<email>miltonm@bga.com</email>
</author>
<published>2010-01-18T02:00:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e03bcb68629c7f0728c95f1afe06ce48565c7713'/>
<id>urn:sha1:e03bcb68629c7f0728c95f1afe06ce48565c7713</id>
<content type='text'>
The smp ipi data is passed around and given write access by
other cpus and should be separated from per-cpu data consumed by
this cpu.

Looking for hot lines, I saw call_function_data shared with
tick_cpu_sched.

Signed-off-by: Milton Miller &lt;miltonm@bga.com&gt;
Acked-by: Anton Blanchard &lt;anton@samba.org&gt;
Acked-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: : Nick Piggin &lt;npiggin@suse.de&gt;
LKML-Reference: &lt;20100118020051.GR12666@kryten&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>smp_call_function_any(): pass the node value to cpumask_of_node()</title>
<updated>2010-01-16T20:15:39Z</updated>
<author>
<name>David John</name>
<email>davidjon@xenontk.org</email>
</author>
<published>2010-01-16T01:01:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=af2422c42c0ff42b8b93dbb3a5fe65250fb65c40'/>
<id>urn:sha1:af2422c42c0ff42b8b93dbb3a5fe65250fb65c40</id>
<content type='text'>
The change in acpi_cpufreq to use smp_call_function_any causes a warning
when it is called since the function erroneously passes the cpu id to
cpumask_of_node rather than the node that the cpu is on.  Fix this.

cpumask_of_node(3): node &gt; nr_node_ids(1)
Pid: 1, comm: swapper Not tainted 2.6.33-rc3-00097-g2c1f189 #223
Call Trace:
 [&lt;ffffffff81028bb3&gt;] cpumask_of_node+0x23/0x58
 [&lt;ffffffff81061f51&gt;] smp_call_function_any+0x65/0xfa
 [&lt;ffffffff810160d1&gt;] ? do_drv_read+0x0/0x2f
 [&lt;ffffffff81015fba&gt;] get_cur_val+0xb0/0x102
 [&lt;ffffffff81016080&gt;] get_cur_freq_on_cpu+0x74/0xc5
 [&lt;ffffffff810168a7&gt;] acpi_cpufreq_cpu_init+0x417/0x515
 [&lt;ffffffff81562ce9&gt;] ? __down_write+0xb/0xd
 [&lt;ffffffff8148055e&gt;] cpufreq_add_dev+0x278/0x922

Signed-off-by: David John &lt;davidjon@xenontk.org&gt;
Cc: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&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>Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2009-12-15T17:02:01Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-12-15T17:02:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8f0ddf91f2aeb09602373e400cf8b403e9017210'/>
<id>urn:sha1:8f0ddf91f2aeb09602373e400cf8b403e9017210</id>
<content type='text'>
* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (26 commits)
  clockevents: Convert to raw_spinlock
  clockevents: Make tick_device_lock static
  debugobjects: Convert to raw_spinlocks
  perf_event: Convert to raw_spinlock
  hrtimers: Convert to raw_spinlocks
  genirq: Convert irq_desc.lock to raw_spinlock
  smp: Convert smplocks to raw_spinlocks
  rtmutes: Convert rtmutex.lock to raw_spinlock
  sched: Convert pi_lock to raw_spinlock
  sched: Convert cpupri lock to raw_spinlock
  sched: Convert rt_runtime_lock to raw_spinlock
  sched: Convert rq-&gt;lock to raw_spinlock
  plist: Make plist debugging raw_spinlock aware
  bkl: Fixup core_lock fallout
  locking: Cleanup the name space completely
  locking: Further name space cleanups
  alpha: Fix fallout from locking changes
  locking: Implement new raw_spinlock
  locking: Convert raw_rwlock functions to arch_rwlock
  locking: Convert raw_rwlock to arch_rwlock
  ...
</content>
</entry>
<entry>
<title>generic-ipi: cleanup for generic_smp_call_function_interrupt()</title>
<updated>2009-12-15T16:53:25Z</updated>
<author>
<name>Xiao Guangrong</name>
<email>xiaoguangrong@cn.fujitsu.com</email>
</author>
<published>2009-12-15T02:00:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c0f68c2fab4898bcc4671a8fb941f428856b4ad5'/>
<id>urn:sha1:c0f68c2fab4898bcc4671a8fb941f428856b4ad5</id>
<content type='text'>
Use smp_processor_id() instead of get_cpu() and put_cpu() in
generic_smp_call_function_interrupt(), It's no need to disable preempt,
because we must call generic_smp_call_function_interrupt() with interrupts
disabled.

Signed-off-by: Xiao Guangrong &lt;xiaoguangrong@cn.fujitsu.com&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Cc: Nick Piggin &lt;nickpiggin@yahoo.com.au&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&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>smp: Convert smplocks to raw_spinlocks</title>
<updated>2009-12-14T22:55:33Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-11-17T14:40:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9f5a5621e78cf48d86682a71ceb3fcdbde38b222'/>
<id>urn:sha1:9f5a5621e78cf48d86682a71ceb3fcdbde38b222</id>
<content type='text'>
Convert locks which cannot be sleeping locks in preempt-rt to
raw_spinlocks.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>generic-ipi: Add smp_call_function_any()</title>
<updated>2009-11-18T13:52:25Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2009-11-17T22:27:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2ea6dec4a22a6f66f6633876212fd4d195cf8277'/>
<id>urn:sha1:2ea6dec4a22a6f66f6633876212fd4d195cf8277</id>
<content type='text'>
Andrew points out that acpi-cpufreq uses cpumask_any, when it really
would prefer to use the same CPU if possible (to avoid an IPI).  In
general, this seems a good idea to offer.

[ tglx: Documented selection preference and Inlined the UP case to
  	avoid the copy of smp_call_function_single() and the extra
  	EXPORT ]

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Venkatesh Pallipadi &lt;venkatesh.pallipadi@intel.com&gt;
Cc: Len Brown &lt;len.brown@intel.com&gt;
Cc: Zhao Yakui &lt;yakui.zhao@intel.com&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: "Zhang, Yanmin" &lt;yanmin_zhang@linux.intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>generic-ipi: Fix misleading smp_call_function*() description</title>
<updated>2009-10-23T11:51:45Z</updated>
<author>
<name>Sheng Yang</name>
<email>sheng@linux.intel.com</email>
</author>
<published>2009-10-22T11:19:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=72f279b256d520e321a850880d094bc0bcbf45d6'/>
<id>urn:sha1:72f279b256d520e321a850880d094bc0bcbf45d6</id>
<content type='text'>
After commit:8969a5ede0f9e17da4b943712429aef2c9bcd82b
"generic-ipi: remove kmalloc()", wait = 0 can be guaranteed.

Signed-off-by: Sheng Yang &lt;sheng@linux.intel.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Cc: Nick Piggin &lt;npiggin@suse.de&gt;
LKML-Reference: &lt;1256210374-25354-1-git-send-email-sheng@linux.intel.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>cpumask: remove arch_send_call_function_ipi</title>
<updated>2009-09-24T00:04:47Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2009-09-24T15:34:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0748bd01773395003208996c4c0b3f80caf80976'/>
<id>urn:sha1:0748bd01773395003208996c4c0b3f80caf80976</id>
<content type='text'>
Now everyone is converted to arch_send_call_function_ipi_mask, remove
the shim and the #defines.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>generic-ipi: make struct call_function_data lockless</title>
<updated>2009-09-23T14:39:28Z</updated>
<author>
<name>Xiao Guangrong</name>
<email>xiaoguangrong@cn.fujitsu.com</email>
</author>
<published>2009-09-22T23:43:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=54fdade1c3332391948ec43530c02c4794a38172'/>
<id>urn:sha1:54fdade1c3332391948ec43530c02c4794a38172</id>
<content type='text'>
This patch can remove spinlock from struct call_function_data, the
reasons are below:

1: add a new interface for cpumask named cpumask_test_and_clear_cpu(),
   it can atomically test and clear specific cpu, we can use it instead
   of cpumask_test_cpu() and cpumask_clear_cpu() and no need data-&gt;lock
   to protect those in generic_smp_call_function_interrupt().

2: in smp_call_function_many(), after csd_lock() return, the current's
   cfd_data is deleted from call_function list, so it not have race
   between other cpus, then cfs_data is only used in
   smp_call_function_many() that must disable preemption and not from
   a hardware interrupthandler or from a bottom half handler to call,
   only the correspond cpu can use it, so it not have race in current
   cpu, no need cfs_data-&gt;lock to protect it.

3: after 1 and 2, cfs_data-&gt;lock is only use to protect cfs_data-&gt;refs in
   generic_smp_call_function_interrupt(), so we can define cfs_data-&gt;refs
   to atomic_t, and no need cfs_data-&gt;lock any more.

Signed-off-by: Xiao Guangrong &lt;xiaoguangrong@cn.fujitsu.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Cc: Nick Piggin &lt;nickpiggin@yahoo.com.au&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
[akpm@linux-foundation.org: use atomic_dec_return()]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
