All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/37] hrtimer: Provide softirq context hrtimers
@ 2017-10-22 21:39 Anna-Maria Gleixner
  2017-10-22 21:39 ` [PATCH v2 01/37] hrtimer: Correct blantanly wrong comment Anna-Maria Gleixner
                   ` (36 more replies)
  0 siblings, 37 replies; 50+ messages in thread
From: Anna-Maria Gleixner @ 2017-10-22 21:39 UTC (permalink / raw)
  To: LKML
  Cc: Thomas Gleixner, Peter Zijlstra, Ingo Molnar, keescook,
	Christoph Hellwig, John Stultz

There are quite some places in the kernel which use a combination of
hrtimers and tasklets to make use of the precise expiry of hrtimers, which
schedule a tasklet to bring the actual function into softirq context.

This was introduced when the previous hrtimer softirq code was
removed. That code was implemented by expiring the timer in hard irq
context and then deferring the execution of the callback into softirq
context. That caused a lot of pointless shuffling between the rbtree and a
linked list.

In recent discussions it turned out that more potential users of hrtimers
in softirq context might come up. Aside of that the RT patches need this
functionality as well to defer hrtimers into softirq context if their
callbacks are not interrupt safe on RT.

This series implements a new approach by adding SOFT hrtimer mode and
instead of doing the list shuffle, timers started with this mode are put
into separate soft expiry hrtimer queues. These queues are evaluated only
when the hardirq context detects that the first expiring timer in the
softirq queues has expired. That makes the overhead in the hardirq context
minimal.

The series reworks the code to reuse as much as possible from the existing
facilities for the new softirq hrtimers and integrates them with all
flavours of hrtimers (HIGH_RES=y/n - NOHZ=y/n).

To achieve this quite some of the conditionals in the existing code are
removed for the price of adding some pointless data and state tracking to
the HIGH_RES=n case. That's minimal, but well worth it as it increases the
readability and maintainability of the code.

The first part of the series implements the new functionality and the
second part converts the hrtimer/tasklet users to make use of it and
removes struct hrtimer_tasklet and the surrounding helper functions.

This series is available from git as well:

	git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.timers

Thanks,

        Anna-Maria

