<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/irq_work.c, branch v4.15</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=v4.15</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.15'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2017-11-14T01:33:11Z</updated>
<entry>
<title>Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2017-11-14T01:33:11Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2017-11-14T01:33:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=670310dfbae0eefe7318ff6a61e29e67a7a7bbce'/>
<id>urn:sha1:670310dfbae0eefe7318ff6a61e29e67a7a7bbce</id>
<content type='text'>
Pull irq core updates from Thomas Gleixner:
 "A rather large update for the interrupt core code and the irq chip drivers:

   - Add a new bitmap matrix allocator and supporting changes, which is
     used to replace the x86 vector allocator which comes with separate
     pull request. This allows to replace the convoluted nested loop
     allocation function in x86 with a facility which supports the
     recently added property of managed interrupts proper and allows to
     switch to a best effort vector reservation scheme, which addresses
     problems with vector exhaustion.

   - A large update to the ARM GIC-V3-ITS driver adding support for
     range selectors.

   - New interrupt controllers:
       - Meson and Meson8 GPIO
       - BCM7271 L2
       - Socionext EXIU

     If you expected that this will stop at some point, I have to
     disappoint you. There are new ones posted already. Sigh!

   - STM32 interrupt controller support for new platforms.

   - A pile of fixes, cleanups and updates to the MIPS GIC driver

   - The usual small fixes, cleanups and updates all over the place.
     Most visible one is to move the irq chip drivers Kconfig switches
     into a separate Kconfig menu"

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
  genirq: Fix type of shifting literal 1 in __setup_irq()
  irqdomain: Drop pointless NULL check in virq_debug_show_one
  genirq/proc: Return proper error code when irq_set_affinity() fails
  irq/work: Use llist_for_each_entry_safe
  irqchip: mips-gic: Print warning if inherited GIC base is used
  irqchip/mips-gic: Add pr_fmt and reword pr_* messages
  irqchip/stm32: Move the wakeup on interrupt mask
  irqchip/stm32: Fix initial values
  irqchip/stm32: Add stm32h7 support
  dt-bindings/interrupt-controllers: Add compatible string for stm32h7
  irqchip/stm32: Add multi-bank management
  irqchip/stm32: Select GENERIC_IRQ_CHIP
  irqchip/exiu: Add support for Socionext Synquacer EXIU controller
  dt-bindings: Add description of Socionext EXIU interrupt controller
  irqchip/gic-v3-its: Fix VPE activate callback return value
  irqchip: mips-gic: Make IPI bitmaps static
  irqchip: mips-gic: Share register writes in gic_set_type()
  irqchip: mips-gic: Remove gic_vpes variable
  irqchip: mips-gic: Use num_possible_cpus() to reserve IPIs
  irqchip: mips-gic: Configure EIC when CPUs come online
  ...
</content>
</entry>
<entry>
<title>Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2017-11-13T20:38:26Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2017-11-13T20:38:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8e9a2dba8686187d8c8179e5b86640e653963889'/>
<id>urn:sha1:8e9a2dba8686187d8c8179e5b86640e653963889</id>
<content type='text'>
Pull core locking updates from Ingo Molnar:
 "The main changes in this cycle are:

   - Another attempt at enabling cross-release lockdep dependency
     tracking (automatically part of CONFIG_PROVE_LOCKING=y), this time
     with better performance and fewer false positives. (Byungchul Park)

   - Introduce lockdep_assert_irqs_enabled()/disabled() and convert
     open-coded equivalents to lockdep variants. (Frederic Weisbecker)

   - Add down_read_killable() and use it in the VFS's iterate_dir()
     method. (Kirill Tkhai)

   - Convert remaining uses of ACCESS_ONCE() to
     READ_ONCE()/WRITE_ONCE(). Most of the conversion was Coccinelle
     driven. (Mark Rutland, Paul E. McKenney)

   - Get rid of lockless_dereference(), by strengthening Alpha atomics,
     strengthening READ_ONCE() with smp_read_barrier_depends() and thus
     being able to convert users of lockless_dereference() to
     READ_ONCE(). (Will Deacon)

   - Various micro-optimizations:

        - better PV qspinlocks (Waiman Long),
        - better x86 barriers (Michael S. Tsirkin)
        - better x86 refcounts (Kees Cook)

   - ... plus other fixes and enhancements. (Borislav Petkov, Juergen
     Gross, Miguel Bernal Marin)"

