From patchwork Fri Apr 24 14:36:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 6270661 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1C119BF4A6 for ; Fri, 24 Apr 2015 14:36:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23A0420384 for ; Fri, 24 Apr 2015 14:36:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF35120379 for ; Fri, 24 Apr 2015 14:36:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754903AbbDXOgX (ORCPT ); Fri, 24 Apr 2015 10:36:23 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:33605 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756185AbbDXOgV (ORCPT ); Fri, 24 Apr 2015 10:36:21 -0400 Received: by wiax7 with SMTP id x7so36564137wia.0 for ; Fri, 24 Apr 2015 07:36:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZHw43Uv9K6if7Fun69a3RGv4j2Fafp3RN2vCNl7Lc2A=; b=WwkzVv/0dEgV6OiE81kfHSryGGII089TE5W8h1lg1LDuw9Qi6yMBi4hTdGJvKx7bTq Si7MAzPywh+YU2kT0wZnjj6kf9qdwD1VngmacnurrPjeCf/XlAS/8tuuylFcZKrHmoZ7 EN/OqSI9bvY7tUAIZleaTgIHR4gzmNjAFmgteIq81mzOUHGju587mBqZkx7xXQ/0AwIc ABKsNyTHG1wqcglF01/rK5HZnNiVR9FX/wi0kzrAaOZlJOkfBms+9s/5jk71ag8HK5AQ 4iYqe2Xi9aGuRtxEqcjLpqGzsAhylWqAQmXopgYqj1uCz9Q7xrwtnEaxTPJK5ko0028f IsIw== X-Gm-Message-State: ALoCoQn3rNT7kt0K6g23kE2Qs05Vg6x6DG4pTWx4Y/I+5SrsQO4SU06gCJjo+VHW4GNPRuhWjAvq X-Received: by 10.180.90.169 with SMTP id bx9mr4396094wib.50.1429886180317; Fri, 24 Apr 2015 07:36:20 -0700 (PDT) Received: from bgdev-debian.home (LPoitiers-656-1-62-228.w90-63.abo.wanadoo.fr. [90.63.143.228]) by mx.google.com with ESMTPSA id dz4sm3852289wib.17.2015.04.24.07.36.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Apr 2015 07:36:19 -0700 (PDT) From: Bartosz Golaszewski To: LKML Cc: linux-pm , Benoit Cousson , Axel Haslam , Bartosz Golaszewski Subject: [PATCH] Documentation: update cputopology.txt Date: Fri, 24 Apr 2015 16:36:45 +0200 Message-Id: <1429886205-28520-1-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski The documentation on cpu topology seems to be a bit out-of-date. It doesn't mention the **_siblings_list attributes and uses old names for topology_**_cpumask() macros. Add information on missing attributes plus some minor clarifications. Signed-off-by: Bartosz Golaszewski --- Documentation/cputopology.txt | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt index 0aad6de..27e67d7 100644 --- a/Documentation/cputopology.txt +++ b/Documentation/cputopology.txt @@ -1,6 +1,6 @@ Export CPU topology info via sysfs. Items (attributes) are similar -to /proc/cpuinfo. +to /proc/cpuinfo output of some architectures: 1) /sys/devices/system/cpu/cpuX/topology/physical_package_id: @@ -23,20 +23,35 @@ to /proc/cpuinfo. 4) /sys/devices/system/cpu/cpuX/topology/thread_siblings: internal kernel map of cpuX's hardware threads within the same - core as cpuX + core as cpuX. -5) /sys/devices/system/cpu/cpuX/topology/core_siblings: +5) /sys/devices/system/cpu/cpuX/topology/thread_siblings_list: + + human-readable list of cpuX's hardware threads within the same + core as cpuX. + +6) /sys/devices/system/cpu/cpuX/topology/core_siblings: internal kernel map of cpuX's hardware threads within the same physical_package_id. -6) /sys/devices/system/cpu/cpuX/topology/book_siblings: +7) /sys/devices/system/cpu/cpuX/topology/core_siblings_list: + + human-readable list of cpuX's hardware threads within the same + physical_package_id. + +8) /sys/devices/system/cpu/cpuX/topology/book_siblings: internal kernel map of cpuX's hardware threads within the same book_id. +9) /sys/devices/system/cpu/cpuX/topology/book_siblings_list: + + human-readable list of cpuX's hardware threads within the same + book_id. + To implement it in an architecture-neutral way, a new source file, -drivers/base/topology.c, is to export the 4 or 6 attributes. The two book +drivers/base/topology.c, is to export the 6 or 9 attributes. The three book related sysfs files will only be created if CONFIG_SCHED_BOOK is selected. For an architecture to support this feature, it must define some of @@ -48,16 +63,17 @@ these macros in include/asm-XXX/topology.h: #define topology_core_cpumask(cpu) #define topology_book_cpumask(cpu) -The type of **_id is int. -The type of siblings is (const) struct cpumask *. +The type of **_id macros is int. +The type of **_cpumask macros is (const) struct cpumask *. The latter +correspond with appropriate **_siblings sysfs attributes. To be consistent on all architectures, include/linux/topology.h provides default definitions for any of the above macros that are not defined by include/asm-XXX/topology.h: 1) physical_package_id: -1 2) core_id: 0 -3) thread_siblings: just the given CPU -4) core_siblings: just the given CPU +3) thread_cpumask: just the given CPU +4) core_cpumask: just the given CPU For architectures that don't support books (CONFIG_SCHED_BOOK) there are no default definitions for topology_book_id() and topology_book_cpumask().