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 ED43AC64ED8 for ; Fri, 24 Feb 2023 10:03:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230001AbjBXKD5 (ORCPT ); Fri, 24 Feb 2023 05:03:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229709AbjBXKD3 (ORCPT ); Fri, 24 Feb 2023 05:03:29 -0500 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C8D014EA1 for ; Fri, 24 Feb 2023 02:03:03 -0800 (PST) Received: by mail-ed1-x52e.google.com with SMTP id x10so51909533edd.13 for ; Fri, 24 Feb 2023 02:03:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xp5RRtgEuUclN1gzlJG38qRywuFBqE+AlMuv+dm8tf8=; b=U0ma6NY+2FTKXGN0P6qdKtrg2IQ/16q9zrmLLf1gz+XI206uuB49xN57V85A8gh+Ys xsfvvPuD3485+qq+cS7YLMUX4ieB6eg8kys4Ljn1W3aWoLfsU42H3dYMo1jn4tTc5WdW vJ9MYmzmgQdSmwcLNab00czGWdHhoo4BtDUZ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xp5RRtgEuUclN1gzlJG38qRywuFBqE+AlMuv+dm8tf8=; b=C7HutlZu1OBHVaB/gufXehGkLNOMhSYAvCjixSe/dw2x25FNmkyjezcVaRIjxjWDid qizxWJON9w317VyoRHhoE4NfGPIrvRut7nJBtdHkm3Ye8LqtTbLM04TEvXflYnljy3kv +GZGRJNRuE6qbr2Wn/fYZ2iLXKA3AT2R+COnqSurNrJSrNUYOSNcL7M6X2pedEAFT9CL MbtinlhOiMETpqckXhZ+12bQFiMpIX7zRS7fRsDWTMegGQs7yWZRUZTyvwqpDVgERj7i TNIu8WbcirdyhL2EN/pmz/gRKaUDxy/FAWq9BSfMMHposkZ/kcSJ10iXMgknBPq62jB/ GPAg== X-Gm-Message-State: AO0yUKXyhUp4UjK8sOmOIH1BXI8TGiV5lSHJ9sfI7WVzw3dtBHGy7Qv8 bzvt4oOWSJexezDktZWXOhos/rrs+Zz800RGtVB9dw== X-Google-Smtp-Source: AK7set/Vi87e+88U7UTVLHS4rzVK6172JuMml9N5j9bjidx56MivcNux2HN3gPdbWBFnfcGerrGJaG3hTgWpg0gKl84= X-Received: by 2002:a17:906:7b88:b0:8b1:81fa:b07a with SMTP id s8-20020a1709067b8800b008b181fab07amr11243575ejo.12.1677232980595; Fri, 24 Feb 2023 02:03:00 -0800 (PST) MIME-Version: 1.0 References: <20230211064527.3481754-1-jstultz@google.com> <20230211064527.3481754-2-jstultz@google.com> <87o7porea9.ffs@tglx> <87a618qlcp.ffs@tglx> <87sff0ox1a.ffs@tglx> <874jrfq3jw.ffs@tglx> In-Reply-To: From: Michael Nazzareno Trimarchi Date: Fri, 24 Feb 2023 11:02:49 +0100 Message-ID: Subject: Re: [RFC][PATCH 2/2] time: alarmtimer: Use TASK_FREEZABLE to cleanup freezer handling To: Thomas Gleixner Cc: John Stultz , LKML , Stephen Boyd , Arnd Bergmann , Michael , kernel-team@android.com, Peter Zijlstra , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas On Tue, Feb 21, 2023 at 8:10 AM Michael Nazzareno Trimarchi wrote: > > Hi > > On Tue, Feb 21, 2023 at 1:12 AM Thomas Gleixner wrote: > > > > 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? > > > > You are right. I will pay more attention to my reply. > I get time to test it and if the system suspend to ram we need to catch: case PM_SUSPEND_PREPARE: case PM_POST_SUSPEND: Michael > Michael > > > 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