Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1023741iog; Wed, 29 Jun 2022 15:31:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vXd6v7s4um/OM+WoWbcLW11fDEV49M7099kiZkbC9ILWJ2Anw+tRJJt/yRpO+WH/6dV137 X-Received: by 2002:a17:906:6d91:b0:715:7d4e:84a2 with SMTP id h17-20020a1709066d9100b007157d4e84a2mr5575798ejt.504.1656541901130; Wed, 29 Jun 2022 15:31:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656541901; cv=none; d=google.com; s=arc-20160816; b=kiTfdDCRMsIWeh/i3GwfP6324iZjKNuiZTlM+TKS9GeDmbvhNERrf+gJ0l/gjRZWyx W9FRGfIsMNF+luedT7Qu9PFmJztkiVcAygnX/WqWjTQlPq+5xMnPOzH68E4WuLyi9/QL 36GsXp8TB04eEO32XrJtVih8vgkYobcg/Jo2pN+mupsPmW/8NBF2PF78TEv3MuYwY3TN n1leutxRsWkMUgwdiTVcY6B61OhASX1zJylL0oK0/geDxouXouFsR25YDM86k2zsjJ8b 7rSLwYsVRwMOZYEzktILMG09BcQ3t/tmvu4MHhAw+q0PtNNiYq+y8ZUAMi7IQP+XkCj7 3NCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=84p0yb2pKb0/mlqhXXfPPXMLX3/ZN9/6y/XnIJNI1Kk=; b=VcL7O/wxqJXsfd8i7rG95IscB/soUakXoEssYHqYn5a9qpGyKA56/muZAQrAGO/ZZf a5PD3fe6DoxLkx520rmXKTy+oI9iTWnjSy+SiP0WeILnxR6J14nPFTyUk+BmG61KfGG8 L8qMTfbRbSKuwnk0GJIRSfQKcT8pwd3Jc5Z7B1xFVmZaTCiN5Skq1CCa2qibMCl8TN6e doIxB9zKTxx2JIrflul8Dh9NnR2zBU0SjFEhgXfIEuujyK5gEoiZcXBwecfp8Ix78n1p Wf2TATt7zl4s61Uhcpy5uSRCxwqt4RAt42CM6MYd4rz6WDy35iCcl3XS0xYTlk0/7Xae wfiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="WL71/59q"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di4-20020a170906730400b00718bdf7794esi11620417ejc.487.2022.06.29.15.30.54; Wed, 29 Jun 2022 15:31:41 -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=@google.com header.s=20210112 header.b="WL71/59q"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230012AbiF2W0t (ORCPT + 99 others); Wed, 29 Jun 2022 18:26:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbiF2W0r (ORCPT ); Wed, 29 Jun 2022 18:26:47 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E1443916D for ; Wed, 29 Jun 2022 15:26:46 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id r81-20020a1c4454000000b003a0297a61ddso491007wma.2 for ; Wed, 29 Jun 2022 15:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=84p0yb2pKb0/mlqhXXfPPXMLX3/ZN9/6y/XnIJNI1Kk=; b=WL71/59quyzcZwTzbjYVhH5ZnVQDEcpcw7ItbNXzShOn/THC8wO8YUbOkC7/+RvKqd zMa5eIP2AL9aRJ3CusxegyqJsSWM3Fiozd6GhJ+TIVqrZ1/KgTOr40oXmXWk5S//q3F5 SPD7nYA6UFrb21/NRTIo2qzZLFKxMzObtdh+i0yZFtLfL+6sEyr1lUg8oO/v3A7I9R1z C4cJw/pN62tDh0RAGG8ffrNbX3Cj65jivvw1FmR4fnNJLQ9bWT5XdC6Pu41X7gchdIHm i3dyaRwk7+WAbRd9JFWNp5aBUIVaYeNhepc5GmF6MHnFvMVhnoStcXWLumeijLd1FCVQ 8Thg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=84p0yb2pKb0/mlqhXXfPPXMLX3/ZN9/6y/XnIJNI1Kk=; b=cWqFPQLvManHs3ETykmPhqIuWnPmIvD44aAU/GADGxCHgb+xVyqN9hHf/gidA5vL4y 1GHs6yiba+eVtWOA7yCd1j/6kUaxattOVJ1ui7sdQAenb0rT6DKMS1GwOBcao6GroA/y 1+ATCWlVjHBpsn3nhAc5o9OrdeBmdzi66ZsffwWi3RUeVRh+pybVlkw+vVHpD9C3MVe4 AYtMkpoUoJtWy+D4s5J3T2DS/N6zYpv1z3F0spRM7iduzjWy6Dp7w33DiHA8EE31WcP/ mnvSSeuCxlCLU5j64CEXdheHteGcSep+ZoVYRjhHizRBqouZbg2krqNKUx18GdoMz9qc U40w== X-Gm-Message-State: AJIora/YgAxnV4hB9zwzvwSKsDiIH0RB+f5Eycr+QUJ4Wz7K3nMSl+eH un3hfi45lj2uFsc8coetEra4UTRcKl56vWYLe1pu8Q== X-Received: by 2002:a05:600c:4081:b0:3a0:47c4:8dd0 with SMTP id k1-20020a05600c408100b003a047c48dd0mr5951181wmh.178.1656541604449; Wed, 29 Jun 2022 15:26:44 -0700 (PDT) MIME-Version: 1.0 References: <20220629150102.1582425-2-hch@lst.de> <20220629161020.GA24891@lst.de> <20220629161527.GA24978@lst.de> <20220629163007.GA25279@lst.de> In-Reply-To: From: Kalesh Singh Date: Wed, 29 Jun 2022 15:26:33 -0700 Message-ID: Subject: Re: [PATCH] remove CONFIG_ANDROID To: "Jason A. Donenfeld" Cc: Christoph Hellwig , Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Hridya Valsaraju , Suren Baghdasaryan , "Theodore Ts'o" , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Alex Xu (Hello71)" , Paolo Abeni , Rob Herring , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Shuah Khan , LKML , wireguard@lists.zx2c4.com, netdev@vger.kernel.org, rcu , "open list:KERNEL SELFTEST FRAMEWORK" , sultan@kerneltoast.com, android-kernel-team , John Stultz , Saravana Kannan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 On Wed, Jun 29, 2022 at 1:47 PM Jason A. Donenfeld wrote: > > Hi Kalesh, > > On Wed, Jun 29, 2022 at 12:05:23PM -0700, Kalesh Singh wrote: > > Thanks for raising this. > > > > Android no longer uses PM_AUTOSLEEP, is correct. libsuspend is > > also now deprecated. Android autosuspend is initiatiated from the > > userspace system suspend service [1]. > > > > A runtime config sounds more reasonable since in the !PM_AUTOSLEEP > > case, it is userspace which decides the suspend policy. > > > > [1] https://cs.android.com/android/platform/superproject/+/bf3906ecb33c98ff8edd96c852b884dbccb73295:system/hardware/interfaces/suspend/1.0/default/SystemSuspend.cpp;l=265 > > Bingo, thanks for the pointer. So looking at this, I'm trying to tease > out some heuristic that wouldn't require any changes, but I don't really > see anything _too_ perfect. One fragment of an idea would be that the > kernel treats things in autosuspending mode if anybody is holding open a > fd to /sys/power/state. But I worry this would interact with > non-autosuspending userspaces that also hold open the file. So barring > that, I'm not quite sure. > > If you also can't think of something, maybe we should talk about adding > something that requires code changes. In that line of thinking, how > would you feel about opening /sys/power/userspace_autosuspender and > keeping that fd open. Then the kernel API would have > `bool pm_has_userspace_autosuspender(void)` that code could check. > Alternatively, if you don't want refcounting fd semantics for that, just > writing a "1" into a similar file seems fine? > > Any strong opinions about it? Personally it doesn't make much of a > difference to me. The important thing is just that it'd be something > you're willing to implement in that SystemSuspend.cpp file. Hi Jason, Thanks for taking a look. I'm concerned holding the sys/power/state open would have unintentional side effects. Adding the /sys/power/userspace_autosuspender seems more appropriate. We don't have a use case for the refcounting, so would prefer the simpler writing '0' / '1' to toggle semantics. Thanks, Kalesh > > Jason