From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (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 9C0F73C460 for ; Mon, 29 Jan 2024 07:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706513239; cv=none; b=c4mnz3z9ffAtSIOiFvZjb3jl5W0Z/ySaph+/F8qkCD8vL+EtuH59ViRBUFYke0olhcGdbPPUvkhV+l+ZtDMkxUx1GPGyxSGxt3KjSqPM5ctlcID6X+uvYdfwMTef5cLXwTc8e7r/40gvrme/kr6VHGHH6jVm9pXojw+CUXxXyzw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706513239; c=relaxed/simple; bh=UQg/5njUp9OZkRWZYCC4RzpOoedARfKxs5rcJ9UqsdE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=lMluimo7Gh/Lh5a8zGN5qGnIWdCZ9eojPgS+hvU6DGWX8p7dll32Xeb3FmTE+VIIUzNkhsr0x7HWvrlAEu0/lhXN2iH5xPqdGBw8t6Mc8rW0i4fPufhVq1EXAOcfI52pqnfUjZN3Ri9enAHKyclVDdpMvvTgg9glEQxzPydEuR0= 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.33 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="E9vIl4BU" Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240129072709epoutp03d8bb90a0509b7aa890ed1fd89ec9fa0e~uwL2S6_-F1535815358epoutp03K for ; Mon, 29 Jan 2024 07:27:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240129072709epoutp03d8bb90a0509b7aa890ed1fd89ec9fa0e~uwL2S6_-F1535815358epoutp03K 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: io-uring@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/sF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 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?