Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86330
b: refs/heads/master
c: cbc3497
h: refs/heads/master
v: v3
  • Loading branch information
Harvey Harrison authored and Ingo Molnar committed Feb 26, 2008
1 parent 38c086a commit 0b76060
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 38 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: 37c00b84d0c1b5c4c65ae837e2235160c03e84c2
refs/heads/master: cbc34973709eb41b369c304c075cf2069f847012
2 changes: 2 additions & 0 deletions trunk/arch/um/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ 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
10 changes: 1 addition & 9 deletions trunk/arch/x86/lguest/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include <linux/lguest_launcher.h>
#include <linux/virtio_console.h>
#include <linux/pm.h>
#include <asm/lguest.h>
#include <asm/paravirt.h>
#include <asm/param.h>
#include <asm/page.h>
Expand All @@ -75,15 +76,6 @@
* behaving in simplified but equivalent ways. In particular, the Guest is the
* same kernel as the Host (or at least, built from the same source code). :*/

/* Declarations for definitions in lguest_guest.S */
extern char lguest_noirq_start[], lguest_noirq_end[];
extern const char lgstart_cli[], lgend_cli[];
extern const char lgstart_sti[], lgend_sti[];
extern const char lgstart_popf[], lgend_popf[];
extern const char lgstart_pushf[], lgend_pushf[];
extern const char lgstart_iret[], lgend_iret[];
extern void lguest_iret(void);

struct lguest_data lguest_data = {
.hcall_status = { [0 ... LHCALL_RING_SIZE-1] = 0xFF },
.noirq_start = (u32)lguest_noirq_start,
Expand Down
27 changes: 16 additions & 11 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,9 @@ 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 inode *inode = m->private;
struct task_struct *task = get_proc_task(inode);

if (!task)
return -ESRCH;
struct task_struct *task = m->private;
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 @@ -344,24 +341,32 @@ 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)
{
return single_open(file, lstats_show_proc, inode);
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;
}

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

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

return count;
}
Expand Down
11 changes: 11 additions & 0 deletions trunk/include/asm-x86/lguest.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@
/* Found in switcher.S */
extern unsigned long default_idt_entries[];

/* Declarations for definitions in lguest_guest.S */
extern char lguest_noirq_start[], lguest_noirq_end[];
extern const char lgstart_cli[], lgend_cli[];
extern const char lgstart_sti[], lgend_sti[];
extern const char lgstart_popf[], lgend_popf[];
extern const char lgstart_pushf[], lgend_pushf[];
extern const char lgstart_iret[], lgend_iret[];

extern void lguest_iret(void);
extern void lguest_init(void);

struct lguest_regs
{
/* Manually saved part. */
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ 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) - printed_len, fmt, args);
sizeof(printk_buf), fmt, args);

/*
* Copy the output into log_buf. If the caller didn't provide
Expand Down
16 changes: 5 additions & 11 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,6 @@ 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 @@ -691,16 +689,14 @@ 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 (unlikely(!scheduler_running))
return 0;

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

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

Expand Down Expand Up @@ -7288,8 +7284,6 @@ 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: 9 additions & 4 deletions trunk/kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,17 @@ 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 *last = rb_last(&cfs_rq->tasks_timeline);
struct rb_node **link = &cfs_rq->tasks_timeline.rb_node;
struct sched_entity *se = NULL;
struct rb_node *parent;

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

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

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

0 comments on commit 0b76060

Please sign in to comment.