All of lore.kernel.org
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Cc: Song Liu <song@kernel.org>, linux-raid <linux-raid@vger.kernel.org>
Subject: Re: [PATCH 0/4] md: fix lockdep warning
Date: Fri, 10 Apr 2020 22:34:01 +0000	[thread overview]
Message-ID: <11131DC5-A7DA-450B-86D9-803EAE8099A2@fb.com> (raw)
In-Reply-To: <DA29BDF5-4B14-48AF-8B21-3B6A82857B7C@fb.com>



> On Apr 9, 2020, at 5:32 PM, Song Liu <songliubraving@fb.com> wrote:
> 
> 
> 
>> On Apr 9, 2020, at 2:47 PM, Guoqing Jiang <guoqing.jiang@cloud.ionos.com> wrote:
>> 
>> On 09.04.20 09:25, Song Liu wrote:
>>> Thanks for the fix!
>>> 
>>> On Sat, Apr 4, 2020 at 3:01 PM Guoqing Jiang
>>> <guoqing.jiang@cloud.ionos.com> wrote:
>>>> Hi,
>>>> 
>>>> After LOCKDEP is enabled, we can see some deadlock issues, this patchset
>>>> makes workqueue is flushed only necessary, and the last patch is a cleanup.
>>>> 
>>>> Thanks,
>>>> Guoqing
>>>> 
>>>> Guoqing Jiang (5):
>>>>  md: add checkings before flush md_misc_wq
>>>>  md: add new workqueue for delete rdev
>>>>  md: don't flush workqueue unconditionally in md_open
>>>>  md: flush md_rdev_misc_wq for HOT_ADD_DISK case
>>>>  md: remove the extra line for ->hot_add_disk
>>> I think we will need a new workqueue (2/5). But I am not sure about
>>> whether we should
>>> do 1/5 and 3/5. It feels like we are hiding errors from lock_dep. With
>>> some quick grep,
>>> I didn't find code pattern like
>>> 
>>>       if (work_pending(XXX))
>>>               flush_workqueue(XXX);
>> 
>> Maybe the way that md uses workqueue is quite different from other subsystems ...
>> 
>> Because, this is the safest way to address the issue. Otherwise I suppose we have to
>> rearrange the lock order or introduce new lock, either of them is tricky and could
>> cause regression.
>> 
>> Or maybe it is possible to  flush workqueue in md_check_recovery, but I would prefer
>> to make less change to avoid any potential risk.

After reading it a little more, I guess this might be the best solution for now. 
I will keep it in a local branch for more tests. 

Thanks again for the fix. 
Song

  reply	other threads:[~2020-04-10 22:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04 21:57 [PATCH 0/4] md: fix lockdep warning Guoqing Jiang
2020-04-04 21:57 ` [PATCH 1/5] md: add checkings before flush md_misc_wq Guoqing Jiang
2020-04-04 21:57 ` [PATCH 2/5] md: add new workqueue for delete rdev Guoqing Jiang
2020-04-04 21:57 ` [PATCH 3/5] md: don't flush workqueue unconditionally in md_open Guoqing Jiang
2020-04-04 21:57 ` [PATCH 4/5] md: flush md_rdev_misc_wq for HOT_ADD_DISK case Guoqing Jiang
2020-04-04 21:57 ` [PATCH 5/5] md: remove the extra line for ->hot_add_disk Guoqing Jiang
2020-04-09  7:25 ` [PATCH 0/4] md: fix lockdep warning Song Liu
2020-04-09 21:47   ` Guoqing Jiang
2020-04-10  0:32     ` Song Liu
2020-04-10 22:34       ` Song Liu [this message]
2020-04-14  7:20         ` Guoqing Jiang

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=11131DC5-A7DA-450B-86D9-803EAE8099A2@fb.com \
    --to=songliubraving@fb.com \
    --cc=guoqing.jiang@cloud.ionos.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.