Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp229117rdb; Sun, 28 Jan 2024 23:27:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtPlMEAeJoWmD3HzYnnX+hLD5m99F1byaxBymFMEoouDIGy/l3vDWAD9En1cssZtYuiVV8 X-Received: by 2002:a05:6a20:7a81:b0:19c:b46c:a972 with SMTP id u1-20020a056a207a8100b0019cb46ca972mr83784pzh.44.1706513273782; Sun, 28 Jan 2024 23:27:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706513273; cv=pass; d=google.com; s=arc-20160816; b=sbag74aSLBhtQ+lVeKXs1o9K0wBTveGCMzwB9u8UtJV5eRMtR6GoWYnMQl0tqookCE U8/4vOIhrqvbIKXD29hmLPIYg15Vx1B4VAdfiiphoictEF5pDQ9Vk6MGvC9U0JtP6ZVk sT6jKccynmemx37pv1xYftJfxmpI2Qpch1supVQfDjhuNg+OCvm3zePK5kme2dlOqefU 7XuP7QneUCtXkyXC0T3NrNXVlNvnBQTTgAqY9puN1XDY1cMmt0e2zN4FCuR0lkJzCHqN BDVfYeu/shphZPEzZ2P+bnmNLkVu5CPZlEbURc2UqK9y7ssTIXO3BAajBLVy1fXX880i qKAw== ARC-Message-Signature: i=2; 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=SlQ1IskImIa1p6m1vQ2rqgCrN2OhcIVK0Fav7DA6fWY=; fh=aY7BzdyKm4Nm0M/uAtUmk2wfKPqEr2Dp62eUaXsSvjg=; b=NmzyIGB5t7Z523EZy+kMq5aII54z3RNRbiGEy5xClKzGuwGVpLW672hrbtrnHTXhct +bKpqvl57QAi6Y661z1dMc2LsvJD07wQC3CgsV7tVBXpo5q1wQiF/PzI+W7WYmlFF+43 HN5hNxcoTIgSGyfEZoKYyNa7+t42QVkoLzb2zyTkrD4z5c/nUExyoHTE/DGvz2EksA3/ S+18/sTQSdKd7z1ZAvQCvwj4e2hi1K6/wA73Ug0yXi3KPPzjShqMJ/WaGvfm9uXWyqiJ q0nC8ta2J74+jnkShtW1fOAYKd2VcprczToWIzEetaBPllfc6L3T3qqRlSKquVuKgTJl C5QA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=E9vIl4BU; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-42281-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42281-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k2-20020a170902c40200b001d3c375bff6si5332062plk.534.2024.01.28.23.27.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 23:27:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42281-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=E9vIl4BU; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-42281-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42281-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 11E82282D21 for ; Mon, 29 Jan 2024 07:27:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F7334E1DF; Mon, 29 Jan 2024 07:27:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="E9vIl4BU" 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 AEECE4D5AC for ; Mon, 29 Jan 2024 07:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706513240; cv=none; b=l7Hn2RE6QhwRjbsaCZ+tmmj28ln6M8lzmX8dMao62w14E//CxHi80eup87lahBxkk/Gn6eRrEVHNMYIc2/GyzvFB/nbqViMZ0AT+ve7QuV9hkYW/uXZT9NIEXCtplhZRWnWgZSEO4kfB6E3U4Z95aPgLBCU/3Er4gUosopMcTaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706513240; c=relaxed/simple; bh=UQg/5njUp9OZkRWZYCC4RzpOoedARfKxs5rcJ9UqsdE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=EhBs3UatUGWeHVZwWhhrnl2KcxMfz84prHMeKoy3x4wGjbzGFIwVGkWuSIHqVUaBqdFpceD+Il3L7ZcZYU7N7vptTfj1vMhNQYn6kBxAkJ205OAYKcbF7T+c/hvr1l4Z1AtFM/KaY102fkYemdyZm1e70eItLSS0ZbH84YzEc3U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=E9vIl4BU; arc=none smtp.client-ip=203.254.224.34 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 epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240129072709epoutp04367ef4ec9318bc22502dab49212fe3b2~uwL2S2Vj11997119971epoutp04A for ; Mon, 29 Jan 2024 07:27:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240129072709epoutp04367ef4ec9318bc22502dab49212fe3b2~uwL2S2Vj11997119971epoutp04A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1706513229; bh=SlQ1IskImIa1p6m1vQ2rqgCrN2OhcIVK0Fav7DA6fWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E9vIl4BU/B0LE37zwdoxwMvznp5XhTPdEtVvBHEhQa/M9HzTprBRXnbP/gH3PAvpr bFnnJtaMfGQIlVpWAyJ6OMMDCkYFlE0dwOkIUal3VV7WmQ7PgR9lTkOhjvQ2sEwQ44 UTEIIILDLAibQIxJpmea+bAgIIGOqS6ZdJoh5smU= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20240129072708epcas5p22bcc24d03a515c53b530109181280576~uwL15IV6v1618316183epcas5p2c; Mon, 29 Jan 2024 07:27:08 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.176]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4TNfy252S4z4x9Q9; Mon, 29 Jan 2024 07:27:06 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 75.11.09672.94357B56; Mon, 29 Jan 2024 16:27:05 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20240129072655epcas5p35d140dba2234e1658b7aa40770b93314~uwLpaXhW72948229482epcas5p3J; Mon, 29 Jan 2024 07:26:55 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240129072655epsmtrp2f78420a682b8202b3027a39fbfefe833~uwLpZjuDb0907209072epsmtrp2E; Mon, 29 Jan 2024 07:26:55 +0000 (GMT) X-AuditID: b6c32a4b-39fff700000025c8-01-65b75349d03c Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 8C.E4.18939.F3357B56; Mon, 29 Jan 2024 16:26:55 +0900 (KST) Received: from AHRE124.. (unknown [109.105.118.124]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240129072654epsmtip2bb7a2b9f5aa86d3d4f891e5c5ecf9a1c~uwLoH6Q1u0936709367epsmtip2_; Mon, 29 Jan 2024 07:26:53 +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 v7] io_uring: Statistics of the true utilization of sq threads. Date: Mon, 29 Jan 2024 15:18:44 +0800 Message-Id: <20240129071844.317225-1-xiaobing.li@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <8e104175-7388-4930-b6a2-405fb9143a2d@kernel.dk> 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+NgFlrKJsWRmVeSWpSXmKPExsWy7bCmpq5n8PZUgyX75S3mrNrGaLH6bj+b xbvWcywWR/+/ZbP41X2X0WLrl6+sFpd3zWGzeLaX0+LL4e/sFmcnfGC1mLplB5NFR8tlRgce j52z7rJ7XD5b6tG3ZRWjx+dNcgEsUdk2GamJKalFCql5yfkpmXnptkrewfHO8aZmBoa6hpYW 5koKeYm5qbZKLj4Bum6ZOUCHKSmUJeaUAoUCEouLlfTtbIryS0tSFTLyi0tslVILUnIKTAr0 ihNzi0vz0vXyUkusDA0MjEyBChOyM84tusxc0Mhbcaj5M1MD4xvOLkZODgkBE4lnv7tZuxi5 OIQEdjNKTJ/+FMr5xCjROP0VgjOx5z8TTEvb9H4miMRORonm+6/ZIZyXjBI/GvewglSxCWhL XF/XBWaLCAhL7O9oZQEpYhb4yygx4eVvZpCEsECkxIKPM9hAbBYBVYkd59+ygNi8ArYSh/tO s0Ksk5fYf/AsWD0nUPzojelsEDWCEidnPgGrZwaqad46mxlkgYTAX3aJtpOr2SCaXSSuL1/L DmELS7w6vgXKlpL4/G4vVE2xxJGe76wQzQ3AILh9FarIWuLflT1AGziANmhKrN+lDxGWlZh6 ah0TxGI+id7fT6DhwiuxYx6MrSqx+tJDFghbWuJ1w2+ouIfEudYbzJDgmgAMrtZ1jBMYFWYh eWgWkodmIaxewMi8ilEytaA4Nz212LTAOC+1HB7Ryfm5mxjB6VXLewfjowcf9A4xMnEwHmKU 4GBWEuH9qbk1VYg3JbGyKrUoP76oNCe1+BCjKTDEJzJLiSbnAxN8Xkm8oYmlgYmZmZmJpbGZ oZI47+vWuSlCAumJJanZqakFqUUwfUwcnFINTMpX1Zb3TeCY9nU/i8iCl02/q4/vW/u+5bDB VbNVjBf/XeNb2OzuYWM6VbHYY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s/1l0HLn+1Nd1+EZWZLvqg9qXZo3sSJW4QnRiRf0e9I+Xms48XepXVi uzkFi6Ny37hN/Px3fXTb1c1x29vNJ1atOKTuMWmROGv/vspF/w0s2n/t/Rxte2LCFtauK1sF DogwCmkvS5HnfHekLCNsDcuGmovxrvPWCIfsjax/5e2b7/PpOMdFxoi592dsuOxuErNTiaU4 I9FQi7moOBEA8AX/zecCAAA= X-CMS-MailID: 20240129072655epcas5p35d140dba2234e1658b7aa40770b93314 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: 20240129072655epcas5p35d140dba2234e1658b7aa40770b93314 References: <8e104175-7388-4930-b6a2-405fb9143a2d@kernel.dk> On 1/18/24 19:34, Jens Axboe wrote: >> diff --git a/io_uring/sqpoll.h b/io_uring/sqpoll.h >> index 8df37e8c9149..c14c00240443 100644 >> --- a/io_uring/sqpoll.h >> +++ b/io_uring/sqpoll.h >> @@ -16,6 +16,7 @@ struct io_sq_data { >> pid_t task_pid; >> pid_t task_tgid; >> >> + long long work_time; >> unsigned long state; >> struct completion exited; >> }; > >Probably just make that an u64. > >As Pavel mentioned, I think we really need to consider if fdinfo is the >appropriate API for this. It's fine if you're running stuff directly and >you're just curious, but it's a very cumbersome API in general as you >need to know the pid of the task holding the ring, the fd of the ring, >and then you can get it as a textual description. If this is something >that is deemed useful, would it not make more sense to make it >programatically available in addition, or even exclusively? Hi, Jens and Pavel sorry for the late reply. I've tried some other methods, but overall, I haven't found a more suitable method than fdinfo. If you think it is troublesome to obtain the PID, then I can provide a shell script to output the total_time and work_time of all sqpoll threads to the terminal, so that we do not have to manually obtain the PID of each thread (the script can be placed in tools/ include/io_uring). eg: PID WorkTime(us) TotalTime(us) COMMAND 9330 1106578 2215321 iou-sqp-9329 9454 1510658 1715321 iou-sqp-9453 9478 165785 223219 iou-sqp-9477 9587 106578 153217 iou-sqp-9586 What do you think of this solution?