提交 06aebdfb 编写于 作者: Z Zheng Zengkai

random: Fix kabi change due to enum cpuhp_state

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6BB
CVE: NA

--------------------------------

As 5064550d422d ("random: clear fast pool, crng, and batches in cpuhp bring up")
add two elements into enum cpuhp_state, the kabi of following interfaces changed:

__cpuhp_remove_state_cpuslocked()
__cpuhp_state_add_instance()
__cpuhp_setup_state()
__cpuhp_setup_state_cpuslocked()
__cpuhp_remove_state()
__cpuhp_state_remove_instance()

To fix the kabi change,
Firstly, remove the newly-added elements and related code.
Secondly, to meet the sequential relationship with workqueue cpuhp callbacks,
put the random cpuhp online callback function into the workqueue cpuhp
online callback function just before its exit,
and put the random cpuhp prepare callback function into the workqueue cpuhp
prepare callback function on the entry.
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NGUO Zihua <guozihua@huawei.com>
Reviewed-by: Nchenjun <chenjun102@huawei.com>
Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 d3fa4d25
...@@ -62,7 +62,6 @@ enum cpuhp_state { ...@@ -62,7 +62,6 @@ enum cpuhp_state {
CPUHP_LUSTRE_CFS_DEAD, CPUHP_LUSTRE_CFS_DEAD,
CPUHP_AP_ARM_CACHE_B15_RAC_DEAD, CPUHP_AP_ARM_CACHE_B15_RAC_DEAD,
CPUHP_PADATA_DEAD, CPUHP_PADATA_DEAD,
CPUHP_RANDOM_PREPARE,
CPUHP_WORKQUEUE_PREP, CPUHP_WORKQUEUE_PREP,
CPUHP_POWER_NUMA_PREPARE, CPUHP_POWER_NUMA_PREPARE,
CPUHP_HRTIMERS_PREPARE, CPUHP_HRTIMERS_PREPARE,
...@@ -198,7 +197,6 @@ enum cpuhp_state { ...@@ -198,7 +197,6 @@ enum cpuhp_state {
CPUHP_AP_PERF_POWERPC_HV_GPCI_ONLINE, CPUHP_AP_PERF_POWERPC_HV_GPCI_ONLINE,
CPUHP_AP_WATCHDOG_ONLINE, CPUHP_AP_WATCHDOG_ONLINE,
CPUHP_AP_WORKQUEUE_ONLINE, CPUHP_AP_WORKQUEUE_ONLINE,
CPUHP_AP_RANDOM_ONLINE,
CPUHP_AP_RCUTREE_ONLINE, CPUHP_AP_RCUTREE_ONLINE,
CPUHP_AP_BASE_CACHEINFO_ONLINE, CPUHP_AP_BASE_CACHEINFO_ONLINE,
CPUHP_AP_ONLINE_DYN, CPUHP_AP_ONLINE_DYN,
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include <linux/scs.h> #include <linux/scs.h>
#include <linux/percpu-rwsem.h> #include <linux/percpu-rwsem.h>
#include <linux/cpuset.h> #include <linux/cpuset.h>
#include <linux/random.h>
#include <trace/events/power.h> #include <trace/events/power.h>
#define CREATE_TRACE_POINTS #define CREATE_TRACE_POINTS
...@@ -1582,11 +1581,6 @@ static struct cpuhp_step cpuhp_hp_states[] = { ...@@ -1582,11 +1581,6 @@ static struct cpuhp_step cpuhp_hp_states[] = {
.startup.single = perf_event_init_cpu, .startup.single = perf_event_init_cpu,
.teardown.single = perf_event_exit_cpu, .teardown.single = perf_event_exit_cpu,
}, },
[CPUHP_RANDOM_PREPARE] = {
.name = "random:prepare",
.startup.single = random_prepare_cpu,
.teardown.single = NULL,
},
[CPUHP_WORKQUEUE_PREP] = { [CPUHP_WORKQUEUE_PREP] = {
.name = "workqueue:prepare", .name = "workqueue:prepare",
.startup.single = workqueue_prepare_cpu, .startup.single = workqueue_prepare_cpu,
...@@ -1703,11 +1697,6 @@ static struct cpuhp_step cpuhp_hp_states[] = { ...@@ -1703,11 +1697,6 @@ static struct cpuhp_step cpuhp_hp_states[] = {
.startup.single = workqueue_online_cpu, .startup.single = workqueue_online_cpu,
.teardown.single = workqueue_offline_cpu, .teardown.single = workqueue_offline_cpu,
}, },
[CPUHP_AP_RANDOM_ONLINE] = {
.name = "random:online",
.startup.single = random_online_cpu,
.teardown.single = NULL,
},
[CPUHP_AP_RCUTREE_ONLINE] = { [CPUHP_AP_RCUTREE_ONLINE] = {
.name = "RCU/tree:online", .name = "RCU/tree:online",
.startup.single = rcutree_online_cpu, .startup.single = rcutree_online_cpu,
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include <linux/sched/isolation.h> #include <linux/sched/isolation.h>
#include <linux/nmi.h> #include <linux/nmi.h>
#include <linux/kvm_para.h> #include <linux/kvm_para.h>
#include <linux/random.h>
#include "workqueue_internal.h" #include "workqueue_internal.h"
...@@ -5061,6 +5062,9 @@ int workqueue_prepare_cpu(unsigned int cpu) ...@@ -5061,6 +5062,9 @@ int workqueue_prepare_cpu(unsigned int cpu)
{ {
struct worker_pool *pool; struct worker_pool *pool;
/* put the random cpuhp callback here to workaround KABI change */
random_prepare_cpu(cpu);
for_each_cpu_worker_pool(pool, cpu) { for_each_cpu_worker_pool(pool, cpu) {
if (pool->nr_workers) if (pool->nr_workers)
continue; continue;
...@@ -5094,6 +5098,10 @@ int workqueue_online_cpu(unsigned int cpu) ...@@ -5094,6 +5098,10 @@ int workqueue_online_cpu(unsigned int cpu)
wq_update_unbound_numa(wq, cpu, true); wq_update_unbound_numa(wq, cpu, true);
mutex_unlock(&wq_pool_mutex); mutex_unlock(&wq_pool_mutex);
/* put the random cpuhp callback here to workaround KABI change */
random_online_cpu(cpu);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册