Patches contributed by Eötvös Lorand University
commit 36c401a44abcc389a00f9cd14892c9cf9bf0780d
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jan 6 16:19:22 2009 +0100
[IA64] fix typo in cpumask_of_pcibus()
Impact: build fix
Fujita Tomonori reported:
drivers/pci/probe.c: In function 'pci_bus_show_cpuaffinity':
drivers/pci/probe.c:56: error: implicit declaration of function 'cpumask_from_node'
drivers/pci/probe.c:56: warning: pointer/integer type mismatch in conditional expression
make[3]: *** [drivers/pci/probe.o] Error 1
make[2]: *** [drivers/pci] Error 2
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h
index 76a33a91ca69..32f3af1641c5 100644
--- a/arch/ia64/include/asm/topology.h
+++ b/arch/ia64/include/asm/topology.h
@@ -124,7 +124,7 @@ extern void arch_fix_phys_package_id(int num, u32 slot);
#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
cpu_all_mask : \
- cpumask_from_node(pcibus_to_node(bus)))
+ cpumask_of_node(pcibus_to_node(bus)))
#include <asm-generic/topology.h>
commit 99793e3dbe39a50d871eedc361659a894601e2bf
Merge: 3e80680208ba a103e2ab7377
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jan 6 10:18:43 2009 +0100
Merge branches 'tracing/kmemtrace2' and 'tracing/ftrace' into tracing/urgent
diff --cc kernel/trace/trace.h
index 742fe1349276,a8b624ccd4d6..94ed45e93a80
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@@ -30,11 -28,9 +29,11 @@@ enum trace_type
TRACE_GRAPH_ENT,
TRACE_USER_STACK,
TRACE_HW_BRANCHES,
+ TRACE_KMEM_ALLOC,
+ TRACE_KMEM_FREE,
TRACE_POWER,
- __TRACE_LAST_TYPE
+ __TRACE_LAST_TYPE,
};
/*
commit 3e80680208ba6ce9635ca7c21ad0019442ea166a
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jan 6 10:16:35 2009 +0100
kmemtrace: add kmemtrace_init()
Impact: build fix
leftover from the relayfs version - but we want to keep it because
this call is the earliest opportunity when we can start kmemtrace
tracing. (after kmem_cache_init()).
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/kernel/trace/kmemtrace.c b/kernel/trace/kmemtrace.c
index 2bfdcd326226..faaa5ae7e75a 100644
--- a/kernel/trace/kmemtrace.c
+++ b/kernel/trace/kmemtrace.c
@@ -337,6 +337,11 @@ static struct tracer kmem_tracer __read_mostly = {
.flags = &kmem_tracer_flags
};
+void kmemtrace_init(void)
+{
+ /* earliest opportunity to start kmem tracing */
+}
+
static int __init init_kmem_tracer(void)
{
return register_tracer(&kmem_tracer);
commit 3d7a96f5a485b7d06c2379f343d7312af89ec9e2
Merge: 723cbe077551 238c6d54830c
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jan 6 09:53:05 2009 +0100
Merge branch 'linus' into tracing/kmemtrace2
commit d9be28ea9110c596a05bd2d56afa94251bd19818
Merge: c70f22d203fc 1c5745aa380e 47fea2adfc9e 238c6d54830c
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jan 6 09:33:57 2009 +0100
Merge branches 'sched/clock', 'sched/cleanups' and 'linus' into sched/urgent
diff --cc include/linux/sched.h
index 91207df702e8,8395e715809d,01d9fd268eb0,38a3f4b15394..c8a90bee2639
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@@@@ -757,48 -758,16 -758,16 -757,48 +757,48 @@@@@ enum cpu_idle_type
#define SD_SERIALIZE 1024 /* Only a single load balancing instance */
#define SD_WAKE_IDLE_FAR 2048 /* Gain latency sacrificing cache hit */
-- #define BALANCE_FOR_MC_POWER \
-- (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0)
++ enum powersavings_balance_level {
++ POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */
++ POWERSAVINGS_BALANCE_BASIC, /* Fill one thread/core/package
++ * first for long running threads
++ */
++ POWERSAVINGS_BALANCE_WAKEUP, /* Also bias task wakeups to semi-idle
++ * cpu package for power savings
++ */
++ MAX_POWERSAVINGS_BALANCE_LEVELS
++ };
+
- #define BALANCE_FOR_PKG_POWER \
- ((sched_mc_power_savings || sched_smt_power_savings) ? \
- SD_POWERSAVINGS_BALANCE : 0)
++ extern int sched_mc_power_savings, sched_smt_power_savings;
+
- #define test_sd_parent(sd, flag) ((sd->parent && \
- (sd->parent->flags & flag)) ? 1 : 0)
++ static inline int sd_balance_for_mc_power(void)
++ {
++ if (sched_smt_power_savings)
++ return SD_POWERSAVINGS_BALANCE;
+
++ return 0;
++ }
++
++ static inline int sd_balance_for_package_power(void)
++ {
++ if (sched_mc_power_savings | sched_smt_power_savings)
++ return SD_POWERSAVINGS_BALANCE;
+
- #define BALANCE_FOR_PKG_POWER \
- ((sched_mc_power_savings || sched_smt_power_savings) ? \
- SD_POWERSAVINGS_BALANCE : 0)
++ return 0;
++ }
++
++ /*
++ * Optimise SD flags for power savings:
++ * SD_BALANCE_NEWIDLE helps agressive task consolidation and power savings.
++ * Keep default SD flags if sched_{smt,mc}_power_saving=0
++ */
+
- #define test_sd_parent(sd, flag) ((sd->parent && \
- (sd->parent->flags & flag)) ? 1 : 0)
++ static inline int sd_power_saving_flags(void)
++ {
++ if (sched_mc_power_savings | sched_smt_power_savings)
++ return SD_BALANCE_NEWIDLE;
+
++ return 0;
++ }
struct sched_group {
struct sched_group *next; /* Must be a circular list */
@@@@@ -900,27 -864,11 -864,11 -900,28 +900,27 @@@@@ struct sched_domain
#ifdef CONFIG_SCHED_DEBUG
char *name;
#endif
++
++ /* span of all CPUs in this domain */
++ unsigned long span[];
};
-- extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
++ static inline struct cpumask *sched_domain_span(struct sched_domain *sd)
++ {
++ return to_cpumask(sd->span);
++ }
++
++ extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new,
struct sched_domain_attr *dattr_new);
---extern int arch_reinit_sched_domains(void);
++
++ /* Test a flag in parent sched domain */
++ static inline int test_sd_parent(struct sched_domain *sd, int flag)
++ {
++ if (sd->parent && (sd->parent->flags & flag))
++ return 1;
++
++ return 0;
++ }
#else /* CONFIG_SMP */
commit fdbc0450df12cc9cb397f3497db4b0cad7c1a8ff
Merge: 46483d10e512 90621c40cc4a ea319518ba3d 238c6d54830c
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jan 6 09:32:11 2009 +0100
Merge branches 'core/futexes', 'core/locking', 'core/rcu' and 'linus' into core/urgent
diff --cc kernel/futex.c
index 7c6cbabe52b3,206d4c906885,8af10027514b,7c6cbabe52b3..002aa189eb09
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@@@@ -144,45 -144,48 -161,6 -144,45 +144,48 @@@@@ static inline int match_futex(union fut
&& key1->both.offset == key2->both.offset);
}
+ /*
+ * Take a reference to the resource addressed by a key.
+ * Can be called while holding spinlocks.
+ *
+ */
+ static void get_futex_key_refs(union futex_key *key)
+ {
+ if (!key->both.ptr)
+ return;
+
+ switch (key->both.offset & (FUT_OFF_INODE|FUT_OFF_MMSHARED)) {
+ case FUT_OFF_INODE:
+ atomic_inc(&key->shared.inode->i_count);
+ break;
+ case FUT_OFF_MMSHARED:
+ atomic_inc(&key->private.mm->mm_count);
+ break;
+ }
+ }
+
+ /*
+ * Drop a reference to the resource addressed by a key.
+ * The hash bucket spinlock must not be held.
+ */
+ static void drop_futex_key_refs(union futex_key *key)
+ {
- - if (!key->both.ptr)
+ ++ if (!key->both.ptr) {
+ ++ /* If we're here then we tried to put a key we failed to get */
+ ++ WARN_ON_ONCE(1);
+ return;
+ ++ }
+
+ switch (key->both.offset & (FUT_OFF_INODE|FUT_OFF_MMSHARED)) {
+ case FUT_OFF_INODE:
+ iput(key->shared.inode);
+ break;
+ case FUT_OFF_MMSHARED:
+ mmdrop(key->private.mm);
+ break;
+ }
+ }
+
/**
* get_futex_key - Get parameters which are the keys for a futex.
* @uaddr: virtual address of the futex
@@@@@ -730,8 -726,8 -759,8 -730,8 +733,8 @@@@@ static int futex_wake(u32 __user *uaddr
}
spin_unlock(&hb->lock);
- -out:
+ put_futex_key(fshared, &key);
+ +out:
- futex_unlock_mm(fshared);
return ret;
}
@@@@@ -794,9 -790,9 -826,9 -794,9 +797,9 @@@@@ retry
*/
if (attempt++) {
ret = futex_handle_fault((unsigned long)uaddr2,
- fshared, attempt);
+ attempt);
if (ret)
- -- goto out;
+ ++ goto out_put_keys;
goto retry;
}
@@@@@ -834,10 -830,11 -872,9 -834,10 +837,11 @@@@@
spin_unlock(&hb1->lock);
if (hb1 != hb2)
spin_unlock(&hb2->lock);
- -out:
+ ++out_put_keys:
+ put_futex_key(fshared, &key2);
+ ++out_put_key1:
+ put_futex_key(fshared, &key1);
- -
+ +out:
- futex_unlock_mm(fshared);
-
return ret;
}
@@@@@ -854,7 -851,7 -892,9 -854,7 +858,7 @@@@@ static int futex_requeue(u32 __user *ua
struct futex_q *this, *next;
int ret, drop_count = 0;
- -- retry:
- futex_lock_mm(fshared);
-
+ ++retry:
ret = get_futex_key(uaddr1, fshared, &key1);
if (unlikely(ret != 0))
goto out;
@@@@@ -927,9 -924,11 -973,8 -927,9 +931,11 @@@@@ out_unlock
while (--drop_count >= 0)
drop_futex_key_refs(&key1);
- -out:
+ ++out_put_keys:
+ put_futex_key(fshared, &key2);
+ ++out_put_key1:
+ put_futex_key(fshared, &key1);
+ +out:
- futex_unlock_mm(fshared);
return ret;
}
@@@@@ -1172,11 -1171,11 -1217,12 -1172,11 +1178,11 @@@@@ static int futex_wait(u32 __user *uaddr
q.pi_state = NULL;
q.bitset = bitset;
- -- retry:
- futex_lock_mm(fshared);
-
+ ++retry:
+ q.key = FUTEX_KEY_INIT;
ret = get_futex_key(uaddr, fshared, &q.key);
if (unlikely(ret != 0))
- -- goto out_release_sem;
+ ++ goto out;
hb = queue_lock(&q);
@@@@@ -1204,6 -1203,7 -1250,12 -1204,6 +1210,7 @@@@@
if (unlikely(ret)) {
queue_unlock(&q, hb);
-
- /*
- * If we would have faulted, release mmap_sem, fault it in and
- * start all over again.
- */
- futex_unlock_mm(fshared);
+ ++ put_futex_key(fshared, &q.key);
ret = get_user(uval, uaddr);
@@@@@ -1305,11 -1305,11 -1359,11 -1305,11 +1312,11 @@@@@
return -ERESTART_RESTARTBLOCK;
}
- -- out_unlock_release_sem:
+ ++out_unlock_put_key:
queue_unlock(&q, hb);
- -
- - out_release_sem:
+ put_futex_key(fshared, &q.key);
+ +
- out_release_sem:
- futex_unlock_mm(fshared);
+ ++out:
return ret;
}
@@@@@ -1358,16 -1358,16 -1411,17 -1358,16 +1365,16 @@@@@ static int futex_lock_pi(u32 __user *ua
}
q.pi_state = NULL;
- -- retry:
- futex_lock_mm(fshared);
-
+ ++retry:
+ q.key = FUTEX_KEY_INIT;
ret = get_futex_key(uaddr, fshared, &q.key);
if (unlikely(ret != 0))
- -- goto out_release_sem;
+ ++ goto out;
- -- retry_unlocked:
+ ++retry_unlocked:
hb = queue_lock(&q);
- -- retry_locked:
+ ++retry_locked:
ret = lock_taken = 0;
/*
@@@@@ -1561,29 -1561,30 -1624,31 -1561,29 +1568,30 @@@@@
destroy_hrtimer_on_stack(&to->timer);
return ret != -EINTR ? ret : -ERESTARTNOINTR;
- -- out_unlock_release_sem:
+ ++out_unlock_put_key:
queue_unlock(&q, hb);
- -- out_release_sem:
- futex_unlock_mm(fshared);
+ ++out_put_key:
+ put_futex_key(fshared, &q.key);
+ ++out:
if (to)
destroy_hrtimer_on_stack(&to->timer);
return ret;
- -- uaddr_faulted:
+ ++uaddr_faulted:
/*
- * We have to r/w *(int __user *)uaddr, but we can't modify it
- * non-atomically. Therefore, if get_user below is not
- * enough, we need to handle the fault ourselves, while
- * still holding the mmap_sem.
- *
- * ... and hb->lock. :-) --ANK
+ * We have to r/w *(int __user *)uaddr, and we have to modify it
+ * atomically. Therefore, if we continue to fault after get_user()
+ * below, we need to handle the fault ourselves, while still holding
+ * the mmap_sem. This can occur if the uaddr is under contention as
+ * we have to drop the mmap_sem in order to call get_user().
*/
queue_unlock(&q, hb);
if (attempt++) {
- ret = futex_handle_fault((unsigned long)uaddr, fshared,
- attempt);
+ ret = futex_handle_fault((unsigned long)uaddr, attempt);
if (ret)
- -- goto out_release_sem;
+ ++ goto out_put_key;
goto retry_unlocked;
}
@@@@@ -1675,9 -1676,9 -1746,9 -1675,9 +1683,9 @@@@@ retry_unlocked
out_unlock:
spin_unlock(&hb->lock);
- --out:
- futex_unlock_mm(fshared);
+ put_futex_key(fshared, &key);
+ ++out:
return ret;
pi_faulted:
commit d12418fdeafdc08dd5bbec89d3e07e47ee75da55
Merge: c2d1cec1c77f 238c6d54830c
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jan 6 09:04:32 2009 +0100
Merge branch 'linus' into cpus4096
commit be92d7af38fb8a91f8575ab2272e00f2e51667ff
Author: Ingo Molnar <mingo@elte.hu>
Date: Mon Jan 5 14:34:42 2009 +0100
genirq: provide irq_to_desc() to non-genirq architectures too
Impact: build fix on non-genirq architectures
Sam Ravnborg reported this build failure on sparc32 allmodconfig,
the GPIO drivers assume the presence of irq_to_desc():
drivers/gpio/gpiolib.c: In function `gpiolib_dbg_show':
drivers/gpio/gpiolib.c:1146: error: implicit declaration of function 'irq_to_desc'
Add it in the !genirq case too.
Reported-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Tested-by: Sam Ravnborg <sam@ravnborg.org>
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index 5504a5c97836..86af92e9e84c 100644
--- a/include/linux/irqnr.h
+++ b/include/linux/irqnr.h
@@ -8,7 +8,12 @@
#ifndef CONFIG_GENERIC_HARDIRQS
#include <asm/irq.h>
-# define nr_irqs NR_IRQS
+
+/*
+ * Wrappers for non-genirq architectures:
+ */
+#define nr_irqs NR_IRQS
+#define irq_to_desc(irq) (&irq_desc[irq])
# define for_each_irq_desc(irq, desc) \
for (irq = 0; irq < nr_irqs; irq++)
commit 46483d10e5123d78cf9abf37577aa8e75f18b8a4
Merge: c59ab97e9ecd 874d6a955551
Author: Ingo Molnar <mingo@elte.hu>
Date: Mon Jan 5 14:17:24 2009 +0100
Merge branch 'core/iommu' into core/urgent
Conflicts:
lib/swiotlb.c
commit 82c5b7b527ccc4b5d3cf832437e842f9d2920a79
Author: Ingo Molnar <mingo@elte.hu>
Date: Mon Jan 5 14:11:10 2009 +0100
hrtimer: splitout peek ahead functionality, fix
Impact: build fix on !CONFIG_HIGH_RES_TIMERS
Fix:
kernel/hrtimer.c:1586: error: implicit declaration of function '__hrtimer_peek_ahead_timers'
Signen-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index aa024f2af78c..1455b7651b6b 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1268,7 +1268,11 @@ static void run_hrtimer_softirq(struct softirq_action *h)
hrtimer_peek_ahead_timers();
}
-#endif /* CONFIG_HIGH_RES_TIMERS */
+#else /* CONFIG_HIGH_RES_TIMERS */
+
+static inline void __hrtimer_peek_ahead_timers(void) { }
+
+#endif /* !CONFIG_HIGH_RES_TIMERS */
/*
* Called from timer softirq every jiffy, expire hrtimers: