Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1592017ybh; Tue, 14 Jul 2020 01:52:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBPckY2ix+vCReloUBi0rUR/1uIQPSfzO2X//UKUYPyXqw8sk9EJhueF8vv+UF5UL3Jfjh X-Received: by 2002:a17:906:b74e:: with SMTP id fx14mr3419203ejb.202.1594716756311; Tue, 14 Jul 2020 01:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594716756; cv=none; d=google.com; s=arc-20160816; b=S2JSwGez6gDEUpKpAcFVDoc4rJP+y8F8yKZALKQM/1+Jh+1zeInNLS5YA2z9MR1tLJ RUIlbZRPEy1kDv5w8CN8RTeL7922JOIsmdzsW2IvaWgUsS6aSz6YPuN3B6smlGf9Wxm2 B7ipHahcIja76VoYzcImOYbHGiIioGg8H5/C3DKFWR6HytxL/YG9yn3hBPbV9t7vxMbM gzmTqfP8hckKIbH9229Ml6FEl5jqqpjiivp9CQEJmwI/kthsUSn72HoynA5Ez48KoD1y imr3y8R1uyq4PGjo2O9N6nD5KXJ+Ofhqo0TWoxjVJp/NxaRe+35mPPrZ8jzRtXICKxtj 2uEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:dkim-signature:dkim-signature:date; bh=hxxJabfXBdmkDeRUYI7JOQ08QQCOa1D9VqkTENSXrQI=; b=o+Enz3BBSVzVao9JcRerW1a6lh1nbzHAW5lTXjnY28v4A2IjtJ1FQzMhB6UAdEx6ZL 1XkeUJ9OILqku/5nBBMxZRVhi1xu2yFOT8Z1Xtb6mR2RFKknRORiSavzBxHel0hD7OPf nsP4WTHLXVlHR6yXx4ZEyuvh9L4ydE4MoLSo+38i48HDf2uZPXzU+j0TDcgK/hed/KwS CsrVWWjnU+Xt8/8mmgNmnD0HulyLh+w9ppZ7IZcrvgtlK94kBcaIE6pPeXh1nuhoNmIG 1eBteiAM4QVzZlKKNlR+lyGb34Sx0T5iY6fbyuOTqoQVc/P79DoH7FwQlUrbUjYFWNvI uT1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sWSVtKWx; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=uZEZ8hQH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt10si10690541edb.146.2020.07.14.01.52.14; Tue, 14 Jul 2020 01:52:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sWSVtKWx; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=uZEZ8hQH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726600AbgGNItg (ORCPT + 99 others); Tue, 14 Jul 2020 04:49:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725816AbgGNItf (ORCPT ); Tue, 14 Jul 2020 04:49:35 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4582C061755 for ; Tue, 14 Jul 2020 01:49:35 -0700 (PDT) Date: Tue, 14 Jul 2020 10:49:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1594716573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hxxJabfXBdmkDeRUYI7JOQ08QQCOa1D9VqkTENSXrQI=; b=sWSVtKWxC7DdBe50wdjSFKEVu+rMxfuCGv8NcELxYUA+B7FHNUEGALieg7turgmA4j/LVG 1TwUCGF+wshLWfhMagjCbSxKOg3ica4saXgvgZLTF5SfcPASMTw2buDdPpBRtbhij3pJuW wwLOHe1KMncWCYSoWOFnDHNMQ/EfOlc25Fb+jeABGHvO5VOjsknG2rpmf9S6upz7tAXFjf K1aByck4a/uDdOBZJ0TskhBszrWw+K7xqkw2s/A6IeWmKOibnRR9HsSCFBmblg2/2QEjly l5n4dvq3BykLoehjgVfRfCXCJYyzKam3xG/fVietdoW76pfla/D9Fw4lQrgvZw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1594716573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hxxJabfXBdmkDeRUYI7JOQ08QQCOa1D9VqkTENSXrQI=; b=uZEZ8hQH7+kHqmNjv/VHv6Hp0zYV54bMmgBGyNrh5TJCWulyFVLGgLEw21vUDfKrgTdOe0 kVJ3x1y/t9zW3fCQ== From: Anna-Maria Behnsen To: Frederic Weisbecker cc: Thomas Gleixner , LKML , Peter Zijlstra , Juri Lelli Subject: Re: [PATCH 4/9] timers: Always keep track of next expiry In-Reply-To: <20200707013253.26770-5-frederic@kernel.org> Message-ID: References: <20200707013253.26770-1-frederic@kernel.org> <20200707013253.26770-5-frederic@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Frederic, On Tue, 7 Jul 2020, Frederic Weisbecker wrote: > So far next expiry was only tracked while the CPU was in nohz_idle mode > in order to cope with missing ticks that can't increment the base->clk > periodically anymore. > > We are going to expand that logic beyond nohz in order to spare timers > softirqs so do it unconditionally. > > Signed-off-by: Frederic Weisbecker > Cc: Peter Zijlstra > Cc: Anna-Maria Gleixner > Cc: Juri Lelli > --- > kernel/time/timer.c | 36 +++++++++++++++++++----------------- > 1 file changed, 19 insertions(+), 17 deletions(-) > > diff --git a/kernel/time/timer.c b/kernel/time/timer.c > index acf7cb8c09f8..8a4138e47aa4 100644 > --- a/kernel/time/timer.c > +++ b/kernel/time/timer.c > @@ -558,8 +558,22 @@ trigger_dyntick_cpu(struct timer_base *base, struct timer_list *timer) > * timer is not deferrable. If the other CPU is on the way to idle > * then it can't set base->is_idle as we hold the base lock: > */ > - if (!base->is_idle) > - return; > + if (base->is_idle) > + wake_up_nohz_cpu(base->cpu); > +} > + > +/* > + * Enqueue the timer into the hash bucket, mark it pending in > + * the bitmap and store the index in the timer flags. > + */ > +static void enqueue_timer(struct timer_base *base, struct timer_list *timer, > + unsigned int idx) > +{ > + hlist_add_head(&timer->entry, base->vectors + idx); > + __set_bit(idx, base->pending_map); > + timer_set_idx(timer, idx); > + > + trace_timer_start(timer, timer->expires, timer->flags); > > /* Check whether this is the new first expiring timer: */ > if (time_after_eq(timer->expires, base->next_expiry)) > @@ -578,21 +592,7 @@ trigger_dyntick_cpu(struct timer_base *base, struct timer_list *timer) > } else { > base->next_expiry = timer->expires; > } > - wake_up_nohz_cpu(base->cpu); > -} > > -/* > - * Enqueue the timer into the hash bucket, mark it pending in > - * the bitmap and store the index in the timer flags. > - */ > -static void enqueue_timer(struct timer_base *base, struct timer_list *timer, > - unsigned int idx) > -{ > - hlist_add_head(&timer->entry, base->vectors + idx); > - __set_bit(idx, base->pending_map); > - timer_set_idx(timer, idx); > - > - trace_timer_start(timer, timer->expires, timer->flags); > trigger_dyntick_cpu(base, timer); > } > Could you please split those two hunks which do only a restructuring into a separate patch? Thanks, Anna-Maria