Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1625987lqt; Wed, 20 Mar 2024 09:15:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVHLSaKfuGOMJwFgIKpnKQdq2xCcxWcLKThWLbO0hP6Mzy7gfVHbyDhXnMshE4axHvy4/MMESBRh4FU91nG1t0KXP8uAe3PkxBTa9Xzgg== X-Google-Smtp-Source: AGHT+IGXKo6MQoJj1fdrH+wtkm6VflEpmgE3BoPG/nZXJ9w+Uwlnaux3Lf9CtN//jKOHpZk+hgAc X-Received: by 2002:a05:6402:4499:b0:568:c6df:d23 with SMTP id er25-20020a056402449900b00568c6df0d23mr8528456edb.1.1710951356585; Wed, 20 Mar 2024 09:15:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710951356; cv=pass; d=google.com; s=arc-20160816; b=nTa6vjGnt51nWOMT37r6zE+SYvJo7ZoKX68vBjAjhpziL8MgXWHMaxjOkYxAkLlxUj wGW+IUzlyWsaXEswsF0IMJmPokoiDqobBIMwfu/50mVDqPmOHbG9RqmFwehmOoeh7G7z 2eTeM7GM+aNEf4r9behVO+NXGBQDgLB/vvo8DzR2hK7ya0qTudAbDEJHS3rJWRBWbrxG VRkW9E747R+wbIvFoz0qHfzO39HQJVp3S/Bca78DcbAa3eUQIhGmRkvhtS9NwDiqqzX/ GpwyTXRWRlY5SqCWfjFfYJMqU+E0D7Co1oOtEr/7gc5+/zOxLn6HB7LnsNCNGWItJbiN TaPg== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=oy2RHBjbfdRJfiH+ylLJKZOaF+uf+av5EE6QpdFKH7Q=; fh=tCtXs8o4b5S26mTG6gxjiDoHss0JJZAi6xEELEFJecM=; b=v/IitK97M3YgBlnk9Z+ZZel7fJDb2O0UL2RyT3ovFydZSMiikrNgajGfWPZ2xk1kfX 1CcYtTyDA9Xpqyegcu32invbOVK5gcu2H260vVmLChdZAaqbU3E9KmZL3RGI4cTmmotw Boi3EP4IO5gLI5dWFRpl7YjalRrqAl/tTfp/kuQbpbgq3cJ9AiTK5mjC1c8OpwESNWHI ehaTuV/o5mKU+gawcM9xHUUNgCW36rCLQajvYnmAAqDPQNwGjefVcwsBtcNSDTONl2fe g23Z3YuK8lm5wj0CtfCqaapl2f942Wa3pR3z5rMmgAYrIfAClV70HyU1ugxNozsEieNL kzHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HKnqgjLg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-109149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109149-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d4-20020a056402400400b0056bb2f5040esi672514eda.628.2024.03.20.09.15.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 09:15:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HKnqgjLg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-109149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109149-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5415A1F25D81 for ; Wed, 20 Mar 2024 16:15:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 166215579F; Wed, 20 Mar 2024 16:15:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HKnqgjLg" 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 3C35D5577E for ; Wed, 20 Mar 2024 16:15:51 +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=1710951352; cv=none; b=QeWjVsp5Dwco3/bagTfUy+yPYWkdKC7DUWUQ+3pCNd6B3zuBeE38nWkJ+tfA0cVMKe72Lqfm9/YXVhf2Cpsrbsb3r4ga91vkE1Evs/v6F/RpgvWoJ1mlQCTXxQ0nKZJmra9zG0gAyZdpfkAzsqr029PA2PDrokvpXnirRSmdLXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710951352; c=relaxed/simple; bh=pNUTtnip1jZyKceBb2YKX7qImvQmdShebTlumYIYMq0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XO3JecxSkft6HcVhoBeurDS0ZNrmAMagzAARsbxkmpeI9/9f3Hz+EtxYUoUWAtoUsQ7xIPOfYAe1VbJZT2XOy8xXow+u08QX7nYvIgAqhIkYESvFChILUDnjjuWAcidX+/F83u/IGeSRYE52VSmqSLO9HOFFd3uLw4/lss3JWfs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HKnqgjLg; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53436C433C7; Wed, 20 Mar 2024 16:15:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710951351; bh=pNUTtnip1jZyKceBb2YKX7qImvQmdShebTlumYIYMq0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HKnqgjLgUjxBUtdHMbNgQQWA8yFWDRpZxADCZYuaEvm5BIqmw1InJ6bT0ngZgN5mE OZn+OeDjrDCHp+AWtBgiCKwsdlnqkRzN4vQKtBPZ5/p1Bs0H8cQBeK3ScR6Z3Hl2wL J3zpCz4nBewVH+2s5fRGke/jRqcVs/NPlNNihN914eQA0/imPnu9NfoTqupsFjVSCZ z3eGq/O8MkIQUqO1NInI/sas+yX/NzKAX+TqXuxGeRrED1SQ/e0xnq92Jnbq8RlR+P iKTU1MW5c4uAHWtXoSO5t+DB8wGR1NZ+KeGhTDcjr0k/3FQcbq4Q2bJftOba4Xawx7 D5BNqcq9ZK/XQ== Date: Wed, 20 Mar 2024 17:15:48 +0100 From: Frederic Weisbecker To: "Paul E. McKenney" 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: 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: <1b5752c8-ef32-4ed4-b539-95d507ec99ce@paulmck-laptop> 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() > 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. Right, there is clearly something else. Investigation continues...