Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61771
b: refs/heads/master
c: e436d80
h: refs/heads/master
i:
  61769: c9d320c
  61767: ce25915
v: v3
  • Loading branch information
Ingo Molnar committed Jul 19, 2007
1 parent a84fcc1 commit 4f35dd7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 969bb4e4032dac67287951d8f6642a3b5119694e
refs/heads/master: e436d80085133858bf2613a630365e8a0459fd58
7 changes: 7 additions & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,13 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
#endif

extern unsigned long long sched_clock(void);

/*
* For kernel-internal use: high-speed (but slightly incorrect) per-cpu
* clock constructed from sched_clock():
*/
extern unsigned long long cpu_clock(int cpu);

extern unsigned long long
task_sched_runtime(struct task_struct *task);

Expand Down
17 changes: 17 additions & 0 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,23 @@ static inline unsigned long long rq_clock(struct rq *rq)
#define task_rq(p) cpu_rq(task_cpu(p))
#define cpu_curr(cpu) (cpu_rq(cpu)->curr)

/*
* For kernel-internal use: high-speed (but slightly incorrect) per-cpu
* clock constructed from sched_clock():
*/
unsigned long long cpu_clock(int cpu)
{
struct rq *rq = cpu_rq(cpu);
unsigned long long now;
unsigned long flags;

spin_lock_irqsave(&rq->lock, flags);
now = rq_clock(rq);
spin_unlock_irqrestore(&rq->lock, flags);

return now;
}

#ifdef CONFIG_FAIR_GROUP_SCHED
/* Change a task's ->cfs_rq if it moves across CPUs */
static inline void set_task_cfs_rq(struct task_struct *p)
Expand Down

0 comments on commit 4f35dd7

Please sign in to comment.