Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp851901imm; Fri, 29 Jun 2018 07:26:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfl+ihiwA8cTaqq3a8KO9b0Cmm2qt2576mYezpFhZU2rPflJQl9/bVDcLcQPiHbz0xuOZ4t X-Received: by 2002:a62:574d:: with SMTP id l74-v6mr14832182pfb.29.1530282402527; Fri, 29 Jun 2018 07:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530282402; cv=none; d=google.com; s=arc-20160816; b=YGtFFecO1+N15ld5CTFS4qvDSMdEyANDnoqXrRRt9BnculNaYBJwynQTuK1P6RdltN 8k9sYM/E9o/bpQmn+zabJ0QyLYftj8P0ztI59hE9wvr8ILw72Qom0lLRlTBEobjsnxx2 J9TyJ5cgaun1htgcjBymlo3Eg0tG4lr44KQ1U+j9YXpf26/2ZjWza5Re5ynoe8fFHrjU +CGTDXVhY1Ypyt57S3tzBM8+w3L/qW8O7stxygC5jZx+Ai1rLfBfpIF95mkRDgavJA/u +YNfYFpEjL3mQZR/HahvSaEhPf6Qv/1nJuPkYb/Az52ZmCaZxXP/QLwdFyugrySFrcS5 6aEw== 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=6ZwZPmMbXRJ0WU8WSDANqpwxL5zYyZEe1otPOugB5Lw=; b=bfBV6ycxqctHd5wK1h4+g2Ha1wRLSDNO6CTqxvVQ5LakQ5fKaNJimFuOJWbUtR/16B 9s3nq5lbpgmi1F4Ym5b+kofqX3m3LcKlqSz7j2fPh3Nj2e+/i3FnPpJeSDM1DlMcV82i oz0ZNJvYpmFb6OoU3BShuWf6l+dVqJe0/VJz0E8Y6ham13HFgQM2Z4csViDdFwiK4UNj KT42iVkDCaRkEgAVhf1PnmzC9m1QRJ/wxCMc29UzyDXtdNHLRHBYu5nUeQkdMJanpbG4 s25UDe8rr6KA4Ljc/KnMXu4rSmdvaNZXUzbM7jjEq8QkUFFBZhXmKCCiDy9VNGWIUeYI 5U2w== 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 b184-v6si9164513pfa.167.2018.06.29.07.26.28; Fri, 29 Jun 2018 07:26:42 -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 S936581AbeF2N3n (ORCPT + 99 others); Fri, 29 Jun 2018 09:29:43 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34276 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935010AbeF2N3m (ORCPT ); Fri, 29 Jun 2018 09:29:42 -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 5F3C480D; Fri, 29 Jun 2018 06:29:42 -0700 (PDT) Received: from e107155-lin (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B8A133F318; Fri, 29 Jun 2018 06:29:40 -0700 (PDT) Date: Fri, 29 Jun 2018 14:29:34 +0100 From: Sudeep Holla To: Andrew Jones Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, jeremy.linton@arm.com, ard.biesheuvel@linaro.org, shunyong.yang@hxt-semitech.com, yu.zheng@hxt-semitech.com, catalin.marinas@arm.com, will.deacon@arm.com Subject: Re: [PATCH] arm64: acpi: reenumerate topology ids Message-ID: <20180629132934.GA16282@e107155-lin> References: <20180628145128.10057-1-drjones@redhat.com> <20180628173243.obydzakh2stfs26w@kamzik.brq.redhat.com> <20180629102927.GA18043@e107155-lin> <20180629112354.hefdl2pe72frl6x3@kamzik.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180629112354.hefdl2pe72frl6x3@kamzik.brq.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 29, 2018 at 01:23:54PM +0200, Andrew Jones wrote: > On Fri, Jun 29, 2018 at 11:29:27AM +0100, Sudeep Holla wrote: > > On Thu, Jun 28, 2018 at 07:32:43PM +0200, Andrew Jones wrote: > > > On Thu, Jun 28, 2018 at 05:30:51PM +0100, Sudeep Holla wrote: > > > > I am not sure if we can ever guarantee that DT and ACPI will get the > > > > same ids whatever counter we use as it depends on the order presented in > > > > the firmware(DT or ACPI). So I am not for generating ids for core and > > > > threads in that way. > > > > > > I don't believe we have to guarantee that the exact (package,core,thread) > > > triplet describing a PE with DT matches ACPI. We just need to guarantee > > > that each triplet we select properly puts a PE in the same group as its > > > peers. So, as long as we keep the grouping described by DT or ACPI, then > > > the (package,core,thread) IDs assigned are pretty arbitrary. > > > > > > > If that's the requirement, we already do that. The IDs are just too > > arbitrary :) > > Right. The patch doesn't fix anything, it just makes the IDs less weird > looking to humans, and brings some consistency to IDs across systems > and hardware descriptions. > I agree, but don't think counter like this will be harmless. It can create some other inconsistency in some other way. > > > > > I could change the commit message to state we can generate IDs *like* > > > DT does (i.e. with counters), even if they may not result in identical > > > triplet to PE mappings. > > > > > > > Why we need to make it *like DT* ? > > Because the DT parser considers human readers, which, IMHO, is nicer. > > The consistency remapping to counters brings shouldn't be overlooked. If > both ACPI and DT present the CPUs in the same order (i.e. cpu0 is mpidr0, > cpu1 is mpidr1, ...) using their respective descriptions, then this patch > will ensure topology IDs are the same. Yes, it's all fine in theory. But firmware is the one presenting it and ACPI PPTT has UID for a reason and I want that to be the single source for these IDs. > Also, when going from machine to > machine, it's nice to expect package/core/thread-id to be within > the same range and to vary by a set difference (1), rather than have > IDs that increment by 20 on one system and by 160 on another, > depending on how the ACPI table nodes are laid out. > If it matters a lot, vendors must use UID for consistency. Since OS doesn't use those IDs for any particular reason, OS must not care. > > > > > > > > > > So I would like to keep it simple and just have this counters for > > > > package ids as demonstrated in Shunyong's patch. > > > > > > > > > > If we don't also handle cores when there are threads, then the cores > > > will also end up having weird IDs. > > > > > > > Yes, but if PPTT says it has valid ID, I would prefer that over DT like > > generated. > > Valid *ACPI* ID, which just means it's a guaranteed unique ACPI UID, > which isn't likely going to be anything useful to a user. > How is that different from OS generated one from user's perspective ? Vendors might assign sockets UID and he may help them to replace one. Having some generated counter based id is not helpful. So if someone needs to have valid IDs there, better to pass it via PPTT. OS will otherwise put any value(current offset is good choice) -- Regards, Sudeep