Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp857195rdb; Mon, 29 Jan 2024 23:59:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzPZpvy4FtLoImT7lIhtyxZCsxGdcAjj6CaVzaLd6zCRV5POJfec7y0Psb9HzSWDMWyM/B X-Received: by 2002:a05:622a:228f:b0:42a:b80d:5068 with SMTP id ay15-20020a05622a228f00b0042ab80d5068mr653031qtb.77.1706601584375; Mon, 29 Jan 2024 23:59:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706601584; cv=pass; d=google.com; s=arc-20160816; b=uC1+lHvSDmih3rQQwU2yuSz/yn0dDj8Oz1Br+kbh/VquqS2HnCzirGF7FnFJQWoiF0 kwsReWZ4zKyS/+6lEnhUx33iJJiTf/GYCaDzoIzG3p9DtHacCyTUm7AshyZLNDHJPMKF Vu7kCLW4PFKrSH5O67TrikzSGuh2q8R6Wepxl7QPTiTD1MTAd+6bzcgRj+egFb7TAhtu QrgmtNHtfdRA807IakTr1WTV+WNZBKjpIxzaueO7OW3rkXYfxGqtt9bahtGeZmbD7n+d lqM4wvLdig2TLeRYgGRGSiFTRNQYyIcFC0mrl3aG6/bpipnI4JWlS6mu48e6eODsvBmY l4Ow== 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=4GusHRVSl/jPvRw8MbBdoLjJ+enCGbBslEdWi0taXsE=; fh=yDu1PszRjYJq05bivgG70tzVvA4bV+eWqg092tdQutY=; b=fz7oXzlyivMKKZN0HJmBZ7zkn6oZq4pSCdHWcYP4bztKN7Fd2hyW7fX6hMSfPXoP/z Vfo20TNJLZh7qw4KW3rACNfNwVeXazlA7EMPhU97eUPFzZ0rG9z8YxhWUlVx4/1jAm1f zyc3PMDbx9G6NsZ+RRCsCgvQGInYiamMf64gUjcNdVbc1xbidS5VKx+BjufydbWOv90a LLqIJFsiygK32Ryq3ioog7Q9Rpk70Z+IDbwouh/powIA3I7+s0drcyy77MGg1SEyGFrZ WMflZG1lb90NiJ26TFYKOCfc3ay0ZpvqTAPWsyQA6ZidODf7Fw18WlsvIx+qfDbp4Rs/ 07xQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=AE8VCBBn; 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-44081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44081-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k22-20020ac85fd6000000b0042a32235cf5si2133918qta.44.2024.01.29.23.59.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 23:59:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=AE8VCBBn; 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-44081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44081-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 16C9C1C22FA6 for ; Tue, 30 Jan 2024 07:59:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2C1F5472A; Tue, 30 Jan 2024 07:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="AE8VCBBn" Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) (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 667AD54668 for ; Tue, 30 Jan 2024 07:59:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706601573; cv=none; b=cV+Lthy7JPjYbrAO7xOVNlqbzZHPLEWrofEzGZ7IvZsS4dcZBs4VZVvKMWj5KidHJRzqPcOLT6gw+SeBoLn6P+00WWknd8eJUNrb051tpbI+ck1fz8Wm7QkCv7k7j4iSIYyRJhWnq6Bh/1EPlubKAlKeF03msCr5UptwoEptpQY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706601573; c=relaxed/simple; bh=pb/LnA0yM9eURb/c2PSjDZQPoCZrE6NsMFcH1GbD9Bo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=PVFI+LyMcpr8s8B00J8jw1BbRpIQnKNWk4y0LmU3sr2hTk2x/4dsz+LtuwjHJqG6n+8dz45MxpJMYAV7bfGLijmTRYJdpnmNRgfPyJi2/v7xIoAxuLu2qYTvc789JIBNCcF8j3rBHFqzzqkSfObXyqOD2inCnO8k7No7yHAUc18= 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.24 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 mailout1.samsung.com (KnoxPortal) with ESMTP id 20240130075225epoutp01f85fd1129120053e7d80948525a5efd0~vELMRVJrt1107511075epoutp01W for ; Tue, 30 Jan 2024 07:52:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20240130075225epoutp01f85fd1129120053e7d80948525a5efd0~vELMRVJrt1107511075epoutp01W 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: linux-kernel@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 Hjtn3WX3uHy21KNvyypGj8+b5AJYorJtMlITU1KLFFLzkvNTMvPSbZW8g+Od403NDAx1DS0t zJUU8hJzU22VXHwCdN0yc4AOU1IoS8wpBQoFJBYXK+nb2RTll5akKmTkF5fYKqUWpOQUmBTo FSfmFpfmpevlpZZYGRoYGJkCFSZkZ7y+/Ja1oEm44ufumewNjM38XYwcHBICJhK7ujO6GDk5 hAR2M0qs++jYxcgFZH9ilDjYtp4Jznn6uI0FpAqk4eeLq4wQiZ2MEpNeHGaBcF4ySpzduwes ik1AW+L6ui5WkBUiAlISv+9ygNQwC3xjlHi/fg0zSI2wQKTEgo8z2EBsFgFViedfVoL18grY Ssw6eRVqm7zE/oNnmUHmcALFF98pgCgRlDg58wlYCTNQSfPW2cwg8yUE/rJLzL71lhmi10Wi c+ldVghbWOLV8S3sELaUxOd3e9kg7GKJIz3fWSGaGxglpt++ClVkLfHvCsgzHEAbNCXW79KH CMtKTD21jgliMZ9E7+8nTBBxXokd82BsVYnVlx5C3S8t8brhN1TcQ+Luq6dMkLCewCjxtTFz AqPCLCT/zELyzyyEzQsYmVcxSqYWFOempxabFhjlpZbD4zg5P3cTIzipanntYHz44IPeIUYm DsZDjBIczEoivD81t6YK8aYkVlalFuXHF5XmpBYfYjQFhvdEZinR5HxgWs8riTc0sTQwMTMz M7E0NjNUEud93To3RUggPbEkNTs1tSC1CKaPiYNTqoHJav1yBwVp06ONNmsCfpRbrtnldcrU o3+2pXHg87MTrllYBCZdcKz2TNaY1jMtc1eTnVKN/ZnZpwO4si5oix3ePauLWXPWz/Ifbo4X z6XzFtlsMpms/XLeYu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01 lrmO6nHxl7dqHup4vKVwmtZbTVYjA4+qyK2tvy8xNSawaJXM38XEtETPxKtG5piq5jt1vdSs CJ+bBbfmzpY4fI5va8VHwz9KG5yF1Y907tpxxX6TwqNTSd8MnrftmSbHOcVvnfZOVq+MdCWW 4oxEQy3mouJEAI9lcAXmAgAA X-CMS-MailID: 20240130055554epcas5p2ad9d28f1e6c256db540ce985c4351461 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: 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