From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEF45C433F5 for ; Fri, 15 Apr 2022 10:29:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352317AbiDOKb3 (ORCPT ); Fri, 15 Apr 2022 06:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350201AbiDOKbZ (ORCPT ); Fri, 15 Apr 2022 06:31:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A04ABBC843; Fri, 15 Apr 2022 03:28:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5E156B82DEB; Fri, 15 Apr 2022 10:28:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A17D2C385A6; Fri, 15 Apr 2022 10:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650018535; bh=+KEpsYKGgSKldm+NlWBYkFbQsp6L86Twv51N6txzysE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m4WNaud45Hme92XUWA9Z9Mvs3B7jBAVH7vXXw6Y+5UJuzsPz+J/hjKSlt/B3syLiv lh7I9ClYkcmsBIZbErevi8Vj7tKeP3+Q7BuzENnTpfpTEuGm4uwnwzo2WDv96HKep+ z09uBKVwwcHusgB8mk4L2NzsB7oqbQTQ7k35b9+WKybtjCscT1PuKjoNEx+dYMkwo3 3FQu+V8iySTMcpumNycGUC7mTT1r2S8srkcGjfDYUKyNmHj2DDsvISyF1j6QYOKIPI FPuPPNaeZjy4tUsQl7E1TloABt2C5hToiXZVprUkVdzmufLSuHzOpEmWm5amrl2arn KaC3mHMRfY72A== Date: Fri, 15 Apr 2022 12:28:52 +0200 From: Frederic Weisbecker To: Alison Chaiken Cc: LKML , linux-rt-users , Mel Gorman , Sebastian Andrzej Siewior , Thomas Gleixner , Glenn Elliott Subject: Re: [RT][PATCH 2/2] tick: Fix timer storm since introduction of timersd Message-ID: <20220415102852.GA1654237@lothringen> References: <20220405010752.1347437-1-frederic@kernel.org> <20220405010752.1347437-2-frederic@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 05, 2022 at 09:21:16AM -0700, Alison Chaiken wrote: > On Mon, Apr 4, 2022 at 9:33 PM Frederic Weisbecker wrote: > > > > If timers are pending while the tick is reprogrammed on nohz_mode, the > > next expiry is not armed to fire now, it is delayed one jiffy forward > > instead so as not to raise an inextinguishable timer storm with such > > scenario: > > > > 1) IRQ triggers and queue a timer > > 2) ksoftirqd() is woken up > > 3) IRQ tail: timer is reprogrammed to fire now > > 4) IRQ exit > > 5) TIMER interrupt > > 6) goto 3) > > > > ...all that until we finally reach ksoftirqd. > > > > Unfortunately we are checking the wrong softirq vector bitmask since > > timersd kthread has split from ksoftirqd. Timers now have their own > > vector state field that must be checked separately. > > With kernel 5.15 and the timersd patch applied, we've observed that > x86_64 cores tend to enter deeper C-states even when there are pending > hrtimers. Presumably failure to check the right bits could also > explain that observation and, accordingly, the patch might fix it? Well, this issue rather adds unnecessary ticks. Thus I wouldn't expect deeper C-states as a consequence but who knows... Thanks.