cpufreq: userspace: Use fine-grained mutex in userspace governor
authorLiao Chang <liaochang1@huawei.com>
Tue, 12 Sep 2023 06:10:56 +0000 (06:10 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 6 Oct 2023 20:01:26 +0000 (22:01 +0200)
commit285189c57391360701af348cd57ca0ba8cbf7ff6
tree4b3d643adf073d191e41598df3f226fd116d349d
parent842c34a2668f68ebe15d0fc9dc19d33733bb428d
cpufreq: userspace: Use fine-grained mutex in userspace governor

The userspace governor currently uses a big global mutex to avoid the
race condition on the governor_data field of cpufreq_policy structure.

This leads to a low concurrency if multiple userspace applications are
trying to set the speed of different policies at the same time.

Introduce a per-policy mutex to allow the updating of different policies
to be performed concurrently, improving overall concurrency.

Signed-off-by: Liao Chang <liaochang1@huawei.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq_userspace.c