---
v1..v2:

  - integration of Peter Zijlstras patch:
    https://lkml.kernel.org/r/20170927164025.GI17526@worktop.programming.kicks-ass.net
  - using hrtimer_mode instead of additional hrtimer clock bases
  - folding the fix for updating the base offsets:
    https://lkml.kernel.org/r/20171006102820.ou4wpm56ed6m3ewr@linutronix.de
  - rework of 08/25 - 10/25 (all of those patches are facing reduction of
    conditional code) and make hrtimer_force_reprogram() unconditional as well
  - integration of new versions of "ALSA/dummy: Replace tasklet with
    softirq hrtimer" and "net/cdc_ncm: Replace tasklet with softirq
    hrtimer"
  - additional hrtimer/tasklet user conversion: "net/mvpp2: Replace tasklet
    with softirq hrtimer"
  - additional fixes of several wrong comments
  - update hrtimer tracing (mode and clock bases)


 drivers/net/ethernet/marvell/mvpp2.c  |   62 +--
 drivers/net/usb/cdc_ncm.c             |   38 --
 drivers/net/wireless/mac80211_hwsim.c |   44 +-
 drivers/usb/gadget/function/f_ncm.c   |   30 -
 include/linux/hrtimer.h               |  110 +++---
 include/linux/interrupt.h             |   25 -
 include/linux/usb/cdc_ncm.h           |    1 
 include/net/xfrm.h                    |    2 
 include/trace/events/timer.h          |   37 +-
 kernel/softirq.c                      |   51 --
 kernel/time/hrtimer.c                 |  623 +++++++++++++++++++++-------------
 kernel/time/timer.c                   |    6 
 net/can/bcm.c                         |  156 ++------
 net/xfrm/xfrm_state.c                 |   30 -
 sound/drivers/dummy.c                 |   27 -
 15 files changed, 652 insertions(+), 590 deletions(-)

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2017-11-13  9:13 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-22 21:39 [PATCH v2 00/37] hrtimer: Provide softirq context hrtimers Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 01/37] hrtimer: Correct blantanly wrong comment Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 02/37] hrtimer: Fix kerneldoc for struct hrtimer_cpu_base Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 03/37] hrtimer: Cleanup clock argument in schedule_hrtimeout_range_clock() Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 04/37] hrtimer: Fix hrtimer function description Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 05/37] hrtimer: Ensure POSIX compliance (relative CLOCK_REALTIME hrtimers) Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 06/37] hrtimer: Cleanup hrtimer_mode enum Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 07/37] tracing: hrtimer: Take all clock bases and modes into account Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 08/37] tracing: hrtimer: Print hrtimer mode in hrtimer_start tracepoint Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 09/37] hrtimer: Switch for loop to _ffs() evaluation Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 10/37] hrtimer: Store running timer in hrtimer_clock_base Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 11/37] hrtimer: Change boolean struct members into bitfield Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 12/37] hrtimer: Make room in struct hrtimer_cpu_base Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 13/37] hrtimer: Reduce conditional code (hres_active) Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 14/37] hrtimer: Use accesor functions instead of direct access Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 15/37] hrtimer: Make the remote enqueue check unconditional Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 16/37] hrtimer: Make hrtimer_cpu_base.next_timer handling unconditional Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 17/37] hrtimer: Make hrtimer_reprogramm() unconditional Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 18/37] hrtimer: Reduce conditional code and make hrtimer_force_reprogramm() unconditional Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 19/37] hrtimer: Unify handling of hrtimer remove Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 20/37] hrtimer: Unify handling of remote enqueue Anna-Maria Gleixner
2017-10-22 21:39 ` [PATCH v2 21/37] hrtimer: Make remote enqueue decision less restrictive Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 22/37] hrtimer: Remove base argument from hrtimer_reprogram() Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 23/37] hrtimer: Split hrtimer_start_range_ns() Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 24/37] hrtimer: Split __hrtimer_get_next_event() Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 25/37] hrtimer: Use irqsave/irqrestore around __run_hrtimer() Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 26/37] hrtimer: Add clock bases and hrtimer mode for soft irq context Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 27/37] hrtimer: Prepare handling of hard and softirq based hrtimers Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 28/37] hrtimer: Implement support for " Anna-Maria Gleixner
2017-11-10 12:42   ` Sebastian Andrzej Siewior
2017-11-13  9:13     ` Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 29/37] hrtimer: Implement SOFT/HARD clock base selection Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 30/37] can/bcm: Replace hrtimer_tasklet with softirq based hrtimer Anna-Maria Gleixner
2017-10-27 14:42   ` Oliver Hartkopp
2017-10-22 21:40 ` [PATCH v2 31/37] mac80211_hwsim: Replace hrtimer tasklet with softirq hrtimer Anna-Maria Gleixner
2017-10-22 21:40   ` Anna-Maria Gleixner
2017-10-23 10:14   ` Johannes Berg
2017-10-23 10:23     ` Thomas Gleixner
2017-10-23 10:25       ` Johannes Berg
2017-10-23 10:33         ` Thomas Gleixner
2017-10-23 10:42           ` Johannes Berg
2017-10-22 21:40 ` [PATCH v2 32/37] xfrm: " Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 33/37] softirq: Remove tasklet_hrtimer Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 34/37] ALSA/dummy: Replace tasklet with softirq hrtimer Anna-Maria Gleixner
2017-10-22 21:40   ` Anna-Maria Gleixner
2017-10-24  6:25   ` Takashi Iwai
2017-10-24  6:25     ` Takashi Iwai
2017-10-22 21:40 ` [PATCH v2 36/37] usb/gadget/NCM: " Anna-Maria Gleixner
2017-10-22 21:40 ` [PATCH v2 37/37] net/mvpp2: " Anna-Maria Gleixner
2017-10-23 16:08 ` [PATCH v2 00/37] hrtimer: Provide softirq context hrtimers Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.