提交 435d7069 编写于 作者: Y Yihao Wu

alinux: sched: Fix nr_migrations compile errors

to #27363370

When CONFIG_SCHED_SLI is not set, compiler gives errors about
task_ca_increase_nr_migrations redefinition. It should've been
an empty implementation in this case.

Fixes: 965d75d3 ("alinux: cpuacct: make cpuacct record nr_migrations")
Signed-off-by: NYihao Wu <wuyihao@linux.alibaba.com>
Acked-by: NCaspar Zhang <caspar@linux.alibaba.com>
上级 8149cf4a
......@@ -77,6 +77,7 @@ static struct cpuacct root_cpuacct = {
#endif
};
#ifdef CONFIG_SCHED_SLI
void task_ca_increase_nr_migrations(struct task_struct *tsk)
{
struct cpuacct *ca;
......@@ -86,6 +87,7 @@ void task_ca_increase_nr_migrations(struct task_struct *tsk)
this_cpu_ptr(ca->alistats)->nr_migrations++;
rcu_read_unlock();
}
#endif
/* Create a new CPU accounting group */
static struct cgroup_subsys_state *
......
......@@ -2287,7 +2287,7 @@ unsigned long scale_irq_capacity(unsigned long util, unsigned long irq, unsigned
#ifdef CONFIG_SCHED_SLI
extern u64 get_idle_time(int cpu);
extern u64 get_iowait_time(int cpu);
void task_ca_increase_nr_migrations(struct task_struct *tsk);
extern void task_ca_increase_nr_migrations(struct task_struct *tsk);
#else
static inline void task_ca_increase_nr_migrations(struct task_struct *tsk) { }
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册