From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751410AbdHaMgM (ORCPT ); Thu, 31 Aug 2017 08:36:12 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:60889 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895AbdHaMgL (ORCPT ); Thu, 31 Aug 2017 08:36:11 -0400 Date: Thu, 31 Aug 2017 14:36:03 +0200 (CEST) From: Anna-Maria Gleixner To: Christoph Hellwig cc: Peter Zijlstra , Ingo Molnar , keescook@chromium.org, John Stultz , Thomas Gleixner , LKML Subject: Re: [PATCH 00/25] hrtimer: Provide softirq context hrtimers In-Reply-To: <20170831105725.809317030@linutronix.de> Message-ID: References: <20170831105725.809317030@linutronix.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm sorry for the typo in the email address! Anna-Maria On Thu, 31 Aug 2017, Anna-Maria Gleixner wrote: > 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_* clock ids and > instead of doing the list shuffle, timers started with these clock ids 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/bigeasy/linux-hrtimer.git soft_hrtimer > https://git.kernel.org/bigeasy/linux-hrtimer/h/soft_hrtimer > > > Thanks, > > Anna-Maria > > --- > drivers/net/usb/cdc_ncm.c | 37 +- > drivers/net/wireless/mac80211_hwsim.c | 44 +- > drivers/usb/gadget/function/f_ncm.c | 28 - > include/linux/hrtimer.h | 76 ++--- > include/linux/interrupt.h | 25 - > include/linux/usb/cdc_ncm.h | 2 > include/net/xfrm.h | 2 > kernel/softirq.c | 51 --- > kernel/time/hrtimer.c | 513 +++++++++++++++++++++------------- > net/can/bcm.c | 150 +++------ > net/xfrm/xfrm_state.c | 29 + > sound/drivers/dummy.c | 16 - > 12 files changed, 484 insertions(+), 489 deletions(-) > >