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 B761CD1AD3E for ; Wed, 16 Oct 2024 10:08:38 +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=+n5gxN40zyzoslrJVpnOvhlr4IVrlpKvUin0Plbpugs=; b=2zrbmTxDCTRRUaqTXuw3elN/x0 yNgFjiV0DgUL60Rb33O8/w/JH+fdzetOmjyaSwzjGpeadD40y2buQgfiYc+KY01YBWoqPQif5ib8M h0VVukzCgIyrrHc5g3KabCNtKczj6McvSiLgj4Akp8DY0yU+5FQB0wsBEQrVVXsbzUonF9sQairV4 X7WzUNuYqwbGxHHXni0QdbRlQyE9a7aNFQLZ4f7Mp8mOqVjJhluorTBB5BN1kcNkZnGt0T+DvtNDV Y6/zSbb91l/vDxPX5ugugQlE9chUPPHwob2O8BPYWz1ac0wfDz6yNVlPaePAXOH0cPf24p38br4i0 O440g7YA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t10x5-0000000BMzz-3f07; Wed, 16 Oct 2024 10:08:23 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t10vb-0000000BMca-07qb for linux-arm-kernel@lists.infradead.org; Wed, 16 Oct 2024 10:06:53 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0EF425C5A94; Wed, 16 Oct 2024 10:06:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D857C4CEC5; Wed, 16 Oct 2024 10:06:45 +0000 (UTC) Date: Wed, 16 Oct 2024 11:06:43 +0100 From: Catalin Marinas To: Ankur Arora Cc: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.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> <87ttddrr1r.fsf@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ttddrr1r.fsf@oracle.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241016_030651_129750_A826E1F7 X-CRM114-Status: GOOD ( 12.74 ) 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 Tue, Oct 15, 2024 at 02:32:00PM -0700, Ankur Arora wrote: > Catalin Marinas writes: > > I'd say if you want > > something like this, better introduce a new smp_cond_load_timeout() > > API. The above looks like a hack that may only work on arm64 when the > > event stream is enabled. > > I had a preliminary version of smp_cond_load_relaxed_timeout() here: > https://lore.kernel.org/lkml/87edae3a1x.fsf@oracle.com/ > > Even with an smp_cond_load_timeout(), we would need to fallback to > something like the above for uarchs without WFxT. Yes, the default/generic implementation would use cpu_relax(). For the arm64 one, some combination of __cmpwait() and __delay() with the fallback to cpu_relax(). -- Catalin