Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp225464imp; Wed, 20 Feb 2019 23:42:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IbgbZsBUTHd+86lf+KQOhfrXEgxL1UWD5TXVwk/1JYMKNXJ1BqzkSDYhHXhaeIP0iuM4Bsk X-Received: by 2002:a62:cf02:: with SMTP id b2mr20150403pfg.71.1550734939783; Wed, 20 Feb 2019 23:42:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550734939; cv=none; d=google.com; s=arc-20160816; b=MC4VwrA/gMeLu7J7p9Lv0twJyJ25OqgijySiW460rH/cvqw9s/xG9r2uyfraSt94kV GjU4Gsi7uVQHLaGPxA1mV1fbeX1KQYu8yghpwn1/v5NJBcaTblX1ve+SwF0/mfUPh5n9 pAJ4JtKdgPHbVfHZ/tT4ENVnWi0BJMs5nV2U5YKlIBTNUR79pZkRzhtoBmX4ToOqFVAZ 5IWDrdos07iyukP4SnwE5LUECNRwJXLhtXilO9brJztz53fjktcC9UAgv+NpFGqR3qb/ d7+A9SSOjH95jrmpPbbwzcw2ftKDISzU5KEXORck52WvJDPe62kpikeUDtyFVaae59Ag qCcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=SBo2jtopDSY25tMk59SLMtIPfmFBSxFG9vz6EUEjXCo=; b=hdHr1QwOuW1WwH8sFsE+yreim86mF3f2SCCbkjdV2QA4c1+cbDoK9IrCBOhnDFbuGt 8YHuFAxPaiaygHzIxhWYx4tl3xNYxC9VtkHqHGfMpejKu5eEj6Xo0ehIBUldzmxoPWUM 0+R+Yl6Sh5r9wSx5+klu8zNfTuQPockAKolMAJ2v9wWCPmFw8l+02zhTZzXZ44/wOoKH h3OdQYTeFY29gURV5jUzTmk0c7Ian1YUSG+kowvx/kCKPWK38vJnYoe50LhSgGQxAyuv X1jgEOMGVRC+yyhVbMAG0jFKYQAiiSNo0jzrCnnMmqKcILjkD8S0bpwV+a8UoHXSUeEM nL2A== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18si21283147pgh.511.2019.02.20.23.42.04; Wed, 20 Feb 2019 23:42:19 -0800 (PST) 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726287AbfBUHlo (ORCPT + 99 others); Thu, 21 Feb 2019 02:41:44 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:43244 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725831AbfBUHln (ORCPT ); Thu, 21 Feb 2019 02:41:43 -0500 Received: by mail-ed1-f66.google.com with SMTP id m35so18247322ede.10; Wed, 20 Feb 2019 23:41:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SBo2jtopDSY25tMk59SLMtIPfmFBSxFG9vz6EUEjXCo=; b=U4mnPVGes2cdaoQZr+D4VG8JSRceDOeHX4j3wFqaJG7v6qxm8Ap6njQYjHkJlJum7H Q25tDf3u7LgwBTsWOEWTOHG4QhYWoFSk1YBEPqoHF6LXQ6aTJcTWx0zdITikRbiRo3SM +hGu9+21+yKspMaa0bZwHVI+x0TjZRWsAynfDD2hvuIZCsi4EZYDYo3IceVzH0qGSVYa oQA24F69SNlEDtUt9FIZ8oWkjg+zKKFxFd0S6tYmSspPz8jTfuoaopKzDfn6ATGRv6ae DdEi9azLsXvYFa6I5l4A5Kn99w7grNtSt8xEh2BV+1EeDn20iFP/mLUMf75IRe1BEytY Lckw== X-Gm-Message-State: AHQUAubByWaj6LLzUYzoO0SbqpMez1ek5NKXPsFAQoIRGMuXEtnMnerO re0u4h/bx7SAEdAxyGKuCAS2AM+FilPGUN73Fyo= X-Received: by 2002:a50:b641:: with SMTP id c1mr671484ede.155.1550734901888; Wed, 20 Feb 2019 23:41:41 -0800 (PST) MIME-Version: 1.0 References: <635b2bf8b1151a191cd9299276b75791a818c0c2.1550545163.git.len.brown@intel.com> <0d54a56186fb9be7a8f622a4625a41dc600dd7a4.1550545163.git.len.brown@intel.com> In-Reply-To: From: Len Brown Date: Thu, 21 Feb 2019 02:41:30 -0500 Message-ID: Subject: Re: [PATCH 05/11] x86 topology: export die_siblings To: Brice Goglin Cc: X86 ML , linux-kernel@vger.kernel.org, Len Brown , linux-doc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Brice, Thank you for your suggestions! > Patches #4 and #5 are changing the meaning the core_siblings (in the > past, it always returned all threads in the entire package). All > existing user-space tools will see each die as a separate package until > they are updated to read die_siblings too. It only matters for multi-die > CPUs when running a recent kernel with an old userspace tool, but it may > still be consider as a sysfs ABI change. I agree. Exhibit 1 is the "lscpu" program. > Worse, things will break again if you ever add tile_siblings for > CPUID.1f "Tiles". User-space will suddenly see 2 dies of 2 cores instead > 1 die of 2 tiles of 2 cores. Agreed, the existing naming scheme is not resilient to future additions. > I understand that this isn't easy to fix. But I want to make sure people > are aware of the meaning of this change. Here is my list of applications that care about the new CPUID leaf and the concepts of packages and die: cpuid lscpu x86_energy_perf_policy turbostat > The proper way to avoid this is to stop having file foo_siblings refer > to "the container of foo" instead of "foo itself" (because that > container changes when you add intermediate levels). Rename sysfs files > like below, and you don't get any breakage anymore when adding > intermediate levels: > > thread_siblings -> core_threads (can we do sysfs alias or symlink to > keep the old name?) > > core_siblings -> die_threads > > die_siblings -> package_threads (needs an alias too) > > The documentation would also be much easier to read since "die_threads" > is obviously "human-readable list of cpuX's hardware threads within the > same die_id". And no need to modify the doc anymore when adding levels :) I like your idea! Hm, I think i'd skip creating "die_siblings", as it adds to the fragile legacy naming scheme that we want to deprecate. And although it is ill-defined and has a mis-leading name, I now think it would be better to leave "core_siblings" as defined -- a legacy synonym for "package_threads". Deprecate it, but keep its original definition until it is removed. Updated applications would use: core_threads die_threads package_threads and they'll be future proof if/when we add any new levels. the legacy thread_siblings and core_siblings will stick around as aliases: core_threads (thread_siblings) die_threads package_threads (core_siblings) thanks! Len Brown, Intel Open Source Technology Center