linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yi Li <yilikernel@gmail.com>
To: Coly Li <colyli@suse.de>
Cc: Yi Li <yili@winhong.com>,
	kent.overstreet@gmail.com, linux-bcache@vger.kernel.org,
	linux-kernel@vger.kernel.org, Guo Chao <guochao@winhong.com>
Subject: Re: [PATCH] bcache: fix panic due to cache_set is null
Date: Thu, 3 Dec 2020 17:06:44 +0800	[thread overview]
Message-ID: <CAJfdMYDLydAtoxvPGzaQ+K5jLvwAXg6MvpE-OM9sFjZgz_01sQ@mail.gmail.com> (raw)
In-Reply-To: <79fde596-254a-510c-547a-b1525985de9d@suse.de>

The root cause:

After just  cached_dev_free do cancel_writeback_rate_update_dwork
without bch_register_lock
.
at the same time. Wirting the writeback_percent by sysfs witch
bch_register_lock will insert a writeback_rate_update work.

cached_dev_free with bch_register_lock to do bcache_device_free.

(it is introduce by patch 80265d8dfd77792e133793cef44a21323aac2908)

pls:
1: run the shell script
#!/bin/bash
while [ true ]
do
        echo 0 > /sys/block/bcache0/bcache/writeback_percent
done

2: hotplug the cache disk


On 12/3/20, Coly Li <colyli@suse.de> wrote:
> On 12/3/20 2:25 PM, Yi Li wrote:
>>> On 12/1/20 12:35 PM, Yi Li wrote:
>>>> sorry, This patch will cause deadlock, i will check and redo it.
>>>
>>> Can you try latest upstream kernel firstly ? Before spending more time
>>> on the fix.
>>>
>>
>> This issue just happened three times (xenserver7.5 dom0 kernel) on the
>> same machine and cannot reproduce it now. and have not reproduce it
>> using the lastest uptream kernel.
>>
>
> Hmm, this is something very probably that I am not able to help. It
> seems the kernel is a third-part maintained Linux v4.4 based kernel +
> bcache backport, which is out of my view.
>
> If similar problem happens on latest upstream kernel, or at least v5.8+
> kernel, I can help to take a look.
>
>
>>> If I remember correctly, when cancel_writeback_rate_update_dwork() is
>>> not timed out, the cache set memory won't be freed before the
>>> writeback_rate_update worker terminates. It is possible that I miss
>>> something in the code, but I suggest to test with a kernel after v5.3,
>>> and better a v5.8+ kernel.
>>>
>>> Coly Li
>>>
>> Thanks.
>>
>> it is  confused that why writeback_rate_update worker run  again after
>> cancel_delayed_work_sync( kernel log telled).
>>
>
> [snipped]
>
> Coly Li
>

  reply	other threads:[~2020-12-03  9:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 11:21 [PATCH] bcache: fix panic due to cache_set is null Yi Li
2020-12-01  4:35 ` Yi Li
2020-12-01 16:42   ` Coly Li
2020-12-03  6:25     ` Yi Li
2020-12-03  6:56       ` Coly Li
2020-12-03  9:06         ` Yi Li [this message]
2020-12-03  9:47           ` [PATCH v2] " Yi Li
2020-12-03 11:27             ` Coly Li
2020-12-04  1:33               ` Yi Li
2020-12-04  5:54                 ` [PATCH v3] " Yi Li
2020-12-01 16:38 ` [PATCH] " Coly Li

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=CAJfdMYDLydAtoxvPGzaQ+K5jLvwAXg6MvpE-OM9sFjZgz_01sQ@mail.gmail.com \
    --to=yilikernel@gmail.com \
    --cc=colyli@suse.de \
    --cc=guochao@winhong.com \
    --cc=kent.overstreet@gmail.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yili@winhong.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;
as well as URLs for NNTP newsgroup(s).