From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2F29C48BCD for ; Wed, 9 Jun 2021 12:18:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B55761287 for ; Wed, 9 Jun 2021 12:18:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235271AbhFIMUb (ORCPT ); Wed, 9 Jun 2021 08:20:31 -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...