Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp854991rdb; Mon, 29 Jan 2024 23:52:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIMeDiKoriAioauzIn0SEb2HDMCa/sfaYTmFYgkrbDfpNa/1H/AwtgRClirxZKELiByEl9 X-Received: by 2002:a17:906:13d9:b0:a35:fdf9:e7e4 with SMTP id g25-20020a17090613d900b00a35fdf9e7e4mr1760862ejc.20.1706601168535; Mon, 29 Jan 2024 23:52:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706601168; cv=pass; d=google.com; s=arc-20160816; b=ux2N1tD7gtvOYC3yyaY23Zrv54lwqbo7tYgC2W8/I+an/u76elCbSm40ptV6dupajz VNzJGq5QGLfUyxYwgQj9doEYLCQ73KIyEVQPuSF6vbFpz85llyQHpVJmlSd/OmnjmwAX /I3U7JoelkBxdM9G3rHZ79eq0EXHktFRch9v8VhoGGYXgGfP7bc1nSbsufgt9IxTHnId AfZ8qAJcs9wCaHARST/vudjSZin1XAtvmkB+uUOgzp92HFny0c6a2K7l0IxoH17rccC6 EJGM2IHWbkPPpNR57+QMSmoW3WjyYcw+Vk322P629+4MsouW6FAxPjuxdeiWCq7TLVWG 2Wrg== 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=P8USmMDWyZvTuJQ5N9jjWEMwGP1hRVmRDjIvhJMCatw=; fh=aY7BzdyKm4Nm0M/uAtUmk2wfKPqEr2Dp62eUaXsSvjg=; b=oDiX2n+BxhTkaSr/OsCQaLzCWMF1sYrTWOF3nJGWRLze+ebBfYSAZQ+qXaQhJvrDz3 Vh1Ka6rPxEy8O3Wzg4ZBo+2IAYeGVnvDgrJhlpj0LmnO62dD+DZzYK6FcOEATyQzFLvh VMEbYu7GVsGlxp+rb1X8ZpNYYTMArkovoG9PaIy79KQaTgnMXBW+cKsHXXBxQfkX8Vyi cFyihUj0Mmk8JbtVa/FFdOqkUtGK+ifkadSAFQ4+UnXGtiMZUz77RxCzEuUCUQEaL5D6 8ciEAJ9Z1ZTNz6H1O0DjRAtmID5iMDitvuW/AsXcQJvUMAhHGE/Lx22i/2F+/HbzeHnB u2xg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=cPvp6T35; 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-44074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44074-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ha23-20020a170906a89700b00a34aa06caa3si4075054ejb.444.2024.01.29.23.52.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 23:52:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=cPvp6T35; 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-44074-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44074-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0E87E1F265B0 for ; Tue, 30 Jan 2024 07:52:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD9E053E3A; Tue, 30 Jan 2024 07:52:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="cPvp6T35" 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 BA0A853E13 for ; Tue, 30 Jan 2024 07:52:36 +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=1706601159; cv=none; b=J/KMcepf/jeUzbCOGVw+yUjgSBTdAI8+grqeW3byXHafea5uTKsUid/9kQ+aLBod20JVbLHAy31u6VwO9PY9Nw3CuVV2Ap7r/TYgl/au4SZv/T5MEk1qM0XoQHpdH9qhpKqY+Zep+y5Wv2k9Rsp+yu5mlm74lxOCLWDpkH3v5G0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706601159; c=relaxed/simple; bh=0Q+E6kRva+/RjLoYooYJxbptgewzdyZaRx/rMpCfyB4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=MXorRvhKOiHAfvEwu9ktOkxYWoJTQegmAep/CDcyA6y0i2U3jVAsgVbK9Uq63dBcPMtU/9O6mfrBRXaP0BWmEGWTed98IYPsmLGx9V6tH+ls5Ng4WZWJ2PXSxwdMmii8OeDsG8ngmgIXeLgrQ1DMtaVuxWo/CIeg5ezk5tTmnHs= 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=cPvp6T35; 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 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240130075229epoutp038070ee24f4a3f2a08ced65cf895a8f54~vELQJBp9c3152131521epoutp03L for ; Tue, 30 Jan 2024 07:52:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240130075229epoutp038070ee24f4a3f2a08ced65cf895a8f54~vELQJBp9c3152131521epoutp03L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1706601149; bh=P8USmMDWyZvTuJQ5N9jjWEMwGP1hRVmRDjIvhJMCatw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cPvp6T35AtjuRSyF4l7XkLaygaChKUbKPgEd01ZwcsZb6QCzGZQTspKzNU86EB/qz 9kPKNGfwddyHifheG9h/LZi8c1EBsC1UC/BQwGtth0Cd6xDN8Gqdv1aMuSBfwILE82 xc2DW1AzWghEbefqAhC7g5VRYuXewRyZjBfqaVs8= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20240130075228epcas5p3d6c6e139979785c598a847fe7db7ebd4~vELPrLviF0783407834epcas5p3f; Tue, 30 Jan 2024 07:52:28 +0000 (GMT) Received: from epsmgec5p1-new.samsung.com (unknown [182.195.38.174]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4TPHSq04fnz4x9QB; Tue, 30 Jan 2024 07:52:27 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmgec5p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id F9.F5.19369.ABAA8B56; Tue, 30 Jan 2024 16:52:26 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20240130070518epcas5p41bdf16f1e864c2590e2f39dac703febb~vDiDhRI_i3016030160epcas5p4c; Tue, 30 Jan 2024 07:05:18 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240130070518epsmtrp255c2f99de24ebab1df4c19c0e7f5ce9e~vDiDgSNIX0303903039epsmtrp2b; Tue, 30 Jan 2024 07:05:18 +0000 (GMT) X-AuditID: b6c32a50-c99ff70000004ba9-85-65b8aabaaba5 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 5D.CF.07368.DAF98B56; Tue, 30 Jan 2024 16:05:18 +0900 (KST) Received: from AHRE124.. (unknown [109.105.118.124]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240130070516epsmtip260674efe39a1fbb849e4e439a464a65d~vDiCSSr5r3157231572epsmtip2Q; Tue, 30 Jan 2024 07:05:16 +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: Tue, 30 Jan 2024 14:57:06 +0800 Message-Id: <20240130065706.423175-1-xiaobing.li@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: 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+NgFlrCJsWRmVeSWpSXmKPExsWy7bCmpu6uVTtSDU4cNreYs2obo8Xqu/1s Fu9az7FYHP3/ls3iV/ddRoutX76yWlzeNYfN4tleTosvh7+zW5yd8IHVYuqWHUwWHS2XGR14 PHbOusvucflsqUffllWMHp83yQWwRGXbZKQmpqQWKaTmJeenZOal2yp5B8c7x5uaGRjqGlpa mCsp5CXmptoqufgE6Lpl5gAdpqRQlphTChQKSCwuVtK3synKLy1JVcjILy6xVUotSMkpMCnQ K07MLS7NS9fLSy2xMjQwMDIFKkzIzrh68zpTwV3Bis+HrrI0MB7k7WLk5JAQMJG4+vosSxcj F4eQwB5Gids7vzBCOJ8YJTY+nc4GUiUk8I1R4vM2eZiOBUsfM0EU7WWUWLHnBCuE85JR4t/H WawgVWwC2hLX13WB2SICwhL7O1rBdjAL/GWUmPDyNzNIQlggUmLBxxlgK1gEVCXaz3YA2Rwc vAK2Ek/uhkJsk5fYf/AsWDknUPjnw1YmEJtXQFDi5MwnLCA2M1BN89bZzCDzJQQ6OSTufL3I AtHsInHy/Ct2CFtY4tXxLVC2lMTnd3vZIOxiiSM931khmhsYJabfvgpVZC3x78oeFpCDmAU0 Jdbv0ocIy0pMPbWOCWIxn0Tv7ydMEHFeiR3zYGxVidWXHkLdIC3xuuE3VNxDomniW2ZIaE1g lDjVc5F9AqPCLCQPzULy0CyE1QsYmVcxSqUWFOempyabFhjq5qWWw+M5OT93EyM4uWoF7GBc veGv3iFGJg7GQ4wSHMxKIrw/NbemCvGmJFZWpRblxxeV5qQWH2I0BYb4RGYp0eR8YHrPK4k3 NLE0MDEzMzOxNDYzVBLnfd06N0VIID2xJDU7NbUgtQimj4mDU6qBSShgl474hF1brG8dLPi2 RjYn5Hat26+e3duOv43Y2qaQ+yPa/mr0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uem31FPXWPFb8En4eKueaW4eMOudXMOFFvHzoj7qNDif5b37tuc +2mvmT12ZXuK1qle3ztzF4/l3CT2Kas19G9V39DefPFoZfo0PlHHFbtcrBQyZHZdCZs+I33p leXvf95Q3xZ++FmfMmvHktrNy+9uOtS47OYnd9nXH60vTk7Um96wcc6PDElj4yx3j8+ikVOf nwtgCFNiKc5INNRiLipOBACdratk6QIAAA== X-CMS-MailID: 20240130070518epcas5p41bdf16f1e864c2590e2f39dac703febb 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: 20240130070518epcas5p41bdf16f1e864c2590e2f39dac703febb References: On 1/29/24 14:00, Jens Axboe wrote: >On 1/29/24 12:18 AM, 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. >> 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? > >I don't think it's a great interface, but at the same time, I don't feel >that strongly about it and perhaps bundling a script that outputs the >above in liburing would be Good Enough. I'm a bit reluctant to add a >stats API via io_uring_register() just for this. > >So maybe spin a v8 with the s/long long/u64 change and include your >script as well? ok, I'll send out a v8. -- Xiaobing Li