Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3416187rdh; Thu, 28 Sep 2023 10:55:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG818mAPoigjIBjOpQZ2WIhklZak0yDob5C2/S+Xx87Szg+FyjPeazTditWrqa+pF1Mr27v X-Received: by 2002:a05:6870:a706:b0:196:45b7:9385 with SMTP id g6-20020a056870a70600b0019645b79385mr2114578oam.27.1695923721433; Thu, 28 Sep 2023 10:55:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695923721; cv=none; d=google.com; s=arc-20160816; b=WiGpp+OSzYQlqz0SkDUamp31JZ6zCntp6rvA+NEMdOWrz1F0b9Um3Z8p1m+QkrSseA EIkcdN2O7otPLU6Jpl+2F5XFuSf2HyZRVeR1FyLOeL8aTmTXu6vrcWBcWt0m2rELdWz6 e91uZCPj2Yipw14ZlvyMdqm67LhbneYkSIm4t8YDO1xc1C0h54YMPNTwAS0EmOhSdqEg viKlqHTHxEBO2wIqYLIWPA+R2c7/2WffYLHbBKvikKPAo2aQY7L269p6rM6FcMg11GMf sRRDizz5IyVr1Mr9y1Tth0+Mw3mSGaq4bY5O17WADsW2xssaHwbOgYGxMNW0EYYSPl2y d0tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=epK406pCE7G22GM7XcjJWrCLpMcnL+S7vFi36SuHG2w=; fh=Sun7qd3QMmR2Sdo9TBDlilMEiof+EF/2J41jrCB1sXw=; b=PgiBHXvGoOKDhiJr7jn4RBB7cpg2FeUD6ELYw9UBzAYBtKBeDWcHLU8SWMbuiXOTBP NNd+vEBsNWyja+Dxj97vPW0HI1lKZQPlfcCn+2kykbZsvcuIxnJs4A9a0c+ycs23H5x2 3MyRNL/R0Fa2h+8Ypql/RDwWt7JwV/fB1TFxxt0IDW78CfJikUZ/xyXUUDjb1JNWyv4B a/UzvazfOcA5I5H8uuQpwXkA7PRpuYv3bBgPaghclTEiyMs6BBw12Vb2NfM9LI7SbB1d 4XepJykcfLS5jOvlW6r+1BiwUZuQuO6tIv269gu2OdN4prLqnKErs7/sMm4S0G8LABWw MV2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=JdnlsHje; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id k8-20020a633d08000000b00584d292d519si7953741pga.386.2023.09.28.10.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 10:55:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=JdnlsHje; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5838E809078A; Thu, 28 Sep 2023 01:41:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231327AbjI1Ila (ORCPT + 99 others); Thu, 28 Sep 2023 04:41:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229605AbjI1Il2 (ORCPT ); Thu, 28 Sep 2023 04:41:28 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34B67AC for ; Thu, 28 Sep 2023 01:41:24 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9b27f99a356so203593466b.0 for ; Thu, 28 Sep 2023 01:41:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1695890482; x=1696495282; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=epK406pCE7G22GM7XcjJWrCLpMcnL+S7vFi36SuHG2w=; b=JdnlsHjeM84fyU7LBVo1hrrEENLtQRb1iESeqysPZzyZDxIN8vqMxeEwK2QvI8Wwmf 9RMwTOsBCxUgrWGCgXIRcuCJCFwXZMnyTjL6SRwHRgRpbvOZd2V29OMyhqq8GMV8410B YTGPfI6nmhAu6Fu8id9CZ4mNqJ02Am7GvlVCLLeXiuNWzEgTqRkFmzIdIEwJ+QmWD7fp nX0PWB1Z7tslUCj1eri9ioY+s7k8awAfv7Blsr2Hl+rwlobRnwrsNoPIkDRQGbv/dvDR vXey8Qo4a48rQq4j2RQjMnUpMrAtIRdtB7XEZiYY4dLN0UOrBsiodt4P/8wU59xc5/W9 eaPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695890482; x=1696495282; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=epK406pCE7G22GM7XcjJWrCLpMcnL+S7vFi36SuHG2w=; b=bi2lkFcELIUdz6t/Mm+u9C1YfGgs13ijsm7ZOqqJtIxzVBuPgqRq82LxIINHDBypct wkqKKO6iGCl+tJ50Kh2ei+qFmwmRDM0Z38aU/42lSv8BtkR2piAwr6++szvXo6E1Ctym HXZcy9gcSpiEt29Oi143lykkzdL54l8Dnya47vFtKVhjK1Xiy3az21HIBpG6nhvhh18+ TfwNf/9SZw2mcBhhX/wf3Ozs9IAywuKTzqsDMkHYdZNwUgsJHo16gzqrbnyscM45QA6L 32VDzLTKkBPmQYht6Yj11m7JFfw1KWyghYbuLvwifsXAKYwGbq/SkDsC4kBY+vPzKc3P GRQA== X-Gm-Message-State: AOJu0Yzgqr/gP8YdV0AcATQcBmIPr+oBhP5J29eSafB8nRK4eJN4s0rw W6mk+82nzt0dgOIomXQmS/gTEA== X-Received: by 2002:a17:906:105d:b0:9ae:5868:c8c9 with SMTP id j29-20020a170906105d00b009ae5868c8c9mr543149ejj.0.1695890482606; Thu, 28 Sep 2023 01:41:22 -0700 (PDT) Received: from [172.20.13.88] ([45.147.210.162]) by smtp.gmail.com with ESMTPSA id y16-20020a1709064b1000b0099b7276235esm10595662eju.93.2023.09.28.01.41.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Sep 2023 01:41:21 -0700 (PDT) Message-ID: <29553ecc-3e5e-4c03-8dd0-0ea6fe88c32f@kernel.dk> Date: Thu, 28 Sep 2023 02:41:20 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] IO_URING: Statistics of the true utilization of sq threads. Content-Language: en-US To: Matthew Wilcox , Peter Zijlstra Cc: Xiaobing Li , mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, asml.silence@gmail.com, linux-kernel@vger.kernel.org, linux-fsdevel@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 References: <20230928022228.15770-1-xiaobing.li@samsung.com> <20230928022228.15770-4-xiaobing.li@samsung.com> <20230928080114.GC9829@noisy.programming.kicks-ass.net> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 28 Sep 2023 01:41:38 -0700 (PDT) On 9/28/23 2:37 AM, Matthew Wilcox wrote: > On Thu, Sep 28, 2023 at 10:01:14AM +0200, Peter Zijlstra wrote: >> Now, I see what you're trying to do, but who actually uses this data? > > I ... don't. There seems to be the notion that since we're polling, that > shouldn't count against the runtime of the thread. But the thread has > chosen to poll! It is doing something! For one thing, it's preventing > the CPU from entering an idle state. It seems absolutely fair to > accuont this poll time to the runtime of the thread. Clearly i'm > missing something. For sure, it should be accounted as CPU time, as it is exactly that. You could argue that if we needed to preempt this task for something else we would do that (and the code does check that on every loop), but it's still using CPU. I can see maybe wanting to know how much of the total time the thread spent doing ACTUAL work rather than just polling for new work, but that's not really something the scheduler should be involved in and should be purely an io_uring sqpoll stat of some sort if that is truly interesting for an application. -- Jens Axboe