From nobody Sun Apr 12 02:48:29 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12705C19F29 for ; Mon, 1 Aug 2022 08:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230192AbiHAIec (ORCPT ); Mon, 1 Aug 2022 04:34:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbiHAIea (ORCPT ); Mon, 1 Aug 2022 04:34:30 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3AA026D6; Mon, 1 Aug 2022 01:34:29 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LxBGH2LZDzGpHj; Mon, 1 Aug 2022 16:33:11 +0800 (CST) Received: from huawei.com (10.67.174.191) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 1 Aug 2022 16:34:26 +0800 From: Li Hua To: , , , , , , CC: , , Subject: [PATCH -next] Documentation/filesystems/proc.rst: Change the document about cputime Date: Tue, 2 Aug 2022 06:30:46 +0800 Message-ID: <20220801223046.35178-1-hucool.lihua@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.191] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Because the values of utime, stime, and delta are temporarily written to cpustat in kcpustat_cpu_fetch_vtime. Therefore, there are two problems read from /proc/stat: 1. The value read the second time may be less than the first time. 2. When there are many tasks, the statistics are not imprecise when utime and stime do not exceed one tick. Signed-off-by: Li Hua --- Documentation/filesystems/proc.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems= /proc.rst index 47e95dbc820d..b6625e83c994 100644 --- a/Documentation/filesystems/proc.rst +++ b/Documentation/filesystems/proc.rst @@ -1459,6 +1459,10 @@ second). The meanings of the columns are as follows= , from left to right: - user: normal processes executing in user mode - nice: niced processes executing in user mode - system: processes executing in kernel mode + The amount of time reading from /proc/stat is not reliable, because the = value + of utime, stime, and delta are temporarily written to cpustat in + kcpustat_cpu_fetch_vtime(). + - idle: twiddling thumbs - iowait: In a word, iowait stands for waiting for I/O to complete. But th= ere are several problems: --=20 2.17.1