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=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 10D65C48BE5 for ; Wed, 16 Jun 2021 14:53:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E49D06115C for ; Wed, 16 Jun 2021 14:53:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234232AbhFPOzU (ORCPT ); Wed, 16 Jun 2021 10:55:20 -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!