提交 acfa0f54 编写于 作者: Q Qiang Xu 提交者: Xie XiuQi

svm: reduce log of run queue and atomic->atomic64

ascend inclusion
category: feature
bugzilla: 16554
CVE: NA

--------

svm add the catch the log of run queue, when open
the sched debug
Signed-off-by: NJiankang Chen <chenjiankang1@huawei.com>
Signed-off-by: NQiang Xu <xuqiang36@huawei.com>
Signed-off-by: NLijun Fang <fanglijun3@huawei.com>
Reviewed-by: NLi Zefan <lizefan@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 6a53218e
...@@ -108,7 +108,7 @@ struct svm_context { ...@@ -108,7 +108,7 @@ struct svm_context {
struct svm_process *process; struct svm_process *process;
struct svm_device *sdev; struct svm_device *sdev;
struct list_head process_head; struct list_head process_head;
atomic_t ref; atomic64_t ref;
}; };
#ifndef CONFIG_ACPI #ifndef CONFIG_ACPI
...@@ -169,6 +169,21 @@ static char *svm_cmd_to_string(unsigned int cmd) ...@@ -169,6 +169,21 @@ static char *svm_cmd_to_string(unsigned int cmd)
return NULL; return NULL;
} }
#ifndef CONFIG_ACPI
extern void sysrq_sched_debug_tidy(void);
void sysrq_sched_debug_show_export(void)
{
#ifdef CONFIG_SCHED_DEBUG
sysrq_sched_debug_tidy();
#else
pr_err("Not open CONFIG_SCHED_DEBUG\n");
#endif
}
EXPORT_SYMBOL(sysrq_sched_debug_show_export);
#endif
static struct svm_process *find_svm_process(unsigned long asid) static struct svm_process *find_svm_process(unsigned long asid)
{ {
struct rb_node *node = svm_process_root.rb_node; struct rb_node *node = svm_process_root.rb_node;
...@@ -742,7 +757,7 @@ static struct svm_context *svm_process_attach(struct svm_process *process, ...@@ -742,7 +757,7 @@ static struct svm_context *svm_process_attach(struct svm_process *process,
context->process = process; context->process = process;
context->sdev = sdev; context->sdev = sdev;
atomic_set(&context->ref, 1); atomic64_set(&context->ref, 1);
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
list_for_each_entry(pos, &child_list, entry) { list_for_each_entry(pos, &child_list, entry) {
svm_bind_core(pos, process); svm_bind_core(pos, process);
...@@ -844,7 +859,7 @@ static int svm_process_bind(struct task_struct *task, ...@@ -844,7 +859,7 @@ static int svm_process_bind(struct task_struct *task,
*ttbr = virt_to_phys(mm->pgd) | asid << ASID_SHIFT; *ttbr = virt_to_phys(mm->pgd) | asid << ASID_SHIFT;
*tcr = read_sysreg(tcr_el1); *tcr = read_sysreg(tcr_el1);
*pasid = process->pasid; *pasid = process->pasid;
atomic_inc(&context->ref); atomic64_inc(&context->ref);
/* One context keep a ref of process */ /* One context keep a ref of process */
svm_process_put_locked(process); svm_process_put_locked(process);
......
...@@ -780,6 +780,33 @@ void sysrq_sched_debug_show(void) ...@@ -780,6 +780,33 @@ void sysrq_sched_debug_show(void)
} }
static void print_cpu_tidy(struct seq_file *m, int cpu)
{
struct rq *run_queue = cpu_rq(cpu);
unsigned long flags;
SEQ_printf(m, "cpu#%d\n", cpu);
spin_lock_irqsave(&sched_debug_lock, flags);
print_rq(m, run_queue, cpu);
spin_unlock_irqrestore(&sched_debug_lock, flags);
SEQ_printf(m, "\n");
}
void sysrq_sched_debug_tidy(void)
{
int cpu;
SEQ_printf(NULL, "Sched Debug Version: v0.11, %s %.*s\n",
init_utsname()->release,
(int)strcspn(init_utsname()->version, " "),
init_utsname()->version);
for_each_online_cpu(cpu)
print_cpu_tidy(NULL, cpu);
}
/* /*
* This itererator needs some explanation. * This itererator needs some explanation.
* It returns 1 for the header position. * It returns 1 for the header position.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册