<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/kernel/irq_work.c, branch v3.17.2</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>irq_work: Force raised irq work to run on irq work interrupt</title>
<updated>2014-10-15T10:29:23+00:00</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2014-08-16T16:37:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6fd5de08a5337d0d601f6361671813df4f013da9'/>
<id>6fd5de08a5337d0d601f6361671813df4f013da9</id>
<content type='text'>
commit 76a33061b9323b7fdb220ae5fa116c10833ec22e upstream.

The nohz full kick, which restarts the tick when any resource depend
on it, can't be executed anywhere given the operation it does on timers.
If it is called from the scheduler or timers code, chances are that
we run into a deadlock.

This is why we run the nohz full kick from an irq work. That way we make
sure that the kick runs on a virgin context.

However if that's the case when irq work runs in its own dedicated
self-ipi, things are different for the big bunch of archs that don't
support the self triggered way. In order to support them, irq works are
also handled by the timer interrupt as fallback.

Now when irq works run on the timer interrupt, the context isn't blank.
More precisely, they can run in the context of the hrtimer that runs the
tick. But the nohz kick cancels and restarts this hrtimer and cancelling
an hrtimer from itself isn't allowed. This is why we run in an endless
loop:

	Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 2
	CPU: 2 PID: 7538 Comm: kworker/u8:8 Not tainted 3.16.0+ #34
	Workqueue: btrfs-endio-write normal_work_helper [btrfs]
	 ffff880244c06c88 000000001b486fe1 ffff880244c06bf0 ffffffff8a7f1e37
	 ffffffff8ac52a18 ffff880244c06c78 ffffffff8a7ef928 0000000000000010
	 ffff880244c06c88 ffff880244c06c20 000000001b486fe1 0000000000000000
	Call Trace:
	 &lt;NMI[&lt;ffffffff8a7f1e37&gt;] dump_stack+0x4e/0x7a
	 [&lt;ffffffff8a7ef928&gt;] panic+0xd4/0x207
	 [&lt;ffffffff8a1450e8&gt;] watchdog_overflow_callback+0x118/0x120
	 [&lt;ffffffff8a186b0e&gt;] __perf_event_overflow+0xae/0x350
	 [&lt;ffffffff8a184f80&gt;] ? perf_event_task_disable+0xa0/0xa0
	 [&lt;ffffffff8a01a4cf&gt;] ? x86_perf_event_set_period+0xbf/0x150
	 [&lt;ffffffff8a187934&gt;] perf_event_overflow+0x14/0x20
	 [&lt;ffffffff8a020386&gt;] intel_pmu_handle_irq+0x206/0x410
	 [&lt;ffffffff8a01937b&gt;] perf_event_nmi_handler+0x2b/0x50
	 [&lt;ffffffff8a007b72&gt;] nmi_handle+0xd2/0x390
	 [&lt;ffffffff8a007aa5&gt;] ? nmi_handle+0x5/0x390
	 [&lt;ffffffff8a0cb7f8&gt;] ? match_held_lock+0x8/0x1b0
	 [&lt;ffffffff8a008062&gt;] default_do_nmi+0x72/0x1c0
	 [&lt;ffffffff8a008268&gt;] do_nmi+0xb8/0x100
	 [&lt;ffffffff8a7ff66a&gt;] end_repeat_nmi+0x1e/0x2e
	 [&lt;ffffffff8a0cb7f8&gt;] ? match_held_lock+0x8/0x1b0
	 [&lt;ffffffff8a0cb7f8&gt;] ? match_held_lock+0x8/0x1b0
	 [&lt;ffffffff8a0cb7f8&gt;] ? match_held_lock+0x8/0x1b0
	 &lt;&lt;EOE&gt;&lt;IRQ[&lt;ffffffff8a0ccd2f&gt;] lock_acquired+0xaf/0x450
	 [&lt;ffffffff8a0f74c5&gt;] ? lock_hrtimer_base.isra.20+0x25/0x50
	 [&lt;ffffffff8a7fc678&gt;] _raw_spin_lock_irqsave+0x78/0x90
	 [&lt;ffffffff8a0f74c5&gt;] ? lock_hrtimer_base.isra.20+0x25/0x50
	 [&lt;ffffffff8a0f74c5&gt;] lock_hrtimer_base.isra.20+0x25/0x50
	 [&lt;ffffffff8a0f7723&gt;] hrtimer_try_to_cancel+0x33/0x1e0
	 [&lt;ffffffff8a0f78ea&gt;] hrtimer_cancel+0x1a/0x30
	 [&lt;ffffffff8a109237&gt;] tick_nohz_restart+0x17/0x90
	 [&lt;ffffffff8a10a213&gt;] __tick_nohz_full_check+0xc3/0x100
	 [&lt;ffffffff8a10a25e&gt;] nohz_full_kick_work_func+0xe/0x10
	 [&lt;ffffffff8a17c884&gt;] irq_work_run_list+0x44/0x70
	 [&lt;ffffffff8a17c8da&gt;] irq_work_run+0x2a/0x50
	 [&lt;ffffffff8a0f700b&gt;] update_process_times+0x5b/0x70
	 [&lt;ffffffff8a109005&gt;] tick_sched_handle.isra.21+0x25/0x60
	 [&lt;ffffffff8a109b81&gt;] tick_sched_timer+0x41/0x60
	 [&lt;ffffffff8a0f7aa2&gt;] __run_hrtimer+0x72/0x470
	 [&lt;ffffffff8a109b40&gt;] ? tick_sched_do_timer+0xb0/0xb0
	 [&lt;ffffffff8a0f8707&gt;] hrtimer_interrupt+0x117/0x270
	 [&lt;ffffffff8a034357&gt;] local_apic_timer_interrupt+0x37/0x60
	 [&lt;ffffffff8a80010f&gt;] smp_apic_timer_interrupt+0x3f/0x50
	 [&lt;ffffffff8a7fe52f&gt;] apic_timer_interrupt+0x6f/0x80

