Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp479214rwl; Thu, 30 Mar 2023 20:05:20 -0700 (PDT) X-Google-Smtp-Source: AKy350YEVFeOq2IvtTYMK73uzUMIWsJca4FnZhKpckPABg5oUmcme+dnDfmz28sI2VW8TGa+zGvq X-Received: by 2002:a05:6402:524e:b0:4fd:298d:4f26 with SMTP id t14-20020a056402524e00b004fd298d4f26mr4129175edd.3.1680231920249; Thu, 30 Mar 2023 20:05:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680231920; cv=none; d=google.com; s=arc-20160816; b=iOzyjuLmUqcDv+xmlnj6BBpzUf7JzwBJOQXYsQii7eM1hCGc8YE8bDwnzO7pa5sncb WXPE7Wrr6E2NJahLFMXM/0cK7pj8s4Qj8ad7AhiYXApfdFBpbqP/kBbGwEZfuM9qQlPf d5xC+br5aU61fK1GfvhX6nd+qyyE/JPBWFl5VvXDraQjBavC8RDB6zZKWKF7I6Pvwtef 4bKCdx8k6bkbkqmy45+4ukCRSrlhCZeSLeCiQZ2oHR/nMDcwO0sLJae7hmz0ONiWrxKX LL7pB2R4sJlOVZxRzssjbRf/fsR64aPPurZ64CLwoylDsnLWxR+wwjiSL0oKyCExCfEd SRfw== 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:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=AMrP2Zp/EKlqbziL+FgCOqPjH/auJOar/Bw7xvN0IJw=; b=dj2z8BWDiWYWboXFQsMmOe7ZBPXgErIDYF9gJagFxQmjUbNvMsVF9gKWsj0neSCWRy G+jJe4+zg6Jk/SFDMlE3oUE3xAPxWl1wEIzVreWtvmJTfQNvwW3Oe4JNGdq6S7nDULsK 4lSctrCyxY9ZlZKuUXrOvqDgAzzpBd7oisqeWIZVBWnAU3uQ20GDk1NgcPO/NF2hrEfo 9UHiiz3vS9Yx9u6wVgxMi2d0+7zewBK7vW3n5j7oBfaJj9RhmmZNC6s0HAjqoK1n+xPA 6YSontCMFy2BjtNt/vLw/TbFQDTA/9djH/PHurY2p9Drxl31vNacArQzVBXnsbJzcron VP0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=gFLNd4ej; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y21-20020aa7ccd5000000b00502032de9a7si1094387edt.181.2023.03.30.20.04.55; Thu, 30 Mar 2023 20:05:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=gFLNd4ej; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbjCaDAp (ORCPT + 99 others); Thu, 30 Mar 2023 23:00:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjCaDAo (ORCPT ); Thu, 30 Mar 2023 23:00:44 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 143501207F for ; Thu, 30 Mar 2023 20:00:40 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id l7so19116204pjg.5 for ; Thu, 30 Mar 2023 20:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1680231639; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=AMrP2Zp/EKlqbziL+FgCOqPjH/auJOar/Bw7xvN0IJw=; b=gFLNd4ejWBxSDzU4aEgXUTu5XK7W5N8DYIf8y981jAiIl1PPhf0gQNwn/L7fY8o8Md GzCyVbfJEEy/JWxGYXiht+V4N/+fmTClBVFIuAb6szfd5tNfLkYBw1YNTx2czLm2sI/4 LcWKYMZvb5xYSRjGmgeCQ85FAdWUc+Df9EGS63HjvDKh3crs1/lOjOR7uTf5jUjUrq5k cPnJx6PMlORh0s/D/pBuw61Y2/NN+GOsJ2tQ5p/TrXz7Y/mQIXZHi8xi5J/D+mhr1SvN iFKRECz2VC/NXpimQsG6Sf6YMmLfu9tL7zZkXzQAYPPhdz5i+P15KxHZ50QexXZjWeLk DgYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680231639; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=AMrP2Zp/EKlqbziL+FgCOqPjH/auJOar/Bw7xvN0IJw=; b=jyG0leg8ckrLDuZyOtqgKk5r0rMSLj1N2U72Q2+94UPHyX0D0pxOyX429zH4VKf0u7 QuxUq+0Kks8Ipx/oGC+543lhrQ0oG4mxKEIEvjEBAHj6X0Nci2z2MSp5pUh4/3UgN+yh tmdOGU760CVn5ntlJYXKc4G+hzkZSCZ+bXNq8SoU84zBUQtZ0SAPXn0mOxS9nHmLv9Dt wdnHHevglt0ruG2g+L0jWYmeFFbpfHzDCXtvPuIpFpgY/E/XglvcTyPtDuinJTfWMJoV nIJVFHHz4M8Yl8u+/3QQOge36r9S4DxP7DCM9OWxMhrU5i+GpA5hcTj/sBSOrMXYKY9i unag== X-Gm-Message-State: AAQBX9cuVh+cFlK2QzggSH0Lp/iBZxWa20+ZtxYhkUiSZo4r800ejkWl LnbJosqVsQklqyscm8vhQ8jdyg== X-Received: by 2002:a17:902:d512:b0:1a0:67fb:445c with SMTP id b18-20020a170902d51200b001a067fb445cmr8985431plg.28.1680231639373; Thu, 30 Mar 2023 20:00:39 -0700 (PDT) Received: from [10.3.157.34] ([61.213.176.10]) by smtp.gmail.com with ESMTPSA id z3-20020a170902ee0300b001a1ea1d6d6esm372585plb.290.2023.03.30.20.00.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Mar 2023 20:00:38 -0700 (PDT) Message-ID: <6128380c-b148-cb7e-44d5-0bd7d05a2942@bytedance.com> Date: Fri, 31 Mar 2023 11:00:33 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [External] Re: [PATCH] blk-throttle: Fix io statistics for cgroup v1 To: Tejun Heo Cc: josef@toxicpanda.com, axboe@kernel.dk, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230328142309.73413-1-hanjinke.666@bytedance.com> <1a858cce-4d87-5e0a-9274-52cffde7dea6@bytedance.com> From: hanjinke In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2023/3/31 上午9:44, Tejun Heo 写道: > Hello, > > On Thu, Mar 30, 2023 at 11:44:04AM +0800, hanjinke wrote: >> 在 2023/3/30 上午2:54, Tejun Heo 写道: >>> On Tue, Mar 28, 2023 at 10:23:09PM +0800, Jinke Han wrote: >>>> From: Jinke Han >>>> >>>> Now the io statistics of cgroup v1 are no longer accurate. Although >>>> in the long run it's best that rstat is a good implementation of >>>> cgroup v1 io statistics. But before that, we'd better fix this issue. >>> >>> Can you please expand on how the stats are wrong on v1 and how the patch >>> fixes it? >>> >>> Thanks. >>> >> Now blkio.throttle.io_serviced and blkio.throttle.io_serviced become the > > "now" might be a bit too vague. Can you point to the commit which made the > change? > >> only stable io stats interface of cgroup v1, and these statistics are done >> in the blk-throttle code. But the current code only counts the bios that are > > Ah, okay, so the stats are now updated by blk-throtl itself but > >> actually throttled. When the user does not add the throttle limit, the io >> stats for cgroup v1 has nothing. I fix it according to the statistical >> method of v2, and made it count all ios accurately. > > updated only when limits are configured which can be confusing. Makes sense > to me. Can you please update the patch description accordingly? > > Also, the following change: > > @@ -2033,6 +2033,9 @@ void blk_cgroup_bio_start(struct bio *bio) > struct blkg_iostat_set *bis; > unsigned long flags; > > + if (!cgroup_subsys_on_dfl(io_cgrp_subsys)) > + return; > + > /* Root-level stats are sourced from system-wide IO stats */ > if (!cgroup_parent(blkcg->css.cgroup)) > return; > > seems incomplete as there's an additional > cgroup_subsys_on_dfl(io_cgrp_subsys) test in the function. We probably wanna > remove that? > > Thanks. > okay, according to your suggestion, I will send a v2. Thanks