Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5726739rwd; Mon, 5 Jun 2023 07:48:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4jdWW+Zejqg1wd8X1c/notdN4Eh+IbUWhPkh4c8WlAnwI6g56H72Qvp63HAgc0RqXrlaTy X-Received: by 2002:a05:6a20:8f29:b0:110:d78f:8156 with SMTP id b41-20020a056a208f2900b00110d78f8156mr3386936pzk.19.1685976517746; Mon, 05 Jun 2023 07:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685976517; cv=none; d=google.com; s=arc-20160816; b=SW8TBAGGsTyzdlTz9M6eKf55RF043kjie2ZISqQGdG+N8uW/Pl5LoszGpERElKJ8C5 mnk8+rpKaHhCsOx1adiLn9U3VFIw1NqLPiMPVnKdOlmX/xrLJ34/GCvrVV+g2V8EVh/3 pL0lLl2HMhw2s7Pb7lYhPHUezlLNLvxTkxhi3KCUnc/souZbdzN3Ghj0whvYK3Agif1i msQ9uO2Awpkx6+oj3Pwo9JDlBveWP0CPTbg8+/zPheBoFGTdrU2XRNMpJFhsGQI7Y7Ll g/G+Vxv4YEEfGoo2ify2t4iIKuG4rGwQXrapKcnUjYr5RtIy74QJtdbqEk6ANL8F/HzI g+Mg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CK7Au94HBB4l0YgdZqv+UZhS7JyLblIGbO8ZkjdT5qM=; b=Ieac5KfS99+suqWhKgf7qqbkWowVsB9VtNqNGjChzy6b9J4Vi+erCmWBp4qAipRNRk 5SaQD82J9Nzp+RZ2rCIIldIvC8hEwEilE63m+LcGBzrp0AKFHzENbuiEBSlTM6y99PQU tm4X1XPTe9y4bD4zB1uafqD0VD879JnLS4RF+q2PkXl1zkXqhl44snQHpsDgX6/0bxs2 /JzVDRagdh9IDdnrmOnEDE0Stz2ffwzC/YKa4XVP5R3BHsODZSZILgbduGz+PbORiUYw WqjAM0saY5cTU/cMrAGmQTw5yV0KvuDJBmtp3VQpStprjktbp1rKjE9qex+t2Wijy+Ee VZ3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dxpZCjJa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w63-20020a638242000000b0053f3e6ec82bsi5496643pgd.774.2023.06.05.07.48.20; Mon, 05 Jun 2023 07:48:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dxpZCjJa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232803AbjFEO0j (ORCPT + 99 others); Mon, 5 Jun 2023 10:26:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbjFEO0i (ORCPT ); Mon, 5 Jun 2023 10:26:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB97699 for ; Mon, 5 Jun 2023 07:26:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 86E3261361 for ; Mon, 5 Jun 2023 14:26:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79EE3C433EF; Mon, 5 Jun 2023 14:26:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685975196; bh=riZ6RIajBfnKWVAP+l75FazrFPYYacaLdTA1K64PwTw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dxpZCjJazPbm1NIgKyTkwvU9CBKuNrVNf4HiIqR5xGw5UF1X5C94bRkfPeEZv+ETz 3Fe5s8f9W+uPBfi1b9JZbIrj4e8iRuqtI5Obkbz09PEhpNk2XySzqrDCgS46gnvSbI 2TdpJU/SFccNTubNuUKokuu8KTebkorQ5y45+7VTc/AbFlNGUegPJn3MxyUFmCW0Sr MrsfLXkZvvY4srPhBPgfRP6CUAmVqeCN7CZoCx5cphq5Ov9z806ZefScT9IRYjZ7Q/ ZWdNhWKeBHaBArp6a7Npp6nH88dCZJ+2FwBKflL1AOmXu4ZQ9e2TJ1EsVbNegzYmyD FwlsM41c73hgQ== Date: Mon, 5 Jun 2023 16:26:33 +0200 From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , Anna-Maria Behnsen , Peter Zijlstra , Sebastian Siewior , syzbot+5c54bd3eb218bb595aa9@syzkaller.appspotmail.com, Dmitry Vyukov , Michael Kerrisk Subject: Re: [patch 18/20] posix-timers: Clarify posix_timer_fn() comments Message-ID: References: <20230425181827.219128101@linutronix.de> <20230425183313.777610259@linutronix.de> <874jnrdmrq.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <874jnrdmrq.ffs@tglx> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le Thu, Jun 01, 2023 at 09:07:37PM +0200, Thomas Gleixner a ?crit : > @@ -359,34 +360,35 @@ static enum hrtimer_restart posix_timer_ > * FIXME: What we really want, is to stop this > * timer completely and restart it in case the > * SIG_IGN is removed. This is a non trivial > - * change which involves sighand locking > - * (sigh !), which we don't want to do late in > - * the release cycle. > + * change to the signal handling code. > + * > + * For now let timers with an interval less than a > + * jiffie expire every jiffie and recheck for a > + * valid signal handler. > + * > + * This avoids interrupt starvation in case of a > + * very small interval, which would expire the > + * timer immediately again. > * > - * For now we just let timers with an interval > - * less than a jiffie expire every jiffie to > - * avoid softirq starvation in case of SIG_IGN > - * and a very small interval, which would put > - * the timer right back on the softirq pending > - * list. By moving now ahead of time we trick > - * hrtimer_forward() to expire the timer > - * later, while we still maintain the overrun > - * accuracy, but have some inconsistency in > - * the timer_gettime() case. This is at least > - * better than a starved softirq. A more > - * complex fix which solves also another related > - * inconsistency is already in the pipeline. > + * Moving now ahead of time by one jiffie tricks > + * hrtimer_forward() to expire the timer later, > + * while it still maintains the overrun accuracy > + * for the price of a slight inconsistency in the > + * timer_gettime() case. This is at least better > + * than a starved softirq. Could be hardirq. How about: "This is at least better than a timer storm." Reviewed-by: Frederic Weisbecker