From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1306E41D63A for ; Thu, 16 Jul 2026 12:19:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784204395; cv=none; b=F8CWXCD1b1MEFBCq7xHiC1ZPaX8D0aMH4GQQzw3vhvD0Pq+qQxm5gk1IZRss7SyM4rRE8YSLTwoz1CtYjGYlM+ABXbniS+SFhgFDEf/9jybTqdbfWklUKM3GjdWNt3mD//q8ndFOQ9/uUIpFC81lvtqy+IACdRKDEEiTgKN4RWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784204395; c=relaxed/simple; bh=PlzjWzgDDt6tc68NVLye65j+dlo1TtiJV4HmRQ9VJao=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Yr58uNplbO+yxwCKmjw46EDRQx8htBUBNIRzgJRz3oRuUrhjj1oKT8oiB1n9ZA4ngF13fbEY2lURmIX7Cu7B5t4YpcY3gN9aRu0/uv02kN9vvkPCdZ2FUjCT9q34TxESp3NSYpTGTeLUtXZ/Z1zdJMIkJ82d0ikCmklgfXyxrZQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Fmxbrowx; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Fmxbrowx" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-848595b338cso7624910b3a.0 for ; Thu, 16 Jul 2026 05:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784204388; x=1784809188; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=NNVBy8u+XjMaZM3z2LpdEO0iw/XOyiSV5aem9nLfAFg=; b=Fmxbrowx2/fDb/VorBk4l4aoN61eN4Fqzn/DN3EMn3VhtVhD2SQtsMCfp5AXNOcG8B +npZhUJdT8/Y6M7JBuirILsehyEAne3RcJH8dGnng8gfUF4nQrA+iAqjYBYA9uk3/FA1 wkIfkb43iXKnp5nlQYOfaNxwI2shfw/LASOPLqXSnno3bUwE+1aqFrXhLgpm6tEHZKm8 uCChY/06s4zX7gQ7PTbNsjQL2BYpnXjbuvBDFZE9OqJ3g2GypmzJ+oxk1PT5tIveNsJK dhwf6x5oPtgzPMdVsOtGYTzUs+x55JqwKs8dSTZRUXoCjykgwsilH/EIImlt8X8Q0Mu8 1frw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784204388; x=1784809188; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=NNVBy8u+XjMaZM3z2LpdEO0iw/XOyiSV5aem9nLfAFg=; b=IN0Dn0vK/gtMAVT9mBSVAioIHDjvo7QIkk0Ytm50mtx0W7b9btkU2Aipw7MhWDFeD7 tW1yDrsF/pUnE7ToTdo84FNsqmHYF66AE6bDBAUVHZokXnGFyt654zIYO+MSYeyGxUaY 1b4H7tosTyo9ojTzQ8Uz63IQEdYZH7ox2GljwJbKv6HMhzTUDBKn5xTAmImRF79GolJe nnLEJNoygDUP6BMJKR9v678gR+y8gS2Heyve880CTMzKsRRXwRO4IeLcyAiKaRuiS3v4 nu9nwBBUnm/Zgc0vPgGRNJOh8BqNSdz+fpnJxThfU49Rct+feAkPexP8XCDPBk9k5puw vPSQ== X-Forwarded-Encrypted: i=1; AHgh+RpvoHUv7dTpCHTFezTCn3VNDfg/pT8oSyWopWwQYf3Ebh0Ne7QJR/8wYW8dyAAqmlGtISOsdauHq0l4Mr8=@vger.kernel.org X-Gm-Message-State: AOJu0YwsG0f31qAT/dE1qEeWRJ20o7l0zWHUV9qIRd+cBEc72eKGi+Zg j6KSZRtPzz/+xlR8XjMwzWIJuqXpOg1w+Oa/+KjxPkFJylnLwfd59gC2 X-Gm-Gg: AfdE7cmLoqSBR/ca4KGf0Gq9JmCBifRoxob205CKbyY0NJLadvfAxpFDcetfKs4Sg4C CDpQ6w78DDpSfVI6s1D+JY/MVNNe5hh293f88q397LkqJcD8d5icjb4Av//y9hu9AcfjBB1qxxu jwg/tgLgxLfTO23Kz2+gZjPksgjof9t0mjCwZkblAhxtJzI7f+vD9V9ZH8ASgVPXUe1NDKiehJv D7oXjNmeMHbapyZOWG9o2AW53fmTu4w45dIwW/t9wEpZ71qZiwtggSDMPQblrMM3boTamsD41Y5 lxHon1BeK04p3rH2lCaZSscdr5mhF+PRP8Fey7SrLanU1IXekgrWM2vEV/4zQUermMJ9L8C7owf jjcL9v4Z1skZsjUw9iKZjfxiK3INSjrfKUCHzKZwA93J3+wLDMEISy+BlbJQRwXUCYDQfe5lDhM v4mNYDreZQ+QMFEDp/X0zR X-Received: by 2002:a05:6a21:e97:b0:3c0:9c18:d5a7 with SMTP id adf61e73a8af0-3c3572937c3mr13731565637.68.1784204387596; Thu, 16 Jul 2026 05:19:47 -0700 (PDT) Received: from [192.168.0.23] ([210.10.76.89]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cb258eb8578sm1834476a12.3.2026.07.16.05.19.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Jul 2026 05:19:47 -0700 (PDT) Message-ID: <676f4205-edef-4d2d-a7b1-8878d466bb7e@gmail.com> Date: Thu, 16 Jul 2026 20:19:43 +0800 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-cgroup: show io.stat numbers for discard-only cgroups To: Tao Cui , axboe@kernel.dk Cc: tj@kernel.org, josef@toxicpanda.com, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Tao Cui References: <20260714063302.1153238-1-cui.tao@linux.dev> Content-Language: en-US From: Tang Yizhou In-Reply-To: <20260714063302.1153238-1-cui.tao@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 14/7/26 2:33 pm, Tao Cui wrote: > From: Tao Cui > > blkcg_print_one_stat() gates the rbytes/wbytes/rios/wios/dbytes/dios > output on > > if (rbytes || wbytes || rios || wios) > > which omits the discard counters. A cgroup that has issued only discards > (zero read and write counters) therefore prints an empty stat line and its > dbytes/dios are never surfaced, even though they are accounted correctly. > > The guard predates the addition of discard stats and was never updated; > include dbytes/dios so discard-only cgroups are reported. > > Fixes: 636620b66d5d ("blkcg: Track DISCARD statistics and output them in cgroup io.stat") > Signed-off-by: Tao Cui > --- > block/blk-cgroup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c > index a778aa9d2bb9..b324701cb05d 100644 > --- a/block/blk-cgroup.c > +++ b/block/blk-cgroup.c > @@ -1154,7 +1154,7 @@ static void blkcg_print_one_stat(struct blkcg_gq *blkg, struct seq_file *s) > dios = bis->cur.ios[BLKG_IOSTAT_DISCARD]; > } while (u64_stats_fetch_retry(&bis->sync, seq)); > > - if (rbytes || wbytes || rios || wios) { > + if (rbytes || wbytes || rios || wios || dbytes || dios) { > seq_printf(s, "rbytes=%llu wbytes=%llu rios=%llu wios=%llu dbytes=%llu dios=%llu", > rbytes, wbytes, rios, wios, > dbytes, dios); Reviewed-by: Tang Yizhou -- Best Regards, Yi