Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3090345pxb; Mon, 19 Apr 2021 23:46:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYXoDDXN/k64awS+q9je1hsoRlHlW2+//HEIlea6ryG9EDM/bsquWJlcC6LenAXSVJr0f9 X-Received: by 2002:a17:907:2662:: with SMTP id ci2mr25537541ejc.467.1618901167922; Mon, 19 Apr 2021 23:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618901167; cv=none; d=google.com; s=arc-20160816; b=dnhkbiMdOJvBr60lqZVa046F9L3PoaAJ+oYLyuI/ZdTq2Y0I1mHndWpng/FW7kSogB XjR04KBTc3D7CcBlYPk+YPJrDsZHPOkcdyt/j9yqWXOX+vZVdXw+8XJSmQJT4h6pdpJA gjOE8fGFgyLofHwI4VQc4F6oFhZUpqGTQlLdC4S9p5cwASWlg+OT8GIyuOglbuWomBZ9 2i0b0JRUGFH0671027g0dQfTDfp/F0vvN7MC3UBihwfkP8Vhd2I171yy9y7QhFnKKr6Z SFp+3Yzp6HF27NCPg52TJcvSm5HBkgHSNHBSqqt0JzHxssNQK/j0c5YpXYgIhhiHU4E1 n3tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=LC+6IgI9HH++U86icU2VDAlo7EhsD7/YM0UYck7wWbo=; b=KKAvz11rMpRTUWFVjTXRFoQ+N1asPreQymhHfBbLyFiJfuec7cJ4SRx3KkH3GE8RwQ xZbh+pRuRcOThsQNzxT7LvsxJz9UfACoYKufZpo9G4jFxt+z3qEQBs9haLbLS+XYMSJV oA3Shx5sRDgzNqhu8u9Q0er3sWGI68iT2d1hNH2iXXHfi8nLUo6GgQAZdqYznzp7KSBT xwBlXeasndO2rm9fYVBwMmod2/GRmBNVm5Ja8pLm5K0DGwBlsRq8AbsKu1kr2RQsDwPj gEZCJc51b5850gR0t8lS+prbIGhWcVplK+tCXiCEn9iQgVTxpRc9jiN7Jsm8WlLBh0kS 1duw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="28Go/CnW"; dkim=neutral (no key) header.i=@linutronix.de; 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 q11si14282004eju.518.2021.04.19.23.45.44; Mon, 19 Apr 2021 23:46:07 -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="28Go/CnW"; dkim=neutral (no key) header.i=@linutronix.de; 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 S230140AbhDTGpZ (ORCPT + 99 others); Tue, 20 Apr 2021 02:45:25 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:50290 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbhDTGpY (ORCPT ); Tue, 20 Apr 2021 02:45:24 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1618901092; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LC+6IgI9HH++U86icU2VDAlo7EhsD7/YM0UYck7wWbo=; b=28Go/CnW7yN4B3YXPBBdEsD8TRHi6BIMu/4AobIiJ4wxU8onIVq2uOzi2n3Fm2uRgTGz0x lLAn+JGMV8lhwSzxRVte8UzaFbCJ0kd8vc/nc+JJBay787St0HfVKkWigqo3CrCFLxauEL Hdzzirf6tSyPU/5TXgdUy5hCYuXZLvp6wh8HUZA7vuGF4YgQy2HSyrMx4wsnx9SuCNedTM iREGHD1i4miFPTXxA8XSoEb7ArUcWhh6PZNCPUZrnJ5V+gkPxf3s80bPYCd6QuyhIbwmfE GV0OdrKBGKxPyjWr6eIn3AYj3bonXIEdG6hBo9YtdNadatxbcTP4JnxTq6l3Ow== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1618901092; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LC+6IgI9HH++U86icU2VDAlo7EhsD7/YM0UYck7wWbo=; b=nLNeVLS0jmwS9XdXnbeRnmi5sfnQBNxzu9s/Bd/S0wqSoDe88pUrgSWs/GfJpm4KSUeRSF 7871JKwJl89IosDg== To: Maciej =?utf-8?Q?=C5=BBenczykowski?= Cc: Lorenzo Colitti , Greg KH , Ingo Molnar , Anna-Maria Behnsen , lkml , mikael.beckius@windriver.com Subject: Re: [PATCH] hrtimer: Update softirq_expires_next correctly after __hrtimer_get_next_event() In-Reply-To: References: <87r1jbv6jc.ffs@nanos.tec.linutronix.de> Date: Tue, 20 Apr 2021 08:44:52 +0200 Message-ID: <87im4hqwt7.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 19 2021 at 20:12, Maciej =C5=BBenczykowski wrote: > On Thu, Apr 15, 2021 at 9:47 AM Thomas Gleixner wrot= e: >> Run the test on a kernels with and without that commit and collect trace >> data for both. >> >> That should give me a pretty clear picture what's going on. > > Lorenzo is trying to get the traces you asked for, or rather he=E2=80=99s > trying to get confirmation he can post them. > > Our initial observation of these results seems to suggest that > updating the timer (hrtimer_start, which seems to also call > hrtimer_cancel) takes twice as long as it used to. Which contradicts my measurements. The change in complexity is marginal and the overhead in cycles/instructions is close to noise. It's measurable in a microbenchmark, but it's in the < 1% range which is far away from the 60% you are seing. > My gut feeling is that softirq_activated is usually false, and the old > code in such a case calls just __hrtimer_get_next_event(, > HRTIMER_ACTIVE_ALL). While the new code will first call > __hrtimer_get_next_event(, HRTIMER_ACTIVE_SOFT) and then > __hrtimer_get_next_event(, HRTIMER_ACTIVE_HARD) > > Perhaps __hrtimer_get_next_event() should return both soft and hard > event times in one function call? > Or perhaps hrtimer_start should not call hrtimer_cancel? Perhaps we do a proper analysis first :) Thanks, tglx