Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp411715pxj; Wed, 16 Jun 2021 05:27:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEbaqXiBYhvKJCStXzKM6L5lIL8c3wUMIAqwk6NBT+d/+sKAetyxgMJ+3HDVgE3XaRS0fd X-Received: by 2002:a05:6638:3048:: with SMTP id u8mr3940202jak.91.1623846443581; Wed, 16 Jun 2021 05:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623846443; cv=none; d=google.com; s=arc-20160816; b=OA+w11845gVYHLZ2P22WTclFhkhr4OO+QDNg/jSQZHWc4FJIhJFpJ+yXY3g3peP5CW JFUKkFkfsaWUlBE5495ud2sAm8WfAoinNgZkEl/KSrW45355yP1ZawqvqhaXrAfazGJj AOePI4FnuwrGMgz2hggHKiqqhDti9b0QLU2bedU8py5GoAqeVw9cggBuy+ZGAUQ+GylK D510Z/aDd5r7YHSk8nr52uoF1TghWsowS+pbQvIxjWHpaki+B/h6rcqWBaVOE6XS6WKm 05JTwqR/Z2C5MN/qvbkKQgXOJEWGPQZy31je+7ivYQpUz+izoxxFlY/VYsBebEllplQ4 kLsw== 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=BILF6/R+VB8OzefHhcVLIuTdGh6RLRSzEmoeurdnr4A=; b=gOajKL+rUS0SJGRIjw27lFrwxYxLZAKTExjwKLyZX8zuUKPCIW9tvpvpah64P/HYPk O7H0D3BGTSUcOaY4/paNql86JWVEdSRm9SNe1rWJbf8kD7HDY5/D4juayJ5At59EB4bt qcKjmmC54hfi3s324k+kHrVZJVMiYI9m4oOKo+VHRPcrlDSEZLibWa4AaydreXqmozc8 m7wLa4p8pyGjfxXTFgpmJmvGocw46vRlUkhyq2oUwPz5x1e9DF3V6FqOLt2BCZSX1dvZ 3tYbJuPdlYaGbSUJyZeSOYChG/Q43ACr1B2foyHBNTtSz/3d2I+YzWfLUxUr7FRqgE60 BybA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Hu6rNDrt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z4si2225516iod.34.2021.06.16.05.27.11; Wed, 16 Jun 2021 05:27:23 -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=@infradead.org header.s=casper.20170209 header.b=Hu6rNDrt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232454AbhFPLxN (ORCPT + 99 others); Wed, 16 Jun 2021 07:53:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbhFPLxN (ORCPT ); Wed, 16 Jun 2021 07:53:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EAF2C061574 for ; Wed, 16 Jun 2021 04:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BILF6/R+VB8OzefHhcVLIuTdGh6RLRSzEmoeurdnr4A=; b=Hu6rNDrtrbbjEeIWnoRUB49PtL Zz/w/kIccIfwAnSysECfzVW6PQggYkLNyHS+eDhZHoa+tXgULkNEDe/Poefo6If3f1BQ/x3clKtpq qbQyd0MNnFArP3rNEmWdXsdrL6pooUSmohzYxiniG+aT/sP6bezcmYQXXruGKFcV5OUKGDYLBldLz 03Z9yoZ3RtCVFvsnY8JvrJh9LC3R0Zlz7hlitHaHvSBtP5XT64ED8HkNKXZks58FeHV025Ng1g7C0 HUm5nHj3nNGihLNSzT9PhQ7tRModq7pBKfw3uRP+k/xkJYUpgOiF9TwzdjOEv019szGMx2Ll54lf0 Dq3uj3Hg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltU41-007zjd-8k; Wed, 16 Jun 2021 11:50:41 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9BD78300252; Wed, 16 Jun 2021 13:50:32 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8552420277F84; Wed, 16 Jun 2021 13:50:32 +0200 (CEST) Date: Wed, 16 Jun 2021 13:50:32 +0200 From: Peter Zijlstra To: Frederic Weisbecker Cc: Thomas Gleixner , LKML , "Eric W . Biederman" , Oleg Nesterov , Ingo Molnar Subject: Re: [PATCH 2/6] posix-cpu-timers: Don't start process wide cputime counter if timer is disabled Message-ID: References: <20210604113159.26177-1-frederic@kernel.org> <20210604113159.26177-3-frederic@kernel.org> <20210616105116.GA801071@lothringen> 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 Wed, Jun 16, 2021 at 01:26:30PM +0200, Peter Zijlstra wrote: > Right, so by the time patch #5 comes around, you seem to be at the point > where you can do: > > * fetch cputime and start threadgroup counter > > * possibly arm timer - possibly > > * if expired: > - fire now > - if armed, disarm (which leads to stop) > > Which is the other 'obvious' solution to not starting it. So we unconditionally start and arm, and then have the early expire do the same things as regular expire.