Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5208435pxj; Wed, 9 Jun 2021 11:43:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJye4HO8c/RmK0AsKuwnNCEQBiTFgzdDdWFFyuAvs35GQanc8g6zRkcNzR7RbK3xAWN3tjTJ X-Received: by 2002:aa7:d590:: with SMTP id r16mr780211edq.355.1623264226333; Wed, 09 Jun 2021 11:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623264226; cv=none; d=google.com; s=arc-20160816; b=M3fF+eKOqznooChPR8Lh8iKU4AGvXLNxlY1SpFjBbpcTYAhAIamwM6RZb1jg+ghc74 gtXrHG44wxFWIhzBvow81zVEAIa53jrjuEnmH7GHN95ljbg6J2QmIS3zMyaFiNeX9DcB hm6h4fkpKY5igat/O+hvg3D7WOV5VJ2dqmiWTt4UD+V2GlJQUGI/NkMfiOaNZCJZ48/4 Ohw45lK2u2P2WF5D0EoecFWRtnkx3Wrcm8pthQbpn+LqlNeqJMvgwlPWE6ph4IPh8aC3 Az/sQJaKCfC6tDj0/fpBeGl2MQNz1lXw4ef43MTfGf4bqGG+bH2suTBBEsCbjAeHLFpL NX5Q== 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=Joa10AJCP54LjWxaKSSIMtAGSt6cZeQ3gur3QdKM5mg=; b=DOkjGPICSF9jbUPhwsoEQw3VDnKw+mxdfZT6Fgq2dtpK7SlvALobY73WYYIDqHjCUW W0cGkCbur0uda+2wyLNASDYejXqsjRL9JCOCuyZFMpRcLjX/2TdaNcWhAGQcB5RIksKf RovGE9W7EPryO9JM9VBcydiVYBGG4mZv5/Ifts3mNNTNrIoC3n6wI6UgHlVcd0Z3n5h6 DJcmxzJ8jMKac3ErxHocgHLaxVxYqphs6uWR5ftSInRJLFXNiHe1wD+ZzRLn424W+wdr j9eajSN+WDWWJUsYn7/ZgAvtANN86BWSfitKYox84aLgfcaoNbWzR0Mkqi5weEOKqSkh b/oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=joCUR5AW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm24si404367ejb.577.2021.06.09.11.43.22; Wed, 09 Jun 2021 11:43:46 -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=@kernel.org header.s=k20201202 header.b=joCUR5AW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234628AbhFIMUa (ORCPT + 99 others); Wed, 9 Jun 2021 08:20:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:41286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233935AbhFIMU2 (ORCPT ); Wed, 9 Jun 2021 08:20:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EB67260E0C; Wed, 9 Jun 2021 12:18:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623241114; bh=BaD5ZvWzoMu1DaZ8oWfiyesJjgOA3KCp3Qb400oOzNk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=joCUR5AWCQHba6t6brL/hcILJeOyvdeA947e5B59c9wKeyFZWPc9T4Jx4WYbzKNvU y5dHKctv6+ulH+QewymCwO8Xdhvj6rP2Ep81TKAjcxyDMEAj9q6HyE3sE0+cil5AsY UjaGyX40ERIAylW1yc3NEiUsSEs0XAXMxKZQfRv/YebHUbCgi+8EG/Ta44l3mkDJmq CTVUQU9bhCXOXznNiKBc31bF8to9tgr3/Oo+kkW8rmtv02Y87+JZFHDP64V68vtnLc RP4uI5aANrMYdXKA2bq/ZDHfdFDl4xC8gf4jaGYyisgsoLgPsOsNnRueadpw2O9Tk+ nRing9dp+NYBw== Date: Wed, 9 Jun 2021 14:18:32 +0200 From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , Peter Zijlstra , "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: <20210609121832.GE104634@lothringen> References: <20210604113159.26177-1-frederic@kernel.org> <20210604113159.26177-3-frederic@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210604113159.26177-3-frederic@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 04, 2021 at 01:31:55PM +0200, Frederic Weisbecker wrote: > If timer_settime() is called with a 0 expiration on a timer that is > already disabled, the process wide cputime counter will be started > and won't ever get a chance to be stopped by stop_process_timer() since > no timer is actually armed to be processed. > > This process wide counter might bring some performance hit due to the > concurrent atomic additions at the thread group scope. > > The following snippet is enough to trigger the issue. > > void trigger_process_counter(void) > { > timer_t id; > struct itimerspec val = { }; > > timer_create(CLOCK_PROCESS_CPUTIME_ID, NULL, &id); > timer_settime(id, TIMER_ABSTIME, &val, NULL); > timer_delete(id); > } > > So make sure we don't needlessly start it. > > Signed-off-by: Frederic Weisbecker > Cc: Oleg Nesterov > Cc: Thomas Gleixner > Cc: Peter Zijlstra (Intel) > Cc: Ingo Molnar > Cc: Eric W. Biederman No Fixes tag for this one. It has been there since year 1 AG. I suspect it's the same for most other commits in the series, checking...