From patchwork Wed Dec 15 15:43:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yong w X-Patchwork-Id: 12678701 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D5AEC433FE for ; Wed, 15 Dec 2021 16:18:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A46D96B0078; Wed, 15 Dec 2021 10:44:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F6EF6B007B; Wed, 15 Dec 2021 10:44:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8BDF96B007D; Wed, 15 Dec 2021 10:44:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id 7E6756B0078 for ; Wed, 15 Dec 2021 10:44:22 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4877C180ACF6C for ; Wed, 15 Dec 2021 15:44:12 +0000 (UTC) X-FDA: 78920449944.18.E9F0490 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf26.hostedemail.com (Postfix) with ESMTP id E0799140013 for ; Wed, 15 Dec 2021 15:44:11 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id oa5-20020a17090b1bc500b001b0f8a5e6b7so4031457pjb.0 for ; Wed, 15 Dec 2021 07:44:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=ZQpjHX9dmpcsXje2Uj46IZRB9dElu7f9CmUWai1aoyo=; b=GPNcCQDNTcfpQ8Igy41dk6BT7Vnak7Z1zgVF79fb569KzmPV9iUwAamE+QYIRxStoY lbvw1V3CNspZk1BfRWE9gPiXEZmEC7viVhsgoK8L3Qx2TfkjWpvADx+8csupU4++5N61 vBuIdUw47L62gXVMCMxDXIToJH7eH/Bt88O+RkQ04LS0uuzg4sy1VHbTRphGpqFWLciG L6mhurvOc5rIx5jmfBar/IDnT+09ek1N5y0+xX26v/rq0YAhxbHA/YWU4XoDdZavM48D KdlrPNcDyjDeEakWIZ9KNP5xq7gGqMX/3f2E6ERBTTYJC/NcX0mqHiP9PMsCwynm4po+ g8yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZQpjHX9dmpcsXje2Uj46IZRB9dElu7f9CmUWai1aoyo=; b=GDKFiHlC4mxe9ZMTBNMLY1URhcnXqiBpfnu7Lj3R4YCwqeuYvcr9xyTwfvdhcxCl9c rYSX4210DHWM0RFkbiePXrEE+6UMzkyCVJrhyUiB9o9G5XP1VpsYnNRUNbTwI1hpU/R9 RMr05gzw6xSOHG71OrwZig62cTdI5v2+OT03ZRy5ehS0J+IrhaK1qdC4pXAteXerB36t 5duJkpYqCVzS6t+vvAwjDOzG2Wgib3YUheR+w+OhawedDPzWlAV//HipnJS22B2YUFDL jOpS9nYB2aMPtgZeZebv8VGIRE1x3w7aHRU16754dEavLRoxrYc5rcUoXVauhjH3AIgE S3Sw== X-Gm-Message-State: AOAM533joWtZ/mIWa8hg5zw8I0jU7ZNyMLOrUDBOH7WHfs0/nHe+VMrv zqDsLrw5FpzSRWbwxmJgqhg= X-Google-Smtp-Source: ABdhPJyTWTg5hRbQgtXnx9xCo10AsgF4ScMRxvo/dpQBveOWmhz0dDkLjkvUNwqZeb87aQr6ljEQ9Q== X-Received: by 2002:a17:902:e747:b0:148:a18e:75be with SMTP id p7-20020a170902e74700b00148a18e75bemr5575502plf.73.1639583050796; Wed, 15 Dec 2021 07:44:10 -0800 (PST) Received: from localhost.localdomain ([171.221.151.97]) by smtp.gmail.com with ESMTPSA id o9sm2907440pgu.12.2021.12.15.07.44.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Dec 2021 07:44:10 -0800 (PST) From: yongw.pur@gmail.com X-Google-Original-From: wang.yong12@zte.com.cn To: bsingharora@gmail.com, akpm@linux-foundation.org, peterz@infradead.org, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, yang.yang29@zte.com.cn, wang.yong12@zte.com.cn Subject: [PATCH] Documentation: accounting: add thrashing page cache and direct compact Date: Wed, 15 Dec 2021 07:43:41 -0800 Message-Id: <1639583021-92977-1-git-send-email-wang.yong12@zte.com.cn> X-Mailer: git-send-email 2.7.4 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: E0799140013 X-Stat-Signature: h7a4y7o8jozyaghs9g1iyib11z944tqp Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=GPNcCQDN; spf=pass (imf26.hostedemail.com: domain of yongw.pur@gmail.com designates 209.85.216.47 as permitted sender) smtp.mailfrom=yongw.pur@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1639583051-178465 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: wangyong Add thrashing page cache and direct compact related descriptions and update the usage of getdelays userspace utility. The following patches modifications have been updated: https://lore.kernel.org/all/20190312102002.31737-4-jinpuwang@gmail.com/ https://lore.kernel.org/all/1638619795-71451-1-git-send-email- wang.yong12@zte.com.cn/ Reported-by: Zeal Robot Signed-off-by: wangyong Reviewed-by: Yang Yang --- Documentation/accounting/delay-accounting.rst | 55 +++++++++++++-------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/Documentation/accounting/delay-accounting.rst b/Documentation/accounting/delay-accounting.rst index 1b8b46d..197fe31 100644 --- a/Documentation/accounting/delay-accounting.rst +++ b/Documentation/accounting/delay-accounting.rst @@ -13,6 +13,8 @@ a) waiting for a CPU (while being runnable) b) completion of synchronous block I/O initiated by the task c) swapping in pages d) memory reclaim +e) thrashing page cache +f) direct compact and makes these statistics available to userspace through the taskstats interface. @@ -41,11 +43,12 @@ 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 + include/uapi/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. +delay seen for cpu, sync block I/O, swapin, memory reclaim, thrash page +cache, direct compact etc. Taking the difference of two successive readings of a given counter (say cpu_delay_total) for a task will give the delay @@ -88,41 +91,37 @@ seen. General format of the getdelays command:: - getdelays [-t tgid] [-p pid] [-c cmd...] - + getdelays [-dilv] [-t tgid] [-p pid] Get delays, since system boot, for pid 10:: - # ./getdelays -p 10 + # ./getdelays -d -p 10 (output similar to next case) Get sum of delays, since system boot, for all pids with tgid 5:: - # ./getdelays -t 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 -d -t 5 + print delayacct stats ON + TGID 5 -Get delays seen in executing a given simple command:: - # ./getdelays -c ls / + CPU count real total virtual total delay total delay average + 8 7000000 6872122 3382277 0.423ms + IO count delay total delay average + 0 0 0ms + SWAP count delay total delay average + 0 0 0ms + RECLAIM count delay total delay average + 0 0 0ms + THRASHING count delay total delay average + 0 0 0ms + COMPACT count delay total delay average + 0 0 0ms - bin data1 data3 data5 dev home media opt root srv sys usr - boot data2 data4 data6 etc lib mnt proc sbin subdomain tmp var +Get IO accounting for pid 1, it works only with -p:: + # ./getdelays -i -p 1 + printing IO accounting + linuxrc: read=65536, write=0, cancelled_write=0 - CPU count real total virtual total delay total - 6 4000250 4000000 0 - IO count delay total - 0 0 - SWAP count delay total - 0 0 - RECLAIM count delay total - 0 0 +The above command can be used with -v to get more debug information.