Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7690214imm; Thu, 28 Jun 2018 07:52:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSSvXug7BMnGwC+izdcNj4Ni6rYBp1y6qvkopJa2jjHnzfGT+T9evgQxH3VJg688CtrAbb X-Received: by 2002:a17:902:7e43:: with SMTP id a3-v6mr10147037pln.151.1530197559965; Thu, 28 Jun 2018 07:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530197559; cv=none; d=google.com; s=arc-20160816; b=ja/bXmcszMdLOI2BDGtx3ks0xkaKxswGdZ4Vi4orC7wPhZ+3k33UUE5ejLkBeeqY0Z Swm+QBWB+c1vhEQm0om1Uk6OhPXPaAwFKElmslbLuZirSHH4LfmhiNl95pEBlx3giR2O tgzGzZsR15+FPX39d4Sn2sYtBuhat8ti+NDtf97OeJMO/uRx3vYfeG6V64Vb5TqTCQWr bLSk88RWalBSUpZo8/+gZMGm+huL1AAqdFnnYJIHuC9hFmAEsK82D//BS2C/al/nw3xY cLLzSACxaO+VLiJRxpp2X8Oc/uIbNl9uS1XjBntPidn1Jc293ychJzS78dZ730CAqywE XZlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Pp9cG06F/5W2kcbGSMiwuwju5hI7dSuNkwPyRaHBtjA=; b=h1LoydkN4RWjUDplG44hbRU1K9q+epud/CoEXk2K35b4mnQmqKXPvgQRSMOM4Z2n1E lpbMaFRzU+ahAt4xleyWhMFbETWCCnpfRHGUW2E+jIVaWapzSHjOoSLE5/PVOBfTFR4j 7tyJnyPzDwJAHPqQRgS5HaQNP0BHusPIcDKzyYx6xSrJ3wfq0UXAb0zsPIPp/wC7HSgb F6v2Mthd1Wvb3DUChn+cza3E+YO1adQWxP47OjuYor2ETHcxDr2FWP2YVlct/hQfxfup QKY+k1vE2yURzXZH1Iiy4grzhoG4HDEIQTi5MqS9LwTU6c9kaljH5aPArdnAlKdflZHf iCOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18-v6si6191276pgf.301.2018.06.28.07.52.25; Thu, 28 Jun 2018 07:52:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966829AbeF1Ovd (ORCPT + 99 others); Thu, 28 Jun 2018 10:51:33 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:47752 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966458AbeF1Ova (ORCPT ); Thu, 28 Jun 2018 10:51:30 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72DE040201D3; Thu, 28 Jun 2018 14:51:29 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.43.2.160]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EEBA82026D69; Thu, 28 Jun 2018 14:51:27 +0000 (UTC) Date: Thu, 28 Jun 2018 16:51:25 +0200 From: Andrew Jones To: Sudeep Holla Cc: Jeremy Linton , Shunyong Yang , catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, Joey Zheng Subject: Re: [RFC PATCH] arm64: topology: Map PPTT node offset to logic physical package id Message-ID: <20180628145125.2psdmymtuueiv4xn@kamzik.brq.redhat.com> References: <1530177508-15298-1-git-send-email-shunyong.yang@hxt-semitech.com> <20180628115748.kprobde6c3joc6ll@kamzik.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180622 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 28 Jun 2018 14:51:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 28 Jun 2018 14:51:29 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'drjones@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 28, 2018 at 03:09:19PM +0100, Sudeep Holla wrote: > > > On 28/06/18 14:19, Jeremy Linton wrote: > > Hi, > > > > On 06/28/2018 07:12 AM, Sudeep Holla wrote: > > [...] > > >> > >> OK sure. I liked the approach in Shunyong's patch. I was thinking if we > >> can avoid the list and dynamic allocation on each addition and make it > >> more simpler. > >> > > > > This one reads simpler, but yes I agree we should try to avoid the > > dynamic allocation. > > > > OTOH, I think that dropping the dynamic allocation leads to an algorithm > > that picks a value and replaces all the matches. Which of course is > > Andrew's patch, although I did have to read it a couple times to get a > > grasp how it works. I'm guessing that is due to the fact that he seems > > to have optimized 3 double loops into a single loop with two individual > > nested loops. AKA its probably more efficient than the naive > > implementation, but readability seems to have suffered a bit in the > > initial version he posted. I'm not sure the optimization is worth it, > > but I'm guessing there is a middle ground which makes it more readable. > > > > Completely agree. RFC from Andrew is not so readable and easy to understand. Middle ground coming up. At the expense of a triple-nested loop (which will never be N^3 iterations due to conditions at the start of each loop), we can avoid dynamic allocations and list iterations and still gain readability. Thanks, drew