Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1026483pxb; Fri, 15 Apr 2022 18:48:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBZtmPtn1OVsIyeZvWAUcy+8L2cB+4e0M08cq+38oRo71oau9SqxLftNEVss41qp7jD8KF X-Received: by 2002:a65:48c6:0:b0:398:b858:e332 with SMTP id o6-20020a6548c6000000b00398b858e332mr1279889pgs.291.1650073684884; Fri, 15 Apr 2022 18:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650073684; cv=none; d=google.com; s=arc-20160816; b=YUcPZd0nyCBKNXHmlyRrcXFnGk4PhXP0EMCQR/UWZT2cNGz2wXD3XJHpdvJ7gaFKdD OPiLT7B1oxrW/Kl5vg1px0LXSHcqzG27JUgoj5VYMnOCT7mZ0RVO6eWCzCRE4MAkcB/g WfzuCAz2b26FyRwpENWx4Qa2nKyXPxTOIdxNsjVvXZbs0vBmoZI6keJCGeGuRmYX72UE eqvq1NYZg3g2ipCa9DS3Loww+REWF5BsfTARDAc4wSs152weBozxF/ZJp4lbAuHtvgja tEFwM6FiP0OeEYGebKV572mbXhjFolBmjh2wuDelIJE6O3NdHLAvUVR7L8fc8YgCe+6L ktUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6c89sxiPl30J4tGLyW2bXwgoQWtlYtZU38d5sZlOrJc=; b=isx1vpaeMQ4ICel2mrSKMNuDF+UEeb7qnLQmQ3vamS2MBriWMTWr787eK2WilNnmJU k94+TCw2Md/ypgOe3dU/oKxdHR76914uYxCidqIYu1sGaAjat4gTkxk0DHHhwC/4sG7F sDiemJnSET9cMetQDdHXovtLC6HnLW4RpHs0yG24gXrws/Lpi+ZH0WirVPbcTpbP9Uhp NMO0CQbtEl4YJJLcynV/+oeE+MCIPXMuggY/jeu4SyOs0FO82my3KpR4HEjtJ5tYkFg4 pe1GcgwXHpf+3/0k/tFj2V58hM7RAwQxt+o4aPDbFNuIS6GWH9jZpjW3GsKNCxBdX1jY ypFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m4WNaud4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 202-20020a6218d3000000b004fa3a8dffeesi2823860pfy.165.2022.04.15.18.48.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:48:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m4WNaud4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1B13E181B10; Fri, 15 Apr 2022 18:11:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352313AbiDOKb2 (ORCPT + 99 others); Fri, 15 Apr 2022 06:31:28 -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: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.