Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04311C636D6 for ; Tue, 21 Feb 2023 00:12:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233324AbjBUAM5 (ORCPT ); Mon, 20 Feb 2023 19:12:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233321AbjBUAMz (ORCPT ); Mon, 20 Feb 2023 19:12:55 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CD945FF9 for ; Mon, 20 Feb 2023 16:12:53 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1676938371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OwOcHyDhmKM0zAB+GbcrD7eW2Ij4McN5k7mmG6Z5gQM=; b=a2EiD8SagPG8nrtP281MLuuF91B0anYgqcArT83Hnm2i6jhq+TgyJ67hDkMOpnELEIPryG 9c07W7OoiwuXzD8l5Tb1WHRTu0rjyFJ0l+HkLtVSmYDdN0304FIpmJZzTExO9tr/sLcFb3 FfX7mPkmhb7pXUTGKy3d60DwNTZjFff8tMFRn0wuGO+YCBLf/I9uesXsaqTe5ziN4tsP6q mestqUSmvVnAxyRFVmfWDeMzoWomJ25zCKtZJltREHX9N9ZuIOLUUclhl1qdTn9luEiOnl ZTMTC9m6XpdPabkaPqMsot2hIwWjtVzrMxiXDWG8XLENU7QxdP8xI9uBXk1dTQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1676938371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OwOcHyDhmKM0zAB+GbcrD7eW2Ij4McN5k7mmG6Z5gQM=; b=FXgoJ7leqhRkXM5V+ExvfKOZkrT9YHaHbdiOl/AAOQsvhPm1ryRsKT9OwbSwhGYVZU08z6 xtgo5tjsP1kY7qDg== To: Michael Nazzareno Trimarchi Cc: John Stultz , LKML , Stephen Boyd , Arnd Bergmann , Michael , kernel-team@android.com, Peter Zijlstra , "Rafael J. Wysocki" Subject: Re: [RFC][PATCH 2/2] time: alarmtimer: Use TASK_FREEZABLE to cleanup freezer handling In-Reply-To: References: <20230211064527.3481754-1-jstultz@google.com> <20230211064527.3481754-2-jstultz@google.com> <87o7porea9.ffs@tglx> <87a618qlcp.ffs@tglx> <87sff0ox1a.ffs@tglx> Date: Tue, 21 Feb 2023 01:12:51 +0100 Message-ID: <874jrfq3jw.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michael! On Mon, Feb 20 2023 at 22:32, Michael Nazzareno Trimarchi wrote: > On Mon, Feb 20, 2023 at 10:18 PM Thomas Gleixner wrote: >> * alarmtimer_fired - Handles alarm hrtimer being fired. >> @@ -194,6 +196,8 @@ static enum hrtimer_restart alarmtimer_f >> int ret = HRTIMER_NORESTART; >> int restart = ALARMTIMER_NORESTART; >> >> + atomic_inc(&alarmtimer_wakeup); >> + > > ptr->it_active = 0; > if (ptr->it_interval) { > atomic_inc(&alarmtimer_wakeup); > si_private = ++ptr->it_requeue_pending; > } > > Should I not go to the alarm_handle_timer? and only if it's a periodic > one? Why? Any alarmtimer which hits that window has exactly the same problem. It's not restricted to periodic timers. Why would a dropped one-shot wakeup be acceptable? It's neither restricted to posix timers. If a clock_nanosleep(ALARM) expires in that window then the task wake up will just end up in the /dev/null bucket for the very same reason. Why would this be correct? Hmm? > Michael > >> spin_lock_irqsave(&base->lock, flags); Tons of wasted electrons Can you please trim your replies? Thanks, tglx