From: Yu Kuai <yukuai1@huaweicloud.com>
To: Song Liu <song@kernel.org>, Yu Kuai <yukuai1@huaweicloud.com>
Cc: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>,
linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
yi.zhang@huawei.com, yangerkun@huawei.com,
"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH -next] md: simplify md_seq_ops
Date: Mon, 25 Sep 2023 09:07:06 +0800 [thread overview]
Message-ID: <d4f63e49-b5a9-3972-4232-94ffe10ceb2d@huaweicloud.com> (raw)
In-Reply-To: <CAPhsuW59JAy7q2B1DeCbKGVAap4pOrfXuyzs9T9KOnaM-4VSdA@mail.gmail.com>
Hi,
在 2023/09/23 5:22, Song Liu 写道:
> On Mon, Sep 11, 2023 at 6:02 PM Yu Kuai <yukuai1@huaweicloud.com> wrote:
>>
> [...]
>>>> +static void *md_seq_start(struct seq_file *seq, loff_t *pos)
>>>> +{
>>>> + struct md_personality *pers;
>>>> +
>>>> + seq_puts(seq, "Personalities : ");
>>>> + spin_lock(&pers_lock);
>>>> + list_for_each_entry(pers, &pers_list, list)
>>>> + seq_printf(seq, "[%s] ", pers->name);
>>>> +
>>>> + spin_unlock(&pers_lock);
>>>> + seq_puts(seq, "\n");
>>>> + seq->poll_event = atomic_read(&md_event_count);
>>>> +
>>>> + spin_lock(&all_mddevs_lock);
>>>
>>> I would prefer to increase "active" instead holding lock when enumerating over
>>> the devices. the main reason is that parsing mdstat is implemented in mdadm, so
>>> it could kind of blocker action- for example mdmon follows mdstat so it is read
>>> frequently. The time of getting other actions done can highly increase because
>>> every open or sysfs_read/write requires this lock.
>
> Existing code holds pers_lock can seq_printf() in md_seq_show(). Do we see
> issues with this?
before this patch, in each loop:
- hold lock, get mddev, drop lock
- md_seq_show
and after this patch:
- hold lock in start, drop lock in stop
- lock is always held in each loop
And mariusz is concerned that lock time is increased and may cause some
performance regression.
We've discussed in slack, and decided to keep this behaviour. I'll
update this in v2.
Thanks,
Kuai
>
> Hi Kuai,
>
> This patch doesn't apply cleanly to md-next now. Please rebase and send v2.
>
> Thanks,
> Song
> .
>
prev parent reply other threads:[~2023-09-25 1:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 6:50 [PATCH -next] md: simplify md_seq_ops Yu Kuai
2023-09-11 14:05 ` Mariusz Tkaczyk
2023-09-12 1:02 ` Yu Kuai
2023-09-13 10:32 ` Mariusz Tkaczyk
2023-09-22 21:22 ` Song Liu
2023-09-25 1:07 ` Yu Kuai [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=d4f63e49-b5a9-3972-4232-94ffe10ceb2d@huaweicloud.com \
--to=yukuai1@huaweicloud.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=mariusz.tkaczyk@linux.intel.com \
--cc=song@kernel.org \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@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;
as well as URLs for NNTP newsgroup(s).