Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2422376yba; Mon, 22 Apr 2019 06:35:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqx50/IcAe5cMCdJ9xYyEvgLkybdoq6gzlOe5Fm6rCtKnXiwMps9ACr7+jjc7eeTnMgjkGRC X-Received: by 2002:a17:902:7c01:: with SMTP id x1mr19821601pll.299.1555940121875; Mon, 22 Apr 2019 06:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555940121; cv=none; d=google.com; s=arc-20160816; b=uB0pHSXo07AliQrFZ5tR7eBTMz/mYLoQkOlYTZHqDfX3fHXaw0b4ExoZNmuMPEkI7I W/LRXw4eXEapbKMgliSoYo2tsbhvOWqATqDRVCmwGJrZsfJoAb1Ceam2BKvZgZgZsETR 8vnBYNNwdQ6Bg1MbnGRpVKqADIp85zwBgkFn4bcD/1Yd1dkRVABJQtRS3v8zRC4CaDy/ l6RIE9GP3bHfRV5VkYJGiLLCUtKffL+yyc0vRXwhicy/A63UNEdLWxIueXMZuVxxJjQ5 wpMbxCINfUZWoAke1vLvoQHLs4uwaNZjjLiihXKA9LfLa74HpsTs3/Wd8aQF914czYoE 73eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zvzvyVb+im44veXN4ZpUOwK9iqmuVXaqp+QMzzaaYqg=; b=cDdyRJoVUI1ajWobWsF45bCjUnHELMcNdz5d8Dy+FzgIWdXe3rHbgWm3DwlROjvTqh vZxZCtPUOsDsF38P4L2UVuTzmm66BdMCdChYkB2e65hUNqHzHcWdBiXIln6NSpCBUWFc CRGEnYOqrdyjl/Y7BKgTF52AqUUlg1s2NcChlAnlGkv31qkz1jQfe1KiEluqSdxwklHe yV7dxQqI0WAwW1VP1mQNEi4f4gL9wfY0cVnoG/O4oSjOFuBL0XKm4Bg1nWx4YAjoSC8N 9QHf2lhjljcYM7OIC/4lZJ8OcRRjFSyMmRo7Da/hzOL7a490zHKfU4WkCst5wwQz5zBV afAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="i/MnSCYw"; 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 g19si3130485pgk.532.2019.04.22.06.35.06; Mon, 22 Apr 2019 06:35:21 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="i/MnSCYw"; 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 S1728071AbfDVNdO (ORCPT + 99 others); Mon, 22 Apr 2019 09:33:14 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37692 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727547AbfDVN2U (ORCPT ); Mon, 22 Apr 2019 09:28:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zvzvyVb+im44veXN4ZpUOwK9iqmuVXaqp+QMzzaaYqg=; b=i/MnSCYwhQaRAc1byPgDI9Yijw Bpks9RbJW/DoJezqTb8V6ZWMWiuvLuhsk/2Dc9HsiRNGD3MiJc3OYBKd/q7iyXXxWYP7umxjPN9U+ kKKFmYZyuGUhzEpMIIXbYcUgJ+4F8zDrwWuuwP264PsEC2kMJ1ogDyjlzaVwAEwj1LdhFnkZp2cV3 23W/RvmNXSB00z0yGPHJKXnkbkIcqV6OXEP2M4FsNcj39uUDTBkfWqMDsH1c6m0vnBBBEoA2zmEQF IEbrn6ugAnhE/HDaTN/vF1vnDuNHvYTs/nmSj107UEsjJaSBmiz3Gb5+3Qm0D+Cf/ZbZikQv0sU/t YX0FCa0Q==; Received: from 179.176.125.229.dynamic.adsl.gvt.net.br ([179.176.125.229] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hIYza-0005Ha-Uj; Mon, 22 Apr 2019 13:28:19 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.92) (envelope-from ) id 1hIYzU-0005o5-1A; Mon, 22 Apr 2019 10:28:12 -0300 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , Balbir Singh , Tejun Heo , Li Zefan , Johannes Weiner , cgroups@vger.kernel.org Subject: [PATCH v2 57/79] docs: accounting: convert to ReST Date: Mon, 22 Apr 2019 10:27:46 -0300 Message-Id: <13b52516ab787b9a9637e6b9adfec88ec1931b99.1555938376.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rename the accounting documentation files to ReST, add an index for them and adjust in order to produce a nice html output via the Sphinx build system. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Signed-off-by: Mauro Carvalho Chehab --- .../{cgroupstats.txt => cgroupstats.rst} | 14 +++-- ...ay-accounting.txt => delay-accounting.rst} | 61 +++++++++++-------- Documentation/accounting/index.rst | 14 +++++ Documentation/accounting/{psi.txt => psi.rst} | 40 ++++++------ ...kstats-struct.txt => taskstats-struct.rst} | 53 ++++++++++------ .../{taskstats.txt => taskstats.rst} | 15 +++-- Documentation/admin-guide/cgroup-v2.rst | 6 +- init/Kconfig | 2 +- 8 files changed, 126 insertions(+), 79 deletions(-) rename Documentation/accounting/{cgroupstats.txt => cgroupstats.rst} (77%) rename Documentation/accounting/{delay-accounting.txt => delay-accounting.rst} (77%) create mode 100644 Documentation/accounting/index.rst rename Documentation/accounting/{psi.txt => psi.rst} (91%) rename Documentation/accounting/{taskstats-struct.txt => taskstats-struct.rst} (90%) rename Documentation/accounting/{taskstats.txt => taskstats.rst} (95%) diff --git a/Documentation/accounting/cgroupstats.txt b/Documentation/accounting/cgroupstats.rst similarity index 77% rename from Documentation/accounting/cgroupstats.txt rename to Documentation/accounting/cgroupstats.rst index d16a9849e60e..b9afc48f4ea2 100644 --- a/Documentation/accounting/cgroupstats.txt +++ b/Documentation/accounting/cgroupstats.rst @@ -1,3 +1,7 @@ +================== +Control Groupstats +================== + Control Groupstats is inspired by the discussion at http://lkml.org/lkml/2007/4/11/187 and implements per cgroup statistics as suggested by Andrew Morton in http://lkml.org/lkml/2007/4/11/263. @@ -19,9 +23,9 @@ about tasks blocked on I/O. If CONFIG_TASK_DELAY_ACCT is disabled, this information will not be available. To extract cgroup statistics a utility very similar to getdelays.c -has been developed, the sample output of the utility is shown below +has been developed, the sample output of the utility is shown below:: -~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a" -sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0 -~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup" -sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2 + ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a" + sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0 + ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup" + sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2 diff --git a/Documentation/accounting/delay-accounting.txt b/Documentation/accounting/delay-accounting.rst similarity index 77% rename from Documentation/accounting/delay-accounting.txt rename to Documentation/accounting/delay-accounting.rst index 042ea59b5853..7cc7f5852da0 100644 --- a/Documentation/accounting/delay-accounting.txt +++ b/Documentation/accounting/delay-accounting.rst @@ -1,5 +1,6 @@ +================ Delay accounting ----------------- +================ Tasks encounter delays in execution when they wait for some kernel resource to become available e.g. a @@ -39,7 +40,9 @@ in detail in a separate document in this directory. Taskstats returns a generic data structure to userspace corresponding to per-pid and per-tgid statistics. The delay accounting functionality populates specific fields of this structure. See + include/linux/taskstats.h + for a description of the fields pertaining to delay accounting. It will generally be in the form of counters returning the cumulative delay seen for cpu, sync block I/O, swapin, memory reclaim etc. @@ -61,13 +64,16 @@ also serves as an example of using the taskstats interface. Usage ----- -Compile the kernel with +Compile the kernel with:: + CONFIG_TASK_DELAY_ACCT=y CONFIG_TASKSTATS=y Delay accounting is enabled by default at boot up. -To disable, add +To disable, add:: + nodelayacct + to the kernel boot options. The rest of the instructions below assume this has not been done. @@ -78,40 +84,43 @@ The utility also allows a given command to be executed and the corresponding delays to be seen. -General format of the getdelays command +General format of the getdelays command:: -getdelays [-t tgid] [-p pid] [-c cmd...] + getdelays [-t tgid] [-p pid] [-c cmd...] -Get delays, since system boot, for pid 10 -# ./getdelays -p 10 -(output similar to next case) +Get delays, since system boot, for pid 10:: -Get sum of delays, since system boot, for all pids with tgid 5 -# ./getdelays -t 5 + # ./getdelays -p 10 + (output similar to next case) +Get sum of delays, since system boot, for all pids with tgid 5:: -CPU count real total virtual total delay total - 7876 92005750 100000000 24001500 -IO count delay total - 0 0 -SWAP count delay total - 0 0 -RECLAIM count delay total - 0 0 + # ./getdelays -t 5 -Get delays seen in executing a given simple command -# ./getdelays -c ls / -bin data1 data3 data5 dev home media opt root srv sys usr -boot data2 data4 data6 etc lib mnt proc sbin subdomain tmp var + CPU count real total virtual total delay total + 7876 92005750 100000000 24001500 + IO count delay total + 0 0 + SWAP count delay total + 0 0 + RECLAIM count delay total + 0 0 +Get delays seen in executing a given simple command:: -CPU count real total virtual total delay total + # ./getdelays -c ls / + + bin data1 data3 data5 dev home media opt root srv sys usr + boot data2 data4 data6 etc lib mnt proc sbin subdomain tmp var + + + CPU count real total virtual total delay total 6 4000250 4000000 0 -IO count delay total + IO count delay total 0 0 -SWAP count delay total + SWAP count delay total 0 0 -RECLAIM count delay total + RECLAIM count delay total 0 0 diff --git a/Documentation/accounting/index.rst b/Documentation/accounting/index.rst new file mode 100644 index 000000000000..e1f6284b5ff3 --- /dev/null +++ b/Documentation/accounting/index.rst @@ -0,0 +1,14 @@ +:orphan: + +========== +Accounting +========== + +.. toctree:: + :maxdepth: 1 + + cgroupstats + delay-accounting + psi + taskstats + taskstats-struct diff --git a/Documentation/accounting/psi.txt b/Documentation/accounting/psi.rst similarity index 91% rename from Documentation/accounting/psi.txt rename to Documentation/accounting/psi.rst index 5cbe5659e3b7..621111ce5740 100644 --- a/Documentation/accounting/psi.txt +++ b/Documentation/accounting/psi.rst @@ -35,14 +35,14 @@ Pressure interface Pressure information for each resource is exported through the respective file in /proc/pressure/ -- cpu, memory, and io. -The format for CPU is as such: +The format for CPU is as such:: -some avg10=0.00 avg60=0.00 avg300=0.00 total=0 + some avg10=0.00 avg60=0.00 avg300=0.00 total=0 -and for memory and IO: +and for memory and IO:: -some avg10=0.00 avg60=0.00 avg300=0.00 total=0 -full avg10=0.00 avg60=0.00 avg300=0.00 total=0 + some avg10=0.00 avg60=0.00 avg300=0.00 total=0 + full avg10=0.00 avg60=0.00 avg300=0.00 total=0 The "some" line indicates the share of time in which at least some tasks are stalled on a given resource. @@ -77,9 +77,9 @@ To register a trigger user has to open psi interface file under /proc/pressure/ representing the resource to be monitored and write the desired threshold and time window. The open file descriptor should be used to wait for trigger events using select(), poll() or epoll(). -The following format is used: +The following format is used:: -