To fix this we force non-lazy irq works to run on irq work self-IPIs
when available. That ability of the arch to trigger irq work self IPIs
is available with arch_irq_work_has_interrupt().

Reported-by: Catalin Iacob &lt;iacobcatalin@gmail.com&gt;
Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 76a33061b9323b7fdb220ae5fa116c10833ec22e upstream.

The nohz full kick, which restarts the tick when any resource depend
on it, can't be executed anywhere given the operation it does on timers.
If it is called from the scheduler or timers code, chances are that
we run into a deadlock.

This is why we run the nohz full kick from an irq work. That way we make
sure that the kick runs on a virgin context.

However if that's the case when irq work runs in its own dedicated
self-ipi, things are different for the big bunch of archs that don't
support the self triggered way. In order to support them, irq works are
also handled by the timer interrupt as fallback.

Now when irq works run on the timer interrupt, the context isn't blank.
More precisely, they can run in the context of the hrtimer that runs the
tick. But the nohz kick cancels and restarts this hrtimer and cancelling
an hrtimer from itself isn't allowed. This is why we run in an endless
loop:

	Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 2
	CPU: 2 PID: 7538 Comm: kworker/u8:8 Not tainted 3.16.0+ #34
	Workqueue: btrfs-endio-write normal_work_helper [btrfs]
	 ffff880244c06c88 000000001b486fe1 ffff880244c06bf0 ffffffff8a7f1e37
	 ffffffff8ac52a18 ffff880244c06c78 ffffffff8a7ef928 0000000000000010
	 ffff880244c06c88 ffff880244c06c20 000000001b486fe1 0000000000000000
	Call Trace:
	 &lt;NMI[&lt;ffffffff8a7f1e37&gt;] dump_stack+0x4e/0x7a
	 [&lt;ffffffff8a7ef928&gt;] panic+0xd4/0x207
	 [&lt;ffffffff8a1450e8&gt;] watchdog_overflow_callback+0x118/0x120
	 [&lt;ffffffff8a186b0e&gt;] __perf_event_overflow+0xae/0x350
	 [&lt;ffffffff8a184f80&gt;] ? perf_event_task_disable+0xa0/0xa0
	 [&lt;ffffffff8a01a4cf&gt;] ? x86_perf_event_set_period+0xbf/0x150
	 [&lt;ffffffff8a187934&gt;] perf_event_overflow+0x14/0x20
	 [&lt;ffffffff8a020386&gt;] intel_pmu_handle_irq+0x206/0x410
	 [&lt;ffffffff8a01937b&gt;] perf_event_nmi_handler+0x2b/0x50
	 [&lt;ffffffff8a007b72&gt;] nmi_handle+0xd2/0x390
	 [&lt;ffffffff8a007aa5&gt;] ? nmi_handle+0x5/0x390
	 [&lt;ffffffff8a0cb7f8&gt;] ? match_held_lock+0x8/0x1b0
	 [&lt;ffffffff8a008062&gt;] default_do_nmi+0x72/0x1c0
	 [&lt;ffffffff8a008268&gt;] do_nmi+0xb8/0x100
	 [&lt;ffffffff8a7ff66a&gt;] end_repeat_nmi+0x1e/0x2e
	 [&lt;ffffffff8a0cb7f8&gt;] ? match_held_lock+0x8/0x1b0
	 [&lt;ffffffff8a0cb7f8&gt;] ? match_held_lock+0x8/0x1b0
	 [&lt;ffffffff8a0cb7f8&gt;] ? match_held_lock+0x8/0x1b0
	 &lt;&lt;EOE&gt;&lt;IRQ[&lt;ffffffff8a0ccd2f&gt;] lock_acquired+0xaf/0x450
	 [&lt;ffffffff8a0f74c5&gt;] ? lock_hrtimer_base.isra.20+0x25/0x50
	 [&lt;ffffffff8a7fc678&gt;] _raw_spin_lock_irqsave+0x78/0x90
	 [&lt;ffffffff8a0f74c5&gt;] ? lock_hrtimer_base.isra.20+0x25/0x50
	 [&lt;ffffffff8a0f74c5&gt;] lock_hrtimer_base.isra.20+0x25/0x50
	 [&lt;ffffffff8a0f7723&gt;] hrtimer_try_to_cancel+0x33/0x1e0
	 [&lt;ffffffff8a0f78ea&gt;] hrtimer_cancel+0x1a/0x30
	 [&lt;ffffffff8a109237&gt;] tick_nohz_restart+0x17/0x90
	 [&lt;ffffffff8a10a213&gt;] __tick_nohz_full_check+0xc3/0x100
	 [&lt;ffffffff8a10a25e&gt;] nohz_full_kick_work_func+0xe/0x10
	 [&lt;ffffffff8a17c884&gt;] irq_work_run_list+0x44/0x70
	 [&lt;ffffffff8a17c8da&gt;] irq_work_run+0x2a/0x50
	 [&lt;ffffffff8a0f700b&gt;] update_process_times+0x5b/0x70
	 [&lt;ffffffff8a109005&gt;] tick_sched_handle.isra.21+0x25/0x60
	 [&lt;ffffffff8a109b81&gt;] tick_sched_timer+0x41/0x60
	 [&lt;ffffffff8a0f7aa2&gt;] __run_hrtimer+0x72/0x470
	 [&lt;ffffffff8a109b40&gt;] ? tick_sched_do_timer+0xb0/0xb0
	 [&lt;ffffffff8a0f8707&gt;] hrtimer_interrupt+0x117/0x270
	 [&lt;ffffffff8a034357&gt;] local_apic_timer_interrupt+0x37/0x60
	 [&lt;ffffffff8a80010f&gt;] smp_apic_timer_interrupt+0x3f/0x50
	 [&lt;ffffffff8a7fe52f&gt;] apic_timer_interrupt+0x6f/0x80

