diff options
Diffstat (limited to 'kernel/sched_debug.c')
| -rw-r--r-- | kernel/sched_debug.c | 25 | 
1 files changed, 14 insertions, 11 deletions
| diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c index e6fb392e516..80fbbfc0429 100644 --- a/kernel/sched_debug.c +++ b/kernel/sched_debug.c @@ -31,9 +31,9 @@  /*   * Ease the printing of nsec fields:   */ -static long long nsec_high(long long nsec) +static long long nsec_high(unsigned long long nsec)  { -	if (nsec < 0) { +	if ((long long)nsec < 0) {  		nsec = -nsec;  		do_div(nsec, 1000000);  		return -nsec; @@ -43,9 +43,9 @@ static long long nsec_high(long long nsec)  	return nsec;  } -static unsigned long nsec_low(long long nsec) +static unsigned long nsec_low(unsigned long long nsec)  { -	if (nsec < 0) +	if ((long long)nsec < 0)  		nsec = -nsec;  	return do_div(nsec, 1000000); @@ -80,6 +80,7 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)  static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)  {  	struct task_struct *g, *p; +	unsigned long flags;  	SEQ_printf(m,  	"\nrunnable tasks:\n" @@ -88,7 +89,7 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)  	"------------------------------------------------------"  	"----------------------------------------------------\n"); -	read_lock_irq(&tasklist_lock); +	read_lock_irqsave(&tasklist_lock, flags);  	do_each_thread(g, p) {  		if (!p->se.on_rq || task_cpu(p) != rq_cpu) @@ -97,7 +98,7 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)  		print_task(m, rq, p);  	} while_each_thread(g, p); -	read_unlock_irq(&tasklist_lock); +	read_unlock_irqrestore(&tasklist_lock, flags);  }  void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) @@ -198,7 +199,7 @@ static int sched_debug_show(struct seq_file *m, void *v)  	u64 now = ktime_to_ns(ktime_get());  	int cpu; -	SEQ_printf(m, "Sched Debug Version: v0.06-v22, %s %.*s\n", +	SEQ_printf(m, "Sched Debug Version: v0.07, %s %.*s\n",  		init_utsname()->release,  		(int)strcspn(init_utsname()->version, " "),  		init_utsname()->version); @@ -210,7 +211,7 @@ static int sched_debug_show(struct seq_file *m, void *v)  #define PN(x) \  	SEQ_printf(m, "  .%-40s: %Ld.%06ld\n", #x, SPLIT_NS(x))  	PN(sysctl_sched_latency); -	PN(sysctl_sched_nr_latency); +	PN(sysctl_sched_min_granularity);  	PN(sysctl_sched_wakeup_granularity);  	PN(sysctl_sched_batch_wakeup_granularity);  	PN(sysctl_sched_child_runs_first); @@ -326,10 +327,12 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m)  			avg_atom = -1LL;  		avg_per_cpu = p->se.sum_exec_runtime; -		if (p->se.nr_migrations) -			avg_per_cpu = div64_64(avg_per_cpu, p->se.nr_migrations); -		else +		if (p->se.nr_migrations) { +			avg_per_cpu = div64_64(avg_per_cpu, +					       p->se.nr_migrations); +		} else {  			avg_per_cpu = -1LL; +		}  		__PN(avg_atom);  		__PN(avg_per_cpu); | 
