public inbox for [email protected]
 help / color / mirror / Atom feed
From: Keith Busch <[email protected]>
To: Bart Van Assche <[email protected]>
Cc: Keith Busch <[email protected]>,
	[email protected], [email protected],
	[email protected], [email protected], [email protected],
	[email protected], [email protected],
	[email protected]
Subject: Re: [PATCHv8 3/6] block: introduce max_write_hints queue limit
Date: Mon, 21 Oct 2024 09:02:32 -0600	[thread overview]
Message-ID: <ZxZtCFNvPlIE8xgV@kbusch-mbp> (raw)
In-Reply-To: <[email protected]>

On Fri, Oct 18, 2024 at 09:18:34AM -0700, Bart Van Assche wrote:
> On 10/17/24 9:09 AM, Keith Busch wrote:
> > Drivers with hardware that support write hints need a way to export how
> > many are available so applications can generically query this.
> 
> Something is missing from this patch, namely a change for the SCSI disk
> (sd) driver that sets max_write_hints to sdkp->permanent_stream_count.

Shouldn't someone who cares about scsi do that? I certainly don't care,
nor have I been keeping up with what's happening there, so I'm also
unqualified.
 
> > +What:		/sys/block/<disk>/queue/max_write_hints
> > +Date:		October 2024
> > +Contact:	[email protected]
> > +Description:
> > +		[RO] Maximum number of write hints supported, 0 if not
> > +		supported. If supported, valid values are 1 through
> > +		max_write_hints, inclusive.
> 
> That's a bit short. I think it would help to add a reference to the
> aspects of the standards related to this attribute: permanent streams
> for SCSI and FDP for NVMe.

The specs regarding write hints have not historically been stable, so
I'd rather not tie kernel docs to volatile external specifications.

> > diff --git a/block/blk-settings.c b/block/blk-settings.c
> > index a446654ddee5e..921fb4d334fa4 100644
> > --- a/block/blk-settings.c
> > +++ b/block/blk-settings.c
> > @@ -43,6 +43,7 @@ void blk_set_stacking_limits(struct queue_limits *lim)
> >   	lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK;
> >   	/* Inherit limits from component devices */
> > +	lim->max_write_hints = USHRT_MAX;
> >   	lim->max_segments = USHRT_MAX;
> >   	lim->max_discard_segments = USHRT_MAX;
> >   	lim->max_hw_sectors = UINT_MAX;
> > @@ -544,6 +545,8 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
> >   	t->max_segment_size = min_not_zero(t->max_segment_size,
> >   					   b->max_segment_size);
> > +	t->max_write_hints = min(t->max_write_hints, b->max_write_hints);
> > +
> >   	alignment = queue_limit_alignment_offset(b, start);
> 
> I prefer that lim->max_write_hints is initialized to zero in
> blk_set_stacking_limits() and that blk_stack_limits() uses
> min_not_zero().

How is a device supposed to report it doesn't support a write hint if 0
gets overridden?

  reply	other threads:[~2024-10-21 15:02 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 16:09 [PATCHv8 0/6] write hints for nvme fdp Keith Busch
2024-10-17 16:09 ` [PATCHv8 1/6] block, fs: restore kiocb based write hint processing Keith Busch
2024-10-18  5:50   ` Christoph Hellwig
2024-10-21 15:47     ` Keith Busch
2024-10-21 17:09       ` Bart Van Assche
2024-10-21 19:35         ` Keith Busch
2024-10-22  6:43       ` Christoph Hellwig
2024-10-22 14:37         ` Keith Busch
2024-10-22 14:40           ` Christoph Hellwig
2024-10-18 16:11   ` Bart Van Assche
2024-10-17 16:09 ` [PATCHv8 2/6] block: use generic u16 for write hints Keith Busch
2024-10-18  5:46   ` Christoph Hellwig
2024-10-24 19:45     ` Keith Busch
2024-10-25 12:20       ` Christoph Hellwig
2024-10-18  6:00   ` Hannes Reinecke
2024-10-18 16:12   ` Bart Van Assche
2024-10-21 15:03     ` Keith Busch
2024-10-17 16:09 ` [PATCHv8 3/6] block: introduce max_write_hints queue limit Keith Busch
2024-10-18  5:51   ` Christoph Hellwig
2024-10-18  6:01   ` Hannes Reinecke
2024-10-18 16:18   ` Bart Van Assche
2024-10-21 15:02     ` Keith Busch [this message]
2024-10-17 16:09 ` [PATCHv8 4/6] fs: introduce per-io hint support flag Keith Busch
2024-10-18  5:52   ` Christoph Hellwig
2024-10-18  6:03   ` Hannes Reinecke
2024-10-17 16:09 ` [PATCHv8 5/6] io_uring: enable per-io hinting capability Keith Busch
2024-10-18  5:53   ` Christoph Hellwig
2024-10-18  6:03   ` Hannes Reinecke
2024-10-17 16:09 ` [PATCHv8 6/6] nvme: enable FDP support Keith Busch
2024-10-18 10:48   ` Kanchan Joshi
2024-10-21 15:08     ` Keith Busch

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=ZxZtCFNvPlIE8xgV@kbusch-mbp \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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