Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9925791ybi; Wed, 24 Jul 2019 12:26:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWcxN9TvmrF87Orh4TaxXGtz312PP/KyZKHEtKC6cBsvlFf7aI+P26tGdMDzMrB6Z5SPsi X-Received: by 2002:aa7:9834:: with SMTP id q20mr13029739pfl.196.1563996406303; Wed, 24 Jul 2019 12:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996406; cv=none; d=google.com; s=arc-20160816; b=er2xQhk/5/b3QK81dkBdTEKRlkw3W9yKEDfnUtYCjpmMdhiGEJOyzmks0cEblKAWHn 8zre/xP8EUfeljmgxqmqU+LvjqnLpjvZpw79ddc/wO/y+JsdqeIiDOmmPtB1jZQf90Mn Kj2SLM8ntOqzWSr2eKxu7F7JuVij+m+St9uro0ClLi6AzjwVTFJyJBgo/69npnAGfB4J sK7UPbn6EhjJgP9QYUkW+gZx4bkWIyE0D/+UkXQtLriQRnBmZGXZCJD/uqeoAcqtbq5h EwX3a1XTur1PP/A1k9U9U4XpU6Vl7g5J/Nw2gWG8vt1qR3BIFvMJ1vW708XKcPOf+80n XjCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=L7bWzjBJyEbT7zsV5SFsXnXnKd4LtcokagI4T+/4CWY=; b=VqQiwh10l4tFaLRGoMSyEB9MrsGXzIYpoQzBHmHNJzAlRJ3Pefde2EF9nh5zU6+Kcq 3EY9s6UZaQMtOeKXdE/EQxAxJBbETvBDD4JGXAQMbwhaiFA8ChPafusHS+spcvPDaWsk LBR8ihIVWeMgxWHY3xwVMbYzmClwO3H37jf6lR22LIh06V6qc/xigu04XM5zIJdRhYE6 NRJHxO8so6yXQcmNyo/bZsozfXRDm74eqCoqmGhmATuWFrwFPirKyORlaJq1tpN/Yv3H CdJboicfF+mw5CglGk2nPH7gUoAEoakaNNgjeEbDx9GVNMH/XdKDxc+lWPhKB2Ql3iRI 7Pyg== 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 w22si14784794pfn.118.2019.07.24.12.26.31; Wed, 24 Jul 2019 12:26:46 -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 S1728724AbfGXSx0 (ORCPT + 99 others); Wed, 24 Jul 2019 14:53:26 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:32905 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728440AbfGXSxZ (ORCPT ); Wed, 24 Jul 2019 14:53:25 -0400 Received: by mail-pf1-f195.google.com with SMTP id g2so21393753pfq.0; Wed, 24 Jul 2019 11:53:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L7bWzjBJyEbT7zsV5SFsXnXnKd4LtcokagI4T+/4CWY=; b=Qw4FJgv0SGNbNd1CqiInQVEM6mkb0N8jD4gwuKZgdjsvvrPVpMZ9CRdwlto8fVjYNx VFAasKfe9rcaLKcPnHkjb0Ns9bZjKagfv3iXtX9hRupU6qD9CV7LHgFV11PUqNEa4jrB ifT32AX0MlGGQlcAF+tdxh8z8pcIP8+54wZ3ZFemwvCYi6g+NbT2PoQXd4IcPnM19sWi m8ruqyE0P7IZVLn2Agpo9VoFRMK5xKqyfjWJ0tOSyijUFSyXKTqKeBRrUgDdTUhIOE/m HOEC5nmsEDiqxFDysqk9tAD+cg3EEYiH8zqhbudf1lzGPoX72SdhcBN7RwlwynKxo4Kv xY8Q== X-Gm-Message-State: APjAAAUWeNp7dsIM3o+ExRI+sQyoiPxOm7VPy3bA7iYT9RFB0qkFt+pf +flFiyZ63lPk5koErj188Co= X-Received: by 2002:a63:d30f:: with SMTP id b15mr81937093pgg.341.1563994404628; Wed, 24 Jul 2019 11:53:24 -0700 (PDT) Received: from localhost.localdomain ([64.124.23.162]) by smtp.gmail.com with ESMTPSA id b29sm78868092pfr.159.2019.07.24.11.53.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Jul 2019 11:53:24 -0700 (PDT) From: Phil Frost Cc: Ingo Molnar , trivial@kernel.org, Phil Frost , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Correct documentation for /proc/schedstat Date: Wed, 24 Jul 2019 11:50:27 -0700 Message-Id: <20190724185029.26822-1-indigo@bitglue.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 425e0968a25fa3f111f9919964cac079738140b5 ("sched: move code into kernel/sched_stats.h") appears to have inadvertently changed the unit of time from jiffies to nanoseconds as part of the implementation of CFS. Signed-off-by: Phil Frost --- Documentation/scheduler/sched-stats.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/scheduler/sched-stats.txt b/Documentation/scheduler/sched-stats.txt index 8259b34a66ae..b6c1807a01b3 100644 --- a/Documentation/scheduler/sched-stats.txt +++ b/Documentation/scheduler/sched-stats.txt @@ -19,6 +19,11 @@ are no architectures which need more than three domain levels. The first field in the domain stats is a bit map indicating which cpus are affected by that domain. +2.6.23 introduced the CFS scheduler, and also an inadvertent +backwards-incompatible change to the statistics. Although the schedstat version +is 14 in either case, in 2.6.23 and later, counters accumulate time in +nanoseconds. Prior to that, jiffies. + These fields are counters, and only increment. Programs which make use of these will need to start with a baseline observation and then calculate the change in the counters at each subsequent observation. A perl script @@ -48,9 +53,10 @@ Next two are try_to_wake_up() statistics: 6) # of times try_to_wake_up() was called to wake up the local cpu Next three are statistics describing scheduling latency: - 7) sum of all time spent running by tasks on this processor (in jiffies) + 7) sum of all time spent running by tasks on this processor (in + nanoseconds, or jiffies prior to 2.6.23) 8) sum of all time spent waiting to run by tasks on this processor (in - jiffies) + nanoseconds, or jiffies prior to 2.6.23) 9) # of timeslices run on this cpu -- 2.20.1 (Apple Git-117)