linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Paolo Valente <paolo.valente@linaro.org>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	davidezini2@gmail.com
Subject: Re: [PATCH BUGFIX 1/1] block, bfq: honor already-setup queue merges
Date: Thu, 2 Sep 2021 06:37:16 -0600	[thread overview]
Message-ID: <df5c8291-9282-1512-cdbf-28aad60beaec@kernel.dk> (raw)
In-Reply-To: <20210802141352.74353-2-paolo.valente@linaro.org>

On 8/2/21 8:13 AM, Paolo Valente wrote:
> The function bfq_setup_merge prepares the merging between two
> bfq_queues, say bfqq and new_bfqq. To this goal, it assigns
> bfqq->new_bfqq = new_bfqq. Then, each time some I/O for bfqq arrives,
> the process that generated that I/O is disassociated from bfqq and
> associated with new_bfqq (merging is actually a redirection). In this
> respect, bfq_setup_merge increases new_bfqq->ref in advance, adding
> the number of processes that are expected to be associated with
> new_bfqq.
> 
> Unfortunately, the stable-merging mechanism interferes with this
> setup. After bfqq->new_bfqq has been set by bfq_setup_merge, and
> before all the expected processes have been associated with
> bfqq->new_bfqq, bfqq may happen to be stably merged with a different
> queue than the current bfqq->new_bfqq. In this case, bfqq->new_bfqq
> gets changed. So, some of the processes that have been already
> accounted for in the ref counter of the previous new_bfqq will not be
> associated with that queue.  This creates an unbalance, because those
> references will never be decremented.
> 
> This commit fixes this issue by reestablishing the previous, natural
> behaviour: once bfqq->new_bfqq has been set, it will not be changed
> until all expected redirections have occurred.

Applied, thanks.

-- 
Jens Axboe


      parent reply	other threads:[~2021-09-02 12:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 14:13 [PATCH BUGFIX 0/1] block, bfq: fix a bug causing a memory leak Paolo Valente
2021-08-02 14:13 ` [PATCH BUGFIX 1/1] block, bfq: honor already-setup queue merges Paolo Valente
2021-08-26  9:16   ` Paolo Valente
2021-09-02  7:32     ` Paolo Valente
2021-09-02 12:37   ` Jens Axboe [this message]

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=df5c8291-9282-1512-cdbf-28aad60beaec@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=davidezini2@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paolo.valente@linaro.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;
as well as URLs for NNTP newsgroup(s).