linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [patch 5/5] block: use a driver-specific handler for the "inflight" value
       [not found] ` <20181108145240.GA20087@infradead.org>
@ 2018-11-08 17:07   ` Mike Snitzer
  2018-11-14 15:18     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Snitzer @ 2018-11-08 17:07 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Mikulas Patocka, Alasdair G. Kergon, dm-devel, linux-block, axboe

On Thu, Nov 08 2018 at  9:52am -0500,
Christoph Hellwig <hch@infradead.org> wrote:

> On Tue, Nov 06, 2018 at 10:35:03PM +0100, Mikulas Patocka wrote:
> > Device mapper was converted to percpu inflight counters. In order to
> > display the correct values in the "inflight" sysfs file, we need a custom
> > callback that sums the percpu counters.
> 
> The attribute that calls this is per-partition, while your method
> is per-queue, so there is some impedence mismatch here.
> 
> Is there any way you could look into just making the generic code
> use percpu counters?

Discussed doing that with Jens and reported as much here:

https://www.redhat.com/archives/dm-devel/2018-November/msg00068.html

And Jens gave additional context for why yet another attempt to switch
block core's in_flight to percpu counters is doomed (having already been
proposed and rejected twice):

https://www.redhat.com/archives/dm-devel/2018-November/msg00071.html

And yes, definitely should've cc'd linux-block (now added).

Mike

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

* Re: [patch 5/5] block: use a driver-specific handler for the "inflight" value
  2018-11-08 17:07   ` [patch 5/5] block: use a driver-specific handler for the "inflight" value Mike Snitzer
@ 2018-11-14 15:18     ` Christoph Hellwig
  2018-11-14 15:34       ` Mike Snitzer
  2018-11-14 22:49       ` Mikulas Patocka
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2018-11-14 15:18 UTC (permalink / raw)
  To: Mike Snitzer
  Cc: Christoph Hellwig, Mikulas Patocka, Alasdair G. Kergon, dm-devel,
	linux-block, axboe

On Thu, Nov 08, 2018 at 12:07:01PM -0500, Mike Snitzer wrote:
> Discussed doing that with Jens and reported as much here:
> 
> https://www.redhat.com/archives/dm-devel/2018-November/msg00068.html
> 
> And Jens gave additional context for why yet another attempt to switch
> block core's in_flight to percpu counters is doomed (having already been
> proposed and rejected twice):
> 
> https://www.redhat.com/archives/dm-devel/2018-November/msg00071.html
> 
> And yes, definitely should've cc'd linux-block (now added).

So how is dm different from the the other 3 handful of drivers using
the make_request interface that the per-cpu counters work for dm and
not the others?

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

* Re: [patch 5/5] block: use a driver-specific handler for the "inflight" value
  2018-11-14 15:18     ` Christoph Hellwig
@ 2018-11-14 15:34       ` Mike Snitzer
  2018-11-14 22:49       ` Mikulas Patocka
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Snitzer @ 2018-11-14 15:34 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Mikulas Patocka, Alasdair G. Kergon, dm-devel, linux-block, axboe

On Wed, Nov 14 2018 at 10:18am -0500,
Christoph Hellwig <hch@infradead.org> wrote:

> On Thu, Nov 08, 2018 at 12:07:01PM -0500, Mike Snitzer wrote:
> > Discussed doing that with Jens and reported as much here:
> > 
> > https://www.redhat.com/archives/dm-devel/2018-November/msg00068.html
> > 
> > And Jens gave additional context for why yet another attempt to switch
> > block core's in_flight to percpu counters is doomed (having already been
> > proposed and rejected twice):
> > 
> > https://www.redhat.com/archives/dm-devel/2018-November/msg00071.html
> > 
> > And yes, definitely should've cc'd linux-block (now added).
> 
> So how is dm different from the the other 3 handful of drivers using
> the make_request interface that the per-cpu counters work for dm and
> not the others?

Think the big part of the historic reluctance to switch to percpu
in_flight counters was that until now (4.21) the legacy request path was
also using the in_flight counters.

Now that they are only used by bio-based (make_request) we likely have
more latitude (hopefully?).  Though I cannot say for sure why they
performed so well in Mikulas' testing.. you'd thinking all the percpu
summing on every jiffie during IO completion would've still been
costly.. but Mikulas saw great results.

Mikulas and I have discussed a new way forward and he is actively
working through implementing it.  Basically he'll still switch to percpu
in_flight counters but he'll change the algorithm for IO accounting
during completion so that it is more of an approximation of the
historically precise in_flight counters and io_ticks (io_ticks is
another problematic component that gets in the way of performance).
Basically the accounting done during IO completion would be much much
faster.  Big part of this is the summation of the percpu in_flight
counters would happen on demand (via sysfs or /proc/diskstats access).
I could look back at my logs from my chat with Mikulas to give you more
details or we could just wait for Mikulas to post the patches (hopefully
within a week).  Your call.

Coming off my Monday discussion with Mikulas I really think the approach
will work nicely and offer a nice performance win for bio-based.

Mike

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

* Re: [patch 5/5] block: use a driver-specific handler for the "inflight" value
  2018-11-14 15:18     ` Christoph Hellwig
  2018-11-14 15:34       ` Mike Snitzer
@ 2018-11-14 22:49       ` Mikulas Patocka
  1 sibling, 0 replies; 4+ messages in thread
From: Mikulas Patocka @ 2018-11-14 22:49 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Mike Snitzer, Alasdair G. Kergon, dm-devel, linux-block, axboe



On Wed, 14 Nov 2018, Christoph Hellwig wrote:

> On Thu, Nov 08, 2018 at 12:07:01PM -0500, Mike Snitzer wrote:
> > Discussed doing that with Jens and reported as much here:
> > 
> > https://www.redhat.com/archives/dm-devel/2018-November/msg00068.html
> > 
> > And Jens gave additional context for why yet another attempt to switch
> > block core's in_flight to percpu counters is doomed (having already been
> > proposed and rejected twice):
> > 
> > https://www.redhat.com/archives/dm-devel/2018-November/msg00071.html
> > 
> > And yes, definitely should've cc'd linux-block (now added).
> 
> So how is dm different from the the other 3 handful of drivers using
> the make_request interface that the per-cpu counters work for dm and
> not the others?

We want to make dm-linear (and dm-stripe) completely lockless, because it 
is used often and we don't want it to degrade performance.

DM already uses srcu to handle table changes, so that the fast path 
doesn't take any locks. And the only one "lock" that is remaining is the 
"in_flight" variable.

As for other drivers, md-raid0 could probably be lockless too (using 
percpu counting similar to dm). The other raid levels can't be lockless 
because they need to check the status of the stripe that is being 
accessed.

Mikulas

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

end of thread, other threads:[~2018-11-14 22:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20181106213858.391264280@debian-a64.vm>
     [not found] ` <20181108145240.GA20087@infradead.org>
2018-11-08 17:07   ` [patch 5/5] block: use a driver-specific handler for the "inflight" value Mike Snitzer
2018-11-14 15:18     ` Christoph Hellwig
2018-11-14 15:34       ` Mike Snitzer
2018-11-14 22:49       ` Mikulas Patocka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).