To fix this we force non-lazy irq works to run on irq work self-IPIs
when available. That ability of the arch to trigger irq work self IPIs
is available with arch_irq_work_has_interrupt().

Reported-by: Catalin Iacob &lt;iacobcatalin@gmail.com&gt;
Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>irq_work: Remove BUG_ON in irq_work_run()</title>
<updated>2014-07-05T09:17:26+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2014-06-25T05:13:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a77353e5eb56b6c6098bfce59aff1f449451b0b7'/>
<id>a77353e5eb56b6c6098bfce59aff1f449451b0b7</id>
<content type='text'>
Because of a collision with 8d056c48e486 ("CPU hotplug, smp: flush any
pending IPI callbacks before CPU offline"), which ends up calling
hotplug_cfd()-&gt;flush_smp_call_function_queue()-&gt;irq_work_run(), which
is not from IRQ context.

And since that already calls irq_work_run() from the hotplug path,
remove our entire hotplug handling.

Reported-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Tested-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Reviewed-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/n/tip-busatzs2gvz4v62258agipuf@git.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because of a collision with 8d056c48e486 ("CPU hotplug, smp: flush any
pending IPI callbacks before CPU offline"), which ends up calling
hotplug_cfd()-&gt;flush_smp_call_function_queue()-&gt;irq_work_run(), which
is not from IRQ context.

And since that already calls irq_work_run() from the hotplug path,
remove our entire hotplug handling.

Reported-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Tested-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Reviewed-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/n/tip-busatzs2gvz4v62258agipuf@git.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>irq_work: Implement remote queueing</title>
<updated>2014-06-16T14:26:54+00:00</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2014-05-07T23:37:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=478850160636c4f0b2558451df0e42f8c5a10939'/>
<id>478850160636c4f0b2558451df0e42f8c5a10939</id>
<content type='text'>
irq work currently only supports local callbacks. However its code
is mostly ready to run remote callbacks and we have some potential user.

The full nohz subsystem currently open codes its own remote irq work
on top of the scheduler ipi when it wants a CPU to reevaluate its next
tick. However this ad hoc solution bloats the scheduler IPI.

Lets just extend the irq work subsystem to support remote queuing on top
of the generic SMP IPI to handle this kind of user. This shouldn't add
noticeable overhead.

Suggested-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Kevin Hilman &lt;khilman@linaro.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
irq work currently only supports local callbacks. However its code
is mostly ready to run remote callbacks and we have some potential user.

The full nohz subsystem currently open codes its own remote irq work
on top of the scheduler ipi when it wants a CPU to reevaluate its next
tick. However this ad hoc solution bloats the scheduler IPI.

Lets just extend the irq work subsystem to support remote queuing on top
of the generic SMP IPI to handle this kind of user. This shouldn't add
noticeable overhead.

Suggested-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Kevin Hilman &lt;khilman@linaro.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>irq_work: Split raised and lazy lists</title>
<updated>2014-06-16T14:26:53+00:00</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2014-05-23T16:10:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b93e0b8fa819c3d5641794ed9a07e643416aa0fd'/>
<id>b93e0b8fa819c3d5641794ed9a07e643416aa0fd</id>
<content type='text'>
An irq work can be handled from two places: from the tick if the work
carries the "lazy" flag and the tick is periodic, or from a self IPI.

We merge all these works in a single list and we use some per cpu latch
to avoid raising a self-IPI when one is already pending.

Now we could do away with this ugly latch if only the list was only made of
non-lazy works. Just enqueueing a work on the empty list would be enough
to know if we need to raise an IPI or not.

Also we are going to implement remote irq work queuing. Then the per CPU
latch will need to become atomic in the global scope. That's too bad
because, here as well, just enqueueing a work on an empty list of
non-lazy works would be enough to know if we need to raise an IPI or not.

So lets take a way out of this: split the works in two distinct lists,
one for the works that can be handled by the next tick and another
one for those handled by the IPI. Just checking if the latter is empty
when we queue a new work is enough to know if we need to raise an IPI.

Suggested-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Kevin Hilman &lt;khilman@linaro.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An irq work can be handled from two places: from the tick if the work
carries the "lazy" flag and the tick is periodic, or from a self IPI.

We merge all these works in a single list and we use some per cpu latch
to avoid raising a self-IPI when one is already pending.

Now we could do away with this ugly latch if only the list was only made of
non-lazy works. Just enqueueing a work on the empty list would be enough
to know if we need to raise an IPI or not.

Also we are going to implement remote irq work queuing. Then the per CPU
latch will need to become atomic in the global scope. That's too bad
because, here as well, just enqueueing a work on an empty list of
non-lazy works would be enough to know if we need to raise an IPI or not.

So lets take a way out of this: split the works in two distinct lists,
one for the works that can be handled by the next tick and another
one for those handled by the IPI. Just checking if the latter is empty
when we queue a new work is enough to know if we need to raise an IPI.

Suggested-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Kevin Hilman &lt;khilman@linaro.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf/x86: Warn to early_printk() in case irq_work is too slow</title>
<updated>2014-02-21T20:49:07+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2014-02-11T15:01:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cd578abb24aa67ce468c427d3356c08ea32cf768'/>
<id>cd578abb24aa67ce468c427d3356c08ea32cf768</id>
<content type='text'>
On Mon, Feb 10, 2014 at 08:45:16AM -0800, Dave Hansen wrote:
&gt; The reason I coded this up was that NMIs were firing off so fast that
&gt; nothing else was getting a chance to run.  With this patch, at least the
&gt; printk() would come out and I'd have some idea what was going on.

It will start spewing to early_printk() (which is a lot nicer to use
from NMI context too) when it fails to queue the IRQ-work because its
already enqueued.

It does have the false-positive for when two CPUs trigger the warn
concurrently, but that should be rare and some extra clutter on the
early printk shouldn't be a problem.

Cc: hpa@zytor.com
Cc: tglx@linutronix.de
Cc: dzickus@redhat.com
Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: mingo@kernel.org
Fixes: 6a02ad66b2c4 ("perf/x86: Push the duration-logging printk() to IRQ context")
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20140211150116.GO27965@twins.programming.kicks-ass.net
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Mon, Feb 10, 2014 at 08:45:16AM -0800, Dave Hansen wrote:
&gt; The reason I coded this up was that NMIs were firing off so fast that
&gt; nothing else was getting a chance to run.  With this patch, at least the
&gt; printk() would come out and I'd have some idea what was going on.

It will start spewing to early_printk() (which is a lot nicer to use
from NMI context too) when it fails to queue the IRQ-work because its
already enqueued.

It does have the false-positive for when two CPUs trigger the warn
concurrently, but that should be rare and some extra clutter on the
early printk shouldn't be a problem.

Cc: hpa@zytor.com
Cc: tglx@linutronix.de
Cc: dzickus@redhat.com
Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: mingo@kernel.org
Fixes: 6a02ad66b2c4 ("perf/x86: Push the duration-logging printk() to IRQ context")
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20140211150116.GO27965@twins.programming.kicks-ass.net
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'nohz/printk-v8' into irq/core</title>
<updated>2013-02-04T23:48:46+00:00</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2013-02-04T23:48:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=077931446b85e7858bf9dc0927cd116669b965d2'/>
<id>077931446b85e7858bf9dc0927cd116669b965d2</id>
<content type='text'>
Conflicts:
	kernel/irq_work.c

Add support for printk in full dynticks CPU.

* Don't stop tick with irq works pending. This
fix is generally useful and concerns archs that
can't raise self IPIs.

* Flush irq works before CPU offlining.

* Introduce "lazy" irq works that can wait for the
next tick to be executed, unless it's stopped.

* Implement klogd wake up using irq work. This
removes the ad-hoc printk_tick()/printk_needs_cpu()
hooks and make it working even in dynticks mode.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	kernel/irq_work.c

Add support for printk in full dynticks CPU.

* Don't stop tick with irq works pending. This
fix is generally useful and concerns archs that
can't raise self IPIs.

* Flush irq works before CPU offlining.

* Introduce "lazy" irq works that can wait for the
next tick to be executed, unless it's stopped.

* Implement klogd wake up using irq work. This
removes the ad-hoc printk_tick()/printk_needs_cpu()
hooks and make it working even in dynticks mode.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>irq_work: Remove return value from the irq_work_queue() function</title>
<updated>2013-02-04T10:50:59+00:00</updated>
<author>
<name>anish kumar</name>
<email>anish198519851985@gmail.com</email>
</author>
<published>2013-02-03T21:08:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c02cf5f8ed6137e2b3b2f10e0fca336e06e09ba4'/>
<id>c02cf5f8ed6137e2b3b2f10e0fca336e06e09ba4</id>
<content type='text'>
As no one is using the return value of irq_work_queue(),
so it is better to just make it void.

Signed-off-by: anish kumar &lt;anish198519851985@gmail.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
[ Fix stale comments, remove now unnecessary __irq_work_queue() intermediate function ]
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Link: http://lkml.kernel.org/r/1359925703-24304-1-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As no one is using the return value of irq_work_queue(),
so it is better to just make it void.

Signed-off-by: anish kumar &lt;anish198519851985@gmail.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
[ Fix stale comments, remove now unnecessary __irq_work_queue() intermediate function ]
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Link: http://lkml.kernel.org/r/1359925703-24304-1-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>irq_work: Make self-IPIs optable</title>
<updated>2012-11-18T00:01:22+00:00</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2012-10-19T20:43:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bc6679aef673f9dcb8f718528fc3df49ff661af9'/>
<id>bc6679aef673f9dcb8f718528fc3df49ff661af9</id>
<content type='text'>
On irq work initialization, let the user choose to define it
as "lazy" or not. "Lazy" means that we don't want to send
an IPI (provided the arch can anyway) when we enqueue this
work but we rather prefer to wait for the next timer tick
to execute our work if possible.

This is going to be a benefit for non-urgent enqueuers
(like printk in the future) that may prefer not to raise
an IPI storm in case of frequent enqueuing on short periods
of time.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On irq work initialization, let the user choose to define it
as "lazy" or not. "Lazy" means that we don't want to send
an IPI (provided the arch can anyway) when we enqueue this
work but we rather prefer to wait for the next timer tick
to execute our work if possible.

This is going to be a benefit for non-urgent enqueuers
(like printk in the future) that may prefer not to raise
an IPI storm in case of frequent enqueuing on short periods
of time.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>irq_work: Warn if there's still work on cpu_down</title>
<updated>2012-11-17T18:31:16+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2012-11-15T17:52:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8aa2accee41f7045dc904fa41d4475b2f6ffae3e'/>
<id>8aa2accee41f7045dc904fa41d4475b2f6ffae3e</id>
<content type='text'>
If we are in nohz and there's still irq_work to be done when the idle
task is about to go offline, give a nasty warning. Everything should
have been flushed from the CPU_DYING notifier already. Further attempts
to enqueue an irq_work are buggy because irqs are disabled by
__cpu_disable(). The best we can do is to report the issue to the user.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we are in nohz and there's still irq_work to be done when the idle
task is about to go offline, give a nasty warning. Everything should
have been flushed from the CPU_DYING notifier already. Further attempts
to enqueue an irq_work are buggy because irqs are disabled by
__cpu_disable(). The best we can do is to report the issue to the user.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>irq_work: Flush work on CPU_DYING</title>
<updated>2012-11-17T18:31:03+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2012-11-15T16:34:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c0e980a4bd7fc5c9b748f2f0209d2a48c0fdf0ab'/>
<id>c0e980a4bd7fc5c9b748f2f0209d2a48c0fdf0ab</id>
<content type='text'>
In order not to offline a CPU with pending irq works, flush the
queue from CPU_DYING. The notifier is called by stop_machine on
the CPU that is going down. The code will not be called from irq context
(so things like get_irq_regs() wont work) but I'm not sure what the
requirements are for irq_work in that regard (Peter?). But irqs are
disabled and the CPU is about to go offline. Might as well flush the work.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order not to offline a CPU with pending irq works, flush the
queue from CPU_DYING. The notifier is called by stop_machine on
the CPU that is going down. The code will not be called from irq context
(so things like get_irq_regs() wont work) but I'm not sure what the
requirements are for irq_work in that regard (Peter?). But irqs are
disabled and the CPU is about to go offline. Might as well flush the work.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
