Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1649756

Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when safe

From Tejun Heo <tj@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when safe
Date 2017-05-24 18:50 +0200
Message-ID <tKHDX-4Jq-3@gated-at.bofh.it> (permalink)
References (2 earlier) <tJ6ZP-6r8-1@gated-at.bofh.it> <tKoUI-8uq-75@gated-at.bofh.it> <tKD7j-1Uh-5@gated-at.bofh.it> <tKFVv-3Cg-3@gated-at.bofh.it> <tKHDX-4Jq-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

On Wed, May 24, 2017 at 05:43:18PM +0100, Paolo Valente wrote:
> > so none of the above objects can be destroyed before the request is
> > done.
> 
> ... the issue seems just to move to a more subtle position: cfq is ok,
> because it protects itself with rq lock, but blk-mq schedulers don't.
> So, the race that leads to the (real) crashes reported by people may
> actually be:

Oh, I was just thinking about !mq paths the whole time.

> 1 blkg_lookup executed on a blkg being destroyed: the scheduler gets a
> copy of the content of the blkg, but the rcu mechanism doesn't prevent
> destruction from going on
> 2 blkg_get gets executed on the copy of the original blkg

So, we can't do that.  We should look up and bump the ref and use the
original copy.  We probably should switch blkgs to use percpu-refs.

Thanks.

-- 
tejun

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH BUGFIX] block, bfq: access and cache blkg data only when safe Paolo Valente <paolo.valente@linaro.org> - 2017-05-19 10:40 +0200
  Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when  safe Jens Axboe <axboe@kernel.dk> - 2017-05-19 16:40 +0200
    Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when safe Paolo Valente <paolo.valente@linaro.org> - 2017-05-22 22:30 +0200
  Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when  safe Tejun Heo <tj@kernel.org> - 2017-05-19 17:00 +0200
    Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when safe Paolo Valente <paolo.valente@linaro.org> - 2017-05-20 09:30 +0200
      Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when  safe Tejun Heo <tj@kernel.org> - 2017-05-23 22:50 +0200
        Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when safe Paolo Valente <paolo.valente@linaro.org> - 2017-05-24 14:00 +0200
          Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when safe Paolo Valente <paolo.valente@linaro.org> - 2017-05-24 16:30 +0200
          Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when  safe Tejun Heo <tj@kernel.org> - 2017-05-24 17:00 +0200
            Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when  safe Tejun Heo <tj@kernel.org> - 2017-05-24 18:50 +0200
              Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when safe Paolo Valente <paolo.valente@linaro.org> - 2017-05-25 09:20 +0200
                Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when  safe Tejun Heo <tj@kernel.org> - 2017-05-25 16:40 +0200
            Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when safe Paolo Valente <paolo.valente@linaro.org> - 2017-05-24 18:50 +0200

csiph-web