Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp777511pxj; Wed, 16 Jun 2021 13:23:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUZf9y8qloBJmMUN0dJhfzkdy+e33CoC51iL7HqVdh1cRf7Z4US8XJiJHX1sEZYxRSE7oE X-Received: by 2002:a17:907:7848:: with SMTP id lb8mr1370790ejc.494.1623875005181; Wed, 16 Jun 2021 13:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623875005; cv=none; d=google.com; s=arc-20160816; b=Y0Zh9aUfDplNp+1swCC65pB4MMaWKwZu9SpHWEIVvXAXIXUgMt+DVXhbG7f6FGQ5u6 PuXH2gBDKrSjzkWuEeIuS5pBqBGXvw0nqZPU+ZEy60vCMn+59Tiba8HBQq4Nu3/s9cAs r0yOuUqBRRTQD9zDVl3zQIPsm5qvA/NS0a4l4yWPrIVN97eWfKNGsL0iE5nQXvED1JIC SwKxH7wBbfLj7BJJ1vx1C6JGlo1XlEByKuKB5SSW/wuWFZbf1PG6OlLcjvxDLQTNm3d8 LTpoPLAnUDvvPe1xfZp1iZaM0bMwnYwXuK4BX2kC25Fd2JlTVrvroqn4a6tOjN4llCgy pljQ== 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=6tznOsNaQDjtpTt4miq7xkWQFvs5BemFL7vQm65tQL4=; b=GFEXzMnth/rVfgcP0NMum9qKFef4subj+D35KOPr5RJcoKJq4SuGERo2zmv3kClh0Q dxHtV+Uz4ranRiKaewCvJPm/uwmY6ZWrlh5NtMdt9n/WR9Lile1lZVOd1fW8Cf8gzPDy 6DJ1dcF/FCgt8WPGbFIlW1AFwVusrnAoC1e9whtctd0itEljr8A/L+smeT3U1+9c80E2 9M7D6yNPSoLCHfpz7+fDmwvwAPDxrlNjzA0/4Sd/XJ7r1Ohm+nx7mPmvIsrEJNYsQTBz hwpUqE4yd3aUVHUhI2aelJoJwQSwIGWtH9Vtf91FLh8xntRLJI1TCWheSNpdK1h6sBJ/ GJLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ih1llUUB; 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 bz20si3559518ejc.486.2021.06.16.13.22.58; Wed, 16 Jun 2021 13:23:25 -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=ih1llUUB; 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 S234224AbhFPOzS (ORCPT + 99 others); Wed, 16 Jun 2021 10:55:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:40408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234120AbhFPOzR (ORCPT ); Wed, 16 Jun 2021 10:55:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EA6EB6105A; Wed, 16 Jun 2021 14:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623855191; bh=ZsjfkAZUSfYYQm0SQ91sXoN2r6em63x8jo3QgV63WRI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ih1llUUBepIcelkQBN/uLty6yg7ykjRTKDjTQKDARdvYXAC8SN5NzZEwj32Q6Vb4J 2CyEcUt0jwSvV4MKK7WnVLMZRF6/0g4SunOHKjkTbt7NnwfTSCXkuWvDRI2Xy+wDm6 p49nyAnw5fEFkUgw7TqISw6wEv89YcwepIz0AkZ4zfIkFvTB4jY5LVe5aXKPYcMkO1 Bt9M5SwtVhQ9IYQbsZPFztyv5x6fIn20G84DtOBffc7f0NTjmhbqI7/+HXDXSlK3L0 P8c5clSkq59RQPMB4TmBSS9zA8XdxpObMUgoAiNyk5KycmcMRA463DQe6A/FB8KjNP YXlfhtm0bkI6g== Date: Wed, 16 Jun 2021 16:53:09 +0200 From: Frederic Weisbecker To: Peter Zijlstra Cc: Thomas Gleixner , LKML , "Eric W . Biederman" , Oleg Nesterov , Ingo Molnar Subject: Re: [PATCH 5/6] posix-cpu-timers: Force next expiration recalc after early timer firing Message-ID: <20210616145309.GF801071@lothringen> References: <20210604113159.26177-1-frederic@kernel.org> <20210604113159.26177-6-frederic@kernel.org> <20210616115923.GC801071@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 03:23:50PM +0200, Peter Zijlstra wrote: > On Wed, Jun 16, 2021 at 01:59:23PM +0200, Frederic Weisbecker wrote: > > On Wed, Jun 16, 2021 at 11:42:53AM +0200, Peter Zijlstra wrote: > > > I'm thinking this is a better fix than patch #2. AFAICT you can now go > > > back to unconditionally doing start, and then if we fire it early, we'll > > > disarm the thing. > > > > > > That would avoid the disconnect between the start condition and the fire > > > condition. > > > > Right but the drawback is that we unconditionally start the threadgroup > > counter while initializing the timer to 0 (deactivated). > > > > Then in the next tick at least one thread will need to lock the sighand > > and re-evaluate the whole list. > > Yes.. but how common is it to enqueue expired timers? Surely that's an > unlikely corner case. All normal timers will have to suffer one extra > tick and iteration on exit, so I find it hard to justify complexity to > optimize an unlikely case. > > I would rather have more obvious code. Ok, I'm having a try at it. Thanks!