Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp430985rdh; Wed, 7 Feb 2024 08:47:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUdzKg6rZc2CLBUNX3TpGZoMw62IAkNm561/8qvgmM9+TiYupBQp/2/3XiuDFDHT6kMho1ao/eYcuBISygCvwvx0g+XitMRSAZOHsiu9Q== X-Google-Smtp-Source: AGHT+IEqID7aUiAiriVJz2Xo5ASLtrjS58I/B0uvJZsE9CiBQnbmidhOEnODBGmlyTsRocHdGbxc X-Received: by 2002:a17:906:17d9:b0:a37:2685:6a86 with SMTP id u25-20020a17090617d900b00a3726856a86mr4791815eje.26.1707324448577; Wed, 07 Feb 2024 08:47:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707324448; cv=pass; d=google.com; s=arc-20160816; b=b6UmjiHUegFPR0KMlBCw00SKBNVPV1isjM2S7lcC0bPUxVE4bZ3WieUxxrGfoPyX7B K6/RPmlKJvUcnWHnJ7w3opS2CawVW3Jm+i7X8FBR+t32pQmN7s2lQKJ2+4YNjGnP30Xa tl9GZljcblKSPwbo/v+qUgp2zmll4oPWrU8vaRrDB4z5GdwPc+QY6pwT6vrqRXiORnQV ROZHL+Uxqm/Q73rBsLmsA1yeSy8v/qk1Q/PQlMJLFyc36wdG7lUjyPrNRosdzkWyl0l+ 1TujeXhuCzL51g5Y1CSXc2F0+Cwx9OjLvIuG4V5w6IX2E75qcCFbXI2EpzM+6A7kBPBN rXFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=B5QDMbEXnz0a9DJjbd5r5ka2eJdhDxqak19jUyB3HAI=; fh=77IiRJO3aCCqOIf55I3VXuMmtRgrSP7ahWjlkZYJgnU=; b=jcqc/vkml6S1F/oDu/M6/vSvXsvgwtvd0ND91UZBRjvBl32vpUnmGPD9fJCZVolxhf 1u5/GrNlFwKnhdlO4YEG52HYtS6C0KqQ8PQ4ySj+u+KAqu9OZmFWZO/SFSckll1zM1w8 jYShhJgEdFswQpyBrfoKWkP/iJUCGSgOCGvyNDN3XewtxKHywF++MGqQWmmoDRuJ16r6 MbMeR9k4OcYFh+CnfomDdZdWrQ6TmJg0pN//mC7gQUpdLlYt3fYQXu3TT3NIRmp65L+e i+T8r5kDyaU0bpg7Sk6xTTkBIZIbA6O0gfxbG+I84jxr65NoSxTHa0OxPpv4WXjEhX5i RP6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ow+7rXcb; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-56792-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56792-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCUdvoV0EKCregjhxJ9sczTHP77kaK7CeA639K6BcM+XUbuaOXbvT4ztOzStmQG66FUFHzu/do2+k0Xdk0dJsgWa99CuxqN+HIj8wKLLNQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j22-20020a170906255600b00a381aa85445si1079067ejb.380.2024.02.07.08.47.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 08:47:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56792-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ow+7rXcb; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-56792-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56792-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2F6AD1F22F0F for ; Wed, 7 Feb 2024 16:47:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9F8881AD3; Wed, 7 Feb 2024 16:47:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ow+7rXcb" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 399D0811F2 for ; Wed, 7 Feb 2024 16:47:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707324429; cv=none; b=X3CmLmDA4UIfpS6hQTL5i54f/C1Bgu4S6iR9hfkWVKAGPYUAUiCzfkFzQUAWetdj7J7Txwn0CODhFz+GntvWxYNIo0VxPTbcHpMMOzJCUYxxZzZ+wDZCcPVyKlY+zg59lSBBQKMGFgXE+arcLXMXt97rvZOLDkvqN5zYjigsQeY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707324429; c=relaxed/simple; bh=Ol4YWhmXZ05lW3VETc45pz1X+eRFewdDFCHvvqRzc9c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=i17pbL+kl/xmdJxj+mWgR06L6nzoUzhRc9+ewWPRg+MjNfurtj/tdzNmrl0t1eUpKQea+TMBD+Ifp+jvEhdWcWVFrfqy2GmcmxVxlIpQy+EM8Lr+Y6VbdypbGqxdea/4Okd6XsNPyAOpF5davQMwIsZbKGxeAIQSKGl4HUVEWd0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ow+7rXcb; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a2f22bfb4e6so114407066b.0 for ; Wed, 07 Feb 2024 08:47:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707324426; x=1707929226; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=B5QDMbEXnz0a9DJjbd5r5ka2eJdhDxqak19jUyB3HAI=; b=ow+7rXcbY1RjEyfPxcrxiQ6vQqDsvO/jM1QyhwTRqHB990dK8LsJmtSbxJiMPaynf3 AP7i0FETO9NYbF1ZYCMQVRxRs2wkVyDM3mjiOsHjoV1qMQIZHo7KpOz6RJQtl1MFAKNI chMo5jxCMleq4P6fpykjDbz3pGrlRuRWNf4l/LUjaPGKJAX4TntWu+r24AFOlGqBe8Ir bYDmzGvvXtLJFs8jTnjTCdwubISppD6sdK6eHoxTVgxNmjGS91Y4WWJHeK4HoxArFMbp wNOo7IALy+N1G+yzr85H+T0gN5SA0ZV2WlqM2sU7FRMqzRYYPSrM32qie2mI4muv/h7t aiUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707324426; x=1707929226; h=content-transfer-encoding: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=B5QDMbEXnz0a9DJjbd5r5ka2eJdhDxqak19jUyB3HAI=; b=cxqBQu/oNWJlACQKD4BqrrWehD7V2rjOrECSnzsKUoMV/wTT4gIzFoksgovf+hKacy Lhm1+NijwQiTDfgnDFAd3MuvEbYYxm6C2bOImRqvIPhBGjLVt+QXRhFk7mHRcfhwHKrB 11hrG2UcxlTWyxEyBqwWwSxLB7gC2PynxGujJ205bhrg2wj4mdhBMLKAi4KqvEylwV52 8Yg67BpNupgMH0Sme/UBm89akrAL5wMzgvoXV2pmb9jt2uaD2gP+Bmh2iykkgDMAEPpJ N2daMEN8C8Aj3sMOahc+QBlKw3vaxvPpErb15oy8AITippuxRarNFTDh0HojFeCPTj1F yEsA== X-Gm-Message-State: AOJu0YxLBHziG00BBf+osGro/j6tJLY0e3Te377oJYmyRWeSsXS78RxD 2KYRBgS6+p8hEkSwfU7KYRMBAj9bItBXYYco4f8OudNu/2cO5IIhgTlsMeGC0ZIGQfQ7IHWkWHl 3GR0G78OpxAWY3AS2+SnBRYWn+dXwkxPL1YBx/a8ZlKpl5lgswDyA X-Received: by 2002:a17:906:550:b0:a37:20be:b37 with SMTP id k16-20020a170906055000b00a3720be0b37mr3849178eja.58.1707324426344; Wed, 07 Feb 2024 08:47:06 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240207100619.3947442-1-pranavpp@google.com> In-Reply-To: <20240207100619.3947442-1-pranavpp@google.com> From: Pranav Prasad Date: Wed, 7 Feb 2024 08:46:55 -0800 Message-ID: Subject: Re: [PATCH 0/2] alarmtimer: Rework the suspend flow in alarmtimer To: tglx@linutronix.de, jstultz@google.com, sboyd@kernel.org Cc: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Please ignore this patch series, submitting v2 with some more suggested fix= es. Pranav On Wed, Feb 7, 2024 at 2:06=E2=80=AFAM Pranav Prasad = wrote: > > Hi! > > During the driver suspend phase of kernel suspend, alarmtimer's suspend > callback is invoked and it identifies the earliest next wakeup alarm and > programs that into the HW real time clock (RTC). However, there is an > exception to this process. If the next alarm is within the next 2 seconds= , > the alarmtimer driver fails to suspend. In this case, a non-trivial amoun= t > of power is spent to freeze and unfreeze all userspace processes and to > suspend and resume a number of devices. In the vast majority of cases, th= e > imminent alarm that caused the failure was likely already scheduled befor= e > suspend even started. This provides an opportunity to reduce power > consumption if the suspend failure decision is made earlier in the suspen= d > flow before the unnecessary extra work is done. This patch series aims to > achieve a kernel suspend flow in which the check for an imminent alarm is > performed early during the suspend prepare phase. > > Pranav Prasad (2): > alarmtimer: Create alarmtimer sysfs to make duration of kernel suspend > check configurable > alarmtimer: Modify alarmtimer suspend callback to check for imminent > alarm using PM notifier > > kernel/time/alarmtimer.c | 178 +++++++++++++++++++++++++++++++-------- > 1 file changed, 144 insertions(+), 34 deletions(-) > > -- > 2.43.0.594.gd9cf4e227d-goog >