<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/workqueue.c, branch v2.6.30</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.30</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.30'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2009-04-09T00:20:37Z</updated>
<entry>
<title>work_on_cpu(): rewrite it to create a kernel thread on demand</title>
<updated>2009-04-09T00:20:37Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@linux-foundation.org</email>
</author>
<published>2009-04-09T15:50:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6b44003e5ca66a3fffeb5bc90f40ada2c4340896'/>
<id>urn:sha1:6b44003e5ca66a3fffeb5bc90f40ada2c4340896</id>
<content type='text'>
Impact: circular locking bugfix

The various implemetnations and proposed implemetnations of work_on_cpu()
are vulnerable to various deadlocks because they all used queues of some
form.

Unrelated pieces of kernel code thus gained dependencies wherein if one
work_on_cpu() caller holds a lock which some other work_on_cpu() callback
also takes, the kernel could rarely deadlock.

Fix this by creating a short-lived kernel thread for each work_on_cpu()
invokation.

This is not terribly fast, but the only current caller of work_on_cpu() is
pci_call_probe().

It would be nice to find some other way of doing the node-local
allocations in the PCI probe code so that we can zap work_on_cpu()
altogether.  The code there is rather nasty.  I can't think of anything
simple at this time...

Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2009-04-05T18:04:19Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-04-05T18:04:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=714f83d5d9f7c785f622259dad1f4fad12d64664'/>
<id>urn:sha1:714f83d5d9f7c785f622259dad1f4fad12d64664</id>
<content type='text'>
* 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (413 commits)
  tracing, net: fix net tree and tracing tree merge interaction
  tracing, powerpc: fix powerpc tree and tracing tree interaction
  ring-buffer: do not remove reader page from list on ring buffer free
  function-graph: allow unregistering twice
  trace: make argument 'mem' of trace_seq_putmem() const
  tracing: add missing 'extern' keywords to trace_output.h
  tracing: provide trace_seq_reserve()
  blktrace: print out BLK_TN_MESSAGE properly
  blktrace: extract duplidate code
  blktrace: fix memory leak when freeing struct blk_io_trace
  blktrace: fix blk_probes_ref chaos
  blktrace: make classic output more classic
  blktrace: fix off-by-one bug
  blktrace: fix the original blktrace
  blktrace: fix a race when creating blk_tree_root in debugfs
  blktrace: fix timestamp in binary output
  tracing, Text Edit Lock: cleanup
  tracing: filter fix for TRACE_EVENT_FORMAT events
  ftrace: Using FTRACE_WARN_ON() to check "freed record" in ftrace_release()
  x86: kretprobe-booster interrupt emulation code fix
  ...

Fix up trivial conflicts in
 arch/parisc/include/asm/ftrace.h
 include/linux/memory.h
 kernel/extable.c
 kernel/module.c
</content>
</entry>
<entry>
<title>workqueue: avoid recursion in run_workqueue()</title>
<updated>2009-04-03T02:05:00Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2009-04-02T23:58:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2355b70fd59cb5be7de2052a9edeee7afb7ff099'/>
<id>urn:sha1:2355b70fd59cb5be7de2052a9edeee7afb7ff099</id>
<content type='text'>
1) lockdep will complain when run_workqueue() performs recursion.

2) The recursive implementation of run_workqueue() means that
   flush_workqueue() and its documentation are inconsistent.  This may
   hide deadlocks and other bugs.

3) The recursion in run_workqueue() will poison cwq-&gt;current_work, but
   flush_work() and __cancel_work_timer(), etcetera need a reliable
   cwq-&gt;current_work.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Acked-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Eric Dumazet &lt;dada1@cosmosbay.com&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>Merge branch 'tracing/core-v2' into tracing-for-linus</title>
<updated>2009-04-01T22:49:02Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-04-01T19:54:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8302294f43250dc337108c51882a6007f2b1e2e0'/>
<id>urn:sha1:8302294f43250dc337108c51882a6007f2b1e2e0</id>
<content type='text'>
Conflicts:
	include/linux/slub_def.h
	lib/Kconfig.debug
	mm/slob.c
	mm/slub.c
</content>
</entry>
<entry>
<title>cpumask: use new cpumask_ functions in core code.</title>
<updated>2009-03-30T11:35:16Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2009-03-31T04:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa85ea5b89c36c51200d795dd788139bd9b8cf50'/>
<id>urn:sha1:aa85ea5b89c36c51200d795dd788139bd9b8cf50</id>
<content type='text'>
Impact: cleanup

