Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1309635lqb; Thu, 30 May 2024 06:51:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU9T0tSgnKTXpWxPkCWsMG1kCHpxs9G2qzl0AMbZLkNqy8UE655/PlGroofrP6vtkauzOyHJo0ucZVHyJnRBjZkLMAzWbklzbRtYGkI/Q== X-Google-Smtp-Source: AGHT+IGN18LNbc6EdhmkpEq9klZre2ojzjWNJCFNE4FZLNcph//TxDf8jgWoo9wUNet2A17KHQei X-Received: by 2002:a05:622a:551:b0:436:4d7c:8a9b with SMTP id d75a77b69052e-43fe930c0damr28016571cf.46.1717077090530; Thu, 30 May 2024 06:51:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717077090; cv=pass; d=google.com; s=arc-20160816; b=E4UDzQJHZY741cLYomcnGWJ/lUPJn8jjIkoZNakZ+dajF5D5qMrK4bpnsvbDocE6sj kVIjBvwmoBzmXISqyFQZrbfY+kKyVneP7OFrH4DsS4TzfCFlBGTrbE4V7DbY/h63DDwN N7AO+dk8OP5phcUyNCam6uHVBUAQGXeze06CxG+hGpR3nji/ouoWl/rUuOM36/oSgN9I etkZ4EDv8zzPFjDZJWHkJZTM3sUEc0dX1YjHQdiluuqhGzcvHPR8nht2Mrv3RLwiW1gT odQN83Z7GPXOG7hnQulOz38Of8RdGPU1CnF8AFqsY+TSXPiGvhTYEYycib3GUnML1eo+ hF8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=sdHTFIUqw1UhZaLCSYhv+4vv96KPTgtHy1W4U/Cmx6I=; fh=WmNKjzno0oT7URBji9KZDuHUtFUw7MwUSEErHaqnLik=; b=tMKGpbTsl4lzVupIQZvVBPeGVkPNpxsCZfif0H3+rIOlj9a5cb2N4ZXp936vsbUNFB LiY7RbMzUIfoEPPRYE+zJoTLY9yQ05N1YYHEPwSdl2s+Ah9h67MxQiTzHOuw1yZPD1+j el1Xg0baYNHN8mBOOopKQC0z0F9nx97FoeIz9afd+8s0o4StzLtkO389iflp5fRw7ulB 5Z30BePvrV8+3SuPupq/8d1M6j6tAwp+cGUw85IeeofL9bwH7Mc8hzG8EyxeRG1knTk7 /RDyPEQVPCQ/iaMsw86vyMYZE4OLIWAO8lL6OC9uk9a7fMjNdWVRCMSBOe6E8T8Fs06z zdXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="N8HW/Y2G"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-195460-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195460-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43fdf93018asi49892131cf.548.2024.05.30.06.51.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 06:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195460-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="N8HW/Y2G"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-195460-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195460-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 444231C22C20 for ; Thu, 30 May 2024 13:51:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E867817F507; Thu, 30 May 2024 13:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="N8HW/Y2G" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 7FBB017D8A2 for ; Thu, 30 May 2024 13:49:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717076991; cv=none; b=He1HOJ7kIn8w/RapqO+xFTDjh2uGkFR755JcMLNFxWXRs7twrXQsJJo6kbxQWF47UDL3V2zL07G9hLJXvU+cepBok5Eu7i1gVWr8MV3psAdvU43o8yOqQQTuMM8pWuNnwBgUhE9+wGyCspOQYNfWf7bEHdQ0DwpfcgO/TS0Z/GA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717076991; c=relaxed/simple; bh=BxQLsWAQxchrkWKnK3ChTnkIylveR7dUnQAn8LahHww=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QG+csDGrJTl8TI9ZYXeB+gGTyxw0xG7or1ddnLBP/uXvoHlKb+RyjRHCcNl6EEvcnz2i81KgLzRe4PhsgDWrcwpAGhBtRzSp7q2jSNgSrFBGbrLxW3s08ahwMBGNd3o804Z9vAujD25AEcmqC2URnskNpDP0AP7rWGHKo67n3N8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=N8HW/Y2G; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717076988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sdHTFIUqw1UhZaLCSYhv+4vv96KPTgtHy1W4U/Cmx6I=; b=N8HW/Y2GdMXwxTNWoSts5XEgIX05+LK/9+eJJgwkH3eoOc6nSxksm69/kT85pHrgy7PpWf hny0JpMR4Rn1kujZAb+oPGC1DF14FxbbTTiy3QCnRq2f0GFmNSAQYsFwNMl5YuDCAo1WY2 gBetKPYGvsnTL0MymmITMK0e2DUalL8= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-335-qnQNB9lYM_6hMWMk9NGfsg-1; Thu, 30 May 2024 09:49:45 -0400 X-MC-Unique: qnQNB9lYM_6hMWMk9NGfsg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ACF4529AA389; Thu, 30 May 2024 13:49:44 +0000 (UTC) Received: from [10.22.33.42] (unknown [10.22.33.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7EB040004D; Thu, 30 May 2024 13:49:43 +0000 (UTC) Message-ID: <0de07021-df77-4196-bb75-9ded88b74ce2@redhat.com> Date: Thu, 30 May 2024 09:49:43 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] blk-throttle: Fix incorrect display of io.max To: Jens Axboe , Tejun Heo , Josef Bacik Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Schatzberg , Ming Lei , Justin Forbes , Yu Kuai References: <20240530134547.970075-1-longman@redhat.com> Content-Language: en-US From: Waiman Long In-Reply-To: <20240530134547.970075-1-longman@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 On 5/30/24 09:45, Waiman Long wrote: > Commit bf20ab538c81 ("blk-throttle: remove CONFIG_BLK_DEV_THROTTLING_LOW") > attempts to revert the code change introduced by commit cd5ab1b0fcb4 > ("blk-throttle: add .low interface"). However, it leaves behind the > bps_conf[] and iops_conf[] fields in the throtl_grp structure which > aren't set anywhere in the new blk-throttle.c code but are still being > used by tg_prfill_limit() to display the limits in io.max. Now io.max > always displays the following values if a block queue is used: > > : rbps=0 wbps=0 riops=0 wiops=0 > > Fix this problem by removing bps_conf[] and iops_conf[] and use bps[] > and iops[] instead to complete the revert. > > Fixes: bf20ab538c81 ("blk-throttle: remove CONFIG_BLK_DEV_THROTTLING_LOW") > Reported-by: Justin Forbes > Closes: https://github.com/containers/podman/issues/22701#issuecomment-2120627789 > Signed-off-by: Waiman Long > --- > block/blk-throttle.c | 24 ++++++++++++------------ > block/blk-throttle.h | 8 ++------ > 2 files changed, 14 insertions(+), 18 deletions(-) > > diff --git a/block/blk-throttle.c b/block/blk-throttle.c > index d907040859f9..da619654f418 100644 > --- a/block/blk-throttle.c > +++ b/block/blk-throttle.c > @@ -1347,32 +1347,32 @@ static u64 tg_prfill_limit(struct seq_file *sf, struct blkg_policy_data *pd, > bps_dft = U64_MAX; > iops_dft = UINT_MAX; > > - if (tg->bps_conf[READ] == bps_dft && > - tg->bps_conf[WRITE] == bps_dft && > - tg->iops_conf[READ] == iops_dft && > - tg->iops_conf[WRITE] == iops_dft) > + if (tg->bps[READ] == bps_dft && > + tg->bps[WRITE] == bps_dft && > + tg->iops[READ] == iops_dft && > + tg->iops[WRITE] == iops_dft) > return 0; > > seq_printf(sf, "%s", dname); > - if (tg->bps_conf[READ] == U64_MAX) > + if (tg->bps[READ] == U64_MAX) > seq_printf(sf, " rbps=max"); > else > - seq_printf(sf, " rbps=%llu", tg->bps_conf[READ]); > + seq_printf(sf, " rbps=%llu", tg->bps[READ]); > > - if (tg->bps_conf[WRITE] == U64_MAX) > + if (tg->bps[WRITE] == U64_MAX) > seq_printf(sf, " wbps=max"); > else > - seq_printf(sf, " wbps=%llu", tg->bps_conf[WRITE]); > + seq_printf(sf, " wbps=%llu", tg->bps[WRITE]); > > - if (tg->iops_conf[READ] == UINT_MAX) > + if (tg->iops[READ] == UINT_MAX) > seq_printf(sf, " riops=max"); > else > - seq_printf(sf, " riops=%u", tg->iops_conf[READ]); > + seq_printf(sf, " riops=%u", tg->iops[READ]); > > - if (tg->iops_conf[WRITE] == UINT_MAX) > + if (tg->iops[WRITE] == UINT_MAX) > seq_printf(sf, " wiops=max"); > else > - seq_printf(sf, " wiops=%u", tg->iops_conf[WRITE]); > + seq_printf(sf, " wiops=%u", tg->iops[WRITE]); > > seq_printf(sf, "\n"); > return 0; > diff --git a/block/blk-throttle.h b/block/blk-throttle.h > index 32503fd83a84..8c365541a275 100644 > --- a/block/blk-throttle.h > +++ b/block/blk-throttle.h > @@ -95,15 +95,11 @@ struct throtl_grp { > bool has_rules_bps[2]; > bool has_rules_iops[2]; > > - /* internally used bytes per second rate limits */ > + /* bytes per second rate limits */ > uint64_t bps[2]; > - /* user configured bps limits */ > - uint64_t bps_conf[2]; > > - /* internally used IOPS limits */ > + /* IOPS limits */ > unsigned int iops[2]; > - /* user configured IOPS limits */ > - unsigned int iops_conf[2]; > > /* Number of bytes dispatched in current slice */ > uint64_t bytes_disp[2]; Add Yu Kuai to cc.