Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp33244iog; Wed, 29 Jun 2022 17:26:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vcVv4HiLpf3tq1psuTgV9L6bAn5nPTTz8w4ZmFSeohKAuaroTFxExNwz4gUntl/yvkCrGi X-Received: by 2002:a17:90a:2d82:b0:1eb:6ee0:9d68 with SMTP id p2-20020a17090a2d8200b001eb6ee09d68mr8568107pjd.28.1656548794890; Wed, 29 Jun 2022 17:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656548794; cv=none; d=google.com; s=arc-20160816; b=bk/jKDkPtiSjsWqMV/cr20CjvZGAa3mx+RYVwPLvSUdzsw4BodnDXjXaWBDLJaj3sG tjkXGfTnz8Uw6PRGvAqTrm36SAq/GxyQLMtuA2B5rCwuUqd49MlBgX1kAHJlyKs4y5uN CUQVnl8CN84EsisiFG8b82fJq3gObN25lFX6OkLtEj58stCCHvM03iIyFbdPDWmMHdQA 4ftzEDHU26YLS4Nt1pvQVwettnhQj2BHMwRjfRBVYbMU8VudVhxKx/qss2XEScHZN7B3 9t0SZAfhSwrje1mvygrSiLK36VArgj2RxFNe1mLAfQ4KiCpU+Y5JFscuAFSfRN+wV4dM aT9w== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yhJeMlaJxX3LrfVXt5LEZDg6XeT5mqblmQOfOgg/+S0=; b=rECU5t+2aRLAgNff3Gh0UjldEbL2Cq72ezGdY7ydaZxxw2S+E62Cb9a45B3+AK5fF2 7QX62zeUYJ1iPkgtkMSbvY3afNywNNdNRtUxA3FP0C+UgIicFlPrcRxLb4Ilbpzm/7/l 0qVZZ3mMpxMdI8lYKrh3qQ3tLSd6y6zWuRkXhT8oZ1lctUh1Ja4pOXJmGr9Horz4WERQ 8faXM/SAYDO3F7VYbTubOgH1sH4ZxxjBGmdJNuhxTPt136u7Kscwsl1tuwvO/dHEiTXE Jm8+bB7JI5GmY5nPpmljtvTRk/526o2h8Am0cRu/0Pj0jtG69Ecv03u04e3VW7wSp2Mm uqtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=RN1R7tzA; 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=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x21-20020a17090300d500b00164059eb197si18652477plc.148.2022.06.29.17.26.17; Wed, 29 Jun 2022 17:26:34 -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=@zx2c4.com header.s=20210105 header.b=RN1R7tzA; 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=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231370AbiF3AY6 (ORCPT + 99 others); Wed, 29 Jun 2022 20:24:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230480AbiF3AYq (ORCPT ); Wed, 29 Jun 2022 20:24:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB0B02A27E; Wed, 29 Jun 2022 17:24:38 -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 ams.source.kernel.org (Postfix) with ESMTPS id 23ABFB827BB; Thu, 30 Jun 2022 00:24:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C1FBC34114; Thu, 30 Jun 2022 00:24:32 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="RN1R7tzA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1656548671; 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=yhJeMlaJxX3LrfVXt5LEZDg6XeT5mqblmQOfOgg/+S0=; b=RN1R7tzA9LJmRLipddoaZl+SAjVveNjXi3uMxifQkM4+JW04JiAXddKuYswIKWd7I6YfzN bWiaN2IgFsUdz6qU9iV9W9jimu8OpM6ldOuliM8ZrOJ34+n0u8U/3IstNXi725jdktXGqq ojC33c7dUhSRMDZ4U1akIsKmYNrXwtw= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id f14ed555 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 30 Jun 2022 00:24:30 +0000 (UTC) Date: Thu, 30 Jun 2022 02:24:26 +0200 From: "Jason A. Donenfeld" To: John Stultz Cc: Kalesh Singh , Christoph Hellwig , Greg Kroah-Hartman , Arve =?utf-8?B?SGrDuG5uZXbDpWc=?= , 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 , Saravana Kannan , "Rafael J. Wysocki" Subject: Re: [PATCH] remove CONFIG_ANDROID Message-ID: References: <20220629161527.GA24978@lst.de> <20220629163007.GA25279@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 Hi John, On Wed, Jun 29, 2022 at 04:52:05PM -0700, John Stultz wrote: > Jason: Thanks for raising this issue and sharing this patch to avoid > breakage! I really appreciate it. > > My only concern with this change introducting a userspace knob set at > runtime, vs a (hopefully more specific than _ANDROID) kernel config is I'd also be okay with a compile-time knob. The details make no difference to me, so long as there's just *something* there. > that it's not exactly clear what the flag really means (which is the > same issue CONFIG_ANDROID has). And more problematic, with this it > would be an ABI. > > So for this we probably need to have a very clear description of what > userland is telling the kernel. Because I'm sure userlands behavior > will drift and shift and we'll end up litigating what kind of behavior > is really userspace_autosleeping vs userspace_sortof_autosleeping. :) I guess what I have in mind is the answer to these being "yes": - "Is it very common to be asleep for only 2 seconds before being woken?" - "Is it very common to be awake for only 2 seconds before sleeping?" I think it'd be easiest to have a knob somewhere (compiletime, runtime, wherever) that describes a device that exhibits those properties. Then wireguard and other things will make a decision on how to handle the crypto during relevant events. > Alternatively, maybe we should switch it to describe what behavior > change we are wanting the kernel take (instead of it hinting to the > kernel what to expect from userland's behavior)? That way it might be > more specific. As a general rule, I don't expose knobs like that in wireguard /itself/, but wireguard has no problem with adapting to whatever machine properties it finds itself on. And besides, this *is* a very definite device property, something really particular and peculiar about the machine the kernel is running on. It's a concrete thing that the kernel should know about. So let's go with your "very clear description idea", above, instead. So taken together, I guess there are two approaches to this: 1) Introduce a simple CONFIG_PM_CONTINUOUS_AUTOSLEEPING Kconfig thing with lots of discouraging help text. 2) Go with the /sys/power tunable and bikeshed the naming of that a bit to get it to something that reflects this better, and document it as being undesirable except for Android phones. It seems like in both cases, the key will be getting the naming right. Jason