From: Mike Travis Date: Thu, 1 Jan 2009 01:34:16 +0000 (-0800) Subject: Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux... X-Git-Tag: v2.6.29-rc1~521^2~11 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7eb19553369c46cc1fa64caf120cbcab1b597f7c;p=linux-2.6-omap-h63xx.git Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask into merge-rr-cpumask Conflicts: arch/x86/kernel/io_apic.c kernel/rcuclassic.c kernel/sched.c kernel/time/tick-sched.c Signed-off-by: Mike Travis [ mingo@elte.hu: backmerged typo fix for io_apic.c ] Signed-off-by: Ingo Molnar --- 7eb19553369c46cc1fa64caf120cbcab1b597f7c diff --cc arch/powerpc/include/asm/topology.h index 373fca394a5,236dae1cd29..375258559ae --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h @@@ -46,8 -46,13 +46,12 @@@ static inline int pcibus_to_node(struc node_to_cpumask(pcibus_to_node(bus)) \ ) + #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ + cpu_all_mask : \ + cpumask_of_node(pcibus_to_node(bus))) + /* sched_domains SD_NODE_INIT for PPC64 machines */ #define SD_NODE_INIT (struct sched_domain) { \ - .span = CPU_MASK_NONE, \ .parent = NULL, \ .child = NULL, \ .groups = NULL, \ diff --cc arch/x86/include/asm/irq.h index 4bb732e45a8,28e409fc73f..592688ed04d --- a/arch/x86/include/asm/irq.h +++ b/arch/x86/include/asm/irq.h @@@ -31,13 -31,9 +31,9 @@@ static inline int irq_canonicalize(int # endif #endif - #ifdef CONFIG_IRQBALANCE - extern int irqbalance_disable(char *str); - #endif - #ifdef CONFIG_HOTPLUG_CPU #include -extern void fixup_irqs(cpumask_t map); +extern void fixup_irqs(void); #endif extern unsigned int do_IRQ(struct pt_regs *regs); diff --cc kernel/sched.c index 756d981d91a,f2095660efe..27ba1d642f0 --- a/kernel/sched.c +++ b/kernel/sched.c @@@ -5477,17 -5426,8 +5495,16 @@@ long sched_setaffinity(pid_t pid, cons get_task_struct(p); read_unlock(&tasklist_lock); + if (!alloc_cpumask_var(&cpus_allowed, GFP_KERNEL)) { + retval = -ENOMEM; + goto out_put_task; + } + if (!alloc_cpumask_var(&new_mask, GFP_KERNEL)) { + retval = -ENOMEM; + goto out_free_cpus_allowed; + } retval = -EPERM; - if ((current->euid != p->euid) && (current->euid != p->uid) && - !capable(CAP_SYS_NICE)) + if (!check_same_owner(p) && !capable(CAP_SYS_NICE)) goto out_unlock; retval = security_task_setscheduler(p, 0, NULL); diff --cc kernel/time/tick-sched.c index 70f872c71f4,8f3fc2582d3..76a574bbef9 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@@ -282,8 -282,31 +282,31 @@@ void tick_nohz_stop_sched_tick(int inid /* Schedule the tick, if we are at least one jiffie off */ if ((long)delta_jiffies >= 1) { + /* + * calculate the expiry time for the next timer wheel + * timer + */ + expires = ktime_add_ns(last_update, tick_period.tv64 * + delta_jiffies); + + /* + * If this cpu is the one which updates jiffies, then + * give up the assignment and let it be taken by the + * cpu which runs the tick timer next, which might be + * this cpu as well. If we don't drop this here the + * jiffies might be stale and do_timer() never + * invoked. + */ + if (cpu == tick_do_timer_cpu) + tick_do_timer_cpu = TICK_DO_TIMER_NONE; + if (delta_jiffies > 1) - cpu_set(cpu, nohz_cpu_mask); + cpumask_set_cpu(cpu, nohz_cpu_mask); + + /* Skip reprogram of event if its not changed */ + if (ts->tick_stopped && ktime_equal(expires, dev->next_event)) + goto out; + /* * nohz_stop_sched_tick can be called several times before * the nohz_restart_sched_tick is called. This happens when