Linux block layer
 help / color / mirror / Atom feed
* Re: [PATCH RFC] nvme-multipath: fix diskstats for partitions
       [not found] ` <20260724050152.GA3680@lst.de>
@ 2026-07-24  7:09   ` John Garry
  2026-07-24 12:45     ` Keith Busch
  0 siblings, 1 reply; 2+ messages in thread
From: John Garry @ 2026-07-24  7:09 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: kbusch, sagi, axboe, linux-nvme, John Garry, linux-block

On 24/07/2026 06:01, Christoph Hellwig wrote:
> On Tue, Jul 21, 2026 at 11: 45: 53AM +0000, John Garry wrote: > Setting as an
> RFC as adding this extra bio field is not acceptable, but I > can't see how to
> lookup the original partition. In general it is not, but you should mark this a
> 
> 
> On Tue, Jul 21, 2026 at 11:45:53AM +0000, John Garry wrote:
>> Setting as an RFC as adding this extra bio field is not acceptable, but I
>> can't see how to lookup the original partition.
> 
> In general it is not, but you should mark this a block patch so that
> Jens can better cream at you :)
> 
> I'm also not sure that supporting per-partition diskstats on a multipath
> device makes too much sense, but then again there's a lot of setups
> that are crazy and actually used..
> 

It just seems to me that we should have same behaviour as if it were not 
multipath.

So we can't use bi_private as that can be set by original bio submitter. 
I was thinking that this bdev pointer could be temp stashed in bi_next 
(as it should be originally NULL), but that it dodgy and maybe won't 
even work.

Least worst I can think if is to alloc some temp memory per-bio in 
nvme_ns_head_submit_bio() to hold this bdev pointer and original 
bi_private, set bio->bi_private to that memory, and then set bi_private 
back to original when we end the bio. But this is all crappy, especially 
just for partition diskstats.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH RFC] nvme-multipath: fix diskstats for partitions
  2026-07-24  7:09   ` [PATCH RFC] nvme-multipath: fix diskstats for partitions John Garry
@ 2026-07-24 12:45     ` Keith Busch
  0 siblings, 0 replies; 2+ messages in thread
From: Keith Busch @ 2026-07-24 12:45 UTC (permalink / raw)
  To: John Garry
  Cc: Christoph Hellwig, sagi, axboe, linux-nvme, John Garry,
	linux-block

On Fri, Jul 24, 2026 at 08:09:51AM +0100, John Garry wrote:
> On 24/07/2026 06:01, Christoph Hellwig wrote:
> > On Tue, Jul 21, 2026 at 11: 45: 53AM +0000, John Garry wrote: > Setting as an
> > RFC as adding this extra bio field is not acceptable, but I > can't see how to
> > lookup the original partition. In general it is not, but you should mark this a
> > 
> > 
> > On Tue, Jul 21, 2026 at 11:45:53AM +0000, John Garry wrote:
> > > Setting as an RFC as adding this extra bio field is not acceptable, but I
> > > can't see how to lookup the original partition.
> > 
> > In general it is not, but you should mark this a block patch so that
> > Jens can better cream at you :)
> > 
> > I'm also not sure that supporting per-partition diskstats on a multipath
> > device makes too much sense, but then again there's a lot of setups
> > that are crazy and actually used..
> > 
> 
> It just seems to me that we should have same behaviour as if it were not
> multipath.
> 
> So we can't use bi_private as that can be set by original bio submitter. I
> was thinking that this bdev pointer could be temp stashed in bi_next (as it
> should be originally NULL), but that it dodgy and maybe won't even work.

Failover is corner case to consider here. We always reset the bio bdev
to the part0, so your stats will be incorrect when that happens. I think
you can quickly fix that in your proposal with the "bi_orig", though.

Can we just thread through partitions for the bio's block_device instead
of assuming part0? I know the hidden path devices skip partition
scanning, but maybe if we let it happen, then those will have the same
partition setup as the head gendisk. Then we can go right to the
disk->part_tbl for what we provide to bio_set_dev() for both submission
and failover, and everything should work out from there.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-24 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260721114553.1657841-1-john.g.garry@oracle.com>
     [not found] ` <20260724050152.GA3680@lst.de>
2026-07-24  7:09   ` [PATCH RFC] nvme-multipath: fix diskstats for partitions John Garry
2026-07-24 12:45     ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox