Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1031005imm; Fri, 29 Jun 2018 10:10:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcAgROG3AqKDjM3Izd13bvQON5gbouMqHzeRh+rCdzdMMpGBgPHkogOyJq9MULFotNRr6aA X-Received: by 2002:a62:c410:: with SMTP id y16-v6mr1312468pff.161.1530292201297; Fri, 29 Jun 2018 10:10:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530292201; cv=none; d=google.com; s=arc-20160816; b=IrmBHFTmB32ebPSVdPr4VZZ8MVnqJ9gh7fvF0bFgkUUF+cFQpt6qNaRXtWFYVVwtPn /5j6A5fd1jaogqbybWPvieYURprK3apZrCtB0W/wNnTTviZDcDR/ZQipAEnLuR90uNMY 1gLAXxmXXwH7blue186m59HP6R1KUDnYF101vbt5OjdAqhikk0BFmy6qDYcFkY7GvUw5 zCPfKZir8tF+1HrSfbfeNdBD/QtnDvT9us+P7pD1cmVhlyK0XzIF69ZGvwVQz5lT9M2B vmQwEgFuJkv79hJNda8jVuFG++ko20+vtT0Pj0dJHo5TDEwMHsP15mN/cZJn4CTb19F0 xElA== 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=LKn7VeXGy8cM3fmI4Q+h5GPteyvmoT+d0JP01C5Zl30=; b=g+cJx6D/pTBtDcUI9FbOopZBvRptIULxBaLtBoppeYSXKgdS8iEk3bS58CnaepgJLu k7HHAtfnTDrDJCtdCyMaDKbuPG64l6Wgvyvx7epIFrNCTMimVt7tItTt3X4e1WWrK2xO idYUsicg8qB/N737qvk6Gpm4KIdyQ4KrW6WB8Y1nOBnuBFQM73wu/z/Vx2CCw9NTxW5Z DfQ0EkwZ8BrlUjfuad4ilYGCo05K1LtvtD+kItEUPGpaNDo5br0jpHOf5lQoJ91rktcp PaxRF6GORUo4CvT57eFKXeWvUKgI7XyGiAEPx8z1Ytq3FUARyDoZON50GPaCk+4mzblG zo4Q== 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 z20-v6si8074256pfj.337.2018.06.29.10.09.46; Fri, 29 Jun 2018 10:10: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966637AbeF2PqO (ORCPT + 99 others); Fri, 29 Jun 2018 11:46:14 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42002 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753159AbeF2PqM (ORCPT ); Fri, 29 Jun 2018 11:46:12 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 68CF6401EF0C; Fri, 29 Jun 2018 15:46:12 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.43.2.160]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0A081D081; Fri, 29 Jun 2018 15:46:10 +0000 (UTC) Date: Fri, 29 Jun 2018 17:46:08 +0200 From: Andrew Jones To: Sudeep Holla 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: <20180629154608.nqudibf54ti6dpjc@kamzik.brq.redhat.com> References: <20180628145128.10057-1-drjones@redhat.com> <20180628173243.obydzakh2stfs26w@kamzik.brq.redhat.com> <20180629102927.GA18043@e107155-lin> <20180629112354.hefdl2pe72frl6x3@kamzik.brq.redhat.com> <20180629132934.GA16282@e107155-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180629132934.GA16282@e107155-lin> User-Agent: NeoMutt/20180622 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 29 Jun 2018 15:46:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 29 Jun 2018 15:46:12 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 Fri, Jun 29, 2018 at 02:29:34PM +0100, Sudeep Holla wrote: > 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. That depends. If you look at how topology_logical_package_id() is used in x86 code you'll see it gets used as an index to an array in a couple places. If we don't remap arbitrary IDs to counters than we may miss out on some opportunities to avoid lists. Also, we're talking about what's visible to users. I think it's much more likely to break a user app by exposing topology IDs that have values greater than the linear CPU numbers (even though properly written apps shouldn't expect them to be strictly <=), than the opposite. > > > > > > > > > > > > > > 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. I agree with this. It's a good argument for maintaining a mapping of package-id to id-physically-printed-on-a-package somewhere. To avoid maintaining a mapping it could just be stored directly in cpu_topology[cpu].package_id, but then how can we tell the difference between a valid printed-on-package-id and an ACPI offset? We'd still have to maintain additional state to determine if it's valid or not, so we could just maintain a mapping instead. Thanks, drew