aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venki@google.com>2011-02-25 18:13:16 -0500
committerIngo Molnar <mingo@elte.hu>2011-02-26 01:59:58 -0500
commit544b4a1f309d18f40969dbab7e08bafd136b2f55 (patch)
tree7628de98a77e92ef27d5c596f99a62fbc18d06d8
parent7e9498705e810404ecf29bb2d6fa632b9484c609 (diff)
sched: Clean up the IRQ_TIME_ACCOUNTING code
Fix this warning: lkml.org/lkml/2011/1/30/124 kernel/sched.c:3719: warning: 'irqtime_account_idle_ticks' defined but not used kernel/sched.c:3720: warning: 'irqtime_account_process_tick' defined but not used In a cleaner way than: 7e9498705e81: sched: Add #ifdef around irq time accounting functions This patch will not have any functional impact. Signed-off-by: Venkatesh Pallipadi <venki@google.com> Cc: heiko.carstens@de.ibm.com Cc: a.p.zijlstra@chello.nl LKML-Reference: <1298675596-10992-1-git-send-email-venki@google.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/sched.c64
1 files changed, 31 insertions, 33 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 79bca166bed7..0c8712630f05 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3687,7 +3687,36 @@ void account_system_time(struct task_struct *p, int hardirq_offset,
3687 __account_system_time(p, cputime, cputime_scaled, target_cputime64); 3687 __account_system_time(p, cputime, cputime_scaled, target_cputime64);
3688} 3688}
3689 3689
3690/*
3691 * Account for involuntary wait time.
3692 * @cputime: the cpu time spent in involuntary wait
3693 */
3694void account_steal_time(cputime_t cputime)
3695{
3696 struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
3697 cputime64_t cputime64 = cputime_to_cputime64(cputime);
3698
3699 cpustat->steal = cputime64_add(cpustat->steal, cputime64);
3700}
3701
3702/*
3703 * Account for idle time.
3704 * @cputime: the cpu time spent in idle wait
3705 */
3706void account_idle_time(cputime_t cputime)
3707{
3708 struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
3709 cputime64_t cputime64 = cputime_to_cputime64(cputime);
3710 struct rq *rq = this_rq();
3711
3712 if (atomic_read(&rq->nr_iowait) > 0)
3713 cpustat->iowait = cputime64_add(cpustat->iowait, cputime64);
3714 else
3715 cpustat->idle = cputime64_add(cpustat->idle, cputime64);
3716}
3717
3690#ifndef CONFIG_VIRT_CPU_ACCOUNTING 3718#ifndef CONFIG_VIRT_CPU_ACCOUNTING
3719
3691#ifdef CONFIG_IRQ_TIME_ACCOUNTING 3720#ifdef CONFIG_IRQ_TIME_ACCOUNTING
3692/* 3721/*
3693 * Account a tick to a process and cpustat 3722 * Account a tick to a process and cpustat
@@ -3749,42 +3778,11 @@ static void irqtime_account_idle_ticks(int ticks)
3749 for (i = 0; i < ticks; i++) 3778 for (i = 0; i < ticks; i++)
3750 irqtime_account_process_tick(current, 0, rq); 3779 irqtime_account_process_tick(current, 0, rq);
3751} 3780}
3752#else 3781#else /* CONFIG_IRQ_TIME_ACCOUNTING */
3753static void irqtime_account_idle_ticks(int ticks) {} 3782static void irqtime_account_idle_ticks(int ticks) {}
3754static void irqtime_account_process_tick(struct task_struct *p, int user_tick, 3783static void irqtime_account_process_tick(struct task_struct *p, int user_tick,
3755 struct rq *rq) {} 3784 struct rq *rq) {}
3756#endif 3785#endif /* CONFIG_IRQ_TIME_ACCOUNTING */
3757#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
3758
3759/*
3760 * Account for involuntary wait time.
3761 * @steal: the cpu time spent in involuntary wait
3762 */
3763void account_steal_time(cputime_t cputime)
3764{
3765 struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
3766 cputime64_t cputime64 = cputime_to_cputime64(cputime);
3767
3768 cpustat->steal = cputime64_add(cpustat->steal, cputime64);
3769}
3770
3771/*
3772 * Account for idle time.
3773 * @cputime: the cpu time spent in idle wait
3774 */
3775void account_idle_time(cputime_t cputime)
3776{
3777 struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
3778 cputime64_t cputime64 = cputime_to_cputime64(cputime);
3779 struct rq *rq = this_rq();
3780
3781 if (atomic_read(&rq->nr_iowait) > 0)
3782 cpustat->iowait = cputime64_add(cpustat->iowait, cputime64);
3783 else
3784 cpustat->idle = cputime64_add(cpustat->idle, cputime64);
3785}
3786
3787#ifndef CONFIG_VIRT_CPU_ACCOUNTING
3788 3786
3789/* 3787/*
3790 * Account a single tick of cpu time. 3788 * Account a single tick of cpu time.