Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3242722ybd; Fri, 28 Jun 2019 05:24:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRi0tkTkFM0Ijsm09oZv3DP20OT30V6WaJ4hq/awW5be0lGnDcmAc70cZ0B23BhrNbEJ6I X-Received: by 2002:a17:902:7087:: with SMTP id z7mr11216009plk.184.1561724642341; Fri, 28 Jun 2019 05:24:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561724642; cv=none; d=google.com; s=arc-20160816; b=lR5X3qiiSR2JmeLs5l9+s09P6EuDMbjjH1BmbxWFXXUZKAxLIohTAurvY4r3pBTgSK t7QD6k3X8AvF0HQNYGDB9n1Qi2OGY8wJQ5sfK+lMABQaJvDSAmzdYU8UoNg7tqJSW9Q7 ayusjyG0TYy2YEL4gwc/tLmGATMtS8xDKDfL/KynUk2HgYLHjsA4qCHSlyx2mRiDHZaM M9lojN49X7dwGRR0VWEB8Pl3tjr5tNkSxtd92Jx12gWfqSGv2rCYTLRU9ocD/Ch0eWk2 CN3+D4ipHoj8JmIrEllVWwA6EiqohkZh2mkojPaQd4I5+W5R7OF7bvcQRltpZL/g33mh 6vvQ== 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=V7YxYhxpUWVDFWBiIOLFjQXoIVrWpuMkJ/MzsnYS0ks=; b=dfG7tkajH3Iv2uBHu3ckgtNtDJDKzglZ6x5mCgSEW3r/rlKkaWfFCogcXTrid3dCcw Z1MArjqnN/GDqnC/HDniZr7w/aaEK5FRJ3PquN/6mfpJ+tuptOS8QvESADL8XU5Dzrhk zY1WQ1Mub5fH11CtttdcLj4/RCUIywoynYL+p7BJ5JKa0QCYBFVKBHMYjrfzSeDM21Cj hn6HW0nSAfLCrm+RB5Tsjp+p86Re98sHqyM/NGxJ3pRqjFQakbwZbjFOqfgB8nQQZWGd WdwLpWYQzFlr4619jsZa50wr8tfmjE0T5cfxL4xI9g1ibwHTTdj0RMxb5kfVa3OunDQt nh2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=CCpDiRi6; 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 t11si2073456pgp.153.2019.06.28.05.23.46; Fri, 28 Jun 2019 05:24:02 -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=CCpDiRi6; 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 S1727358AbfF1MXA (ORCPT + 99 others); Fri, 28 Jun 2019 08:23:00 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:58810 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726817AbfF1MUr (ORCPT ); Fri, 28 Jun 2019 08:20:47 -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=V7YxYhxpUWVDFWBiIOLFjQXoIVrWpuMkJ/MzsnYS0ks=; b=CCpDiRi6Tdpe/MP7795hd0/khc ShuEjuQFKeTWRaYYMPlA8f2bhvxIJCdkNVo1W08osE0AwokHeGhzRzzt/QFAHWtzxBL8RSYEbgcai knxpx9O1WY7O0OKdMaJYciBwc3YE70YYSYosmA4njrSYimsOmjyRau5AW5WdalupoYm4Sa5LgzlKK qBGvMPUxMcB8Ko7058K3C/ZjTYGa/Jnnuj9p7Z4GHMcN2URnX7gtkP7XKYiGCWYqqlfT8+TR6fh3h bHhqf94MUlsMGWzZ253Yw6Odb0bKHwcG36wgxLTGEFJ+xbNta1s1NRVGoalvkjZfsBeN4GaEYwp1u xmX3V14w==; Received: from [186.213.242.156] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hgprv-0000AA-Go; Fri, 28 Jun 2019 12:20:43 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.92) (envelope-from ) id 1hgprt-00058Z-KT; Fri, 28 Jun 2019 09:20:41 -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 22/43] docs: accounting: convert to ReST Date: Fri, 28 Jun 2019 09:20:18 -0300 Message-Id: X-Mailer: git-send-email 2.21.0 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} | 79 ++++++++++++------- .../{taskstats.txt => taskstats.rst} | 15 ++-- Documentation/admin-guide/cgroup-v2.rst | 6 +- init/Kconfig | 2 +- 8 files changed, 139 insertions(+), 92 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} (78%) 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:: -