Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp120176lqp; Wed, 20 Mar 2024 15:58:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUCu7MXL4KKuKUjV80yKOsZKPgVPqFW7EDQVAxFFx+DyYzl2l9V1xf0CtOCs4ifl1oUMJ2htwEO7Cb+w0C7Qe5zpuGfHgDmubXEIVP6QA== X-Google-Smtp-Source: AGHT+IESSLoVn0YWLv3LRwwp7fuL7Uf+e/sDjedV+DwuMv+SNRK17LExQN2M98B8AMaxZ48eIYRr X-Received: by 2002:a17:90a:6889:b0:29c:25e6:ce86 with SMTP id a9-20020a17090a688900b0029c25e6ce86mr15143144pjd.32.1710975536159; Wed, 20 Mar 2024 15:58:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710975536; cv=pass; d=google.com; s=arc-20160816; b=NL1GfSeORMNUAuqnZdlSaBej7YJgkJN4Gn28HjElmPzuUBaDjYXIS7hecl/yzV0orF 8LAkGn9BRlAL37tHmo+ClZEx18feIJ0u7yJf42puW2OSjTqGh4j122Fn3lKwWNPRq3t5 /iSdBdBDOig/9SAyPIyaSHnm/PCUjDzv9WuEScIr9XnDztyJcm4hHb33f059fF71J+Ut 8v9xucB2/d7zlCkGM5MTm+tqqf7DllOynuP2Ptql9s++9/0GGYVNFmggqwV8exGOY7we 1NvGzjBSqHp/gvLUD/2YdvrKBZXayI18bH+S7kTTrSoYlm3IvJofpasieETMwUfVg46c eqGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=sw7jucmJxnqT85l2EEiXJ29oXjCNgQOKEUR6Z0sXCE8=; fh=Vzoq0nVshxERZBL4pLZ68yhgpR1mmqRekZaurNon2Tg=; b=q8U/fCe9mjBZn9BP0Zz9Usi2CRkeANmje3rj8WxdjaIZ3f0Wggh8a+lx0YBBvKi8GH ACC21R+8Aps70keCZCz6xVbMXDrks0LoQ5lggn4fIbeBiVLghwKcuqg9eHgzGdxpdABo 10iGOKGNb3ZKeV2Amdh4eLCTGjTAq8t5hcxmcrPY2qSidvsF9MjLu4hkAW5yAbhrxccz yriJyKDAxubNI3KyLyOS0QX3EH/dQBKQ7o9dM2Os3VdE5dN5AtZH0MUf0H08hSLM5Pgv tR/gupjYJjMo7jK/GUjDfKVAgrGX9EO9EiAuxxHSXlPsA6p2++PfBk1r/aoXe/EMAlG2 fG7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LXwDs7Pf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-109476-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109476-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s65-20020a17090a69c700b002993b6846d5si2246436pjj.85.2024.03.20.15.58.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 15:58:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109476-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LXwDs7Pf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-109476-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109476-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 99514B22997 for ; Wed, 20 Mar 2024 22:55:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A80F52F78; Wed, 20 Mar 2024 22:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LXwDs7Pf" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A783381D1 for ; Wed, 20 Mar 2024 22:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710975320; cv=none; b=bnlOS3j4Ar/oUL6gey+WEFlMmu9Kpmjrjkan/kOzb9woS4UPOmV2NPAN8xa86D3GXHCjEwkkAF6RVq8EOsauBcfGrvy53mpzrvzfz0GPzqr3CX9S+WJHv9CHea6XMnA7q7Q6X60W2I6WZYGDZUmDtCKredKF4qwk8DcBIwm8hsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710975320; c=relaxed/simple; bh=DpItbTfCRtsp3QfBKRvAonSxvMxe8uSVUklGaCB6Nrw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kfMJK4mJxt0gjbHhGybuxpydpgDz8f6/UAoBHSzQK59mvlVuzezVifVG2kdxuk5JQhYF7q5/i6qVT1hr9xtGkbfMiaIb2htqCZgr/VQmsjm9SdH2Bh+uFltnm6t0eNL/WYTgf7APBH/qjnbSBCkltYBs+OVNy6kv2EanS3OrCjc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LXwDs7Pf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9968EC433C7; Wed, 20 Mar 2024 22:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710975319; bh=DpItbTfCRtsp3QfBKRvAonSxvMxe8uSVUklGaCB6Nrw=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=LXwDs7PfqhdJZgEWblaU0LIWQkK88pK8wgY6+JBVL/+5iPWGjWHcuAOfuJSnd7qHg 5N+jn/Sjng+9ghuUBwO/TxUDZKXlLIjkIu9QcojI+gRjikHQAUWcb0ak8aoELt51Tq xXYgXK1cgsT0s3WkYuMcmgVqpxRdNPBC4UuvcDC8sL8cUzCv85hptwr1uc7wnQqg61 Zw4fIvpfxOvZFcuVekuZceuY+FivkoCX39YQLs5s39JJuDTND6yiA57aM3XrwYhSAt gEb7m+gc0d15ab8dyR9anNiZLIpXZZSCidLexLRYEipIulPVP6/TPW+9z2yVVSLinN yJnO0A4bCcVvg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 88A54CE0716; Wed, 20 Mar 2024 15:55:17 -0700 (PDT) Date: Wed, 20 Mar 2024 15:55:17 -0700 From: "Paul E. McKenney" To: Frederic Weisbecker Cc: Thomas Gleixner , LKML , Ingo Molnar , Anna-Maria Behnsen Subject: Re: [PATCH 2/2] timers: Fix removed self-IPI on global timer's enqueue in nohz_full Message-ID: <6a95b6ac-6681-4492-b155-e30c19bb3341@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20240318230729.15497-1-frederic@kernel.org> <20240318230729.15497-3-frederic@kernel.org> <464f6be2-4a72-440d-be53-6a1035d56a4f@paulmck-laptop> <1b5752c8-ef32-4ed4-b539-95d507ec99ce@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Mar 20, 2024 at 05:15:48PM +0100, Frederic Weisbecker wrote: > Le Wed, Mar 20, 2024 at 04:14:24AM -0700, Paul E. McKenney a ?crit : > > On Tue, Mar 19, 2024 at 02:18:00AM -0700, Paul E. McKenney wrote: > > > On Tue, Mar 19, 2024 at 12:07:29AM +0100, Frederic Weisbecker wrote: > > > > While running in nohz_full mode, a task may enqueue a timer while the > > > > tick is stopped. However the only places where the timer wheel, > > > > alongside the timer migration machinery's decision, may reprogram the > > > > next event accordingly with that new timer's expiry are the idle loop or > > > > any IRQ tail. > > > > > > > > However neither the idle task nor an interrupt may run on the CPU if it > > > > resumes busy work in userspace for a long while in full dynticks mode. > > > > > > > > To solve this, the timer enqueue path raises a self-IPI that will > > > > re-evaluate the timer wheel on its IRQ tail. This asynchronous solution > > > > avoids potential locking inversion. > > > > > > > > This is supposed to happen both for local and global timers but commit: > > > > > > > > b2cf7507e186 ("timers: Always queue timers on the local CPU") > > > > > > > > broke the global timers case with removing the ->is_idle field handling > > > > for the global base. As a result, global timers enqueue may go unnoticed > > > > in nohz_full. > > > > > > > > Fix this with restoring the idle tracking of the global timer's base, > > > > allowing self-IPIs again on enqueue time. > > > > > > Testing with the previous patch (1/2 in this series) reduced the number of > > > problems by about an order of magnitude, down to two sched_tick_remote() > > > instances and one enqueue_hrtimer() instance, very good! > > > > > > I have kicked off a test including this patch. Here is hoping! ;-) > > > > And 22*100 hours of TREE07 got me one run with a sched_tick_remote() Sigh. s/22/12/ > > complaint and another run with a starved RCU grace-period kthread. > > So this is definitely getting more reliable, but still a little ways > > to go. An additional eight hours got anohtre sched_tick_remote(). > Right, there is clearly something else. Investigation continues... Please let me know if there is a debug patch that I could apply. Thanx, Paul