Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp390736pxj; Thu, 10 Jun 2021 03:25:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyckqZxNvoyhf7ZFdy1Bv2DqYaHJc9Z9h575fxXBPzBu92F/KNHFrl7mm0AfF+tPreDQZmh X-Received: by 2002:a17:906:19d0:: with SMTP id h16mr3830830ejd.193.1623320745042; Thu, 10 Jun 2021 03:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623320745; cv=none; d=google.com; s=arc-20160816; b=zqjMVq79kzanEW1iFpz4maukBotMP/YVFcuGFd+t7FJLCG8b2lHEO0JWun+1ZgZMTB rPV1YnYbTjlQnAf8p1+HmPFMeCeLTyMppSZdnjd5oaEEN3npZQj+/prDJdHr6QYeqCou O9szEY0Z2TxeoCGMqsehkjET0dGqaWGRvs1behNtd4637EpuPMD8wvTznqGKQTHG9psy uguHKUAKq7v74lA+i7Q4GobAVw1szkmpRxnhCjIQT/QIx0L8E05JJIKGKtbBKiBjUSYS 9xMh3QC8JKt4/j/L/xqvnase/06GH2NfTN1HeBcnq59zQf0N0ZdGJ5ycRNcVefQGsNJA NnKw== 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=cqLthEKCQ9+u19VzPicX4OUxehLksRDoop9zj8dCg6c=; b=aQ2GzWh4S7Ye+d91BLreWal6E7+nwVsCLUOgdqvZelaYiCxiM/dNLA6eyh8uzLxGSY nd9vDXJxH9a1heTJhN8BXQTjLIt8BfjxpmVZT9CqB9dCbY20bQBgA4AxFkRSMhm834cq WNYF9E6d8mjhbm/MyaO0XrDD4KhM20Mpoc96x3atgPab+XOiNg/00t5C/NiWwpdlh2bx +1aZCiG12Z28i8tjWU6Ntu1GQ3EmB9XCnIzY3vIkFUM7Qanmo1FcpEv2jty3V2tGarb9 hUBi7D5Si4YFx3AVUq/yTwtc3HsXtS/18FoXit+xCyTYy0GCLD/JjNOcjUkgwPoFnIgS 8U6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N+Qis6JA; 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 v29si2083440eda.545.2021.06.10.03.25.21; Thu, 10 Jun 2021 03:25:45 -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=N+Qis6JA; 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 S230029AbhFJK0L (ORCPT + 99 others); Thu, 10 Jun 2021 06:26:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:56422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbhFJK0K (ORCPT ); Thu, 10 Jun 2021 06:26:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AE3E1613FF; Thu, 10 Jun 2021 10:24:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623320654; bh=M6AEleLc4JKp4M6OeGH/BH3NxyqfJE++xRcWRirs5qo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N+Qis6JAheBOaZ3dboJlNbAb1TDo1/FyqLWX70S1HQEkLRBwhZqg85uLAn1U9na5g Y1FqxJwB6ddwRdU52JWGuFXArb4ZA8GEc/yofuVOwPIuL5SeN1h6cQdA+XkTGxJNrt 93eEUZeZU7SyumlvQ3Yd6jCAXbNOOLp/eFYzpScB16ytVz5oW7SKFyq86USB0bZJGW uMWrN9sD5EMZlOcoKsXoY4FH6rNSpqrpbI7xZ+VcrIxE3IjmaqqNst8T4VW0lkuNEU eRy3FXwokuGXW6H7NZPejdpTphj9OsaDTO0mSOKiChz+b0uwvP103euRG3070X5Z4/ P0kpbtLfXTqzg== Date: Thu, 10 Jun 2021 12:24:11 +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: <20210610102411.GA127975@lothringen> References: <20210604113159.26177-1-frederic@kernel.org> <20210604113159.26177-3-frederic@kernel.org> <20210609121832.GE104634@lothringen> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210609121832.GE104634@lothringen> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 09, 2021 at 02:18:34PM +0200, Frederic Weisbecker wrote: > 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... Right, so only the first commit needs one. Thanks.