[PATCH v6] erofs: lazily initialize per-CPU workers and CPU hotplug hooks

Gao Xiang hsiangkao at linux.alibaba.com
Wed May 7 09:51:22 AEST 2025



On 2025/5/7 06:57, Sandeep Dhavale wrote:
> Currently, when EROFS is built with per-CPU workers, the workers are
> started and CPU hotplug hooks are registered during module initialization.
> This leads to unnecessary worker start/stop cycles during CPU hotplug
> events, particularly on Android devices that frequently suspend and resume.
> 
> This change defers the initialization of per-CPU workers and the
> registration of CPU hotplug hooks until the first EROFS mount. This
> ensures that these resources are only allocated and managed when EROFS is
> actually in use.
> 
> The tear down of per-CPU workers and unregistration of CPU hotplug hooks
> still occurs during z_erofs_exit_subsystem(), but only if they were
> initialized.
> 
> Signed-off-by: Sandeep Dhavale <dhavale at google.com>

Thanks, it looks good to me,
Reviewed-by: Gao Xiang <hsiangkao at linux.alibaba.com>

I will apply this later.

Thanks,
Gao Xiang


More information about the Linux-erofs mailing list