* 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
  locking/x86: Use LOCK ADD for smp_mb() instead of MFENCE
  rcu: Use lockdep to assert IRQs are disabled/enabled
  netpoll: Use lockdep to assert IRQs are disabled/enabled
  timers/posix-cpu-timers: Use lockdep to assert IRQs are disabled/enabled
  sched/clock, sched/cputime: Use lockdep to assert IRQs are disabled/enabled
  irq_work: Use lockdep to assert IRQs are disabled/enabled
  irq/timings: Use lockdep to assert IRQs are disabled/enabled
  perf/core: Use lockdep to assert IRQs are disabled/enabled
  x86: Use lockdep to assert IRQs are disabled/enabled
  smp/core: Use lockdep to assert IRQs are disabled/enabled
  timers/hrtimer: Use lockdep to assert IRQs are disabled/enabled
  timers/nohz: Use lockdep to assert IRQs are disabled/enabled
  workqueue: Use lockdep to assert IRQs are disabled/enabled
  irq/softirqs: Use lockdep to assert IRQs are disabled/enabled
  locking/lockdep: Add IRQs disabled/enabled assertion APIs: lockdep_assert_irqs_enabled()/disabled()
  locking/pvqspinlock: Implement hybrid PV queued/unfair locks
  locking/rwlocks: Fix comments
  x86/paravirt: Set up the virt_spin_lock_key after static keys get initialized
  block, locking/lockdep: Assign a lock_class per gendisk used for wait_for_completion()
  workqueue: Remove now redundant lock acquisitions wrt. workqueue flushes
  ...
</content>
</entry>
<entry>
<title>irq/work: Use llist_for_each_entry_safe</title>
<updated>2017-11-12T12:15:14Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2017-11-12T12:02:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d00a08cf9ee986ad6689ce8c6fd176aff679c106'/>
<id>urn:sha1:d00a08cf9ee986ad6689ce8c6fd176aff679c106</id>
<content type='text'>
The llist_for_each_entry() loop in irq_work_run_list() is unsafe because
once the works PENDING bit is cleared it can be requeued on another CPU.

Use llist_for_each_entry_safe() instead.

Fixes: 16c0890dc66d ("irq/work: Don't reinvent the wheel but use existing llist API")
Reported-by:Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Frederic Weisbecker &lt;frederic@kernel.org&gt;
Cc: Byungchul Park &lt;byungchul.park@lge.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Petri Latvala &lt;petri.latvala@intel.com&gt;
Link: http://lkml.kernel.org/r/151027307351.14762.4611888896020658384@mail.alporthouse.com
</content>
</entry>
<entry>
<title>irq_work: Use lockdep to assert IRQs are disabled/enabled</title>
<updated>2017-11-08T10:13:52Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>frederic@kernel.org</email>
</author>
<published>2017-11-06T15:01:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3c7169a3bf8216a56761a8edf775072dd36a00a0'/>
<id>urn:sha1:3c7169a3bf8216a56761a8edf775072dd36a00a0</id>
<content type='text'>
Use lockdep to check that IRQs are enabled or disabled as expected. This
way the sanity check only shows overhead when concurrency correctness
debug code is enabled.

Signed-off-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: David S . Miller &lt;davem@davemloft.net&gt;
Cc: Lai Jiangshan &lt;jiangshanlai@gmail.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Link: http://lkml.kernel.org/r/1509980490-4285-11-git-send-email-frederic@kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>irq/work: Don't reinvent the wheel but use existing llist API</title>
<updated>2017-10-31T09:24:39Z</updated>
<author>
<name>Byungchul Park</name>
<email>byungchul.park@lge.com</email>
</author>
<published>2017-10-31T01:46:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=16c0890dc66d258fdeccf7b15a133f3930b19143'/>
<id>urn:sha1:16c0890dc66d258fdeccf7b15a133f3930b19143</id>
<content type='text'>
Use the proper llist APIs instead of open-coded variants of them.

