summaryrefslogtreecommitdiff
path: root/kernel/sched/MuQSS.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/MuQSS.h')
-rw-r--r--kernel/sched/MuQSS.h57
1 files changed, 54 insertions, 3 deletions
diff --git a/kernel/sched/MuQSS.h b/kernel/sched/MuQSS.h
index 10a12b335..f9510d739 100644
--- a/kernel/sched/MuQSS.h
+++ b/kernel/sched/MuQSS.h
@@ -2,6 +2,7 @@
#include <linux/cpuidle.h>
#include <linux/skip_list.h>
#include <linux/stop_machine.h>
+#include "cpuacct.h"
#ifndef MUQSS_SCHED_H
#define MUQSS_SCHED_H
@@ -17,9 +18,6 @@
struct rq {
struct task_struct *curr, *idle, *stop;
struct mm_struct *prev_mm;
- long nr_uninterruptible;
- s64 nr_switches;
- int nr_running;
raw_spinlock_t lock;
@@ -88,6 +86,10 @@ struct rq {
int iso_ticks;
bool iso_refractory;
+#ifdef CONFIG_HIGH_RES_TIMERS
+ struct hrtimer hrexpiry_timer;
+#endif
+
#ifdef CONFIG_SCHEDSTATS
/* latency stats */
@@ -247,6 +249,55 @@ static inline struct cpuidle_state *idle_get_state(struct rq *rq)
}
#endif
+#ifdef CONFIG_IRQ_TIME_ACCOUNTING
+
+DECLARE_PER_CPU(u64, cpu_hardirq_time);
+DECLARE_PER_CPU(u64, cpu_softirq_time);
+
+#ifndef CONFIG_64BIT
+DECLARE_PER_CPU(seqcount_t, irq_time_seq);
+
+static inline void irq_time_write_begin(void)
+{
+ __this_cpu_inc(irq_time_seq.sequence);
+ smp_wmb();
+}
+
+static inline void irq_time_write_end(void)
+{
+ smp_wmb();
+ __this_cpu_inc(irq_time_seq.sequence);
+}
+
+static inline u64 irq_time_read(int cpu)
+{
+ u64 irq_time;
+ unsigned seq;
+
+ do {
+ seq = read_seqcount_begin(&per_cpu(irq_time_seq, cpu));
+ irq_time = per_cpu(cpu_softirq_time, cpu) +
+ per_cpu(cpu_hardirq_time, cpu);
+ } while (read_seqcount_retry(&per_cpu(irq_time_seq, cpu), seq));
+
+ return irq_time;
+}
+#else /* CONFIG_64BIT */
+static inline void irq_time_write_begin(void)
+{
+}
+
+static inline void irq_time_write_end(void)
+{
+}
+
+static inline u64 irq_time_read(int cpu)
+{
+ return per_cpu(cpu_softirq_time, cpu) + per_cpu(cpu_hardirq_time, cpu);
+}
+#endif /* CONFIG_64BIT */
+#endif /* CONFIG_IRQ_TIME_ACCOUNTING */
+
#ifdef CONFIG_CPU_FREQ
DECLARE_PER_CPU(struct update_util_data *, cpufreq_update_util_data);