]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 26 Feb 2008 15:44:09 +0000 (07:44 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 26 Feb 2008 15:44:09 +0000 (07:44 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86: (24 commits)
  x86: no robust/pi futex for real i386 CPUs
  x86: fix boot failure on 486 due to TSC breakage
  x86: fix build on non-C locales.
  x86: make c_idle.work have a static address.
  x86: don't save unreliable stack trace entries
  x86: don't make swapper_pg_pmd global
  x86: don't print a warning when MTRR are blank and running in KVM
  x86: fix execve with -fstack-protect
  x86: fix vsyscall wreckage
  x86: rename KERNEL_TEXT_SIZE => KERNEL_IMAGE_SIZE
  x86: fix spontaneous reboot with allyesconfig bzImage
  x86: remove double-checking empty zero pages debug
  x86: notsc is ignored on common configurations
  x86/mtrr: fix kernel-doc missing notation
  x86: handle BIOSes which terminate e820 with CF=1 and no SMAP
  x86: add comments for NOPs
  x86: don't use P6_NOPs if compiling with CONFIG_X86_GENERIC
  x86: require family >= 6 if we are using P6 NOPs
  x86: do not promote TM3x00/TM5x00 to i686-class
  x86: hpet fix docbook comment
  ...

arch/um/kernel/process.c
fs/proc/base.c
include/linux/sched.h
kernel/printk.c
kernel/sched.c
kernel/sched_fair.c

index fc50d2f959d12f44bc6c41171f3cc030d6ad38fa..e8cb9ff183e9fe1da41020bc39ffe22b43ef56c7 100644 (file)
@@ -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.
index 96ee899d65020e76e5c0c8d49b0683c74214ebed..91a1bd67ac1d6dd58da1d3db5c0691cdb7ea7525 100644 (file)
@@ -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;
@@ -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;
 }
index e217d188a102bec8b15693f6a871945f823431be..9c17e828d6d4f14ea2734aec19e97bb6afe456d9 100644 (file)
@@ -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);
 
index bee36100f110ab75617ad4dce16beac9e1434f76..9adc2a473e6e0f59bbc41350422d415e8f17a7ec 100644 (file)
@@ -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
index b387a8de26a5f9ca8b6e2e9d3ad33f66fbf65882..f06950c8a6ce17b95624bccc63ecfb399d2eb40c 100644 (file)
@@ -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
@@ -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);
 
@@ -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;
 
@@ -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
index 6c091d6e159d01fb23c0dd786495c533cb005c5b..c8e6492c5925f0dea503d48d04b9a12a6f0ade51 100644 (file)
@@ -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);
 }
 
 /**************************************************************