mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "yukuai (C)" <yukuai3@huawei.com>
To: Ming Lei <ming.lei@redhat.com>, Christoph Hellwig <hch@infradead.org>
Cc: <tj@kernel.org>, <axboe@kernel.dk>, <cgroups@vger.kernel.org>,
	<linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<yi.zhang@huawei.com>
Subject: Re: [PATCH v9] block: cancel all throttled bios in del_gendisk()
Date: Tue, 1 Mar 2022 21:54:28 +0800	[thread overview]
Message-ID: <836f0686-4ac8-327d-2bab-64a762ea8673@huawei.com> (raw)
In-Reply-To: <Yh31bQu3gbXoDBuK@T590>

在 2022/03/01 18:29, Ming Lei 写道:
> On Mon, Feb 28, 2022 at 01:40:53AM -0800, Christoph Hellwig wrote:
>> On Mon, Feb 28, 2022 at 02:11:30PM +0800, Ming Lei wrote:
>>>> FYI, this crashed left rigt and center when running xfstests with
>>>> traces pointing to throtl_pending_timer_fn.
>>>
>>> Can you share the exact xfstests test(fs, test)? Or panic log?
>>>
>>> I can't reproduce it when running './check -g auto' on XFS, meantime
>>> tracking throtl_pending_timer_fn().
>>
>>  From a quick run using f2fs:
>>
>> generic/081 files ... [  316.487861] run fstests generic/081 at 2022-02-28 09:38:40
> 
> Thanks for providing the reproducer.
> 
> The reason is that the pending timer is deleted in blkg's release
> handler, so the timer can still be live after request queue is released.
> 
> The patch of 'block: cancel all throttled bios in del_gendisk()' should just
> make it easier to trigger.
> 
> After patch of "block: move blkcg initialization/destroy into disk allocation/
> release handler" lands, the issue can be fixed easily by:

Hi,

Thanks for locating this problem,

Perhaps this patch should wait for the problem to be solved.

Thanks,
Kuai
> 
> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index fa063c6c0338..e8d4be5e1de3 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -82,6 +82,7 @@ static void blkg_free(struct blkcg_gq *blkg)
>   		if (blkg->pd[i])
>   			blkcg_policy[i]->pd_free_fn(blkg->pd[i]);
>   
> +	blk_put_queue(blkg->q);
>   	free_percpu(blkg->iostat_cpu);
>   	percpu_ref_exit(&blkg->refcnt);
>   	kfree(blkg);
> @@ -297,9 +298,10 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
>   	blkg->online = true;
>   	spin_unlock(&blkcg->lock);
>   
> -	if (!ret)
> +	if (!ret && blk_get_queue(q))
>   		return blkg;
> -
> +	else if (!ret)
> +		ret = -ENODEV;
>   	/* @blkg failed fully initialized, use the usual release path */
>   	blkg_put(blkg);
>   	return ERR_PTR(ret);
> 
> 
> Thanks,
> Ming
> 
> .
> 

  reply	other threads:[~2022-03-01 13:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 11:56 Yu Kuai
2022-02-25  7:18 ` yukuai (C)
2022-02-25  8:11 ` Ming Lei
2022-02-25 14:27 ` Jens Axboe
2022-02-27 17:16 ` Christoph Hellwig
2022-02-27 21:51   ` Jens Axboe
2022-02-28  6:11   ` Ming Lei
2022-02-28  9:40     ` Christoph Hellwig
2022-03-01 10:29       ` Ming Lei
2022-03-01 13:54         ` yukuai (C) [this message]
2022-03-02  0:51           ` Ming Lei
2022-03-17 11:22             ` yukuai (C)
2022-03-18  7:04               ` Ming Lei

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=836f0686-4ac8-327d-2bab-64a762ea8673@huawei.com \
    --to=yukuai3@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=tj@kernel.org \
    --cc=yi.zhang@huawei.com \
    /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

all inboxes | Powered by JetHome®