[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAB=BE-S6Brg0e277mdY-d3ZwrGeUe3idz37_FJVaTesAFTGfnQ@mail.gmail.com>
Date: Sun, 30 Mar 2025 20:14:21 -0700
From: Sandeep Dhavale <dhavale@...gle.com>
To: Gao Xiang <hsiangkao@...ux.alibaba.com>
Cc: kernel-team@...roid.com, linux-kernel@...r.kernel.org,
linux-erofs mailing list <linux-erofs@...ts.ozlabs.org>, Gao Xiang <xiang@...nel.org>,
Chao Yu <chao@...nel.org>, Yue Hu <zbestahu@...il.com>,
Jeffle Xu <jefflexu@...ux.alibaba.com>
Subject: Re: [PATCH v1 1/1] erofs: lazily initialize per-CPU workers and CPU
hotplug hooks
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.
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.
Thanks,
Sandeep.
Powered by blists - more mailing lists