Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7647066imm; Thu, 28 Jun 2018 07:12:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI2LE0GYvAHRLPlnBx1mWWXs3bPmyo/kfrJtdIvSUd7tUoBhvpyrL2x7AMJcs8VSwuYlN4u X-Received: by 2002:a65:44c3:: with SMTP id g3-v6mr8979702pgs.231.1530195121950; Thu, 28 Jun 2018 07:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530195121; cv=none; d=google.com; s=arc-20160816; b=dOsuwDrzHmyV6z30qceG2EMpARtVQqYSPG/alPvwLoKUJewVbju8P491YNiT2Df4tU 6gFnfJZzdk2Ik2E2TSvHW92GDUNNWouzTC17wQ/UsrjUVdgGmo06zRbYl1XQa+ExfFc3 sN+VatFY7Qo7RAvHMTMn9QJ2yVDSvQEq2eFVxSvgz/fsad5ByttmzouUyHkf3BiGsCAw XtLBGfIWTKatwMkENoMWjIErm4CT9wwGSO64UCK+pi2mGSAq9YgYzjjs1bzNlS+JXkn5 51Hkv7BVgcArtpHwdwCnGqNGYOTNdMhco+O92i931eeccu7R+Orkq9XCTqcT/YRN5KCc ghCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:to:subject:cc :arc-authentication-results; bh=04bsKC/beFDDwo+gUyxzoC0IRMCpsqGOkrT7HQMsvuM=; b=LeGfNbzboFO/Tvgxp5u/bVs7PDyvbLO6t/fFtdHZ2Y99V8XXNo0s0aAyiAb60Fceaa D1k3ysjRVT1NunsuZJRSznAYwQt24y6I11jsi1FckYmcpZGA/NVaja1nTfNi80mpE1DX BDBs/bsiYdRK9ExkPV/ogR+OheQl9JAPsYu6zGc9YrvABVQlzzHk4hH58jq4KmyBG7Gc 3H5ZrhEKsMYcV03XJcfZcsyZ6FbiaJwqkj6q3UuKqqlhjCNrr79UcQDvyMfJZxOH6ctL +iOwRV+G2AFdBK6NRhFiL2siVoFeGFMk0QPzjJTLMecc3OsT8/hLupUgHA6NU15rWZlt Clqg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f35-v6si6650334plh.193.2018.06.28.07.11.47; Thu, 28 Jun 2018 07:12:01 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966484AbeF1OJY (ORCPT + 99 others); Thu, 28 Jun 2018 10:09:24 -0400 Received: from foss.arm.com ([217.140.101.70]:48160 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965506AbeF1OJW (ORCPT ); Thu, 28 Jun 2018 10:09:22 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7513318A; Thu, 28 Jun 2018 07:09:22 -0700 (PDT) Received: from [10.1.210.28] (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 16C6E3F5AD; Thu, 28 Jun 2018 07:09:20 -0700 (PDT) Cc: Sudeep Holla , 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 To: Jeremy Linton , Andrew Jones References: <1530177508-15298-1-git-send-email-shunyong.yang@hxt-semitech.com> <20180628115748.kprobde6c3joc6ll@kamzik.brq.redhat.com> From: Sudeep Holla Organization: ARM Message-ID: Date: Thu, 28 Jun 2018 15:09:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Regards, Sudeep