From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Sandeep Dhavale <dhavale@google.com>
Cc: kernel-team@android.com, linux-kernel@vger.kernel.org,
linux-erofs mailing list <linux-erofs@lists.ozlabs.org>,
Gao Xiang <xiang@kernel.org>, Chao Yu <chao@kernel.org>,
Yue Hu <zbestahu@gmail.com>,
Jeffle Xu <jefflexu@linux.alibaba.com>
Subject: Re: [PATCH v1 1/1] erofs: lazily initialize per-CPU workers and CPU hotplug hooks
Date: Mon, 31 Mar 2025 11:48:20 +0800 [thread overview]
Message-ID: <4492c013-4e59-425a-859f-5f8b30fb922d@linux.alibaba.com> (raw)
In-Reply-To: <330276be-f9cb-4263-85f5-20fe2e10cf72@linux.alibaba.com>
On 2025/3/31 11:28, Gao Xiang wrote:
>
>
> On 2025/3/31 11:14, Sandeep Dhavale wrote:
>> Hi Gao,
>>> Do we really need to destroy workers on the last mount?
>>> it could cause many unnecessary init/uninit cycles.
>>>
>>> Or your requirement is just to defer per-CPU workers to
>>> the first mount?
>>>
>>> If your case is the latter, I guess you could just call
>>> erofs_init_percpu_workers() in z_erofs_init_super().
>>>
>>>> +{
>>>> + if (atomic_dec_and_test(&erofs_mount_count))
>>>
>>> So in that case, we won't need erofs_mount_count anymore,
>>> you could just add a pcpu_worker_initialized atomic bool
>>> to control that.
>>>
>> Android devices go through suspend and resume cycles aggressively.
>>
>> And currently long running traces showed that erofs_workers being
>> created and destroyed without active erofs mount.
>> Your suggestion is good and could work for devices which do not use
>> erofs at all.
>
>> But if erofs is used once (and unmounted later),> we will not destroy the percpu workers.
>
> Is there a real use case in Android like this? It
> would be really useful to write down something in the
> commit message.
>
>>
>> Can you please expand a little bit more on your concern
>>> it could cause many unnecessary init/uninit cycles.
>> Did you mean on the cases where only one erofs fs
>> is mounted at time? Just trying to see if there is a better
>> way to address your concern.
>
> My concern is that it could slow down the mount time (on
> the single mount/unmount) if there are too many CPUs
> (especially on the server side.. 96 CPUs or more...)
>
> Or I guess if kworker CPU hotplug is not used at all
> for Android if "suspend and resume" latency is really
> important, could we just add a mode to always initialize
> pcpu kworkers for all possible CPUs.
Ok, ignore this part after more thinking.
Thanks,
Gao Xiang
prev parent reply other threads:[~2025-03-31 3:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-31 2:20 [PATCH v1 0/1] erofs: start per-CPU workers on demand Sandeep Dhavale
2025-03-31 2:20 ` [PATCH v1 1/1] erofs: lazily initialize per-CPU workers and CPU hotplug hooks Sandeep Dhavale
2025-03-31 2:38 ` Gao Xiang
2025-03-31 3:14 ` Sandeep Dhavale
2025-03-31 3:28 ` Gao Xiang
2025-03-31 3:43 ` Sandeep Dhavale
2025-03-31 3:48 ` Gao Xiang [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=4492c013-4e59-425a-859f-5f8b30fb922d@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=chao@kernel.org \
--cc=dhavale@google.com \
--cc=jefflexu@linux.alibaba.com \
--cc=kernel-team@android.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiang@kernel.org \
--cc=zbestahu@gmail.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®