Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86354
b: refs/heads/master
c: 7c811e4
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Feb 26, 2008
1 parent 5b19a02 commit 9d715c2
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f18edc95a37a901ffcbe91f5e05105f916a04fae
refs/heads/master: 7c811e4b6af424c295e3c6438fdc9b647fe6595f
2 changes: 0 additions & 2 deletions trunk/arch/um/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ void *get_current(void)
return current;
}

extern void schedule_tail(struct task_struct *prev);

/*
* This is called magically, by its address being stuffed in a jmp_buf
* and being longjmp-d to.
Expand Down
27 changes: 11 additions & 16 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,12 @@ static int proc_pid_schedstat(struct task_struct *task, char *buffer)
static int lstats_show_proc(struct seq_file *m, void *v)
{
int i;
struct task_struct *task = m->private;
seq_puts(m, "Latency Top version : v0.1\n");
struct inode *inode = m->private;
struct task_struct *task = get_proc_task(inode);

if (!task)
return -ESRCH;
seq_puts(m, "Latency Top version : v0.1\n");
for (i = 0; i < 32; i++) {
if (task->latency_record[i].backtrace[0]) {
int q;
Expand All @@ -341,32 +344,24 @@ static int lstats_show_proc(struct seq_file *m, void *v)
}

}
put_task_struct(task);
return 0;
}

static int lstats_open(struct inode *inode, struct file *file)
{
int ret;
struct seq_file *m;
struct task_struct *task = get_proc_task(inode);

ret = single_open(file, lstats_show_proc, NULL);
if (!ret) {
m = file->private_data;
m->private = task;
}
return ret;
return single_open(file, lstats_show_proc, inode);
}

static ssize_t lstats_write(struct file *file, const char __user *buf,
size_t count, loff_t *offs)
{
struct seq_file *m;
struct task_struct *task;
struct task_struct *task = get_proc_task(file->f_dentry->d_inode);

m = file->private_data;
task = m->private;
if (!task)
return -ESRCH;
clear_all_latency_tracing(task);
put_task_struct(task);

return count;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ struct task_struct;

extern void sched_init(void);
extern void sched_init_smp(void);
extern asmlinkage void schedule_tail(struct task_struct *prev);
extern void init_idle(struct task_struct *idle, int cpu);
extern void init_idle_bootup_task(struct task_struct *idle);

Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
}
/* Emit the output into the temporary buffer */
printed_len += vscnprintf(printk_buf + printed_len,
sizeof(printk_buf), fmt, args);
sizeof(printk_buf) - printed_len, fmt, args);

/*
* Copy the output into log_buf. If the caller didn't provide
Expand Down
16 changes: 11 additions & 5 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,8 @@ const_debug unsigned int sysctl_sched_nr_migrate = 32;
*/
unsigned int sysctl_sched_rt_period = 1000000;

static __read_mostly int scheduler_running;

/*
* part of the period that we allow rt tasks to run in us.
* default: 0.95s
Expand All @@ -689,14 +691,16 @@ unsigned long long cpu_clock(int cpu)
unsigned long flags;
struct rq *rq;

local_irq_save(flags);
rq = cpu_rq(cpu);
/*
* Only call sched_clock() if the scheduler has already been
* initialized (some code might call cpu_clock() very early):
*/
if (rq->idle)
update_rq_clock(rq);
if (unlikely(!scheduler_running))
return 0;

local_irq_save(flags);
rq = cpu_rq(cpu);
update_rq_clock(rq);
now = rq->clock;
local_irq_restore(flags);

Expand Down Expand Up @@ -3885,7 +3889,7 @@ pick_next_task(struct rq *rq, struct task_struct *prev)
asmlinkage void __sched schedule(void)
{
struct task_struct *prev, *next;
long *switch_count;
unsigned long *switch_count;
struct rq *rq;
int cpu;

Expand Down Expand Up @@ -7284,6 +7288,8 @@ void __init sched_init(void)
* During early bootup we pretend to be a normal task:
*/
current->sched_class = &fair_sched_class;

scheduler_running = 1;
}

#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
Expand Down
13 changes: 4 additions & 9 deletions trunk/kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,12 @@ static struct sched_entity *__pick_next_entity(struct cfs_rq *cfs_rq)

static inline struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
{
struct rb_node **link = &cfs_rq->tasks_timeline.rb_node;
struct sched_entity *se = NULL;
struct rb_node *parent;
struct rb_node *last = rb_last(&cfs_rq->tasks_timeline);

while (*link) {
parent = *link;
se = rb_entry(parent, struct sched_entity, run_node);
link = &parent->rb_right;
}
if (!last)
return NULL;

return se;
return rb_entry(last, struct sched_entity, run_node);
}

/**************************************************************
Expand Down

0 comments on commit 9d715c2

Please sign in to comment.