mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tao Cui <cui.tao@linux.dev>
To: Tejun Heo <tj@kernel.org>
Cc: cui.tao@linux.dev, Josef Bacik <josef@toxicpanda.com>,
	josef@toxicopanda.com, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@infradead.org>,
	cgroups@vger.kernel.org, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, cuitao@kylinos.cn
Subject: Re: [PATCH v2 1/4] blk-iocost: charge flushes as pageless random writes
Date: Sun, 20 Sep 2026 15:08:54 +0800	[thread overview]
Message-ID: <ab72a564-108c-4b74-adf3-1eadbbf01084@linux.dev> (raw)
In-Reply-To: <9575357186118be214d6377dd80a21e8@kernel.org>

Hello Tejun,

在 2026/9/19 22:59, Tejun Heo 写道:
> Hello, Tao.
> 
> On Wed, Sep 16, 2026 at 04:53:01PM +0800, Tao Cui wrote:
>> Charge the flush component of any REQ_PREFLUSH bio on top of its data
>> cost, priced as a pageless random write (LCOEF_WRANDIO), which provides
>> an approximation of the device time consumed by a flush.  For profiles
>> where WRANDIO clamps to zero (ssd_dfl / ssd_fast), use a one-page floor
>> (LCOEF_WPAGE).
> 
> Pricing a flush as a random write, or as a page where that comes out to
> zero, is as arbitrary as pricing it at zero, and it changes what existing
> setups get charged. 013adcbef165 ("blk-iocost: skip empty flush bio in
> iocost") zeroed them because the flush machinery coalesces flushes and the
> write coefficients don't say anything about what a flush costs.
> 

Understood.  The write-coefficient pricing was only an approximation and
would change the accounting behavior for existing setups, so I'll drop it
and rework the series around a dedicated flush cost.

> Can you instead add the flushiops parameter you mentioned in the v1 thread
> to the linear model? A flush costs VTIME_PER_SEC / flushiops, and zero when
> the parameter isn't set, including in the builtin profiles, so nothing
> changes until it's configured or the profiles are regenerated with a flush
> measurement.
> 

Will do.  I'll add flushiops to the linear model using the same conversion
as the other iops coefficients:

- add a flushiops=%u token for io.cost.model and translate it to
  LCOEF_FLUSH = VTIME_PER_SEC / flushiops
- keep flushiops zero in builtin profiles, with no fallback, so existing
  profiles keep their current behavior
- account REQ_PREFLUSH and REQ_FUA consistently with the flush machinery:
  PREFLUSH charges one flush, and FUA adds another flush when the device
  does not support native FUA

The rest of the series (zone append charging, latency accounting, and the
comment fix) remains unchanged.

> The same charge should cover REQ_FUA the way the flush machinery does: one
> flush for PREFLUSH, and one for FUA on a device without FUA support, which
> is when a post-flush gets issued.
> 
> Please also drop the Fixes tag on this patch. With the parameter, this is
> an extension rather than a fix.
> 

Done.  v3 will position this as a cost model extension.

One remaining question is whether builtin profiles should eventually carry
measured flushiops values, or whether flushiops is expected to remain
user-configured.  This series leaves it at zero because I don't have
reliable measurements for the existing profiles.

Thanks,
Tao

> Thanks.
> 


  reply	other threads:[~2026-09-20  7:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  8:53 [PATCH v2 0/4] blk-iocost: charge flushes and zone appends Tao Cui
2026-09-16  8:53 ` [PATCH v2 1/4] blk-iocost: charge flushes as pageless random writes Tao Cui
2026-09-18 13:21   ` Christoph Hellwig
2026-09-19 14:59   ` Tejun Heo
2026-09-20  7:08     ` Tao Cui [this message]
2026-09-20 12:19       ` Tejun Heo
2026-09-16  8:53 ` [PATCH v2 2/4] blk-iocost: charge zone appends as page-counted sequential writes Tao Cui
2026-09-18 13:22   ` Christoph Hellwig
2026-09-20  7:11     ` Tao Cui
2026-09-19 15:00   ` Tejun Heo
2026-09-20  7:13     ` Tao Cui
2026-09-16  8:53 ` [PATCH v2 3/4] blk-iocost: account zone append completions in latency stats Tao Cui
2026-09-18 13:22   ` Christoph Hellwig
2026-09-16  8:53 ` [PATCH v2 4/4] blk-iocost: fix stale comment in ioc_rqos_throttle() Tao Cui
2026-09-18 13:23   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab72a564-108c-4b74-adf3-1eadbbf01084@linux.dev \
    --to=cui.tao@linux.dev \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=cuitao@kylinos.cn \
    --cc=hch@infradead.org \
    --cc=josef@toxicopanda.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®