Signed-off-by: Byungchul Park &lt;byungchul.park@lge.com&gt;
Signed-off-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/1509414414-14987-1-git-send-email-frederic@kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>irq_work: Map irq_work_on_queue() to irq_work_on() in !SMP</title>
<updated>2017-10-09T21:24:14Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2017-08-18T17:59:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6733bab7bc09b67668028dab562caea1b4ff3c69'/>
<id>urn:sha1:6733bab7bc09b67668028dab562caea1b4ff3c69</id>
<content type='text'>
Commit 478850160636 ("irq_work: Implement remote queueing") provides
irq_work_on_queue() only for SMP builds.  However, providing it simplifies
code that submits irq_work to lists of CPUs, eliminating the !SMP special
cases.  This commit therefore maps irq_work_on_queue() to irq_work_on()
in !SMP builds, but validating the specified CPU.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>treewide: Remove old email address</title>
<updated>2015-11-23T08:44:58Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2015-11-16T10:08:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=90eec103b96e30401c0b846045bf8a1c7159b6da'/>
<id>urn:sha1:90eec103b96e30401c0b846045bf8a1c7159b6da</id>
<content type='text'>
There were still a number of references to my old Red Hat email
address in the kernel source. Remove these while keeping the
Red Hat copyright notices intact.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>percpu: Convert remaining __get_cpu_var uses in 3.18-rcX</title>
<updated>2014-10-29T15:18:18Z</updated>
<author>
<name>Christoph Lameter</name>
<email>cl@linux.com</email>
</author>
<published>2014-10-27T15:49:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=56e4dea81a55c338eede625f715c7fa21f1a28c4'/>
<id>urn:sha1:56e4dea81a55c338eede625f715c7fa21f1a28c4</id>
<content type='text'>
During the 3.18 merge period additional __get_cpu_var uses were
added. The patch converts these to this_cpu_ptr().

Signed-off-by: Christoph Lameter &lt;cl@linux.com&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu</title>
<updated>2014-10-15T05:48:18Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-10-15T05:48:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0429fbc0bdc297d64188483ba029a23773ae07b0'/>
<id>urn:sha1:0429fbc0bdc297d64188483ba029a23773ae07b0</id>
<content type='text'>
Pull percpu consistent-ops changes from Tejun Heo:
 "Way back, before the current percpu allocator was implemented, static
  and dynamic percpu memory areas were allocated and handled separately
  and had their own accessors.  The distinction has been gone for many
  years now; however, the now duplicate two sets of accessors remained
  with the pointer based ones - this_cpu_*() - evolving various other
  operations over time.  During the process, we also accumulated other
  inconsistent operations.

  This pull request contains Christoph's patches to clean up the
  duplicate accessor situation.  __get_cpu_var() uses are replaced with
  with this_cpu_ptr() and __this_cpu_ptr() with raw_cpu_ptr().

  Unfortunately, the former sometimes is tricky thanks to C being a bit
  messy with the distinction between lvalues and pointers, which led to
  a rather ugly solution for cpumask_var_t involving the introduction of
  this_cpu_cpumask_var_ptr().

  This converts most of the uses but not all.  Christoph will follow up
  with the remaining conversions in this merge window and hopefully
  remove the obsolete accessors"

* 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (38 commits)
  irqchip: Properly fetch the per cpu offset
  percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t -fix
  ia64: sn_nodepda cannot be assigned to after this_cpu conversion. Use __this_cpu_write.
  percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t
  Revert "powerpc: Replace __get_cpu_var uses"
  percpu: Remove __this_cpu_ptr
  clocksource: Replace __this_cpu_ptr with raw_cpu_ptr
  sparc: Replace __get_cpu_var uses
  avr32: Replace __get_cpu_var with __this_cpu_write
  blackfin: Replace __get_cpu_var uses
  tile: Use this_cpu_ptr() for hardware counters
  tile: Replace __get_cpu_var uses
  powerpc: Replace __get_cpu_var uses
  alpha: Replace __get_cpu_var
  ia64: Replace __get_cpu_var uses
  s390: cio driver &amp;__get_cpu_var replacements
  s390: Replace __get_cpu_var uses
  mips: Replace __get_cpu_var uses
  MIPS: Replace __get_cpu_var uses in FPU emulator.
  arm: Replace __this_cpu_ptr with raw_cpu_ptr
  ...
</content>
</entry>
<entry>
<title>irq_work: Force raised irq work to run on irq work interrupt</title>
<updated>2014-09-13T16:38:15Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2014-08-16T16:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=76a33061b9323b7fdb220ae5fa116c10833ec22e'/>
<id>urn:sha1:76a33061b9323b7fdb220ae5fa116c10833ec22e</id>
<content type='text'>
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;
</content>
</entry>
</feed>
