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 X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17B60C433EF for ; Tue, 7 Sep 2021 01:21:52 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB8E561077 for ; Tue, 7 Sep 2021 01:21:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BB8E561077 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:39902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNPo6-00074l-NO for qemu-devel@archiver.kernel.org; Mon, 06 Sep 2021 21:21:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNPlA-0004no-IA; Mon, 06 Sep 2021 21:18:48 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:38129 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNPl8-0007Cu-K2; Mon, 06 Sep 2021 21:18:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1630977522; bh=qWH41vaz3kAk/ePRI/TOpFnC8Dt9k6Lg3GUe7Fx5nNs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m4vsj28BihP5DokuBhqcfELYf6s3LmMBzLsX4FUnK+bmXeLu5zd9sGQTPjHIIFdaC VqJGBjsgptaJi2xJHSvlBpSketHujlQLDtcvGzIa/HafazVozfBYKq4ev2+GUkKfUG OadN/HH5NAznW6MpK3zHxRGxQDyPizi/Fa7Gvbiw= Received: by ozlabs.org (Postfix, from userid 1007) id 4H3S8L526nz9shn; Tue, 7 Sep 2021 11:18:42 +1000 (AEST) Date: Tue, 7 Sep 2021 11:12:35 +1000 From: David Gibson To: Daniel Henrique Barboza Subject: Re: [PATCH v4 2/5] spapr_numa.c: split FORM1 code into helpers Message-ID: References: <20210827092455.125411-1-danielhb413@gmail.com> <20210827092455.125411-3-danielhb413@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="w6FG26qljlQsJcfF" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=203.11.71.1; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, groug@kaod.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --w6FG26qljlQsJcfF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 06, 2021 at 09:50:36PM -0300, Daniel Henrique Barboza wrote: >=20 >=20 > On 9/6/21 9:30 PM, David Gibson wrote: > > On Fri, Aug 27, 2021 at 06:24:52AM -0300, Daniel Henrique Barboza wrote: > > > The upcoming FORM2 NUMA affinity will support asymmetric NUMA topolog= ies > > > and doesn't need be concerned with all the legacy support for older > > > pseries FORM1 guests. > > >=20 > > > We're also not going to calculate associativity domains based on numa > > > distance (via spapr_numa_define_associativity_domains) since the > > > distances will be written directly into new DT properties. > > >=20 > > > Let's split FORM1 code into its own functions to allow for easier > > > insertion of FORM2 logic later on. > > >=20 > > > Reviewed-by: Greg Kurz > > > Signed-off-by: Daniel Henrique Barboza > > > --- > > > hw/ppc/spapr_numa.c | 61 +++++++++++++++++++++++++++++-------------= --- > > > 1 file changed, 39 insertions(+), 22 deletions(-) > > >=20 > > > diff --git a/hw/ppc/spapr_numa.c b/hw/ppc/spapr_numa.c > > > index 779f18b994..04a86f9b5b 100644 > > > --- a/hw/ppc/spapr_numa.c > > > +++ b/hw/ppc/spapr_numa.c > > > @@ -155,6 +155,32 @@ static void spapr_numa_define_associativity_doma= ins(SpaprMachineState *spapr) > > > } > > > +/* > > > + * Set NUMA machine state data based on FORM1 affinity semantics. > > > + */ > > > +static void spapr_numa_FORM1_affinity_init(SpaprMachineState *spapr, > > > + MachineState *machine) > > > +{ > > > + bool using_legacy_numa =3D spapr_machine_using_legacy_numa(spapr= ); > > > + > > > + /* > > > + * Legacy NUMA guests (pseries-5.1 and older, or guests with only > > > + * 1 NUMA node) will not benefit from anything we're going to do > > > + * after this point. > > > + */ > > > + if (using_legacy_numa) { > > > + return; > > > + } > >=20 > > My only concern with this patch is that handling the > > "using_legacy_numa" case might logically belong outside the FORM1 > > code. I mean, I'm pretty sure using_legacy_numa implies FORM1 in > > practice, but conceptually it seems like a more fundamental question > > than the DT encoding of the NUMA information. >=20 > I'll carry on this suggestion for the next spin, v6, given that the v5 I = sent > a few minutes ago is also verifying legacy numa in FORM1 code. Ok. I should note that I'm not saying what you have now is definitely wrong, it just looks a bit odd to me. If you have a rationale for doing it this way, go ahead and tell me, rather than changing it. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --w6FG26qljlQsJcfF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAmE2vIMACgkQbDjKyiDZ s5IG1w//Y+hnkGvpqgWE25NT16cMa7kHw6GlAoXlyZwpeUxOaSP5+OCnmyqxoh6B ZswMK5vOmlkZXr93LEBljHUxqNB6MBRrInJsNfhduQjP8RQFmZP+ET9vEihegeL6 VqFP4tYw5IAXAdeBJIBV/vN0uQX6at15mFOvEvLqVlTtW99uqp5QMLZxpsmndFW/ LL4bEQDl/1/67kMWrW3amnLi1xf9gpaxmO8AZEklL2sjZe4RPhJuKFqIF8XLLHQX NfTmiJ/WfDDN7beiGveugGQ9gwDOd3nI5uORmsn2K+lA6Z/LrTN3Cisa/l3Q6WRw KyH7SrmfIxZY/0f2Nf34liKmOoRbzzcixn/5Z5V1lSeztvPw0dvqOPD3CPBN7BEQ vgQJGnzhcnu+4H5JVkGjiL87s+V2aYvmhk7SHfwF+yS0+CDQgH5PeohSGUs/pVP+ QVyB1QVKqvNqkb5xD1R0txgAu5rLVCNzE/aV2I2SummTu14bfQla3ltVF9n5GQY5 5yiqJKjGTC1QfZK3C+JlvWc4Cl+o+Wdjljl3lqLABiPqxWmY3Y00qIMW6MQfz5SV qPGlYWfWF26uIiDS4WhJg0N5C/hURw2KrHXKfaAkNKYeLd+1XWranVaivkpAjY52 KpIZ6lritaNCtrf/TBpcqtcKxY2BCVEZhML+67gJFvZH8/byn/A= =wrDO -----END PGP SIGNATURE----- --w6FG26qljlQsJcfF--