Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4210599ybi; Tue, 18 Jun 2019 13:56:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqw220A1GusFg4WkNB55Nl71dyZT7POOd0+3Z04Rw9IUvTjHiY6bQz171AVI+OcWHuEYzarM X-Received: by 2002:a17:902:ab83:: with SMTP id f3mr25379576plr.122.1560891374559; Tue, 18 Jun 2019 13:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560891374; cv=none; d=google.com; s=arc-20160816; b=l1PuGH7xsoM56CPXT9cVq3HwFMUmWCC0rocBHi0Z6S3U1pSC3JYUahtDrRL1rh4XCU iY5BSzoj2DJwKHXdqJRW9xU+d14YH6ED3QK4hIxu68g+wKvAZO9U6ZEMwa/UeuzlifbI WlgmNV+e+zsAJ7tXXobI6N2iOVw/sc4wqrcGN6XAIxzHVteYh+xkl1BTWb8ArEJEm/f2 anPnjC7tzqvtgRAdrGKl53MCOITtlchxNJkIEONFkb3bzn1Ls4trGD1+2BXr42dfGAoO e7Hdl2/2lyF2aK5Kqr3sIl8eJSOuIdiIWICsWGqnLmn4iZd13dJOeYcxJEyqUb6Uxcsy nP5w== 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=ySP7Rfm9vrPZVi9yG2V7YPPuHG8L4YJY7F6xTxyIBXY=; b=cw/jRNVho+G/hGoNXyaOC90lU9chsCkrv9IA3bQLR3YUUmylmASCxtn2IbxdHOTxvn +L/DBG9PlHBB6InAyEekpfJ5/mGk9RhWe2yCnhh8S/4DDSNbroS9L8uLOui8wV1NQDbx C+fgquoxb14KOzn6DAP1rDpHzyErhQ3g1y+4tp1ZHN8+14IvNKrQPhb9eaCLrSeFo6+t oB0oR1gT8D8eEUTs4d9+MdHbQBjcYjW3tB4T5e5/ZwafK34yWj/ARtSoaMdlxDW175uN 57WUT+8HaN6oYgZMGAXq73qdd8pTtQTv3e3GqYQTg77BsZcEjxahgTYaNQMvtcTF3UFE mplA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rMo6StLo; 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 x5si3273327pjp.75.2019.06.18.13.55.59; Tue, 18 Jun 2019 13:56:14 -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=rMo6StLo; 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 S1731038AbfFRUz1 (ORCPT + 99 others); Tue, 18 Jun 2019 16:55:27 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50608 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730723AbfFRUx4 (ORCPT ); Tue, 18 Jun 2019 16:53:56 -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=ySP7Rfm9vrPZVi9yG2V7YPPuHG8L4YJY7F6xTxyIBXY=; b=rMo6StLojTA5CIfllup+lKHnw8 nzrIafayuRk0lTaoAC9W1jBSxShK60Ofr63C/9bVD2YhaWrADCKtC4dRIsY1SMKfXnwPaTNKRy9ps BbFdrTYs1QY8ScLFrZfM2R9niSHZor2yuGPa07PUEcMP8+0fG//jBQJln5O/giXqm5A5aMj8x6kft J12XBjJEJbELgt5edcBrNqq2S8xoBt9DwghBEpP9i31tn5pDJKl2ZL4XwdWeHVKcNe7R7QsINjep5 IlJr3vUSY00kIRZm/afMzQ0VEMxd889K8KUK3S/MY9FfyTRF4s3jNS5qPpp26FbCb/PmeYLRzoVGN tt3PTw9g==; Received: from 177.133.86.196.dynamic.adsl.gvt.net.br ([177.133.86.196] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hdL74-0008Nh-98; Tue, 18 Jun 2019 20:53:54 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.92) (envelope-from ) id 1hdL70-000201-4R; Tue, 18 Jun 2019 17:53:50 -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 18/29] docs: accounting: convert to ReST Date: Tue, 18 Jun 2019 17:53:36 -0300 Message-Id: <3b8adf6981981dd64acece4e81dfcca65f95983f.1560890800.git.mchehab+samsung@kernel.org> 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:: -