Commit 2bc7bc93 authored by Sandeep Dhavale's avatar Sandeep Dhavale Committed by Isaac Manjarres
Browse files

BACKPORT: erofs: lazily initialize per-CPU workers and CPU hotplug hooks



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.

Bug: 382400420
Signed-off-by: default avatarSandeep Dhavale <dhavale@google.com>
Reviewed-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20250506225743.308517-1-dhavale@google.com


Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>

(cherry picked from commit 12bf25d1)
[dhavale: resolved conflict in z_erofs_init_zip_subsystem()
erofs_init_managed_cache() was renamed upstream as z_erofs_init_super()
so the changes are applied to erofs_init_managed_cache()]

Change-Id: I895b5350e357c2165d44f85cf7a3811e0e48f1b0
parent 434940a4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment