From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (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 2FC8A56B71 for ; Tue, 30 Jan 2024 07:52:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706601155; cv=none; b=LHHFyrSr1BnTWWaacww/btTG7pyWc5eTSn5I0npDq66wHgd4EbKBWFaaBH0+V4LVrioZX42osm4OX/EgJbRrsIWEAPYZfEyPk94RN0/lr2SlcEkiklyZ9GufX93FecLVkB4r8LUwopucLS5XWxttQiT8fy1Id1QpOMDm9eJoxTs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706601155; c=relaxed/simple; bh=pb/LnA0yM9eURb/c2PSjDZQPoCZrE6NsMFcH1GbD9Bo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=EAcjZk+TA0oDghwREnxx4mACOVX8PQPlXYhK6RopJ3lOqH5+KJfMdE9qjvEBSnreB5zSFUWBkTLLok/wsh/CHOWfSXoSJ2UPTBc1YrQzqDHyFa8VjxaSmy0UvQEKL1GBVdrJNaWjMbF8iuzwinU+YUYzf8aedYo1UXFq3oGzFUA= 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=AE8VCBBn; arc=none smtp.client-ip=203.254.224.25 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="AE8VCBBn" Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20240130075225epoutp026d047b2e128c18c5257179d1ab03a61a~vELMRJ37i1163311633epoutp02Y for ; Tue, 30 Jan 2024 07:52:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20240130075225epoutp026d047b2e128c18c5257179d1ab03a61a~vELMRJ37i1163311633epoutp02Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1706601145; bh=4GusHRVSl/jPvRw8MbBdoLjJ+enCGbBslEdWi0taXsE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AE8VCBBnaISokPMzZcplUb+LVI/SgK4DiA1ISBZ1FQffyeWaCWoyhuXxdSgDy6KaO N3J7F4emTp5i9QDkE9HbQPCvlCRuNyczwf33ffiLbaWaa5etKDVnzlh6xSQlEBujZr iKn94s5o+NhohiHeCr3sj6M1MILx+LD2OVByqJTo= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20240130075224epcas5p1a99b7f76986370fb610abf88792969c8~vELL12u3n1098810988epcas5p12; Tue, 30 Jan 2024 07:52:24 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.182]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4TPHSk5XDGz4x9Q3; Tue, 30 Jan 2024 07:52:22 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 03.6F.10009.6BAA8B56; Tue, 30 Jan 2024 16:52:22 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20240130055554epcas5p2ad9d28f1e6c256db540ce985c4351461~vCld8z7hm2990729907epcas5p24; Tue, 30 Jan 2024 05:55:54 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240130055554epsmtrp28e51d871603fc187bd3212b2bbf72b87~vCld75MH_2750927509epsmtrp2j; Tue, 30 Jan 2024 05:55:54 +0000 (GMT) X-AuditID: b6c32a4a-261fd70000002719-27-65b8aab6cfd0 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 6B.3B.18939.A6F88B56; Tue, 30 Jan 2024 14:55:54 +0900 (KST) Received: from AHRE124.. (unknown [109.105.118.124]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240130055553epsmtip268f856ca6e9327b68145bb173a734122~vClcpXhPU3025130251epsmtip21; Tue, 30 Jan 2024 05:55:52 +0000 (GMT) From: Xiaobing Li To: asml.silence@gmail.com Cc: axboe@kernel.dk, 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: Tue, 30 Jan 2024 13:47:42 +0800 Message-Id: <20240130054742.417610-1-xiaobing.li@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <3044a700-252c-4e87-a0cf-a1fec6e83f8f@gmail.com> 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+NgFlrAJsWRmVeSWpSXmKPExsWy7bCmlu62VTtSDXp3aFnMWbWN0WL13X42 i3et51gsjv5/y2bxq/suo8XWL19ZLS7vmsNm8Wwvp8WXw9/ZLc5O+MBqMXXLDiaLjpbLjA48 Hjtn3WX3uH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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: 20240130055554epcas5p2ad9d28f1e6c256db540ce985c4351461 References: <3044a700-252c-4e87-a0cf-a1fec6e83f8f@gmail.com> On 1/29/24 15:01, Pavel Begunkov wrote: >On 1/29/24 07:18, Xiaobing Li wrote: >> 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. > >I wouldn't mind if it's fdinfo only for now, that can be changed later >if needed. I'm more concerned that reading fdinfo and then parsing it >is incompatible with the word performance, which you mentioned in the >context of using 1 vs 2 syscalls to get the stats. > >That can be left to be resolved later, however. Let's just be clear >in docs that stats could be 0, which means the feature is not >working/disabled. > >Another question I raised in my reply (v6 thread), why it's using >ktime_get(), which same as jiffies but more precise, instead of a >task time? Sorry, I forgot to reply to you. I was thinking wrong. you are right, we can use "getrusage" to statistics the work_time of sqpoll in the ring. > > >> If you think it is troublesome to obtain the PID, then I can provide > >I missed the context, where do we need to know PIDs? Since obtaining the fdinfo content of sqpoll requires finding the corresponding PID first, I guess Jens thinks it is troublesome to manually obtain the PID of each sqpoll thread when there are many sqpoll threads. Therefore, I want to write a script that can automatically output all sqpoll statistics. -- Xiaobing Li