Time to clean up remaining laggards using the old cpu_ functions.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Trond.Myklebust@netapp.com
</content>
</entry>
<entry>
<title>Merge branches 'tracing/ftrace', 'tracing/kmemtrace' and 'linus' into tracing/core</title>
<updated>2009-02-03T05:25:38Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-02-03T05:25:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dc573f9b20c8710105ac35c08ed0fe1da5160ecd'/>
<id>urn:sha1:dc573f9b20c8710105ac35c08ed0fe1da5160ecd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>work_on_cpu: Use our own workqueue.</title>
<updated>2009-01-19T21:36:07Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2009-01-16T23:31:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ccad40df8d314f786fdb06bdbedd4f43f3257cd'/>
<id>urn:sha1:8ccad40df8d314f786fdb06bdbedd4f43f3257cd</id>
<content type='text'>
Impact: remove potential clashes with generic kevent workqueue

Annoyingly, some places we want to use work_on_cpu are already in
workqueues.  As per Ingo's suggestion, we create a different workqueue
for work_on_cpu.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Mike Travis &lt;travis@sgi.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>work_on_cpu: don't try to get_online_cpus() in work_on_cpu.</title>
<updated>2009-01-19T21:36:02Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2009-01-16T23:31:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=31ad9081200c06ccc350625d41d1f8b2d1cef29f'/>
<id>urn:sha1:31ad9081200c06ccc350625d41d1f8b2d1cef29f</id>
<content type='text'>
Impact: remove potential circular lock dependency with cpu hotplug lock

This has caused more problems than it solved, with a pile of cpu
hotplug locking issues.

Followup patches will get_online_cpus() in callers that need it, but
if they don't do it they're no worse than before when they were using
set_cpus_allowed without locking.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Mike Travis &lt;travis@sgi.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: add a new workqueue tracer</title>
<updated>2009-01-14T11:11:43Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-01-12T22:15:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e1d8aa9f1dd655a3534b22fcfbecb70cdb125766'/>
<id>urn:sha1:e1d8aa9f1dd655a3534b22fcfbecb70cdb125766</id>
<content type='text'>
Impact: new tracer

The workqueue tracer provides some statistical informations
about each cpu workqueue thread such as the number of the
works inserted and executed since their creation. It can help
to evaluate the amount of work each of them have to perform.
For example it can help a developer to decide whether he should
choose a per cpu workqueue instead of a singlethreaded one.

It only traces statistical informations for now but it will probably later
provide event tracing too.

Such a tracer could help too, and be improved, to help rt priority sorted
workqueue development.

To have a snapshot of the workqueues state at any time, just do

cat /debugfs/tracing/trace_stat/workqueues

Ie:

  1    125        125       reiserfs/1
  1      0          0       scsi_tgtd/1
  1      0          0       aio/1
  1      0          0       ata/1
  1    114        114       kblockd/1
  1      0          0       kintegrityd/1
  1   2147       2147       events/1

  0      0          0       kpsmoused
  0    105        105       reiserfs/0
  0      0          0       scsi_tgtd/0
  0      0          0       aio/0
  0      0          0       ata_aux
  0      0          0       ata/0
  0      0          0       cqueue
  0      0          0       kacpi_notify
  0      0          0       kacpid
  0    149        149       kblockd/0
  0      0          0       kintegrityd/0
  0   1000       1000       khelper
  0   2270       2270       events/0

Changes in V2:

_ Drop the static array based on NR_CPU and dynamically allocate the stat array
  with num_possible_cpus() and other cpu mask facilities....
_ Trace workqueue insertion at a bit lower level (insert_work instead of queue_work) to handle
  even the workqueue barriers.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>cpumask: convert kernel/workqueue.c</title>
<updated>2008-12-31T23:42:25Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2008-12-31T23:42:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e7577c50f2fb2d1c167e2c04a4b4c2cc042acb82'/>
<id>urn:sha1:e7577c50f2fb2d1c167e2c04a4b4c2cc042acb82</id>
<content type='text'>
Impact: Reduce memory usage, use new cpumask API.

cpu_populated_map becomes a cpumask_var_t, and cpu_singlethread_map is
simply a cpumask pointer: it's simply the cpumask containing the first
possible CPU anyway.

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