Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6947927rdb; Tue, 2 Jan 2024 21:58:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IH0MQPvSwpGXkRPWNuMHTxlLKxWsa0SzbaEfGs23tDITqsg2aCb69L8u6pIFO7Vwm5hh1HK X-Received: by 2002:a05:6358:99a0:b0:172:e227:bfd9 with SMTP id j32-20020a05635899a000b00172e227bfd9mr16733344rwb.42.1704261501714; Tue, 02 Jan 2024 21:58:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704261501; cv=none; d=google.com; s=arc-20160816; b=xzDWCgNT4xuWQ1Hhd3MYt3PoXucrAU+sph/FLAixnCNlYofHQ9VFW1lVA60UsbwgdM LmU1eBssHt2fo+HPlfgrCy17KCtMtxk5Trn0q27sz4olFP0qdrlGam8fQyRwwVGX6jW5 fMDYYL6Kh1L4KF5lNzy1uhsnHUs1tQz6nPRGzr7wV5kKLUFzSEdCCL7zBQE0pMR2o5hj 5r+gVib/n68OxmfRxsIeXQMNMmRcZY1acE9FMmSC9ZpR3WwnSrgbOglPEFrmG3+w87Gi Z6ttodjAn6BYKxapxiU02BTV7pbmHfqJN5pW7+p9wDQmCBDDsmpWTPSwZikNzY7nCYFK 58Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:dlp-filter:cms-type:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=Pf2dZcRj3DhWgVRNDm7EChH8TNgNl1cEinXghVV1m/0=; fh=aY7BzdyKm4Nm0M/uAtUmk2wfKPqEr2Dp62eUaXsSvjg=; b=j8YLvFN/Wka9GAqcLzkaqTm96i1WozI0H2LopqVG67yJB2uEMtR0+mgOrBhp9CMRS0 a/1Axe9y2Z2kvmJ+JBRS/xA9HuND9CJZp3ifg0QltKhYLh7kCrJg0k9Tq/CUrNKI8v8f L5CnuuErrzpLoaFhwNrZXuIIWUmeJrMB5Mt/lxy87zcDvvBUjBzDAWm8bEBWFw5f+Q5B fnkpWtNqTjxAAMbaLDcVPCHyYwVM2zVmi8NXnEdYtXIFDP3nXyPgTUlXKc9jZ1/inVxo AXIGNbhFLNK8YsL2b6idjOBg0+ZP/gaEsXGUUAPJ/NwqLGUSGKklQl8uRcPjVtt5hmMr DGkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=N+25HVh+; spf=pass (google.com: domain of linux-kernel+bounces-15191-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15191-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bj19-20020a056a02019300b005be00224982si22667278pgb.381.2024.01.02.21.58.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 21:58:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15191-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=N+25HVh+; spf=pass (google.com: domain of linux-kernel+bounces-15191-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15191-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 085D3284FD5 for ; Wed, 3 Jan 2024 05:58:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C3E5418037; Wed, 3 Jan 2024 05:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="N+25HVh+" X-Original-To: linux-kernel@vger.kernel.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 779A118028 for ; Wed, 3 Jan 2024 05:58:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240103055809epoutp045c44ee08335cfc6f5fc093fe706f5eac~mwMt_MsFz0170601706epoutp04G for ; Wed, 3 Jan 2024 05:58:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240103055809epoutp045c44ee08335cfc6f5fc093fe706f5eac~mwMt_MsFz0170601706epoutp04G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1704261489; bh=Pf2dZcRj3DhWgVRNDm7EChH8TNgNl1cEinXghVV1m/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N+25HVh+4ML3wkudkDl6FBs2QAVINFb0EWrDUTHUIEi6+0pctB5eASaZ9brs0+sMX bEslyMbpCxQgfNRl8+2Wluh6Ef04tYw1efx/svHveXLsX39xUx04iTL9J2azFz9x49 LCGW6hGTsNxDi8Ol1AJYjwrhwn1VaV+7eWIExtVk= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20240103055808epcas5p15ffe7e7ea10f818af80b259ada734a29~mwMtYYyNb1619516195epcas5p1G; Wed, 3 Jan 2024 05:58:08 +0000 (GMT) Received: from epsmgec5p1-new.samsung.com (unknown [182.195.38.183]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4T4fCM2ZRrz4x9QB; Wed, 3 Jan 2024 05:58:07 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmgec5p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id 6D.20.19369.E67F4956; Wed, 3 Jan 2024 14:58:06 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20240103055746epcas5p148c2b06032e09956ddcfc72894abc82a~mwMY6WIXB3067430674epcas5p1x; Wed, 3 Jan 2024 05:57:46 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240103055746epsmtrp296aaac7ef0f47548fc855c3e5f4fd4ee~mwMY5mVys1420114201epsmtrp2e; Wed, 3 Jan 2024 05:57:46 +0000 (GMT) X-AuditID: b6c32a50-c99ff70000004ba9-90-6594f76e952d Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id A9.EE.08817.A57F4956; Wed, 3 Jan 2024 14:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [109.105.118.124]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240103055745epsmtip1f241b366c1140cb8ec56c16fb7bdc7fa~mwMXbCpzL2375623756epsmtip1E; Wed, 3 Jan 2024 05:57:44 +0000 (GMT) From: Xiaobing Li To: axboe@kernel.dk Cc: asml.silence@gmail.com, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, kun.dou@samsung.com, peiwei.li@samsung.com, joshi.k@samsung.com, kundan.kumar@samsung.com, wenwen.chen@samsung.com, ruyi.zhang@samsung.com, xiaobing.li@samsung.com Subject: Re: Re: [PATCH v6] io_uring: Statistics of the true utilization of sq threads. Date: Wed, 3 Jan 2024 13:49:37 +0800 Message-ID: <20240103054940.2121301-1-xiaobing.li@samsung.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <7967c7a9-3d17-44de-a170-2b5354460126@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMJsWRmVeSWpSXmKPExsWy7bCmlm7e9ympBgcnalrMWbWN0WL13X42 i3et51gsjv5/y2bxq/suo8XWL19ZLS7vmsNm8Wwvp8WXw9/ZLc5O+MBqMXXLDiaLjpbLjA48 Hjtn3WX3uHy21KNvyypGj8+b5AJYorJtMlITU1KLFFLzkvNTMvPSbZW8g+Od403NDAx1DS0t zJUU8hJzU22VXHwCdN0yc4AOU1IoS8wpBQoFJBYXK+nb2RTll5akKmTkF5fYKqUWpOQUmBTo FSfmFpfmpevlpZZYGRoYGJkCFSZkZyyf/oO5oFOg4tPmtAbG5zxdjBwcEgImEjs+ZHUxcnEI CexhlNjdO48JwvnEKHHh6GlGCOcbo0Tr5vtADidYx/+vJ5ghEnsZJd50vWKHcL4yStye9ZkJ pIpNQFvi+rouVhBbREBYYn9HKwtIEbPAX0aJCS9/M4MkhAUiJTq/nWcCOYRFQFXixocIkDCv gJ3Et+ZFbBDb5CUW71gOVs4pYCtx5OMudogaQYmTM5+wgNjMQDXNW2eDXSQhMJVD4tCiG6wQ zS4Svy/0s0DYwhKvjm9hh7ClJD6/2wu1oFjiSM93VojmBkaJ6bevQhVZS/y7socF5DhmAU2J 9bv0IcKyElNPrWOCWMwn0fv7CRNEnFdixzwYW1Vi9aWHUHulJV43/IaKe0hMapsMDdMJjBK/ dk9lm8CoMAvJQ7OQPDQLYfUCRuZVjFKpBcW56anJpgWGunmp5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CrEm5JYWZValB9fVJqTWnyIUZqDRUmc99vr3hQhgfTE ktTs1NSC1CKYLBMHp1QDk/2XQ1t7d0ys4e54drc6WMB8ha1LzNzzdxIrMvZW9V1bt/eUwEqz N5u23JoaINDy8MF/AynJw0JMun/Pxxf1GO9KPPS9nuHOdn7ZxJuVZ6ds2CHf02l84KBr986A PdMbZibpzX/37CdrbEbfl/2R/rvEFhezBHTdfct5/XHZBqMTPM0pS5sLcmJ5v/5N0w3ZcK2r eYM8Y1yF1LHWwx+unG/12MzetEP7U7d2TBvHlPftdZ38pjwuuc9vrTu/adn6uPh3KivffJn9 /nPT+6QDcdIZU9rUcut91SJ0u9L557hdfq110KGZ5+rXhrXHi2+Iy/PtZeGPTDi9RefbHKmZ 6m+2+qR09BYXCWWuKlStVGIpzkg01GIuKk4EAA5fCGD/AgAA X-CMS-MailID: 20240103055746epcas5p148c2b06032e09956ddcfc72894abc82a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240103055746epcas5p148c2b06032e09956ddcfc72894abc82a References: <7967c7a9-3d17-44de-a170-2b5354460126@gmail.com> On 12/30/23 9:27 AM, Pavel Begunkov wrote: > Why it uses jiffies instead of some task run time? > Consequently, why it's fine to account irq time and other > preemption? (hint, it's not) > > Why it can't be done with userspace and/or bpf? Why > can't it be estimated by checking and tracking > IORING_SQ_NEED_WAKEUP in userspace? > > What's the use case in particular? Considering that > one of the previous revisions was uapi-less, something > is really fishy here. Again, it's a procfs file nobody > but a few would want to parse to use the feature. > > Why it just keeps aggregating stats for the whole > life time of the ring? If the workload changes, > that would either totally screw the stats or would make > it too inert to be useful. That's especially relevant > for long running (days) processes. There should be a > way to reset it so it starts counting anew. Hi, Jens and Pavel, I carefully read the questions you raised. First of all, as to why I use jiffies to statistics time, it is because I have done some performance tests and found that using jiffies has a relatively smaller loss of performance than using task run time. Of course, using task run time is indeed more accurate. But in fact, our requirements for accuracy are not particularly high, so after comprehensive consideration, we finally chose to use jiffies. Of course, if you think that a little more performance loss here has no impact, I can use task run time instead, but in this case, does the way of calculating sqpoll thread timeout also need to be changed, because it is also calculated through jiffies. Then there’s how to use this metric. We are studying some optimization methods for io-uring, including performance and CPU utilization, but we found that there is currently no tool that can observe the CPU ratio of sqthread's actual processing IO part, so we want to merge this method that can observe this value so that we can more easily observe the optimization effects. Best regards, -- Xiaobing Li