From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5D63D15D83 for ; Mon, 21 Oct 2024 12:04:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/1cxyd4CBC3npzS3rvrKSaM5X0siqw3bgq/VarQyyTk=; b=2dLEb4jQ6FLixc2RxXqYwVgvPK HgFa7yzcR495KzDm75MQtyyfbEs6x9k+Eijr6splMY6QSyTwtOlwtwo5uEdjOJDcCGKXWzXDMYq4v HJMDsFTQiqLXQPjo0BTtEZXvUN4AFRFHn/4dZojV9p+udM+x3RUhlCGQUFicI3jp7vrOs1MdLVnmF ssQwMPq901rXQq8uq1qoQMUvMThA9U2HqkOze/Nln7BE5x4QDyX2BVU+/E95wmu7T5ZE3nCpJAs0m jcK5h0Tax7fe9VaOVfZiKlSMBSijxd6Eds13WqeQCWyfUFMILvodbG9zQaEcQh4Prt8yrgJOdJZnK oeCvsz1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2r9L-00000007A6N-3JFG; Mon, 21 Oct 2024 12:04:39 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2r7o-000000079fd-3rLa for linux-arm-kernel@lists.infradead.org; Mon, 21 Oct 2024 12:03:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 881D05C3C0C; Mon, 21 Oct 2024 12:02:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7E27C4CEE6; Mon, 21 Oct 2024 12:02:58 +0000 (UTC) Date: Mon, 21 Oct 2024 13:02:56 +0100 From: Catalin Marinas To: Ankur Arora Cc: "Okanovic, Haris" , "kvm@vger.kernel.org" , "rafael@kernel.org" , "sudeep.holla@arm.com" , "joao.m.martins@oracle.com" , "dave.hansen@linux.intel.com" , "konrad.wilk@oracle.com" , "wanpengli@tencent.com" , "cl@gentwo.org" , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , "maobibo@loongson.cn" , "pbonzini@redhat.com" , "tglx@linutronix.de" , "misono.tomohiro@fujitsu.com" , "daniel.lezcano@linaro.org" , "arnd@arndb.de" , "lenb@kernel.org" , "will@kernel.org" , "hpa@zytor.com" , "peterz@infradead.org" , "boris.ostrovsky@oracle.com" , "vkuznets@redhat.com" , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" , "bp@alien8.de" , "mtosatti@redhat.com" , "x86@kernel.org" , "mark.rutland@arm.com" Subject: Re: [PATCH v8 01/11] cpuidle/poll_state: poll via smp_cond_load_relaxed() Message-ID: References: <20240925232425.2763385-1-ankur.a.arora@oracle.com> <20240925232425.2763385-2-ankur.a.arora@oracle.com> <7f7ffdcdb79eee0e8a545f544120495477832cd5.camel@amazon.com> <87h69amjng.fsf@oracle.com> <87jze5kzhp.fsf@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87jze5kzhp.fsf@oracle.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_050305_027904_AD85BE32 X-CRM114-Status: GOOD ( 19.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 18, 2024 at 12:00:34PM -0700, Ankur Arora wrote: > Catalin Marinas writes: > > On Thu, Oct 17, 2024 at 03:47:31PM -0700, Ankur Arora wrote: > >> So maybe the right thing to do would be to keep smp_cond_load_timeout() > >> but only allow polling if WFxT or event-stream is enabled. And enhance > >> cpuidle_poll_state_init() to fail if the above condition is not met. > > > > We could do this as well. Maybe hide this behind another function like > > arch_has_efficient_smp_cond_load_timeout() (well, some shorter name), > > checked somewhere in or on the path to cpuidle_poll_state_init(). Well, > > it might be simpler to do this in haltpoll_want(), backed by an > > arch_haltpoll_want() function. > > Yeah, checking in arch_haltpoll_want() would mean that we can leave all > the cpuidle_poll_state_init() call sites unchanged. > > However, I suspect that even acpi-idle on arm64 might end up using > poll_idle() (as this patch tries to do: > https://lore.kernel.org/lkml/f8a1f85b-c4bf-4c38-81bf-728f72a4f2fe@huawei.com/). > > So, let me try doing it both ways to see which one is simpler. > Given that the event-stream can be assumed to be always-on it might just > be more straight-forward to fallback to cpu_relax() in that edge case. I agree, let's go with the simplest. If one has some strong case for running with the event stream disabled and idle polling becomes too energy inefficient, we can revisit and add some run-time checks. -- Catalin