patches/0000775000076400007640000000000011161723724011241 5ustar tglxtglxpatches/preempt-realtimer-timer-non-rt-warning-fixes.patch0000664000076400007640000000317511160752235023034 0ustar tglxtglxSubject: timer:fix build warning in timer.c From: Shi Weihua Date: Thu, 14 Feb 2008 18:02:14 +0800 [ The following text is in the "UTF-8" character set. ] [ Your display is set for the "iso-8859-1" character set. ] [ Some characters may be displayed incorrectly. ] Fix the following compile warning without CONFIG_PREEMPT_RT: kernel/timer.c:937: warning: â^À^Øcount_active_rt_tasksâ^À^Ù defined but not used Signed-off-by: Shi Weihua Signed-off-by: Ingo Molnar --- --- kernel/timer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: linux-2.6-tip/kernel/timer.c =================================================================== --- linux-2.6-tip.orig/kernel/timer.c +++ linux-2.6-tip/kernel/timer.c @@ -1199,20 +1199,18 @@ static unsigned long count_active_tasks( #endif } +#ifdef CONFIG_PREEMPT_RT /* * Nr of active tasks - counted in fixed-point numbers */ static unsigned long count_active_rt_tasks(void) { -#ifdef CONFIG_PREEMPT_RT extern unsigned long rt_nr_running(void); extern unsigned long rt_nr_uninterruptible(void); return (rt_nr_running() + rt_nr_uninterruptible()) * FIXED_1; -#else - return 0; -#endif } +#endif /* * Hmm.. Changed this, as the GNU make sources (load.c) seems to @@ -1241,7 +1239,9 @@ static inline void calc_load(unsigned lo count -= ticks; if (unlikely(count < 0)) { active_tasks = count_active_tasks(); +#ifdef CONFIG_PREEMPT_RT active_rt_tasks = count_active_rt_tasks(); +#endif do { CALC_LOAD(avenrun[0], EXP_1, active_tasks); CALC_LOAD(avenrun[1], EXP_5, active_tasks); patches/rt-mutex-core-fixes2.patch0000664000076400007640000000337511160752235016201 0ustar tglxtglxSubject: mingo: rt spinlock fix From: Ingo Molnar Date: Sun Feb 08 17:10:09 CET 2009 Signed-off-by: Ingo Molnar --- include/linux/spinlock_api_smp.h | 2 +- kernel/spinlock.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) Index: linux-2.6-tip/include/linux/spinlock_api_smp.h =================================================================== --- linux-2.6-tip.orig/include/linux/spinlock_api_smp.h +++ linux-2.6-tip/include/linux/spinlock_api_smp.h @@ -19,7 +19,7 @@ int in_lock_functions(unsigned long addr #define assert_spin_locked(x) BUG_ON(!spin_is_locked(x)) -void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *map) +void __lockfunc __spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map) __acquires(lock); #define ACQUIRE_SPIN __acquires(lock) #define ACQUIRE_RW __acquires(lock) Index: linux-2.6-tip/kernel/spinlock.c =================================================================== --- linux-2.6-tip.orig/kernel/spinlock.c +++ linux-2.6-tip/kernel/spinlock.c @@ -345,16 +345,16 @@ void __lockfunc __spin_lock_nested(raw_s } EXPORT_SYMBOL(__spin_lock_nested); -void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, +void __lockfunc __spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *nest_lock) { preempt_disable(); spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_); LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); } -EXPORT_SYMBOL(_spin_lock_nest_lock); +EXPORT_SYMBOL(__spin_lock_nest_lock); -unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass) +unsigned long __lockfunc __spin_lock_irqsave_nested(raw_spinlock_t *lock, int subclass) { unsigned long flags; patches/arm-preempt-config.patch0000664000076400007640000000173511160752235015762 0ustar tglxtglx arch/arm/Kconfig | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) Index: linux-2.6-tip/arch/arm/Kconfig =================================================================== --- linux-2.6-tip.orig/arch/arm/Kconfig +++ linux-2.6-tip/arch/arm/Kconfig @@ -838,18 +838,7 @@ config LOCAL_TIMERS accounting to be spread across the timer interval, preventing a "thundering herd" at every timer tick. -config PREEMPT - bool "Preemptible Kernel (EXPERIMENTAL)" - depends on EXPERIMENTAL - help - This option reduces the latency of the kernel when reacting to - real-time or interactive events by allowing a low priority process to - be preempted even if it is in kernel mode executing a system call. - This allows applications to run more reliably even when the system is - under load. - - Say Y here if you are building a kernel for a desktop, embedded - or real-time system. Say N if you are unsure. +source kernel/Kconfig.preempt config HZ int patches/fix-erroneous-histogram-stop-warn-on-messages.patch0000664000076400007640000000222611160752235023231 0ustar tglxtglxSubject: ftrace: fix erroneous histogram stop WARN_ON() messages From: Thomas Gleixner Date: Wed, 28 Jan 2009 14:02:06 +0100 IRQs are temporarily disabled during histogram calculation in cycles_2_ns(). This causes a nested irqs_off histogram processing which emittes an erroneous WARN_ON() message and also confuses the histogramm output. Change local_irq to raw_local_irq in cycles_2_ns to prevent irqs_off histogram processing. Tested-by: Carsten Emde Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/include/asm/timer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6-tip/arch/x86/include/asm/timer.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/timer.h +++ linux-2.6-tip/arch/x86/include/asm/timer.h @@ -58,9 +58,9 @@ static inline unsigned long long cycles_ unsigned long long ns; unsigned long flags; - local_irq_save(flags); + raw_local_irq_save(flags); ns = __cycles_2_ns(cyc); - local_irq_restore(flags); + raw_local_irq_restore(flags); return ns; } patches/seqlocks-handle-rwlock-and-spin.patch0000664000076400007640000000355011160752235020346 0ustar tglxtglxSubject: seqlock - fix for both PREEMPT_RT and non PREEMPT_RT From: Steven Rostedt The change to have two different types of locks (spinlocks for raw seqlocks and rwlocks for preempt seqlocks), caused the non PREEMPT_RT build to fail. This patch cleans up the code a bit to allow for both types of locks. Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- include/linux/seqlock.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) Index: linux-2.6-tip/include/linux/seqlock.h =================================================================== --- linux-2.6-tip.orig/include/linux/seqlock.h +++ linux-2.6-tip/include/linux/seqlock.h @@ -30,6 +30,7 @@ * Priority inheritance and live-lock avoidance by Gregory Haskins */ +#include #include #include @@ -69,11 +70,25 @@ typedef __raw_seqlock_t raw_seqlock_t; #define SEQLOCK_UNLOCKED \ __SEQLOCK_UNLOCKED(old_style_seqlock_init) -#define raw_seqlock_init(x) \ - do { *(x) = (raw_seqlock_t) __RAW_SEQLOCK_UNLOCKED(x); spin_lock_init(&(x)->lock); } while (0) +static inline void __raw_seqlock_init(raw_seqlock_t *seqlock) +{ + *seqlock = (raw_seqlock_t) __RAW_SEQLOCK_UNLOCKED(x); + spin_lock_init(&seqlock->lock); +} + +#ifdef CONFIG_PREEMPT_RT +static inline void __seqlock_init(seqlock_t *seqlock) +{ + *seqlock = (seqlock_t) __SEQLOCK_UNLOCKED(seqlock); + rwlock_init(&seqlock->lock); +} +#else +extern void __seqlock_init(seqlock_t *seqlock); +#endif -#define seqlock_init(x) \ - do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); rwlock_init(&(x)->lock); } while (0) +#define seqlock_init(seq) \ + PICK_FUNCTION(raw_seqlock_t *, seqlock_t *, \ + __raw_seqlock_init, __seqlock_init, seq); #define DEFINE_SEQLOCK(x) \ seqlock_t x = __SEQLOCK_UNLOCKED(x) patches/preempt-irqs-port-fixes.patch0000664000076400007640000000206111160752235017005 0ustar tglxtglxSubject: preempt: irqs port fixes From: Ingo Molnar Date: Wed Feb 04 01:41:19 CET 2009 cpumask infrastructure related changes. Signed-off-by: Ingo Molnar --- kernel/irq/manage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: linux-2.6-tip/kernel/irq/manage.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/manage.c +++ linux-2.6-tip/kernel/irq/manage.c @@ -970,7 +970,7 @@ static int do_irqd(void * __desc) struct irq_desc *desc = __desc; #ifdef CONFIG_SMP - set_cpus_allowed(current, desc->affinity); + set_cpus_allowed_ptr(current, desc->affinity); #endif current->flags |= PF_NOFREEZE | PF_HARDIRQ; @@ -993,8 +993,8 @@ static int do_irqd(void * __desc) /* * Did IRQ affinities change? */ - if (!cpus_equal(current->cpus_allowed, desc->affinity)) - set_cpus_allowed(current, desc->affinity); + if (!cpumask_equal(¤t->cpus_allowed, desc->affinity)) + set_cpus_allowed_ptr(current, desc->affinity); #endif schedule(); } patches/preempt-rt-scatterlist-nort.patch0000664000076400007640000000252711160752235017704 0ustar tglxtglxSubject: preempt-rt-scatterlist-nort.patch From: Thomas Gleixner Date: Mon, 16 Feb 2009 23:14:40 +0100 Signed-off-by: Thomas Gleixner --- lib/scatterlist.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) Index: linux-2.6-tip/lib/scatterlist.c =================================================================== --- linux-2.6-tip.orig/lib/scatterlist.c +++ linux-2.6-tip/lib/scatterlist.c @@ -9,6 +9,7 @@ #include #include #include +#include /** * sg_next - return the next scatterlist entry in a list @@ -392,7 +393,7 @@ void sg_miter_stop(struct sg_mapping_ite miter->__offset += miter->consumed; if (miter->__flags & SG_MITER_ATOMIC) { - WARN_ON(!irqs_disabled()); + WARN_ON_NONRT(!irqs_disabled()); kunmap_atomic(miter->addr, KM_BIO_SRC_IRQ); } else kunmap(miter->page); @@ -426,7 +427,7 @@ static size_t sg_copy_buffer(struct scat sg_miter_start(&miter, sgl, nents, SG_MITER_ATOMIC); - local_irq_save(flags); + local_irq_save_nort(flags); while (sg_miter_next(&miter) && offset < buflen) { unsigned int len; @@ -445,7 +446,7 @@ static size_t sg_copy_buffer(struct scat sg_miter_stop(&miter); - local_irq_restore(flags); + local_irq_restore_nort(flags); return offset; } patches/fix-emergency-reboot.patch0000664000076400007640000000277311160752235016323 0ustar tglxtglxSubject: call reboot notifier list when doing an emergency reboot From: Ingo Molnar my laptop does not reboot unless the shutdown notifiers are called first. So the following command, which i use as a fast way to reboot into a new kernel: echo b > /proc/sysrq-trigger just hangs indefinitely after the kernel prints "System rebooting". the thing is, that the kernel is actually reschedulable in this stage, so we could as well process the reboot_notifier_list. (furthermore, on -rt kernels this place is preemptable even during SysRq-b) So just process the reboot notifier list if we are preemptable. This will shut disk caches and chipsets off. Signed-off-by: Ingo Molnar --- kernel/sys.c | 10 ++++++++++ 1 file changed, 10 insertions(+) Index: linux-2.6-tip/kernel/sys.c =================================================================== --- linux-2.6-tip.orig/kernel/sys.c +++ linux-2.6-tip/kernel/sys.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -280,6 +281,15 @@ out_unlock: */ void emergency_restart(void) { + /* + * Call the notifier chain if we are not in an + * atomic context: + */ +#ifdef CONFIG_PREEMPT + if (!in_atomic() && !irqs_disabled()) + blocking_notifier_call_chain(&reboot_notifier_list, + SYS_RESTART, NULL); +#endif machine_emergency_restart(); } EXPORT_SYMBOL_GPL(emergency_restart); patches/remove-check-pgt-cache-calls.patch0000664000076400007640000000114511160752235017556 0ustar tglxtglxSubject: remove: check pgt cache calls From: Ingo Molnar Date: Wed Feb 04 00:02:56 CET 2009 Signed-off-by: Ingo Molnar --- arch/x86/kernel/process_32.c | 1 - 1 file changed, 1 deletion(-) Index: linux-2.6-tip/arch/x86/kernel/process_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/process_32.c +++ linux-2.6-tip/arch/x86/kernel/process_32.c @@ -108,7 +108,6 @@ void cpu_idle(void) tick_nohz_stop_sched_tick(1); while (!need_resched()) { - check_pgt_cache(); rmb(); if (cpu_is_offline(cpu)) patches/rtmutex-debug.h-cleanup.patch0000664000076400007640000000277611160752235016743 0ustar tglxtglxSubject: lock debugging: clean up rtmutex-debug.h From: Ingo Molnar style cleanups. Signed-off-by: Ingo Molnar --- kernel/rtmutex-debug.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) Index: linux-2.6-tip/kernel/rtmutex-debug.h =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex-debug.h +++ linux-2.6-tip/kernel/rtmutex-debug.h @@ -17,17 +17,17 @@ extern void debug_rt_mutex_free_waiter(s extern void debug_rt_mutex_init(struct rt_mutex *lock, const char *name); extern void debug_rt_mutex_lock(struct rt_mutex *lock); extern void debug_rt_mutex_unlock(struct rt_mutex *lock); -extern void debug_rt_mutex_proxy_lock(struct rt_mutex *lock, - struct task_struct *powner); +extern void +debug_rt_mutex_proxy_lock(struct rt_mutex *lock, struct task_struct *powner); extern void debug_rt_mutex_proxy_unlock(struct rt_mutex *lock); extern void debug_rt_mutex_deadlock(int detect, struct rt_mutex_waiter *waiter, struct rt_mutex *lock); extern void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter); -# define debug_rt_mutex_reset_waiter(w) \ +# define debug_rt_mutex_reset_waiter(w) \ do { (w)->deadlock_lock = NULL; } while (0) -static inline int debug_rt_mutex_detect_deadlock(struct rt_mutex_waiter *waiter, - int detect) +static inline int +debug_rt_mutex_detect_deadlock(struct rt_mutex_waiter *waiter, int detect) { - return (waiter != NULL); + return waiter != NULL; } patches/preempt-realtime-cleanup-dev-queue-xmit.patch0000664000076400007640000000457511160752235022051 0ustar tglxtglxSubject: net: clean up dev_queue_xmit() code flow From: Ingo Molnar Date: Sun Feb 08 08:39:41 CET 2009 Flatten out the dev_queue_xmit() code flow. This keeps the fall-through fast-path free for the compiler, and also helps code readability. Signed-off-by: Ingo Molnar --- net/core/dev.c | 63 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 28 deletions(-) Index: linux-2.6-tip/net/core/dev.c =================================================================== --- linux-2.6-tip.orig/net/core/dev.c +++ linux-2.6-tip/net/core/dev.c @@ -1878,45 +1878,52 @@ gso: Check this and shot the lock. It is not prone from deadlocks. Either shot noqueue qdisc, it is even simpler 8) */ - if (dev->flags & IFF_UP) { - int cpu = raw_smp_processor_id(); /* ok because BHs are off */ + if (!(dev->flags & IFF_UP)) + goto err; - /* - * No need to check for recursion with threaded interrupts: - */ - if (!netif_tx_lock_recursion(txq)) { + /* Recursion is detected! It is possible, unfortunately: */ + if (netif_tx_lock_recursion(txq)) + goto err_recursion; - HARD_TX_LOCK(dev, txq); + HARD_TX_LOCK(dev, txq); - if (!netif_tx_queue_stopped(txq)) { - rc = 0; - if (!dev_hard_start_xmit(skb, dev, txq)) { - HARD_TX_UNLOCK(dev, txq); - goto out; - } - } - HARD_TX_UNLOCK(dev, txq); - if (net_ratelimit()) - printk(KERN_CRIT "Virtual device %s asks to " - "queue packet!\n", dev->name); - } else { - /* Recursion is detected! It is possible, - * unfortunately */ - if (net_ratelimit()) - printk(KERN_CRIT "Dead loop on virtual device " - "%s, fix it urgently!\n", dev->name); - } + if (netif_tx_queue_stopped(txq)) + goto err_tx_unlock; + + if (dev_hard_start_xmit(skb, dev, txq)) + goto err_tx_unlock; + + rc = 0; + HARD_TX_UNLOCK(dev, txq); + +out: + rcu_read_unlock_bh(); + return rc; + +err_recursion: + if (net_ratelimit()) { + printk(KERN_CRIT + "Dead loop on virtual device %s, fix it urgently!\n", + dev->name); } + goto err; +err_tx_unlock: + HARD_TX_UNLOCK(dev, txq); + + if (net_ratelimit()) { + printk(KERN_CRIT "Virtual device %s asks to queue packet!\n", + dev->name); + } + /* Fall through: */ + +err: rc = -ENETDOWN; rcu_read_unlock_bh(); out_kfree_skb: kfree_skb(skb); return rc; -out: - rcu_read_unlock_bh(); - return rc; } patches/net-xmit-lock-owner-cleanup.patch0000664000076400007640000001524611160752235017540 0ustar tglxtglxSubject: net: xmit lock owner cleanup From: Ingo Molnar Date: Sun Feb 08 08:17:14 CET 2009 - __netif_tx_lock() always passes in 'current' as the lock owner, so eliminate this parameter. - likewise for HARD_TX_LOCK() Signed-off-by: Ingo Molnar --- drivers/net/bnx2.c | 2 +- drivers/net/mv643xx_eth.c | 6 +++--- drivers/net/niu.c | 2 +- include/linux/netdevice.h | 24 ++++++++++++++---------- net/core/dev.c | 4 ++-- net/core/netpoll.c | 2 +- net/sched/sch_generic.c | 4 ++-- 7 files changed, 24 insertions(+), 20 deletions(-) Index: linux-2.6-tip/drivers/net/bnx2.c =================================================================== --- linux-2.6-tip.orig/drivers/net/bnx2.c +++ linux-2.6-tip/drivers/net/bnx2.c @@ -2661,7 +2661,7 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2 if (unlikely(netif_tx_queue_stopped(txq)) && (bnx2_tx_avail(bp, txr) > bp->tx_wake_thresh)) { - __netif_tx_lock(txq, (void *)current); + __netif_tx_lock(txq); if ((netif_tx_queue_stopped(txq)) && (bnx2_tx_avail(bp, txr) > bp->tx_wake_thresh)) netif_tx_wake_queue(txq); Index: linux-2.6-tip/drivers/net/mv643xx_eth.c =================================================================== --- linux-2.6-tip.orig/drivers/net/mv643xx_eth.c +++ linux-2.6-tip/drivers/net/mv643xx_eth.c @@ -484,7 +484,7 @@ static void txq_maybe_wake(struct tx_que struct netdev_queue *nq = netdev_get_tx_queue(mp->dev, txq->index); if (netif_tx_queue_stopped(nq)) { - __netif_tx_lock(nq, (void *)current); + __netif_tx_lock(nq); if (txq->tx_ring_size - txq->tx_desc_count >= MAX_SKB_FRAGS + 1) netif_tx_wake_queue(nq); __netif_tx_unlock(nq); @@ -838,7 +838,7 @@ static void txq_kick(struct tx_queue *tx u32 hw_desc_ptr; u32 expected_ptr; - __netif_tx_lock(nq, (void *)current); + __netif_tx_lock(nq); if (rdlp(mp, TXQ_COMMAND) & (1 << txq->index)) goto out; @@ -862,7 +862,7 @@ static int txq_reclaim(struct tx_queue * struct netdev_queue *nq = netdev_get_tx_queue(mp->dev, txq->index); int reclaimed; - __netif_tx_lock(nq, (void *)current); + __netif_tx_lock(nq); reclaimed = 0; while (reclaimed < budget && txq->tx_desc_count > 0) { Index: linux-2.6-tip/drivers/net/niu.c =================================================================== --- linux-2.6-tip.orig/drivers/net/niu.c +++ linux-2.6-tip/drivers/net/niu.c @@ -3519,7 +3519,7 @@ static void niu_tx_work(struct niu *np, out: if (unlikely(netif_tx_queue_stopped(txq) && (niu_tx_avail(rp) > NIU_TX_WAKEUP_THRESH(rp)))) { - __netif_tx_lock(txq, (void *)current); + __netif_tx_lock(txq); if (netif_tx_queue_stopped(txq) && (niu_tx_avail(rp) > NIU_TX_WAKEUP_THRESH(rp))) netif_tx_wake_queue(txq); Index: linux-2.6-tip/include/linux/netdevice.h =================================================================== --- linux-2.6-tip.orig/include/linux/netdevice.h +++ linux-2.6-tip/include/linux/netdevice.h @@ -1625,10 +1625,18 @@ static inline void netif_rx_complete(str napi_complete(napi); } -static inline void __netif_tx_lock(struct netdev_queue *txq, void *curr) +static inline void __netif_tx_lock(struct netdev_queue *txq) { spin_lock(&txq->_xmit_lock); - txq->xmit_lock_owner = curr; + txq->xmit_lock_owner = (void *)current; +} + +/* + * Do we hold the xmit_lock already? + */ +static inline int netif_tx_lock_recursion(struct netdev_queue *txq) +{ + return txq->xmit_lock_owner == (void *)current; } static inline void __netif_tx_lock_bh(struct netdev_queue *txq) @@ -1666,10 +1674,8 @@ static inline void __netif_tx_unlock_bh( static inline void netif_tx_lock(struct net_device *dev) { unsigned int i; - void *curr; spin_lock(&dev->tx_global_lock); - curr = (void *)current; for (i = 0; i < dev->num_tx_queues; i++) { struct netdev_queue *txq = netdev_get_tx_queue(dev, i); @@ -1679,7 +1685,7 @@ static inline void netif_tx_lock(struct * the ->hard_start_xmit() handler and already * checked the frozen bit. */ - __netif_tx_lock(txq, curr); + __netif_tx_lock(txq); set_bit(__QUEUE_STATE_FROZEN, &txq->state); __netif_tx_unlock(txq); } @@ -1715,9 +1721,9 @@ static inline void netif_tx_unlock_bh(st local_bh_enable(); } -#define HARD_TX_LOCK(dev, txq, curr) { \ +#define HARD_TX_LOCK(dev, txq) { \ if ((dev->features & NETIF_F_LLTX) == 0) { \ - __netif_tx_lock(txq, curr); \ + __netif_tx_lock(txq); \ } \ } @@ -1730,14 +1736,12 @@ static inline void netif_tx_unlock_bh(st static inline void netif_tx_disable(struct net_device *dev) { unsigned int i; - void *curr; local_bh_disable(); - curr = (void *)current; for (i = 0; i < dev->num_tx_queues; i++) { struct netdev_queue *txq = netdev_get_tx_queue(dev, i); - __netif_tx_lock(txq, curr); + __netif_tx_lock(txq); netif_tx_stop_queue(txq); __netif_tx_unlock(txq); } Index: linux-2.6-tip/net/core/dev.c =================================================================== --- linux-2.6-tip.orig/net/core/dev.c +++ linux-2.6-tip/net/core/dev.c @@ -1884,9 +1884,9 @@ gso: /* * No need to check for recursion with threaded interrupts: */ - if (txq->xmit_lock_owner != (void *)current) { + if (!netif_tx_lock_recursion(txq)) { - HARD_TX_LOCK(dev, txq, (void *)current); + HARD_TX_LOCK(dev, txq); if (!netif_tx_queue_stopped(txq)) { rc = 0; Index: linux-2.6-tip/net/core/netpoll.c =================================================================== --- linux-2.6-tip.orig/net/core/netpoll.c +++ linux-2.6-tip/net/core/netpoll.c @@ -69,7 +69,7 @@ static void queue_process(struct work_st txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); local_irq_save_nort(flags); - __netif_tx_lock(txq, (void *)current); + __netif_tx_lock(txq); if (netif_tx_queue_stopped(txq) || netif_tx_queue_frozen(txq) || ops->ndo_start_xmit(skb, dev) != NETDEV_TX_OK) { Index: linux-2.6-tip/net/sched/sch_generic.c =================================================================== --- linux-2.6-tip.orig/net/sched/sch_generic.c +++ linux-2.6-tip/net/sched/sch_generic.c @@ -80,7 +80,7 @@ static inline int handle_dev_cpu_collisi { int ret; - if (unlikely(dev_queue->xmit_lock_owner == (void *)current)) { + if (unlikely(netif_tx_lock_recursion(dev_queue))) { /* * Same CPU holding the lock. It may be a transient * configuration error, when hard_start_xmit() recurses. We @@ -143,7 +143,7 @@ static inline int qdisc_restart(struct Q dev = qdisc_dev(q); txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); - HARD_TX_LOCK(dev, txq, (void *)current); + HARD_TX_LOCK(dev, txq); if (!netif_tx_queue_stopped(txq) && !netif_tx_queue_frozen(txq)) ret = dev_hard_start_xmit(skb, dev, txq); patches/sched-rt-stats.patch0000664000076400007640000000166511160752235015135 0ustar tglxtglxSubject: patches/sched-rt-stats.patch So, I have merged my previous patch (to display rt_nr_running info in sched_debug.c) with this one. Signed-off-by: Ankita Garg [mingo@elte.hu: fix it to work on !SCHEDSTATS too] Signed-off-by: Ingo Molnar -- kernel/sched_debug.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) Index: linux-2.6-tip/kernel/sched_debug.c =================================================================== --- linux-2.6-tip.orig/kernel/sched_debug.c +++ linux-2.6-tip/kernel/sched_debug.c @@ -280,6 +280,19 @@ static void print_cpu(struct seq_file *m P(cpu_load[2]); P(cpu_load[3]); P(cpu_load[4]); +#ifdef CONFIG_PREEMPT_RT + /* Print rt related rq stats */ + P(rt.rt_nr_running); + P(rt.rt_nr_uninterruptible); +# ifdef CONFIG_SCHEDSTATS + P(rto_schedule); + P(rto_schedule_tail); + P(rto_wakeup); + P(rto_pulled); + P(rto_pushed); +# endif +#endif + #undef P #undef PN patches/sched-fix-dequeued-race.patch0000664000076400007640000000142311161723437016644 0ustar tglxtglxSubject: sched-fix-dequeued-race.patch From: Thomas Gleixner Date: Thu, 24 Jul 2008 16:14:31 +0200 Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- kernel/sched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -4762,7 +4762,8 @@ void scheduler_tick(void) spin_lock(&rq->lock); update_rq_clock(rq); update_cpu_load(rq); - curr->sched_class->task_tick(rq, curr, 0); + if (curr != rq->idle && curr->se.on_rq) + curr->sched_class->task_tick(rq, curr, 0); perf_counter_task_tick(curr, cpu); spin_unlock(&rq->lock); patches/dont-disable-preemption-without-IST.patch0000664000076400007640000000634411160752235021152 0ustar tglxtglxSubject: Don't disable preemption in exception handlers without IST From: Andi Kleen Date: Sat, 27 Oct 2007 12:39:33 +0200 Some of the exception handlers that run on an IST in a normal kernel still disable preemption. This causes might_sleep warning when sending signals for debugging in PREEMPT-RT because sending signals can take a lock. Since the ISTs are disabled now for those don't disable the preemption. This completes the remove IST patch I sent some time ago and fixes another case where using gdb caused warnings. Also it will likely improve latency a little bit. Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar --- arch/x86/kernel/traps.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) Index: linux-2.6-tip/arch/x86/kernel/traps.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/traps.c +++ linux-2.6-tip/arch/x86/kernel/traps.c @@ -92,9 +92,10 @@ static inline void conditional_sti(struc local_irq_enable(); } -static inline void preempt_conditional_sti(struct pt_regs *regs) +static inline void preempt_conditional_sti(struct pt_regs *regs, int stack) { - inc_preempt_count(); + if (stack) + inc_preempt_count(); if (regs->flags & X86_EFLAGS_IF) local_irq_enable(); } @@ -105,11 +106,12 @@ static inline void conditional_cli(struc local_irq_disable(); } -static inline void preempt_conditional_cli(struct pt_regs *regs) +static inline void preempt_conditional_cli(struct pt_regs *regs, int stack) { if (regs->flags & X86_EFLAGS_IF) local_irq_disable(); - dec_preempt_count(); + if (stack) + dec_preempt_count(); } #ifdef CONFIG_X86_32 @@ -236,9 +238,9 @@ dotraplinkage void do_stack_segment(stru if (notify_die(DIE_TRAP, "stack segment", regs, error_code, 12, SIGBUS) == NOTIFY_STOP) return; - preempt_conditional_sti(regs); + preempt_conditional_sti(regs, STACKFAULT_STACK); do_trap(12, SIGBUS, "stack segment", regs, error_code, NULL); - preempt_conditional_cli(regs); + preempt_conditional_cli(regs, STACKFAULT_STACK); } dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code) @@ -471,9 +473,9 @@ dotraplinkage void __kprobes do_int3(str return; #endif - preempt_conditional_sti(regs); + preempt_conditional_sti(regs, DEBUG_STACK); do_trap(3, SIGTRAP, "int3", regs, error_code, NULL); - preempt_conditional_cli(regs); + preempt_conditional_cli(regs, DEBUG_STACK); } #ifdef CONFIG_X86_64 @@ -550,7 +552,7 @@ dotraplinkage void __kprobes do_debug(st return; /* It's safe to allow irq's after DR6 has been saved */ - preempt_conditional_sti(regs); + preempt_conditional_sti(regs, DEBUG_STACK); /* Mask out spurious debug traps due to lazy DR7 setting */ if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) { @@ -585,7 +587,7 @@ dotraplinkage void __kprobes do_debug(st */ clear_dr7: set_debugreg(0, 7); - preempt_conditional_cli(regs); + preempt_conditional_cli(regs, DEBUG_STACK); return; #ifdef CONFIG_X86_32 @@ -600,7 +602,7 @@ debug_vm86: clear_TF_reenable: set_tsk_thread_flag(tsk, TIF_SINGLESTEP); regs->flags &= ~X86_EFLAGS_TF; - preempt_conditional_cli(regs); + preempt_conditional_cli(regs, DEBUG_STACK); return; } patches/per-cpu-locked-infrastructure.patch0000664000076400007640000000473211160752235020156 0ustar tglxtglxSubject: per: cpu locked infrastructure From: Ingo Molnar Date: Mon Feb 09 23:43:22 CET 2009 Signed-off-by: Ingo Molnar --- include/linux/percpu.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) Index: linux-2.6-tip/include/linux/percpu.h =================================================================== --- linux-2.6-tip.orig/include/linux/percpu.h +++ linux-2.6-tip/include/linux/percpu.h @@ -37,9 +37,17 @@ __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name +#define DEFINE_PER_CPU_SPINLOCK(name, section) \ + __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ + PER_CPU_ATTRIBUTES __DEFINE_SPINLOCK(per_cpu__lock_##name##_locked); + #define DEFINE_PER_CPU(type, name) \ DEFINE_PER_CPU_SECTION(type, name, "") +#define DEFINE_PER_CPU_LOCKED(type, name) \ + DEFINE_PER_CPU_SPINLOCK(name, "") \ + DEFINE_PER_CPU_SECTION(type, name##_locked, "") + #define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ ____cacheline_aligned_in_smp @@ -51,7 +59,9 @@ DEFINE_PER_CPU_SECTION(type, name, PER_CPU_FIRST_SECTION) #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) +#define EXPORT_PER_CPU_LOCKED_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var##_locked) #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) +#define EXPORT_PER_CPU_LOCKED_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var##_locked) /* enough to cover all DEFINE_PER_CPUs in modules */ #ifdef CONFIG_MODULES @@ -76,6 +86,29 @@ &__get_cpu_var(var); })) #define put_cpu_var(var) preempt_enable() +/* + * Per-CPU data structures with an additional lock - useful for + * PREEMPT_RT code that wants to reschedule but also wants + * per-CPU data structures. + * + * 'cpu' gets updated with the CPU the task is currently executing on. + * + * NOTE: on normal !PREEMPT_RT kernels these per-CPU variables + * are the same as the normal per-CPU variables, so there no + * runtime overhead. + */ +#define get_cpu_var_locked(var, cpuptr) \ +(*({ \ + int __cpu = raw_smp_processor_id(); \ + \ + *(cpuptr) = __cpu; \ + spin_lock(&__get_cpu_lock(var, __cpu)); \ + &__get_cpu_var_locked(var, __cpu); \ +})) + +#define put_cpu_var_locked(var, cpu) \ + do { (void)cpu; spin_unlock(&__get_cpu_lock(var, cpu)); } while (0) + #ifdef CONFIG_SMP #ifdef CONFIG_HAVE_DYNAMIC_PER_CPU_AREA patches/namespace-lock-fixes.patch0000664000076400007640000001063611160752235016264 0ustar tglxtglxSubject: Fix Bug messages From: Chirag Jog Date: Wed, 30 Jul 2008 22:48:42 +0530 [ The following text is in the "iso-8859-1" character set. ] [ Your display is set for the "ANSI_X3.4-1968" character set. ] [ Some characters may be displayed incorrectly. ] * J?rgen Mell [2008-07-30 11:01:32]: > Hello Thomas, > > On Wednesday, 30. July 2008, Thomas Gleixner wrote: > > We are pleased to announce the 2.6.26-rt1 tree, which can be > > downloaded from the location: > > I have tried the new kernel and have some good news and some bad news: > > The good news: The machine boots and seems to run without major problems. > > The bad news: It produces continuously lots of bug messages in the error > logs (cf. attached dmesg.tgz). The error at rtmutex.c:743 was already > present in 2.6.25-rt* when ACPI was enabled. The 'using smp_processor_id > () in preemptible code' is new here with 2.6.26. > > Machine is an old Athlon XP (single core) on an EPOX mainboard with VIA > chipset. > > If I can help with testing, please let me know. > > Bye, > J?rgen > > This patch should solve some of the bug messages. It does two things: 1. Change rt_runtime_lock to be a raw spinlock as the comment above it says: it is nested inside the rq lock. 2. Change mnt_writers to be a per_cpu locked variable. This eliminates the need for the codepath to disable preemption and then potentially sleep, leading to the BUG messages Signed-Off-By: Chirag Signed-off-by: Ingo Molnar --- fs/namespace.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) Index: linux-2.6-tip/fs/namespace.c =================================================================== --- linux-2.6-tip.orig/fs/namespace.c +++ linux-2.6-tip/fs/namespace.c @@ -180,13 +180,13 @@ struct mnt_writer { unsigned long count; struct vfsmount *mnt; } ____cacheline_aligned_in_smp; -static DEFINE_PER_CPU(struct mnt_writer, mnt_writers); +static DEFINE_PER_CPU_LOCKED(struct mnt_writer, mnt_writers); static int __init init_mnt_writers(void) { int cpu; for_each_possible_cpu(cpu) { - struct mnt_writer *writer = &per_cpu(mnt_writers, cpu); + struct mnt_writer *writer = &per_cpu_var_locked(mnt_writers, cpu); spin_lock_init(&writer->lock); lockdep_set_class(&writer->lock, &writer->lock_class); writer->count = 0; @@ -201,7 +201,7 @@ static void unlock_mnt_writers(void) struct mnt_writer *cpu_writer; for_each_possible_cpu(cpu) { - cpu_writer = &per_cpu(mnt_writers, cpu); + cpu_writer = &per_cpu_var_locked(mnt_writers, cpu); spin_unlock(&cpu_writer->lock); } } @@ -253,8 +253,8 @@ int mnt_want_write(struct vfsmount *mnt) { int ret = 0; struct mnt_writer *cpu_writer; - - cpu_writer = &get_cpu_var(mnt_writers); + int cpu = 0; + cpu_writer = &get_cpu_var_locked(mnt_writers, &cpu); spin_lock(&cpu_writer->lock); if (__mnt_is_readonly(mnt)) { ret = -EROFS; @@ -264,7 +264,7 @@ int mnt_want_write(struct vfsmount *mnt) cpu_writer->count++; out: spin_unlock(&cpu_writer->lock); - put_cpu_var(mnt_writers); + put_cpu_var_locked(mnt_writers, cpu); return ret; } EXPORT_SYMBOL_GPL(mnt_want_write); @@ -275,7 +275,7 @@ static void lock_mnt_writers(void) struct mnt_writer *cpu_writer; for_each_possible_cpu(cpu) { - cpu_writer = &per_cpu(mnt_writers, cpu); + cpu_writer = &per_cpu_var_locked(mnt_writers, cpu); spin_lock(&cpu_writer->lock); __clear_mnt_count(cpu_writer); cpu_writer->mnt = NULL; @@ -333,8 +333,8 @@ void mnt_drop_write(struct vfsmount *mnt { int must_check_underflow = 0; struct mnt_writer *cpu_writer; - - cpu_writer = &get_cpu_var(mnt_writers); + int cpu = 0; + cpu_writer = &get_cpu_var_locked(mnt_writers, &cpu); spin_lock(&cpu_writer->lock); use_cpu_writer_for_mount(cpu_writer, mnt); @@ -361,7 +361,7 @@ void mnt_drop_write(struct vfsmount *mnt * __mnt_writers can underflow. Without it, * we could theoretically wrap __mnt_writers. */ - put_cpu_var(mnt_writers); + put_cpu_var_locked(mnt_writers, cpu); } EXPORT_SYMBOL_GPL(mnt_drop_write); @@ -613,7 +613,8 @@ static inline void __mntput(struct vfsmo * can come in. */ for_each_possible_cpu(cpu) { - struct mnt_writer *cpu_writer = &per_cpu(mnt_writers, cpu); + struct mnt_writer *cpu_writer = &per_cpu_var_locked(mnt_writers, cpu); + spin_lock(&cpu_writer->lock); if (cpu_writer->mnt != mnt) { spin_unlock(&cpu_writer->lock); patches/version.patch0000664000076400007640000000102111161661320013732 0ustar tglxtglxSubject: add -rt version tag From: Ingo Molnar Date: Mon Feb 09 23:09:57 CET 2009 Signed-off-by: Ingo Molnar --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/Makefile =================================================================== --- linux-2.6-tip.orig/Makefile +++ linux-2.6-tip/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 29 -EXTRAVERSION = -rc8 +EXTRAVERSION = -rc8-rt3 NAME = Erotic Pickled Herring # *DOCUMENTATION* patches/powerpc-percpu-tlb.patch0000664000076400007640000002473611160752235016026 0ustar tglxtglxSubject: powerpc-percpu-tlb.patch From: Thomas Gleixner Date: Fri, 20 Mar 2009 17:48:44 +0100 Signed-off-by: Thomas Gleixner --- arch/powerpc/include/asm/pgtable-ppc64.h | 9 +++++++- arch/powerpc/include/asm/tlb.h | 6 +++-- arch/powerpc/include/asm/tlbflush.h | 31 +++++++++++++++++++++++----- arch/powerpc/kernel/process.c | 22 ++++++++++++++++++++ arch/powerpc/mm/init_32.c | 2 - arch/powerpc/mm/pgtable.c | 34 ++++++++++++++++++++----------- arch/powerpc/mm/tlb_hash64.c | 20 ++++++++++++++++-- arch/powerpc/platforms/pseries/iommu.c | 9 +++++--- 8 files changed, 107 insertions(+), 26 deletions(-) Index: linux-2.6-tip/arch/powerpc/include/asm/pgtable-ppc64.h =================================================================== --- linux-2.6-tip.orig/arch/powerpc/include/asm/pgtable-ppc64.h +++ linux-2.6-tip/arch/powerpc/include/asm/pgtable-ppc64.h @@ -285,8 +285,15 @@ static inline unsigned long pte_update(s : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY) : "cc" ); - if (old & _PAGE_HASHPTE) + if (old & _PAGE_HASHPTE) { +#ifdef CONFIG_PREEMPT_RT + preempt_disable(); +#endif hpte_need_flush(mm, addr, ptep, old, huge); +#ifdef CONFIG_PREEMPT_RT + preempt_enable(); +#endif + } return old; } Index: linux-2.6-tip/arch/powerpc/include/asm/tlb.h =================================================================== --- linux-2.6-tip.orig/arch/powerpc/include/asm/tlb.h +++ linux-2.6-tip/arch/powerpc/include/asm/tlb.h @@ -40,15 +40,17 @@ extern void pte_free_finish(void); static inline void tlb_flush(struct mmu_gather *tlb) { - struct ppc64_tlb_batch *tlbbatch = &__get_cpu_var(ppc64_tlb_batch); + struct ppc64_tlb_batch *tlbbatch = &get_cpu_var(ppc64_tlb_batch); /* If there's a TLB batch pending, then we must flush it because the * pages are going to be freed and we really don't want to have a CPU * access a freed page because it has a stale TLB */ - if (tlbbatch->index) + if (tlbbatch->index) { __flush_tlb_pending(tlbbatch); + } + put_cpu_var(ppc64_tlb_batch); pte_free_finish(); } Index: linux-2.6-tip/arch/powerpc/include/asm/tlbflush.h =================================================================== --- linux-2.6-tip.orig/arch/powerpc/include/asm/tlbflush.h +++ linux-2.6-tip/arch/powerpc/include/asm/tlbflush.h @@ -101,18 +101,39 @@ extern void hpte_need_flush(struct mm_st static inline void arch_enter_lazy_mmu_mode(void) { - struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); + struct ppc64_tlb_batch *batch; +#ifdef CONFIG_PREEMPT_RT + preempt_disable(); +#endif + batch = &get_cpu_var(ppc64_tlb_batch); + +#ifdef CONFIG_PREEMPT_RT + preempt_enable(); +#endif batch->active = 1; + put_cpu_var(ppc64_tlb_batch); } static inline void arch_leave_lazy_mmu_mode(void) { - struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); + struct ppc64_tlb_batch *batch; - if (batch->index) - __flush_tlb_pending(batch); - batch->active = 0; +#ifdef CONFIG_PREEMPT_RT + preempt_disable(); +#endif + batch = &get_cpu_var(ppc64_tlb_batch); + + if (batch->active) { + if (batch->index) { + __flush_tlb_pending(batch); + } + batch->active = 0; + } +#ifdef CONFIG_PREEMPT_RT + preempt_enable(); +#endif + put_cpu_var(ppc64_tlb_batch); } #define arch_flush_lazy_mmu_mode() do {} while (0) Index: linux-2.6-tip/arch/powerpc/kernel/process.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/kernel/process.c +++ linux-2.6-tip/arch/powerpc/kernel/process.c @@ -302,6 +302,10 @@ struct task_struct *__switch_to(struct t struct thread_struct *new_thread, *old_thread; unsigned long flags; struct task_struct *last; +#if defined(CONFIG_PPC64) && defined (CONFIG_PREEMPT_RT) + struct ppc64_tlb_batch *batch; + int hadbatch; +#endif #ifdef CONFIG_SMP /* avoid complexity of lazy save/restore of fpu @@ -393,6 +397,17 @@ struct task_struct *__switch_to(struct t old_thread->accum_tb += (current_tb - start_tb); new_thread->start_tb = current_tb; } + +#ifdef CONFIG_PREEMPT_RT + batch = &__get_cpu_var(ppc64_tlb_batch); + if (batch->active) { + hadbatch = 1; + if (batch->index) { + __flush_tlb_pending(batch); + } + batch->active = 0; + } +#endif /* #ifdef CONFIG_PREEMPT_RT */ #endif local_irq_save(flags); @@ -411,6 +426,13 @@ struct task_struct *__switch_to(struct t local_irq_restore(flags); +#if defined(CONFIG_PPC64) && defined(CONFIG_PREEMPT_RT) + if (hadbatch) { + batch = &__get_cpu_var(ppc64_tlb_batch); + batch->active = 1; + } +#endif + return last; } Index: linux-2.6-tip/arch/powerpc/mm/init_32.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/mm/init_32.c +++ linux-2.6-tip/arch/powerpc/mm/init_32.c @@ -54,7 +54,7 @@ #endif #define MAX_LOW_MEM CONFIG_LOWMEM_SIZE -DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); +DEFINE_PER_CPU_LOCKED(struct mmu_gather, mmu_gathers); phys_addr_t total_memory; phys_addr_t total_lowmem; Index: linux-2.6-tip/arch/powerpc/mm/pgtable.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/mm/pgtable.c +++ linux-2.6-tip/arch/powerpc/mm/pgtable.c @@ -29,7 +29,7 @@ #include #include -static DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); +static DEFINE_PER_CPU_LOCKED(struct pte_freelist_batch *, pte_freelist_cur); static unsigned long pte_freelist_forced_free; struct pte_freelist_batch @@ -80,21 +80,24 @@ static void pte_free_submit(struct pte_f void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf) { - /* This is safe since tlb_gather_mmu has disabled preemption */ - cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id()); - struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur); + /* tlb->cpu is set by tlb_gather_mmu */ + cpumask_t local_cpumask = cpumask_of_cpu(tlb->cpu); + struct pte_freelist_batch **batchp; + int cpu; + + batchp = &get_cpu_var_locked(pte_freelist_cur, &cpu); if (atomic_read(&tlb->mm->mm_users) < 2 || cpus_equal(tlb->mm->cpu_vm_mask, local_cpumask)) { pgtable_free(pgf); - return; + goto cleanup; } if (*batchp == NULL) { *batchp = (struct pte_freelist_batch *)__get_free_page(GFP_ATOMIC); if (*batchp == NULL) { pgtable_free_now(pgf); - return; + goto cleanup; } (*batchp)->index = 0; } @@ -103,15 +106,22 @@ void pgtable_free_tlb(struct mmu_gather pte_free_submit(*batchp); *batchp = NULL; } + +cleanup: + put_cpu_var_locked(pte_freelist_cur, cpu); } void pte_free_finish(void) { - /* This is safe since tlb_gather_mmu has disabled preemption */ - struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur); + struct pte_freelist_batch **batchp; + int cpu; + + batchp = &get_cpu_var_locked(pte_freelist_cur, &cpu); + + if (*batchp) { + pte_free_submit(*batchp); + *batchp = NULL; + } - if (*batchp == NULL) - return; - pte_free_submit(*batchp); - *batchp = NULL; + put_cpu_var_locked(pte_freelist_cur, cpu); } Index: linux-2.6-tip/arch/powerpc/mm/tlb_hash64.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/mm/tlb_hash64.c +++ linux-2.6-tip/arch/powerpc/mm/tlb_hash64.c @@ -30,13 +30,14 @@ #include #include #include +#include DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); /* This is declared as we are using the more or less generic * arch/powerpc/include/asm/tlb.h file -- tgall */ -DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); +DEFINE_PER_CPU_LOCKED(struct mmu_gather, mmu_gathers); /* * A linux PTE was changed and the corresponding hash table entry @@ -49,7 +50,7 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_ga void hpte_need_flush(struct mm_struct *mm, unsigned long addr, pte_t *ptep, unsigned long pte, int huge) { - struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); + struct ppc64_tlb_batch *batch = &get_cpu_var(ppc64_tlb_batch); unsigned long vsid, vaddr; unsigned int psize; int ssize; @@ -100,6 +101,7 @@ void hpte_need_flush(struct mm_struct *m */ if (!batch->active) { flush_hash_page(vaddr, rpte, psize, ssize, 0); + put_cpu_var(ppc64_tlb_batch); return; } @@ -126,8 +128,22 @@ void hpte_need_flush(struct mm_struct *m batch->pte[i] = rpte; batch->vaddr[i] = vaddr; batch->index = ++i; + +#ifdef CONFIG_PREEMPT_RT + /* + * Since flushing tlb needs expensive hypervisor call(s) on celleb, + * always flush it on RT to reduce scheduling latency. + */ + if (machine_is(celleb)) { + __flush_tlb_pending(batch); + put_cpu_var(ppc64_tlb_batch); + return; + } +#endif /* CONFIG_PREEMPT_RT */ + if (i >= PPC64_TLB_BATCH_NR) __flush_tlb_pending(batch); + put_cpu_var(ppc64_tlb_batch); } /* Index: linux-2.6-tip/arch/powerpc/platforms/pseries/iommu.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/platforms/pseries/iommu.c +++ linux-2.6-tip/arch/powerpc/platforms/pseries/iommu.c @@ -140,7 +140,7 @@ static int tce_build_pSeriesLP(struct io return ret; } -static DEFINE_PER_CPU(u64 *, tce_page) = NULL; +static DEFINE_PER_CPU_LOCKED(u64 *, tce_page) = NULL; static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages, unsigned long uaddr, @@ -154,13 +154,14 @@ static int tce_buildmulti_pSeriesLP(stru long l, limit; long tcenum_start = tcenum, npages_start = npages; int ret = 0; + int cpu; if (npages == 1) { return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr, direction, attrs); } - tcep = __get_cpu_var(tce_page); + tcep = get_cpu_var_locked(tce_page, &cpu); /* This is safe to do since interrupts are off when we're called * from iommu_alloc{,_sg}() @@ -169,10 +170,11 @@ static int tce_buildmulti_pSeriesLP(stru tcep = (u64 *)__get_free_page(GFP_ATOMIC); /* If allocation fails, fall back to the loop implementation */ if (!tcep) { + put_cpu_var_locked(tce_page, cpu); return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr, direction, attrs); } - __get_cpu_var(tce_page) = tcep; + per_cpu_var_locked(tce_page, cpu) = tcep; } rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT; @@ -216,6 +218,7 @@ static int tce_buildmulti_pSeriesLP(stru printk("\ttce[0] val = 0x%llx\n", tcep[0]); show_stack(current, (unsigned long *)__get_SP()); } + put_cpu_var_locked(tce_page, cpu); return ret; } patches/bh-state-lock.patch0000664000076400007640000000606311161723465014726 0ustar tglxtglxSubject: patches/bh-state-lock.patch I was compiling a kernel in a shell that I set to a priority of 20, and it locked up on the bit_spin_lock crap of jbd. This patch adds another spinlock to the buffer head and uses that instead of the bit_spins. From: Steven Rostedt Signed-off-by: Ingo Molnar -- fs/buffer.c | 3 ++- include/linux/buffer_head.h | 1 + include/linux/jbd.h | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) Index: linux-2.6-tip/fs/buffer.c =================================================================== --- linux-2.6-tip.orig/fs/buffer.c +++ linux-2.6-tip/fs/buffer.c @@ -40,7 +40,6 @@ #include #include #include -#include static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); @@ -3296,6 +3295,7 @@ struct buffer_head *alloc_buffer_head(gf if (ret) { INIT_LIST_HEAD(&ret->b_assoc_buffers); spin_lock_init(&ret->b_uptodate_lock); + spin_lock_init(&ret->b_state_lock); get_cpu_var(bh_accounting).nr++; recalc_bh_state(); put_cpu_var(bh_accounting); @@ -3308,6 +3308,7 @@ void free_buffer_head(struct buffer_head { BUG_ON(!list_empty(&bh->b_assoc_buffers)); BUG_ON(spin_is_locked(&bh->b_uptodate_lock)); + BUG_ON(spin_is_locked(&bh->b_state_lock)); kmem_cache_free(bh_cachep, bh); get_cpu_var(bh_accounting).nr--; recalc_bh_state(); Index: linux-2.6-tip/include/linux/buffer_head.h =================================================================== --- linux-2.6-tip.orig/include/linux/buffer_head.h +++ linux-2.6-tip/include/linux/buffer_head.h @@ -71,6 +71,7 @@ struct buffer_head { associated with */ atomic_t b_count; /* users using this buffer_head */ spinlock_t b_uptodate_lock; + spinlock_t b_state_lock; }; /* Index: linux-2.6-tip/include/linux/jbd.h =================================================================== --- linux-2.6-tip.orig/include/linux/jbd.h +++ linux-2.6-tip/include/linux/jbd.h @@ -315,32 +315,32 @@ static inline struct journal_head *bh2jh static inline void jbd_lock_bh_state(struct buffer_head *bh) { - bit_spin_lock(BH_State, &bh->b_state); + spin_lock(&bh->b_state_lock); } static inline int jbd_trylock_bh_state(struct buffer_head *bh) { - return bit_spin_trylock(BH_State, &bh->b_state); + return spin_trylock(&bh->b_state_lock); } static inline int jbd_is_locked_bh_state(struct buffer_head *bh) { - return bit_spin_is_locked(BH_State, &bh->b_state); + return spin_is_locked(&bh->b_state_lock); } static inline void jbd_unlock_bh_state(struct buffer_head *bh) { - bit_spin_unlock(BH_State, &bh->b_state); + spin_unlock(&bh->b_state_lock); } static inline void jbd_lock_bh_journal_head(struct buffer_head *bh) { - bit_spin_lock(BH_JournalHead, &bh->b_state); + spin_lock_irq(&bh->b_uptodate_lock); } static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh) { - bit_spin_unlock(BH_JournalHead, &bh->b_state); + spin_unlock_irq(&bh->b_uptodate_lock); } struct jbd_revoke_table_s; patches/genirq-warn-on-do-irq.patch0000664000076400007640000000151611160752235016320 0ustar tglxtglxSubject: genirq-warn-on-do-irq.patch From: Thomas Gleixner Date: Fri, 20 Mar 2009 18:03:07 +0100 Signed-off-by: Thomas Gleixner --- kernel/irq/handle.c | 5 +++++ 1 file changed, 5 insertions(+) Index: linux-2.6-tip/kernel/irq/handle.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/handle.c +++ linux-2.6-tip/kernel/irq/handle.c @@ -465,6 +465,11 @@ unsigned int __do_IRQ(unsigned int irq) struct irqaction *action; unsigned int status; +#ifdef CONFIG_PREEMPT_RT + printk(KERN_WARNING "__do_IRQ called for irq %d. " + "PREEMPT_RT will crash your system soon\n", irq); + printk(KERN_WARNING "I hope you have a fire-extinguisher handy!\n"); +#endif kstat_incr_irqs_this_cpu(irq, desc); if (CHECK_IRQ_PER_CPU(desc->status)) { patches/cpuhotplug-per-cpu.patch0000664000076400007640000000272511160752235016031 0ustar tglxtglxSubject: cpu-hotplug: get_cpu_var_locked online aware From: Peter Zijlstra Date: Wed Mar 18 15:33:54 CET 2009 Signed-off-by: Peter Zijlstra --- include/linux/percpu.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) Index: linux-2.6-tip/include/linux/percpu.h =================================================================== --- linux-2.6-tip.orig/include/linux/percpu.h +++ linux-2.6-tip/include/linux/percpu.h @@ -97,14 +97,36 @@ * are the same as the normal per-CPU variables, so there no * runtime overhead. */ +#ifdef CONFIG_PREEMPT_RT #define get_cpu_var_locked(var, cpuptr) \ (*({ \ - int __cpu = raw_smp_processor_id(); \ + spinlock_t *__lock; \ + int __cpu; \ \ +again: \ + __cpu = raw_smp_processor_id(); \ + __lock = &__get_cpu_lock(var, __cpu); \ + spin_lock(__lock); \ + if (!cpu_online(__cpu)) { \ + spin_unlock(__lock); \ + goto again; \ + } \ *(cpuptr) = __cpu; \ + &__get_cpu_var_locked(var, __cpu); \ +})) +#else +#define get_cpu_var_locked(var, cpuptr) \ +(*({ \ + int __cpu; \ + \ + preempt_disable(); \ + __cpu = smp_processor_id(); \ spin_lock(&__get_cpu_lock(var, __cpu)); \ + preempt_enable(); \ + *(cpuptr) = __cpu; \ &__get_cpu_var_locked(var, __cpu); \ })) +#endif #define put_cpu_var_locked(var, cpu) \ do { (void)cpu; spin_unlock(&__get_cpu_lock(var, cpu)); } while (0) patches/netfilter-rcu-destroy.patch0000664000076400007640000000444011160752235016534 0ustar tglxtglxcommit 052a02a695a2600d6435555b4f82cfe1559a77d7 Author: Steven Rostedt Date: Tue Jan 27 10:40:52 2009 -0500 preempt-rt: use a rcu callback for nf_conntrack_destroy __nf_conntrack_destroy is called with preemption disabled and calls functions that will schedule in PREEMPT_RT. When PREEMPT_RT is defined we call an RCU callback to do the destruction at a later time. Signed-off-by: Steven Rostedt --- include/linux/skbuff.h | 3 +++ net/netfilter/core.c | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) Index: linux-2.6-tip/include/linux/skbuff.h =================================================================== --- linux-2.6-tip.orig/include/linux/skbuff.h +++ linux-2.6-tip/include/linux/skbuff.h @@ -101,6 +101,9 @@ struct pipe_inode_info; #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) struct nf_conntrack { atomic_t use; +#ifdef CONFIG_PREEMPT_RT + struct rcu_head rcu; +#endif }; #endif Index: linux-2.6-tip/net/netfilter/core.c =================================================================== --- linux-2.6-tip.orig/net/netfilter/core.c +++ linux-2.6-tip/net/netfilter/core.c @@ -235,7 +235,7 @@ EXPORT_SYMBOL(nf_ct_attach); void (*nf_ct_destroy)(struct nf_conntrack *); EXPORT_SYMBOL(nf_ct_destroy); -void nf_conntrack_destroy(struct nf_conntrack *nfct) +static void __nf_conntrack_destroy(struct nf_conntrack *nfct) { void (*destroy)(struct nf_conntrack *); @@ -245,6 +245,28 @@ void nf_conntrack_destroy(struct nf_conn destroy(nfct); rcu_read_unlock(); } + +#ifdef CONFIG_PREEMPT_RT +/* + * nf_contrack_destroy is called with preemption disabled + * and will call functions that might schedule in PREEMPT_RT. + * For PREEMPT_RT we use a rcu callback instead to handle + * the destroying. + */ +static void nf_conntrack_destroy_rcu(struct rcu_head *rhp) +{ + __nf_conntrack_destroy(container_of(rhp, struct nf_conntrack, rcu)); +} +void nf_conntrack_destroy(struct nf_conntrack *nfct) +{ + call_rcu(&nfct->rcu, nf_conntrack_destroy_rcu); +} +#else /* !PREEMPT_RT */ +void nf_conntrack_destroy(struct nf_conntrack *nfct) +{ + __nf_conntrack_destroy(nfct); +} +#endif /* PREEMPT_RT */ EXPORT_SYMBOL(nf_conntrack_destroy); #endif /* CONFIG_NF_CONNTRACK */ patches/preempt-realtime-mmdrop-delayed.patch0000664000076400007640000001646311161723462020450 0ustar tglxtglxSubject: preempt: realtime mmdrop delayed From: Ingo Molnar Date: Wed Feb 04 00:02:55 CET 2009 Signed-off-by: Ingo Molnar --- include/linux/mm_types.h | 3 + include/linux/sched.h | 8 ++ kernel/fork.c | 141 +++++++++++++++++++++++++++++++++++++++++++++++ kernel/sched.c | 6 +- 4 files changed, 157 insertions(+), 1 deletion(-) Index: linux-2.6-tip/include/linux/mm_types.h =================================================================== --- linux-2.6-tip.orig/include/linux/mm_types.h +++ linux-2.6-tip/include/linux/mm_types.h @@ -241,6 +241,9 @@ struct mm_struct { /* Architecture-specific MM context */ mm_context_t context; + /* realtime bits */ + struct list_head delayed_drop; + /* Swap token stuff */ /* * Last value of global fault stamp as seen by this process. Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -2062,12 +2062,20 @@ extern struct mm_struct * mm_alloc(void) /* mmdrop drops the mm and the page tables */ extern void __mmdrop(struct mm_struct *); +extern void __mmdrop_delayed(struct mm_struct *); + static inline void mmdrop(struct mm_struct * mm) { if (unlikely(atomic_dec_and_test(&mm->mm_count))) __mmdrop(mm); } +static inline void mmdrop_delayed(struct mm_struct * mm) +{ + if (atomic_dec_and_test(&mm->mm_count)) + __mmdrop_delayed(mm); +} + /* mmput gets rid of the mappings and all user-space */ extern void mmput(struct mm_struct *); /* Grab a reference to a task's mm, if it is not already going away */ Index: linux-2.6-tip/kernel/fork.c =================================================================== --- linux-2.6-tip.orig/kernel/fork.c +++ linux-2.6-tip/kernel/fork.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -49,6 +50,8 @@ #include #include #include +#include +#include #include #include #include @@ -88,6 +91,15 @@ __cacheline_aligned DEFINE_RWLOCK(taskli DEFINE_TRACE(sched_process_fork); +/* + * Delayed mmdrop. In the PREEMPT_RT case we + * dont want to do this from the scheduling + * context. + */ +static DEFINE_PER_CPU(struct task_struct *, desched_task); + +static DEFINE_PER_CPU(struct list_head, delayed_drop_list); + int nr_processes(void) { int cpu; @@ -174,6 +186,8 @@ void __put_task_struct(struct task_struc void __init fork_init(unsigned long mempages) { + int i; + #ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR #ifndef ARCH_MIN_TASKALIGN #define ARCH_MIN_TASKALIGN L1_CACHE_BYTES @@ -204,6 +218,9 @@ void __init fork_init(unsigned long memp init_task.signal->rlim[RLIMIT_NPROC].rlim_max = max_threads/2; init_task.signal->rlim[RLIMIT_SIGPENDING] = init_task.signal->rlim[RLIMIT_NPROC]; + + for (i = 0; i < NR_CPUS; i++) + INIT_LIST_HEAD(&per_cpu(delayed_drop_list, i)); } int __attribute__((weak)) arch_dup_task_struct(struct task_struct *dst, @@ -285,6 +302,7 @@ static int dup_mmap(struct mm_struct *mm mm->locked_vm = 0; mm->mmap = NULL; mm->mmap_cache = NULL; + INIT_LIST_HEAD(&mm->delayed_drop); mm->free_area_cache = oldmm->mmap_base; mm->cached_hole_size = ~0UL; mm->map_count = 0; @@ -1277,7 +1295,9 @@ static struct task_struct *copy_process( attach_pid(p, PIDTYPE_PGID, task_pgrp(current)); attach_pid(p, PIDTYPE_SID, task_session(current)); list_add_tail_rcu(&p->tasks, &init_task.tasks); + preempt_disable(); __get_cpu_var(process_counts)++; + preempt_enable(); } attach_pid(p, PIDTYPE_PID, pid); nr_threads++; @@ -1743,3 +1763,124 @@ int unshare_files(struct files_struct ** task_unlock(task); return 0; } + +static int mmdrop_complete(void) +{ + struct list_head *head; + int ret = 0; + + head = &get_cpu_var(delayed_drop_list); + while (!list_empty(head)) { + struct mm_struct *mm = list_entry(head->next, + struct mm_struct, delayed_drop); + list_del(&mm->delayed_drop); + put_cpu_var(delayed_drop_list); + + __mmdrop(mm); + ret = 1; + + head = &get_cpu_var(delayed_drop_list); + } + put_cpu_var(delayed_drop_list); + + return ret; +} + +/* + * We dont want to do complex work from the scheduler, thus + * we delay the work to a per-CPU worker thread: + */ +void __mmdrop_delayed(struct mm_struct *mm) +{ + struct task_struct *desched_task; + struct list_head *head; + + head = &get_cpu_var(delayed_drop_list); + list_add_tail(&mm->delayed_drop, head); + desched_task = __get_cpu_var(desched_task); + if (desched_task) + wake_up_process(desched_task); + put_cpu_var(delayed_drop_list); +} + +static int desched_thread(void * __bind_cpu) +{ + set_user_nice(current, -10); + current->flags |= PF_NOFREEZE | PF_SOFTIRQ; + + set_current_state(TASK_INTERRUPTIBLE); + + while (!kthread_should_stop()) { + + if (mmdrop_complete()) + continue; + schedule(); + + /* + * This must be called from time to time on ia64, and is a + * no-op on other archs. Used to be in cpu_idle(), but with + * the new -rt semantics it can't stay there. + */ + check_pgt_cache(); + + set_current_state(TASK_INTERRUPTIBLE); + } + __set_current_state(TASK_RUNNING); + return 0; +} + +static int __devinit cpu_callback(struct notifier_block *nfb, + unsigned long action, + void *hcpu) +{ + int hotcpu = (unsigned long)hcpu; + struct task_struct *p; + + switch (action) { + case CPU_UP_PREPARE: + + BUG_ON(per_cpu(desched_task, hotcpu)); + INIT_LIST_HEAD(&per_cpu(delayed_drop_list, hotcpu)); + p = kthread_create(desched_thread, hcpu, "desched/%d", hotcpu); + if (IS_ERR(p)) { + printk("desched_thread for %i failed\n", hotcpu); + return NOTIFY_BAD; + } + per_cpu(desched_task, hotcpu) = p; + kthread_bind(p, hotcpu); + break; + case CPU_ONLINE: + + wake_up_process(per_cpu(desched_task, hotcpu)); + break; +#ifdef CONFIG_HOTPLUG_CPU + case CPU_UP_CANCELED: + + /* Unbind so it can run. Fall thru. */ + kthread_bind(per_cpu(desched_task, hotcpu), smp_processor_id()); + case CPU_DEAD: + + p = per_cpu(desched_task, hotcpu); + per_cpu(desched_task, hotcpu) = NULL; + kthread_stop(p); + takeover_tasklets(hotcpu); + break; +#endif /* CONFIG_HOTPLUG_CPU */ + } + return NOTIFY_OK; +} + +static struct notifier_block __devinitdata cpu_nfb = { + .notifier_call = cpu_callback +}; + +__init int spawn_desched_task(void) +{ + void *cpu = (void *)(long)smp_processor_id(); + + cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); + cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); + register_cpu_notifier(&cpu_nfb); + return 0; +} + Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -2871,8 +2871,12 @@ static void finish_task_switch(struct rq #endif fire_sched_in_preempt_notifiers(current); + /* + * Delay the final freeing of the mm or task, so that we dont have + * to do complex work from within the scheduler: + */ if (mm) - mmdrop(mm); + mmdrop_delayed(mm); if (unlikely(prev_state == TASK_DEAD)) { /* * Remove function-return probe instances associated with this patches/ioapic-fix-too-fast-clocks.patch0000664000076400007640000000306011160752235017315 0ustar tglxtglxSubject: patches/ioapic-fix-too-fast-clocks.patch From: Akira Tsukamoto This one line patch adds upper bound testing inside timer_irq_works() when evaluating whether irq timer works or not on boot up. It fix the machines having problem with clock running too fast. What this patch do is, if timer interrupts running too fast through IO-APIC IRQ then false back to i8259A IRQ. I really appreciate for the feedback from ATI Xpress 200 chipset user, It should eliminate the needs of adding no_timer_check on kernel options. I have NEC laptop using ATI Xpress 200 chipset with Pentium M 1.8GHz and its clock keep going forward when kernel compiled with local APIC support. Many machines based on RS200 chipset seem to have the same problem, including Acer Ferrari 400X AMD notebook or Compaq R4000. Also I would like to have comments on upper bound limit, 16 ticks, which I chose in this patch. My laptop always reports around 20, which is double from normal. arch/x86/kernel/apic/io_apic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Signed-off-by: Ingo Molnar Index: linux-2.6-tip/arch/x86/kernel/apic/io_apic.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/apic/io_apic.c +++ linux-2.6-tip/arch/x86/kernel/apic/io_apic.c @@ -2251,8 +2251,10 @@ static int __init timer_irq_works(void) */ /* jiffies wrap? */ - if (time_after(jiffies, t1 + 4)) + if (time_after(jiffies, t1 + 4) && + time_before(jiffies, t1 + 16)) return 1; + return 0; } patches/preempt-realtime-arm-shark.patch0000664000076400007640000000102111161723427017413 0ustar tglxtglx--- arch/arm/mach-shark/leds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/arch/arm/mach-shark/leds.c =================================================================== --- linux-2.6-tip.orig/arch/arm/mach-shark/leds.c +++ linux-2.6-tip/arch/arm/mach-shark/leds.c @@ -32,7 +32,7 @@ static char led_state; static short hw_led_state; static short saved_state; -static DEFINE_SPINLOCK(leds_lock); +static DEFINE_RAW_SPINLOCK(leds_lock); short sequoia_read(int addr) { outw(addr,0x24); patches/tglx-07-rtmutex-prevent-missed-wakeups.patch0000664000076400007640000001377511161723437021630 0ustar tglxtglxSubject: rtmutex: prevent missed wakeups From: Thomas Gleixner Date: Fri, 19 Dec 2008 21:23:10 -0000 The sleeping locks implementation based on rtmutexes can miss wakeups for two reasons: 1) The unconditional usage TASK_UNINTERRUPTIBLE for the blocking state Results in missed wakeups from wake_up_interruptible*() state = TASK_INTERRUPTIBLE; blocks_on_lock() state = TASK_UNINTERRUPTIBLE; schedule(); .... acquires_lock(); restore_state(); Until the waiter has restored its state wake_up_interruptible*() will fail. 2) The rtmutex wakeup intermediate state TASK_RUNNING_MUTEX Results in missed wakeups from wake_up*() waiter is woken by mutex wakeup waiter->state = TASK_RUNNING_MUTEX; .... acquires_lock(); restore_state(); Until the waiter has restored its state wake_up*() will fail. Solution: Instead of setting the state to TASK_RUNNING_MUTEX in the mutex wakeup case we logically OR TASK_RUNNING_MUTEX to the current waiter state. This keeps the original bits (TASK_INTERRUPTIBLE / TASK_UNINTERRUPTIBLE) intact and lets wakeups succeed. When a task blocks on a lock in state TASK_INTERRUPTIBLE and is woken up by a real wakeup, then we store the state = TASK_RUNNING for the restore and can safely use TASK_UNINTERRUPTIBLE from that point to avoid further wakeups which just let us loop in the lock code. This also removes the extra TASK_RUNNING_MUTEX flags from the wakeup_process*() functions as they are not longer necessary. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- include/linux/sched.h | 3 +-- kernel/rtmutex.c | 22 +++++++++++++++++++--- kernel/sched.c | 24 ++++++++++++++++-------- 3 files changed, 36 insertions(+), 13 deletions(-) Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -218,8 +218,7 @@ extern struct semaphore kernel_sem; /* Convenience macros for the sake of wake_up */ #define TASK_NORMAL (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE) -#define TASK_ALL (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED | \ - TASK_RUNNING_MUTEX) +#define TASK_ALL (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED) /* get_task_state() */ #define TASK_REPORT (TASK_RUNNING | TASK_RUNNING_MUTEX | \ Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -739,16 +739,32 @@ static int adaptive_wait(struct rt_mutex /* * The state setting needs to preserve the original state and needs to * take care of non rtmutex wakeups. + * + * Called with rtmutex->wait_lock held to serialize against rtmutex + * wakeups(). */ static inline unsigned long rt_set_current_blocked_state(unsigned long saved_state) { - unsigned long state; + unsigned long state, block_state; + + /* + * If state is TASK_INTERRUPTIBLE, then we set the state for + * blocking to TASK_INTERRUPTIBLE as well, otherwise we would + * miss real wakeups via wake_up_interruptible(). If such a + * wakeup happens we see the running state and preserve it in + * saved_state. Now we can ignore further wakeups as we will + * return in state running from our "spin" sleep. + */ + if (saved_state == TASK_INTERRUPTIBLE) + block_state = TASK_INTERRUPTIBLE; + else + block_state = TASK_UNINTERRUPTIBLE; - state = xchg(¤t->state, TASK_UNINTERRUPTIBLE); + state = xchg(¤t->state, block_state); /* * Take care of non rtmutex wakeups. rtmutex wakeups - * set the state to TASK_RUNNING_MUTEX. + * or TASK_RUNNING_MUTEX to (UN)INTERRUPTIBLE. */ if (state == TASK_RUNNING) saved_state = TASK_RUNNING; Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -2598,8 +2598,16 @@ out_running: trace_sched_wakeup(rq, p, success); check_preempt_curr(rq, p, sync); + /* + * For a mutex wakeup we or TASK_RUNNING_MUTEX to the task + * state to preserve the original state, so a real wakeup + * still can see the (UN)INTERRUPTIBLE bits in the state check + * above. We dont have to worry about the | TASK_RUNNING_MUTEX + * here. The waiter is serialized by the mutex lock and nobody + * else can fiddle with p->state as we hold rq lock. + */ if (mutex) - p->state = TASK_RUNNING_MUTEX; + p->state |= TASK_RUNNING_MUTEX; else p->state = TASK_RUNNING; #ifdef CONFIG_SMP @@ -2638,7 +2646,7 @@ EXPORT_SYMBOL(wake_up_process_mutex_sync int wake_up_state(struct task_struct *p, unsigned int state) { - return try_to_wake_up(p, state | TASK_RUNNING_MUTEX, 0, 0); + return try_to_wake_up(p, state, 0, 0); } /* @@ -4953,8 +4961,8 @@ asmlinkage void __sched __schedule(void) update_rq_clock(rq); clear_tsk_need_resched(prev); - if ((prev->state & ~TASK_RUNNING_MUTEX) && - !(preempt_count() & PREEMPT_ACTIVE)) { + if (!(prev->state & TASK_RUNNING_MUTEX) && prev->state && + !(preempt_count() & PREEMPT_ACTIVE)) { if (unlikely(signal_pending_state(prev->state, prev))) prev->state = TASK_RUNNING; else { @@ -5198,8 +5206,7 @@ asmlinkage void __sched preempt_schedule int default_wake_function(wait_queue_t *curr, unsigned mode, int sync, void *key) { - return try_to_wake_up(curr->private, mode | TASK_RUNNING_MUTEX, - sync, 0); + return try_to_wake_up(curr->private, mode, sync, 0); } EXPORT_SYMBOL(default_wake_function); @@ -6617,8 +6624,9 @@ void sched_show_task(struct task_struct unsigned state; state = p->state ? __ffs(p->state) + 1 : 0; - printk("%-13.13s %c [%p]", p->comm, - state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?', p); + printk("%-13.13s %c (%03lx) [%p]", p->comm, + state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?', + (unsigned long) p->state, p); #if BITS_PER_LONG == 32 if (0 && (state == TASK_RUNNING)) printk(KERN_CONT " running "); patches/printk-in-atomic-hack-fix.patch0000664000076400007640000000336411160752235017143 0ustar tglxtglxSubject: fix printk in atomic hack From: Steven Rostedt The printk in atomic hack had a slight bug. This but was triggered by debug locking options. The hack prevents grabbing sleeping spin locks in printk console drivers if we are in atomic (can't sleep). But the unlock had a bug where it incorrectely assumed that if we are in printk and atomic, that we didn't grab the lock. The debug locking can encapsulate these options and cause unlocks to be in atomic when the lock was not. This means we would not release the lock after it was taken. The patch only skips releasing the lock if in printk - atomic *and* not the lock owner. Special thanks goes to Jon Masters for digging his head deep into this crap and narrowing it down to a problem with printks and locks. Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- kernel/rtmutex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -634,7 +634,7 @@ rt_spin_lock_fastlock(struct rt_mutex *l void (*slowfn)(struct rt_mutex *lock)) { /* Temporary HACK! */ - if (!current->in_printk) + if (likely(!current->in_printk)) might_sleep(); else if (in_atomic() || irqs_disabled()) /* don't grab locks for printk in atomic */ @@ -651,7 +651,7 @@ rt_spin_lock_fastunlock(struct rt_mutex void (*slowfn)(struct rt_mutex *lock)) { /* Temporary HACK! */ - if (current->in_printk && (in_atomic() || irqs_disabled())) + if (unlikely(rt_mutex_owner(lock) != current) && current->in_printk) /* don't grab locks for printk in atomic */ return; patches/preempt-realtime-i386.patch0000664000076400007640000004102311161660655016230 0ustar tglxtglxSubject: preempt: realtime i386 From: Ingo Molnar Date: Wed Feb 04 00:02:56 CET 2009 Signed-off-by: Ingo Molnar --- arch/Kconfig | 5 ++++ arch/x86/Kconfig.debug | 1 arch/x86/include/asm/highmem.h | 27 ++++++++++++++++++++++++++ arch/x86/include/asm/i8253.h | 2 - arch/x86/include/asm/pci_x86.h | 2 - arch/x86/include/asm/tlbflush.h | 22 +++++++++++++++++++++ arch/x86/include/asm/xor_32.h | 19 ++++++++++++++++-- arch/x86/kernel/cpu/mtrr/generic.c | 2 - arch/x86/kernel/dumpstack_32.c | 6 +++++ arch/x86/kernel/head_32.S | 1 arch/x86/kernel/i8253.c | 2 - arch/x86/kernel/microcode_amd.c | 2 - arch/x86/kernel/microcode_intel.c | 2 - arch/x86/kernel/process_32.c | 6 +++-- arch/x86/kernel/vm86_32.c | 1 arch/x86/mm/fault.c | 1 arch/x86/mm/highmem_32.c | 38 +++++++++++++++++++++++++++++-------- arch/x86/pci/common.c | 2 - arch/x86/pci/direct.c | 29 ++++++++++++++++++---------- 19 files changed, 141 insertions(+), 29 deletions(-) Index: linux-2.6-tip/arch/Kconfig =================================================================== --- linux-2.6-tip.orig/arch/Kconfig +++ linux-2.6-tip/arch/Kconfig @@ -33,6 +33,11 @@ config OPROFILE_IBS config HAVE_OPROFILE bool +config PROFILE_NMI + bool + depends on OPROFILE + default y + config KPROBES bool "Kprobes" depends on KALLSYMS && MODULES Index: linux-2.6-tip/arch/x86/Kconfig.debug =================================================================== --- linux-2.6-tip.orig/arch/x86/Kconfig.debug +++ linux-2.6-tip/arch/x86/Kconfig.debug @@ -135,6 +135,7 @@ config DEBUG_NX_TEST config 4KSTACKS bool "Use 4Kb for kernel stacks instead of 8Kb" depends on X86_32 + default y ---help--- If you say Y here the kernel will use a 4Kb stacksize for the kernel stack attached to each process/thread. This facilitates Index: linux-2.6-tip/arch/x86/include/asm/highmem.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/highmem.h +++ linux-2.6-tip/arch/x86/include/asm/highmem.h @@ -58,6 +58,16 @@ extern void *kmap_high(struct page *page extern void kunmap_high(struct page *page); void *kmap(struct page *page); +extern void kunmap_virt(void *ptr); +extern struct page *kmap_to_page(void *ptr); +void kunmap(struct page *page); + +void *__kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot); +void *__kmap_atomic(struct page *page, enum km_type type); +void __kunmap_atomic(void *kvaddr, enum km_type type); +void *__kmap_atomic_pfn(unsigned long pfn, enum km_type type); +struct page *__kmap_atomic_to_page(void *ptr); + void kunmap(struct page *page); void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot); void *kmap_atomic(struct page *page, enum km_type type); @@ -75,6 +85,23 @@ struct page *kmap_atomic_to_page(void *p extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn, unsigned long end_pfn); +/* + * on PREEMPT_RT kmap_atomic() is a wrapper that uses kmap(): + */ +#ifdef CONFIG_PREEMPT_RT +# define kmap_atomic_prot(page, type, prot) kmap(page) +# define kmap_atomic(page, type) kmap(page) +# define kmap_atomic_pfn(pfn, type) kmap(pfn_to_page(pfn)) +# define kunmap_atomic(kvaddr, type) kunmap_virt(kvaddr) +# define kmap_atomic_to_page(kvaddr) kmap_to_page(kvaddr) +#else +# define kmap_atomic_prot(page, type, prot) __kmap_atomic_prot(page, type, prot) +# define kmap_atomic(page, type) __kmap_atomic(page, type) +# define kmap_atomic_pfn(pfn, type) __kmap_atomic_pfn(pfn, type) +# define kunmap_atomic(kvaddr, type) __kunmap_atomic(kvaddr, type) +# define kmap_atomic_to_page(kvaddr) __kmap_atomic_to_page(kvaddr) +#endif + #endif /* __KERNEL__ */ #endif /* _ASM_X86_HIGHMEM_H */ Index: linux-2.6-tip/arch/x86/include/asm/i8253.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/i8253.h +++ linux-2.6-tip/arch/x86/include/asm/i8253.h @@ -6,7 +6,7 @@ #define PIT_CH0 0x40 #define PIT_CH2 0x42 -extern spinlock_t i8253_lock; +extern raw_spinlock_t i8253_lock; extern struct clock_event_device *global_clock_event; Index: linux-2.6-tip/arch/x86/include/asm/pci_x86.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/pci_x86.h +++ linux-2.6-tip/arch/x86/include/asm/pci_x86.h @@ -83,7 +83,7 @@ struct irq_routing_table { extern unsigned int pcibios_irq_mask; extern int pcibios_scanned; -extern spinlock_t pci_config_lock; +extern raw_spinlock_t pci_config_lock; extern int (*pcibios_enable_irq)(struct pci_dev *dev); extern void (*pcibios_disable_irq)(struct pci_dev *dev); Index: linux-2.6-tip/arch/x86/include/asm/tlbflush.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/tlbflush.h +++ linux-2.6-tip/arch/x86/include/asm/tlbflush.h @@ -7,6 +7,21 @@ #include #include +/* + * TLB-flush needs to be nonpreemptible on PREEMPT_RT due to the + * following complex race scenario: + * + * if the current task is lazy-TLB and does a TLB flush and + * gets preempted after the movl %%r3, %0 but before the + * movl %0, %%cr3 then its ->active_mm might change and it will + * install the wrong cr3 when it switches back. This is not a + * problem for the lazy-TLB task itself, but if the next task it + * switches to has an ->mm that is also the lazy-TLB task's + * new ->active_mm, then the scheduler will assume that cr3 is + * the new one, while we overwrote it with the old one. The result + * is the wrong cr3 in the new (non-lazy-TLB) task, which typically + * causes an infinite pagefault upon the next userspace access. + */ #ifdef CONFIG_PARAVIRT #include #else @@ -97,6 +112,13 @@ static inline void __flush_tlb_one(unsig static inline void flush_tlb_mm(struct mm_struct *mm) { + /* + * This is safe on PREEMPT_RT because if we preempt + * right after the check but before the __flush_tlb(), + * and if ->active_mm changes, then we might miss a + * TLB flush, but that TLB flush happened already when + * ->active_mm was changed: + */ if (mm == current->active_mm) __flush_tlb(); } Index: linux-2.6-tip/arch/x86/include/asm/xor_32.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/xor_32.h +++ linux-2.6-tip/arch/x86/include/asm/xor_32.h @@ -865,7 +865,21 @@ static struct xor_block_template xor_blo #include #undef XOR_TRY_TEMPLATES -#define XOR_TRY_TEMPLATES \ +/* + * MMX/SSE ops disable preemption for long periods of time, + * so on PREEMPT_RT use the register-based ops only: + */ +#ifdef CONFIG_PREEMPT_RT +# define XOR_TRY_TEMPLATES \ + do { \ + xor_speed(&xor_block_8regs); \ + xor_speed(&xor_block_8regs_p); \ + xor_speed(&xor_block_32regs); \ + xor_speed(&xor_block_32regs_p); \ + } while (0) +# define XOR_SELECT_TEMPLATE(FASTEST) (FASTEST) +#else +# define XOR_TRY_TEMPLATES \ do { \ xor_speed(&xor_block_8regs); \ xor_speed(&xor_block_8regs_p); \ @@ -882,7 +896,8 @@ do { \ /* We force the use of the SSE xor block because it can write around L2. We may also be able to load into the L1 only depending on how the cpu deals with a load to a line that is being prefetched. */ -#define XOR_SELECT_TEMPLATE(FASTEST) \ +# define XOR_SELECT_TEMPLATE(FASTEST) \ (cpu_has_xmm ? &xor_block_pIII_sse : FASTEST) +#endif /* CONFIG_PREEMPT_RT */ #endif /* _ASM_X86_XOR_32_H */ Index: linux-2.6-tip/arch/x86/kernel/cpu/mtrr/generic.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/cpu/mtrr/generic.c +++ linux-2.6-tip/arch/x86/kernel/cpu/mtrr/generic.c @@ -548,7 +548,7 @@ static unsigned long set_mtrr_state(void static unsigned long cr4 = 0; -static DEFINE_SPINLOCK(set_atomicity_lock); +static DEFINE_RAW_SPINLOCK(set_atomicity_lock); /* * Since we are disabling the cache don't allow any interrupts - they Index: linux-2.6-tip/arch/x86/kernel/dumpstack_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/dumpstack_32.c +++ linux-2.6-tip/arch/x86/kernel/dumpstack_32.c @@ -93,6 +93,12 @@ show_stack_log_lvl(struct task_struct *t } +#if defined(CONFIG_DEBUG_STACKOVERFLOW) && defined(CONFIG_EVENT_TRACE) +extern unsigned long worst_stack_left; +#else +# define worst_stack_left -1L +#endif + void show_registers(struct pt_regs *regs) { int i; Index: linux-2.6-tip/arch/x86/kernel/head_32.S =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/head_32.S +++ linux-2.6-tip/arch/x86/kernel/head_32.S @@ -595,6 +595,7 @@ ignore_int: call dump_stack addl $(5*4),%esp + call dump_stack popl %ds popl %es popl %edx Index: linux-2.6-tip/arch/x86/kernel/i8253.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/i8253.c +++ linux-2.6-tip/arch/x86/kernel/i8253.c @@ -15,7 +15,7 @@ #include #include -DEFINE_SPINLOCK(i8253_lock); +DEFINE_RAW_SPINLOCK(i8253_lock); EXPORT_SYMBOL(i8253_lock); #ifdef CONFIG_X86_32 Index: linux-2.6-tip/arch/x86/kernel/microcode_amd.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/microcode_amd.c +++ linux-2.6-tip/arch/x86/kernel/microcode_amd.c @@ -80,7 +80,7 @@ struct microcode_amd { #define UCODE_CONTAINER_HEADER_SIZE 12 /* serialize access to the physical write */ -static DEFINE_SPINLOCK(microcode_update_lock); +static DEFINE_RAW_SPINLOCK(microcode_update_lock); static struct equiv_cpu_entry *equiv_cpu_table; Index: linux-2.6-tip/arch/x86/kernel/microcode_intel.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/microcode_intel.c +++ linux-2.6-tip/arch/x86/kernel/microcode_intel.c @@ -151,7 +151,7 @@ struct extended_sigtable { #define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE) /* serialize access to the physical write to MSR 0x79 */ -static DEFINE_SPINLOCK(microcode_update_lock); +static DEFINE_RAW_SPINLOCK(microcode_update_lock); static int collect_cpu_info(int cpu_num, struct cpu_signature *csig) { Index: linux-2.6-tip/arch/x86/kernel/process_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/process_32.c +++ linux-2.6-tip/arch/x86/kernel/process_32.c @@ -165,8 +165,10 @@ void __show_regs(struct pt_regs *regs, i regs->ax, regs->bx, regs->cx, regs->dx); printk("ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n", regs->si, regs->di, regs->bp, sp); - printk(" DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n", - (u16)regs->ds, (u16)regs->es, (u16)regs->fs, gs, ss); + printk(" DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x" + " preempt:%08x\n", + (u16)regs->ds, (u16)regs->es, (u16)regs->fs, gs, ss, + preempt_count()); if (!all) return; Index: linux-2.6-tip/arch/x86/kernel/vm86_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/vm86_32.c +++ linux-2.6-tip/arch/x86/kernel/vm86_32.c @@ -137,6 +137,7 @@ struct pt_regs *save_v86_state(struct ke local_irq_enable(); if (!current->thread.vm86_info) { + local_irq_disable(); printk("no vm86_info: BAD\n"); do_exit(SIGSEGV); } Index: linux-2.6-tip/arch/x86/mm/fault.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/fault.c +++ linux-2.6-tip/arch/x86/mm/fault.c @@ -591,6 +591,7 @@ static int is_f00f_bug(struct pt_regs *r nr = (address - idt_descr.address) >> 3; if (nr == 6) { + zap_rt_locks(); do_invalid_op(regs, 0); return 1; } Index: linux-2.6-tip/arch/x86/mm/highmem_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/highmem_32.c +++ linux-2.6-tip/arch/x86/mm/highmem_32.c @@ -19,6 +19,27 @@ void kunmap(struct page *page) kunmap_high(page); } +void kunmap_virt(void *ptr) +{ + struct page *page; + + if ((unsigned long)ptr < PKMAP_ADDR(0)) + return; + page = pte_page(pkmap_page_table[PKMAP_NR((unsigned long)ptr)]); + kunmap(page); +} + +struct page *kmap_to_page(void *ptr) +{ + struct page *page; + + if ((unsigned long)ptr < PKMAP_ADDR(0)) + return virt_to_page(ptr); + page = pte_page(pkmap_page_table[PKMAP_NR((unsigned long)ptr)]); + return page; +} +EXPORT_SYMBOL_GPL(kmap_to_page); /* PREEMPT_RT converts some modules to use this */ + static void debug_kmap_atomic_prot(enum km_type type) { #ifdef CONFIG_DEBUG_HIGHMEM @@ -70,7 +91,7 @@ static void debug_kmap_atomic_prot(enum * However when holding an atomic kmap is is not legal to sleep, so atomic * kmaps are appropriate for short, tight code paths only. */ -void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot) +void *__kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot) { enum fixed_addresses idx; unsigned long vaddr; @@ -92,12 +113,12 @@ void *kmap_atomic_prot(struct page *page return (void *)vaddr; } -void *kmap_atomic(struct page *page, enum km_type type) +void *__kmap_atomic(struct page *page, enum km_type type) { return kmap_atomic_prot(page, type, kmap_prot); } -void kunmap_atomic(void *kvaddr, enum km_type type) +void __kunmap_atomic(void *kvaddr, enum km_type type) { unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id(); @@ -125,13 +146,13 @@ void kunmap_atomic(void *kvaddr, enum km * This is the same as kmap_atomic() but can map memory that doesn't * have a struct page associated with it. */ -void *kmap_atomic_pfn(unsigned long pfn, enum km_type type) +void *__kmap_atomic_pfn(unsigned long pfn, enum km_type type) { return kmap_atomic_prot_pfn(pfn, type, kmap_prot); } -EXPORT_SYMBOL_GPL(kmap_atomic_pfn); /* temporarily in use by i915 GEM until vmap */ +EXPORT_SYMBOL_GPL(__kmap_atomic_pfn); /* temporarily in use by i915 GEM until vmap */ -struct page *kmap_atomic_to_page(void *ptr) +struct page *__kmap_atomic_to_page(void *ptr) { unsigned long idx, vaddr = (unsigned long)ptr; pte_t *pte; @@ -146,8 +167,9 @@ struct page *kmap_atomic_to_page(void *p EXPORT_SYMBOL(kmap); EXPORT_SYMBOL(kunmap); -EXPORT_SYMBOL(kmap_atomic); -EXPORT_SYMBOL(kunmap_atomic); +EXPORT_SYMBOL(kunmap_virt); +EXPORT_SYMBOL(__kmap_atomic); +EXPORT_SYMBOL(__kunmap_atomic); void __init set_highmem_pages_init(void) { Index: linux-2.6-tip/arch/x86/pci/common.c =================================================================== --- linux-2.6-tip.orig/arch/x86/pci/common.c +++ linux-2.6-tip/arch/x86/pci/common.c @@ -81,7 +81,7 @@ int pcibios_scanned; * This interrupt-safe spinlock protects all accesses to PCI * configuration space. */ -DEFINE_SPINLOCK(pci_config_lock); +DEFINE_RAW_SPINLOCK(pci_config_lock); static int __devinit can_skip_ioresource_align(const struct dmi_system_id *d) { Index: linux-2.6-tip/arch/x86/pci/direct.c =================================================================== --- linux-2.6-tip.orig/arch/x86/pci/direct.c +++ linux-2.6-tip/arch/x86/pci/direct.c @@ -223,16 +223,23 @@ static int __init pci_check_type1(void) unsigned int tmp; int works = 0; - local_irq_save(flags); + spin_lock_irqsave(&pci_config_lock, flags); outb(0x01, 0xCFB); tmp = inl(0xCF8); outl(0x80000000, 0xCF8); - if (inl(0xCF8) == 0x80000000 && pci_sanity_check(&pci_direct_conf1)) { - works = 1; + + if (inl(0xCF8) == 0x80000000) { + spin_unlock_irqrestore(&pci_config_lock, flags); + + if (pci_sanity_check(&pci_direct_conf1)) + works = 1; + + spin_lock_irqsave(&pci_config_lock, flags); } outl(tmp, 0xCF8); - local_irq_restore(flags); + + spin_unlock_irqrestore(&pci_config_lock, flags); return works; } @@ -242,17 +249,19 @@ static int __init pci_check_type2(void) unsigned long flags; int works = 0; - local_irq_save(flags); + spin_lock_irqsave(&pci_config_lock, flags); outb(0x00, 0xCFB); outb(0x00, 0xCF8); outb(0x00, 0xCFA); - if (inb(0xCF8) == 0x00 && inb(0xCFA) == 0x00 && - pci_sanity_check(&pci_direct_conf2)) { - works = 1; - } - local_irq_restore(flags); + if (inb(0xCF8) == 0x00 && inb(0xCFA) == 0x00) { + spin_unlock_irqrestore(&pci_config_lock, flags); + + if (pci_sanity_check(&pci_direct_conf2)) + works = 1; + } else + spin_unlock_irqrestore(&pci_config_lock, flags); return works; } patches/slub-compile-fix.patch0000664000076400007640000000425311160752235015443 0ustar tglxtglxSubject: -rt, bit-spinlocks: add __bit_spin_unlock() From: Ingo Molnar Date: Sun Feb 08 07:16:24 CET 2009 This commit: b8dc93c: bit_spin_lock: use lock bitops - introduced __bit_spin_unlock() => add that too - changed the clear-bit primitives to the _locked version => update Signed-off-by: Ingo Molnar --- include/linux/spinlock.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) Index: linux-2.6-tip/include/linux/spinlock.h =================================================================== --- linux-2.6-tip.orig/include/linux/spinlock.h +++ linux-2.6-tip/include/linux/spinlock.h @@ -531,7 +531,7 @@ static inline void bit_spin_lock(int bit * attempt to acquire the lock bit. */ #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) - while (test_and_set_bit(bitnum, addr)) + while (unlikely(test_and_set_bit_lock(bitnum, addr))) while (test_bit(bitnum, addr)) cpu_relax(); #endif @@ -544,7 +544,7 @@ static inline void bit_spin_lock(int bit static inline int bit_spin_trylock(int bitnum, unsigned long *addr) { #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) - if (test_and_set_bit(bitnum, addr)) + if (unlikely(test_and_set_bit_lock(bitnum, addr))) return 0; #endif __acquire(bitlock); @@ -552,14 +552,29 @@ static inline int bit_spin_trylock(int b } /* - * bit-based spin_unlock() + * bit-based spin_unlock(): */ static inline void bit_spin_unlock(int bitnum, unsigned long *addr) { #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) +# ifdef CONFIG_DEBUG_SPINLOCK BUG_ON(!test_bit(bitnum, addr)); - smp_mb__before_clear_bit(); - clear_bit(bitnum, addr); +# endif + clear_bit_unlock(bitnum, addr); +#endif + __release(bitlock); +} + +/* + * bit-based spin_unlock() - non-atomic version: + */ +static inline void __bit_spin_unlock(int bitnum, unsigned long *addr) +{ +#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) +# ifdef CONFIG_DEBUG_SPINLOCK + BUG_ON(!test_bit(bitnum, addr)); +# endif + __clear_bit_unlock(bitnum, addr); #endif __release(bitlock); } patches/lock-init-plist-fix.patch0000664000076400007640000000444311160752235016073 0ustar tglxtglxSubject: Fix plist initialisation for CONFIG_DEBUG_PI_LIST From: Jan Kiszka Date: Fri, 26 Oct 2007 17:38:19 +0200 [ The following text is in the "ISO-8859-15" character set. ] [ Your display is set for the "iso-8859-1" character set. ] [ Some special characters may be displayed incorrectly. ] PLIST_NODE_INIT (once used, only in -rt ATM) will fail when CONFIG_DEBUG_PI_LIST is enabled as it then generates a &NULL statement. This patch fixes the issue indirectly by turning the _lock argument of PLIST_HEAD_INIT into a pointer and adopting its users. Signed-off-by: Jan Kiszka Signed-off-by: Ingo Molnar --- include/linux/plist.h | 4 ++-- include/linux/rtmutex.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: linux-2.6-tip/include/linux/plist.h =================================================================== --- linux-2.6-tip.orig/include/linux/plist.h +++ linux-2.6-tip/include/linux/plist.h @@ -103,12 +103,12 @@ struct plist_node { /** * PLIST_HEAD_INIT - static struct plist_head initializer * @head: struct plist_head variable name - * @_lock: lock to initialize for this list + * @_lock: lock * to initialize for this list */ #define PLIST_HEAD_INIT(head, _lock) \ { \ _PLIST_HEAD_INIT(head), \ - PLIST_HEAD_LOCK_INIT(&(_lock)) \ + PLIST_HEAD_LOCK_INIT(_lock) \ } /** Index: linux-2.6-tip/include/linux/rtmutex.h =================================================================== --- linux-2.6-tip.orig/include/linux/rtmutex.h +++ linux-2.6-tip/include/linux/rtmutex.h @@ -64,7 +64,7 @@ struct hrtimer_sleeper; #define __RT_MUTEX_INITIALIZER(mutexname) \ { .wait_lock = RAW_SPIN_LOCK_UNLOCKED(mutexname) \ - , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list, mutexname.wait_lock) \ + , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list, &mutexname.wait_lock) \ , .owner = NULL \ __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} @@ -100,7 +100,7 @@ extern void rt_mutex_unlock(struct rt_mu #ifdef CONFIG_RT_MUTEXES # define INIT_RT_MUTEXES(tsk) \ - .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \ + .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, &tsk.pi_lock), \ INIT_RT_MUTEX_DEBUG(tsk) #else # define INIT_RT_MUTEXES(tsk) patches/percpu-locked-netfilter.patch0000664000076400007640000001046211160752235017012 0ustar tglxtglxSubject: patches/percpu-locked-netfilter.patch Signed-off-by: Ingo Molnar --- --- net/core/flow.c | 22 ++++++++++++++-------- net/ipv4/netfilter/arp_tables.c | 4 ++-- net/ipv4/netfilter/ip_tables.c | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) Index: linux-2.6-tip/net/core/flow.c =================================================================== --- linux-2.6-tip.orig/net/core/flow.c +++ linux-2.6-tip/net/core/flow.c @@ -39,9 +39,10 @@ atomic_t flow_cache_genid = ATOMIC_INIT( static u32 flow_hash_shift; #define flow_hash_size (1 << flow_hash_shift) -static DEFINE_PER_CPU(struct flow_cache_entry **, flow_tables) = { NULL }; -#define flow_table(cpu) (per_cpu(flow_tables, cpu)) +static DEFINE_PER_CPU_LOCKED(struct flow_cache_entry **, flow_tables); + +#define flow_table(cpu) (per_cpu_var_locked(flow_tables, cpu)) static struct kmem_cache *flow_cachep __read_mostly; @@ -168,24 +169,24 @@ static int flow_key_compare(struct flowi void *flow_cache_lookup(struct net *net, struct flowi *key, u16 family, u8 dir, flow_resolve_t resolver) { - struct flow_cache_entry *fle, **head = NULL /* shut up GCC */; + struct flow_cache_entry **table, *fle, **head = NULL /* shut up GCC */; unsigned int hash; int cpu; local_bh_disable(); - cpu = smp_processor_id(); + table = get_cpu_var_locked(flow_tables, &cpu); fle = NULL; /* Packet really early in init? Making flow_cache_init a * pre-smp initcall would solve this. --RR */ - if (!flow_table(cpu)) + if (!table) goto nocache; if (flow_hash_rnd_recalc(cpu)) flow_new_hash_rnd(cpu); hash = flow_hash_code(key, cpu); - head = &flow_table(cpu)[hash]; + head = &table[hash]; for (fle = *head; fle; fle = fle->next) { if (fle->family == family && fle->dir == dir && @@ -195,6 +196,7 @@ void *flow_cache_lookup(struct net *net, if (ret) atomic_inc(fle->object_ref); + put_cpu_var_locked(flow_tables, cpu); local_bh_enable(); return ret; @@ -220,6 +222,8 @@ void *flow_cache_lookup(struct net *net, } nocache: + put_cpu_var_locked(flow_tables, cpu); + { int err; void *obj; @@ -249,14 +253,15 @@ nocache: static void flow_cache_flush_tasklet(unsigned long data) { struct flow_flush_info *info = (void *)data; + struct flow_cache_entry **table; int i; int cpu; - cpu = smp_processor_id(); + table = get_cpu_var_locked(flow_tables, &cpu); for (i = 0; i < flow_hash_size; i++) { struct flow_cache_entry *fle; - fle = flow_table(cpu)[i]; + fle = table[i]; for (; fle; fle = fle->next) { unsigned genid = atomic_read(&flow_cache_genid); @@ -267,6 +272,7 @@ static void flow_cache_flush_tasklet(uns atomic_dec(fle->object_ref); } } + put_cpu_var_locked(flow_tables, cpu); if (atomic_dec_and_test(&info->cpuleft)) complete(&info->completion); Index: linux-2.6-tip/net/ipv4/netfilter/arp_tables.c =================================================================== --- linux-2.6-tip.orig/net/ipv4/netfilter/arp_tables.c +++ linux-2.6-tip/net/ipv4/netfilter/arp_tables.c @@ -239,7 +239,7 @@ unsigned int arpt_do_table(struct sk_buf read_lock_bh(&table->lock); private = table->private; - table_base = (void *)private->entries[smp_processor_id()]; + table_base = (void *)private->entries[raw_smp_processor_id()]; e = get_entry(table_base, private->hook_entry[hook]); back = get_entry(table_base, private->underflow[hook]); @@ -1157,7 +1157,7 @@ static int do_add_counters(struct net *n i = 0; /* Choose the copy that is on our node */ - loc_cpu_entry = private->entries[smp_processor_id()]; + loc_cpu_entry = private->entries[raw_smp_processor_id()]; ARPT_ENTRY_ITERATE(loc_cpu_entry, private->size, add_counter_to_entry, Index: linux-2.6-tip/net/ipv4/netfilter/ip_tables.c =================================================================== --- linux-2.6-tip.orig/net/ipv4/netfilter/ip_tables.c +++ linux-2.6-tip/net/ipv4/netfilter/ip_tables.c @@ -350,7 +350,7 @@ ipt_do_table(struct sk_buff *skb, read_lock_bh(&table->lock); IP_NF_ASSERT(table->valid_hooks & (1 << hook)); private = table->private; - table_base = (void *)private->entries[smp_processor_id()]; + table_base = (void *)private->entries[raw_smp_processor_id()]; e = get_entry(table_base, private->hook_entry[hook]); /* For return from builtin chain */ patches/x86-pae-preempt-realtime-fix.patch0000664000076400007640000000255011161661303017504 0ustar tglxtglxSubject: x86-pae-preempt-realtime-fix.patch From: Thomas Gleixner Date: Mon, 23 Mar 2009 11:20:36 +0100 Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/pgtable-3level.h | 1 + arch/x86/mm/pgtable.c | 2 ++ 2 files changed, 3 insertions(+) Index: linux-2.6-tip/arch/x86/include/asm/pgtable-3level.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/pgtable-3level.h +++ linux-2.6-tip/arch/x86/include/asm/pgtable-3level.h @@ -71,6 +71,7 @@ static inline void pud_clear(pud_t *pudp { unsigned long pgd; + preempt_disable(); set_pud(pudp, __pud(0)); /* Index: linux-2.6-tip/arch/x86/mm/pgtable.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/pgtable.c +++ linux-2.6-tip/arch/x86/mm/pgtable.c @@ -132,6 +132,7 @@ void pud_populate(struct mm_struct *mm, reserved at the pmd (PDPT) level. */ set_pud(pudp, __pud(__pa(pmd) | _PAGE_PRESENT)); + preempt_disable(); /* * According to Intel App note "TLBs, Paging-Structure Caches, * and Their Invalidation", April 2007, document 317080-001, @@ -140,6 +141,7 @@ void pud_populate(struct mm_struct *mm, */ if (mm == current->active_mm) write_cr3(read_cr3()); + preempt_enable(); } #else /* !CONFIG_X86_PAE */ patches/print-might-sleep-hack.patch0000664000076400007640000000534511161723446016546 0ustar tglxtglxSubject: patches/print-might-sleep-hack.patch PREEMPT_RT suffers from the on going problem of running printk in atomic operations. It is very advantageous to do so but with PREEMPT_RT making spin_locks sleep, it can also be devastating. This patch does not solve the problem of printk sleeping in an atomic operation. This patch just makes printk not report that it is. Of course if printk does report that it's sleeping in an atomic operation, then that printing of the report will also print a report, and you go into recursive hell. We need to really sit down and solve the real issue here. Signed-off-by: Ingo Molnar --- include/linux/sched.h | 13 +++++++++++++ kernel/printk.c | 5 ++++- kernel/rtmutex.c | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-) Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -1514,11 +1514,24 @@ struct task_struct { /* state flags for use by tracers */ unsigned long trace; #endif +#ifdef CONFIG_PREEMPT_RT + /* + * Temporary hack, until we find a solution to + * handle printk in atomic operations. + */ + int in_printk; +#endif }; /* Future-safe accessor for struct task_struct's cpus_allowed. */ #define tsk_cpumask(tsk) (&(tsk)->cpus_allowed) +#ifdef CONFIG_PREEMPT_RT +# define set_printk_might_sleep(x) do { current->in_printk = x; } while(0) +#else +# define set_printk_might_sleep(x) do { } while(0) +#endif + /* * Priority of a process goes from 0..MAX_PRIO-1, valid RT * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH Index: linux-2.6-tip/kernel/printk.c =================================================================== --- linux-2.6-tip.orig/kernel/printk.c +++ linux-2.6-tip/kernel/printk.c @@ -396,8 +396,11 @@ static void __call_console_drivers(unsig for (con = console_drivers; con; con = con->next) { if ((con->flags & CON_ENABLED) && con->write && (cpu_online(raw_smp_processor_id()) || - (con->flags & CON_ANYTIME))) + (con->flags & CON_ANYTIME))) { + set_printk_might_sleep(1); con->write(con, &LOG_BUF(start), end - start); + set_printk_might_sleep(0); + } } } Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -632,7 +632,9 @@ static inline void rt_spin_lock_fastlock(struct rt_mutex *lock, void (*slowfn)(struct rt_mutex *lock)) { - might_sleep(); + /* Temporary HACK! */ + if (!current->in_printk) + might_sleep(); if (likely(rt_mutex_cmpxchg(lock, NULL, current))) rt_mutex_deadlock_account_lock(lock, current); patches/ntfs-local-irq-save-nort.patch0000664000076400007640000000514111160752235017030 0ustar tglxtglxSubject: Re: NMI watchdog trace of deadlock From: Mike Galbraith Date: Sat, 27 Oct 2007 12:17:49 +0200 On Sat, 2007-10-27 at 11:44 +0200, Ingo Molnar wrote: > * Nick Piggin wrote: > > > > [10138.175796] [] show_trace+0x12/0x14 > > > [10138.180291] [] dump_stack+0x16/0x18 > > > [10138.184769] [] native_smp_call_function_mask+0x138/0x13d > > > [10138.191117] [] smp_call_function+0x1e/0x24 > > > [10138.196210] [] on_each_cpu+0x25/0x50 > > > [10138.200807] [] flush_tlb_all+0x1e/0x20 > > > [10138.205553] [] kmap_high+0x1b6/0x417 > > > [10138.210118] [] kmap+0x4d/0x4f > > > [10138.214102] [] ntfs_end_buffer_async_read+0x228/0x2f9 > > > [10138.220163] [] end_bio_bh_io_sync+0x26/0x3f > > > [10138.225352] [] bio_endio+0x42/0x6d > > > [10138.229769] [] __end_that_request_first+0x115/0x4ac > > > [10138.235682] [] end_that_request_chunk+0x8/0xa > > > [10138.241052] [] ide_end_request+0x55/0x10a > > > [10138.246058] [] ide_dma_intr+0x6f/0xac > > > [10138.250727] [] ide_intr+0x93/0x1e0 > > > [10138.255125] [] handle_IRQ_event+0x5c/0xc9 > > > > Looks like ntfs is kmap()ing from interrupt context. Should be using > > kmap_atomic instead, I think. > > it's not atomic interrupt context but irq thread context - and -rt > remaps kmap_atomic() to kmap() internally. Hm. Looking at the change to mm/bounce.c, perhaps I should do this instead? Signed-off-by: Ingo Molnar --- fs/ntfs/aops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Index: linux-2.6-tip/fs/ntfs/aops.c =================================================================== --- linux-2.6-tip.orig/fs/ntfs/aops.c +++ linux-2.6-tip/fs/ntfs/aops.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "aops.h" #include "attrib.h" @@ -143,13 +144,13 @@ static void ntfs_end_buffer_async_read(s recs = PAGE_CACHE_SIZE / rec_size; /* Should have been verified before we got here... */ BUG_ON(!recs); - local_irq_save(flags); + local_irq_save_nort(flags); kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ); for (i = 0; i < recs; i++) post_read_mst_fixup((NTFS_RECORD*)(kaddr + i * rec_size), rec_size); kunmap_atomic(kaddr, KM_BIO_SRC_IRQ); - local_irq_restore(flags); + local_irq_restore_nort(flags); flush_dcache_page(page); if (likely(page_uptodate && !PageError(page))) SetPageUptodate(page); patches/preempt-realtime-fix-irqdesc-lock-initializers.patch0000664000076400007640000000420411160752235023402 0ustar tglxtglxSubject: rt: sparseirq build fix From: Ingo Molnar Date: Sun Feb 08 16:43:43 CET 2009 Convert it to raw locks: kernel/irq/manage.c: In function ‘thread_simple_irq’: kernel/irq/manage.c:821: error: ‘irq_desc’ undeclared (first use in this function) kernel/irq/manage.c:821: error: (Each undeclared identifier is reported only once kernel/irq/manage.c:821: error: for each function it appears in.) kernel/irq/manage.c: In function ‘thread_level_irq’: kernel/irq/manage.c:843: error: ‘irq_desc’ undeclared (first use in this function) kernel/irq/manage.c: In function ‘thread_fasteoi_irq’: kernel/irq/manage.c:855: error: ‘irq_desc’ undeclared (first use in this function) kernel/irq/manage.c: In function ‘thread_edge_irq’: kernel/irq/manage.c:867: error: ‘irq_desc’ undeclared (first use in this function) kernel/irq/manage.c: In function ‘thread_do_irq’: kernel/irq/manage.c:905: error: ‘irq_desc’ undeclared (first use in this function) kernel/irq/manage.c: In function ‘init_hardirqs’: kernel/irq/manage.c:1031: error: ‘irq_desc’ undeclared (first use in this function) make[1]: *** [kernel/irq/manage.o] Error 1 make: *** [kernel/irq/manage.o] Error 2 => fold back to: preempt-realtime-irqs.patch Signed-off-by: Ingo Molnar --- kernel/irq/handle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6-tip/kernel/irq/handle.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/handle.c +++ linux-2.6-tip/kernel/irq/handle.c @@ -79,7 +79,7 @@ static struct irq_desc irq_desc_init = { .chip = &no_irq_chip, .handle_irq = handle_bad_irq, .depth = 1, - .lock = __SPIN_LOCK_UNLOCKED(irq_desc_init.lock), + .lock = RAW_SPIN_LOCK_UNLOCKED(irq_desc_init.lock), }; void init_kstat_irqs(struct irq_desc *desc, int cpu, int nr) @@ -137,7 +137,7 @@ static struct irq_desc irq_desc_legacy[N .chip = &no_irq_chip, .handle_irq = handle_bad_irq, .depth = 1, - .lock = __SPIN_LOCK_UNLOCKED(irq_desc_init.lock), + .lock = RAW_SPIN_LOCK_UNLOCKED(irq_desc_init.lock), } }; patches/percpu-locked-netfilter-ecache.patch0000664000076400007640000000631411160752235020221 0ustar tglxtglxSubject: percpu-locked-netfilter-ecache.patch From: Thomas Gleixner Date: Tue, 24 Feb 2009 16:57:24 +0100 Signed-off-by: Thomas Gleixner --- include/net/netfilter/nf_conntrack_ecache.h | 8 ++++++-- net/netfilter/nf_conntrack_ecache.c | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) Index: linux-2.6-tip/include/net/netfilter/nf_conntrack_ecache.h =================================================================== --- linux-2.6-tip.orig/include/net/netfilter/nf_conntrack_ecache.h +++ linux-2.6-tip/include/net/netfilter/nf_conntrack_ecache.h @@ -13,6 +13,7 @@ #ifdef CONFIG_NF_CONNTRACK_EVENTS struct nf_conntrack_ecache { + spinlock_t lock; struct nf_conn *ct; unsigned int events; }; @@ -29,7 +30,8 @@ extern int nf_conntrack_register_notifie extern int nf_conntrack_unregister_notifier(struct notifier_block *nb); extern void nf_ct_deliver_cached_events(const struct nf_conn *ct); -extern void __nf_ct_event_cache_init(struct nf_conn *ct); +extern void __nf_ct_event_cache_init(struct nf_conn *ct, + struct nf_conntrack_ecache *ecache); extern void nf_ct_event_cache_flush(struct net *net); static inline void @@ -40,9 +42,11 @@ nf_conntrack_event_cache(enum ip_conntra local_bh_disable(); ecache = per_cpu_ptr(net->ct.ecache, raw_smp_processor_id()); + spin_lock(&ecache->lock); if (ct != ecache->ct) - __nf_ct_event_cache_init(ct); + __nf_ct_event_cache_init(ct, ecache); ecache->events |= event; + spin_unlock(&ecache->lock); local_bh_enable(); } Index: linux-2.6-tip/net/netfilter/nf_conntrack_ecache.c =================================================================== --- linux-2.6-tip.orig/net/netfilter/nf_conntrack_ecache.c +++ linux-2.6-tip/net/netfilter/nf_conntrack_ecache.c @@ -61,20 +61,20 @@ void nf_ct_deliver_cached_events(const s local_bh_disable(); ecache = per_cpu_ptr(net->ct.ecache, raw_smp_processor_id()); + spin_lock(&ecache->lock); if (ecache->ct == ct) __nf_ct_deliver_cached_events(ecache); + spin_unlock(&ecache->lock); local_bh_enable(); } EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events); /* Deliver cached events for old pending events, if current conntrack != old */ -void __nf_ct_event_cache_init(struct nf_conn *ct) +void __nf_ct_event_cache_init(struct nf_conn *ct, + struct nf_conntrack_ecache *ecache) { struct net *net = nf_ct_net(ct); - struct nf_conntrack_ecache *ecache; - /* take care of delivering potentially old events */ - ecache = per_cpu_ptr(net->ct.ecache, raw_smp_processor_id()); BUG_ON(ecache->ct == ct); if (ecache->ct) __nf_ct_deliver_cached_events(ecache); @@ -93,16 +93,26 @@ void nf_ct_event_cache_flush(struct net for_each_possible_cpu(cpu) { ecache = per_cpu_ptr(net->ct.ecache, cpu); + spin_lock(&ecache->lock); if (ecache->ct) nf_ct_put(ecache->ct); + spin_unlock(&ecache->lock); } } int nf_conntrack_ecache_init(struct net *net) { + struct nf_conntrack_ecache *ecache; + int cpu; + net->ct.ecache = alloc_percpu(struct nf_conntrack_ecache); if (!net->ct.ecache) return -ENOMEM; + + for_each_possible_cpu(cpu) { + ecache = per_cpu_ptr(net->ct.ecache, cpu); + spin_lock_init(&ecache->lock); + } return 0; } patches/preempt-realtime-ipi-call-lock-raw.patch0000664000076400007640000000245711160752235020751 0ustar tglxtglxSubject:rt: fix ipi call lock From: Ingo Molnar Date: Mon Feb 09 23:08:53 CET 2009 call_function_lock needs to be raw too - it gets called from atomic IPI context. Signed-off-by: Ingo Molnar --- kernel/smp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) Index: linux-2.6-tip/kernel/smp.c =================================================================== --- linux-2.6-tip.orig/kernel/smp.c +++ linux-2.6-tip/kernel/smp.c @@ -16,11 +16,11 @@ static DEFINE_PER_CPU(struct call_single static struct { struct list_head queue; - spinlock_t lock; + raw_spinlock_t lock; } call_function __cacheline_aligned_in_smp = { .queue = LIST_HEAD_INIT(call_function.queue), - .lock = __SPIN_LOCK_UNLOCKED(call_function.lock), + .lock = RAW_SPIN_LOCK_UNLOCKED(call_function.lock), }; enum { @@ -29,18 +29,18 @@ enum { struct call_function_data { struct call_single_data csd; - spinlock_t lock; + raw_spinlock_t lock; unsigned int refs; cpumask_var_t cpumask; }; struct call_single_queue { struct list_head list; - spinlock_t lock; + raw_spinlock_t lock; }; static DEFINE_PER_CPU(struct call_function_data, cfd_data) = { - .lock = __SPIN_LOCK_UNLOCKED(cfd_data.lock), + .lock = RAW_SPIN_LOCK_UNLOCKED(cfd_data.lock), }; static int patches/preempt-realtime-direct-keyboard-sparseirq-fix.patch0000664000076400007640000000125411160752235023377 0ustar tglxtglxSubject: rt: irq handle.c fix2 From: Ingo Molnar Date: Sun Feb 08 18:06:00 CET 2009 => fold back to mingo-rt-irq-handle.c-fix.patch Signed-off-by: Ingo Molnar --- kernel/irq/handle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/kernel/irq/handle.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/handle.c +++ linux-2.6-tip/kernel/irq/handle.c @@ -430,7 +430,7 @@ int redirect_hardirq(struct irq_desc *de return 0; #ifdef __i386__ - if (debug_direct_keyboard && (desc - irq_desc == 1)) + if (debug_direct_keyboard && desc->irq == 1) return 0; #endif patches/rt-kmap-scale-fix.patch0000664000076400007640000001453711161723450015514 0ustar tglxtglxSubject: patches/rt-kmap-scale-fix.patch Apply on top of what is still in -rt. This seems to survive a kbuild -j64 & -j512 (although with that latter the machine goes off for a while, but does return with a kernel). If you can spare a cycle between hacking syslets and -rt, could you have a look at the logic this patch adds? Signed-off-by: Ingo Molnar --- Solve 2 deadlocks in the current kmap code. 1) akpm spotted a race in the waitqueue usage that could deadlock the machine. the very unlikely scenario was what we would not find a usable map in LAST_PKMAP tries but right before we hit schedule the very last returns. Solve this by keeping a free count. 2) akpm told about the kmap deadlock where multiple processes each require 2 maps (src, dst). When they deplete the maps for the src maps they will be stuck waiting for their dst maps. Solve this by by tracking (and limiting) kmap users and account two maps for each. This all adds more atomic globals, this will bounce like mad on real large smp. (perhaps add some __cacheline_aligned_on_smp) Signed-off-by: Peter Zijlstra --- include/linux/sched.h | 1 mm/highmem.c | 97 ++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 88 insertions(+), 10 deletions(-) Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -1723,6 +1723,7 @@ extern cputime_t task_gtime(struct task_ #define PF_MEMALLOC 0x00000800 /* Allocating memory */ #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ +#define PF_KMAP 0x00004000 /* this context has a kmap */ #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ #define PF_FROZEN 0x00010000 /* frozen for system suspend */ #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ Index: linux-2.6-tip/mm/highmem.c =================================================================== --- linux-2.6-tip.orig/mm/highmem.c +++ linux-2.6-tip/mm/highmem.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -68,10 +69,13 @@ unsigned int nr_free_highpages (void) */ static atomic_t pkmap_count[LAST_PKMAP]; static atomic_t pkmap_hand; +static atomic_t pkmap_free; +static atomic_t pkmap_users; pte_t * pkmap_page_table; -static DECLARE_WAIT_QUEUE_HEAD(pkmap_map_wait); +static DECLARE_WAIT_QUEUE_HEAD(pkmap_wait); + /* * Try to free a given kmap slot. * @@ -85,6 +89,7 @@ static int pkmap_try_free(int pos) if (atomic_cmpxchg(&pkmap_count[pos], 1, 0) != 1) return -1; + atomic_dec(&pkmap_free); /* * TODO: add a young bit to make it CLOCK */ @@ -113,7 +118,8 @@ static inline void pkmap_put(atomic_t *c BUG(); case 1: - wake_up(&pkmap_map_wait); + atomic_inc(&pkmap_free); + wake_up(&pkmap_wait); } } @@ -122,11 +128,10 @@ static inline void pkmap_put(atomic_t *c static int pkmap_get_free(void) { int i, pos, flush; - DECLARE_WAITQUEUE(wait, current); restart: for (i = 0; i < LAST_PKMAP; i++) { - pos = atomic_inc_return(&pkmap_hand) % LAST_PKMAP; + pos = atomic_inc_return(&pkmap_hand) & LAST_PKMAP_MASK; flush = pkmap_try_free(pos); if (flush >= 0) goto got_one; @@ -135,10 +140,8 @@ restart: /* * wait for somebody else to unmap their entries */ - __set_current_state(TASK_UNINTERRUPTIBLE); - add_wait_queue(&pkmap_map_wait, &wait); - schedule(); - remove_wait_queue(&pkmap_map_wait, &wait); + if (likely(!in_interrupt())) + wait_event(pkmap_wait, atomic_read(&pkmap_free) != 0); goto restart; @@ -147,7 +150,7 @@ got_one: #if 0 flush_tlb_kernel_range(PKMAP_ADDR(pos), PKMAP_ADDR(pos+1)); #else - int pos2 = (pos + 1) % LAST_PKMAP; + int pos2 = (pos + 1) & LAST_PKMAP_MASK; int nr; int entries[TLB_BATCH]; @@ -157,7 +160,7 @@ got_one: * Scan ahead of the hand to minimise search distances. */ for (i = 0, nr = 0; i < LAST_PKMAP && nr < TLB_BATCH; - i++, pos2 = (pos2 + 1) % LAST_PKMAP) { + i++, pos2 = (pos2 + 1) & LAST_PKMAP_MASK) { flush = pkmap_try_free(pos2); if (flush < 0) @@ -222,9 +225,79 @@ void kmap_flush_unused(void) WARN_ON_ONCE(1); } +/* + * Avoid starvation deadlock by limiting the number of tasks that can obtain a + * kmap to (LAST_PKMAP - KM_TYPE_NR*NR_CPUS)/2. + */ +static void kmap_account(void) +{ + int weight; + +#ifndef CONFIG_PREEMPT_RT + if (in_interrupt()) { + /* irqs can always get them */ + weight = -1; + } else +#endif + if (current->flags & PF_KMAP) { + current->flags &= ~PF_KMAP; + /* we already accounted the second */ + weight = 0; + } else { + /* mark 1, account 2 */ + current->flags |= PF_KMAP; + weight = 2; + } + + if (weight > 0) { + /* + * reserve KM_TYPE_NR maps per CPU for interrupt context + */ + const int target = LAST_PKMAP +#ifndef CONFIG_PREEMPT_RT + - KM_TYPE_NR*NR_CPUS +#endif + ; + +again: + wait_event(pkmap_wait, + atomic_read(&pkmap_users) + weight <= target); + + if (atomic_add_return(weight, &pkmap_users) > target) { + atomic_sub(weight, &pkmap_users); + goto again; + } + } +} + +static void kunmap_account(void) +{ + int weight; + +#ifndef CONFIG_PREEMPT_RT + if (in_irq()) { + weight = -1; + } else +#endif + if (current->flags & PF_KMAP) { + /* there was only 1 kmap, un-account both */ + current->flags &= ~PF_KMAP; + weight = 2; + } else { + /* there were two kmaps, un-account per kunmap */ + weight = 1; + } + + if (weight > 0) + atomic_sub(weight, &pkmap_users); + wake_up(&pkmap_wait); +} + void *kmap_high(struct page *page) { unsigned long vaddr; + + kmap_account(); again: vaddr = (unsigned long)page_address(page); if (vaddr) { @@ -265,6 +338,7 @@ EXPORT_SYMBOL(kmap_high); unsigned long vaddr = (unsigned long)page_address(page); BUG_ON(!vaddr); pkmap_put(&pkmap_count[PKMAP_NR(vaddr)]); + kunmap_account(); } EXPORT_SYMBOL(kunmap_high); @@ -420,6 +494,9 @@ void __init page_address_init(void) for (i = 0; i < ARRAY_SIZE(pkmap_count); i++) atomic_set(&pkmap_count[i], 1); + atomic_set(&pkmap_hand, 0); + atomic_set(&pkmap_free, LAST_PKMAP); + atomic_set(&pkmap_users, 0); #endif #ifdef HASHED_PAGE_VIRTUAL patches/irq-desc-init.patch0000664000076400007640000000121611160752235014730 0ustar tglxtglxSubject: irq: desc init From: Ingo Molnar Date: Mon Feb 09 23:43:36 CET 2009 Signed-off-by: Ingo Molnar --- kernel/irq/handle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/kernel/irq/handle.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/handle.c +++ linux-2.6-tip/kernel/irq/handle.c @@ -237,7 +237,7 @@ struct irq_desc irq_desc[NR_IRQS] __cach .chip = &no_irq_chip, .handle_irq = handle_bad_irq, .depth = 1, - .lock = __SPIN_LOCK_UNLOCKED(irq_desc->lock), + .lock = RAW_SPIN_LOCK_UNLOCKED(irq_desc->lock), } }; patches/tasklet-redesign.patch0000664000076400007640000002257711160752235015542 0ustar tglxtglxSubject: patches/tasklet-redesign.patch From: Ingo Molnar tasklet redesign: make it saner and make it easier to thread. Signed-off-by: Ingo Molnar ---- include/linux/interrupt.h | 33 ++++---- kernel/softirq.c | 184 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 149 insertions(+), 68 deletions(-) Index: linux-2.6-tip/include/linux/interrupt.h =================================================================== --- linux-2.6-tip.orig/include/linux/interrupt.h +++ linux-2.6-tip/include/linux/interrupt.h @@ -342,8 +342,9 @@ extern void __send_remote_softirq(struct to be executed on some cpu at least once after this. * If the tasklet is already scheduled, but its excecution is still not started, it will be executed only once. - * If this tasklet is already running on another CPU (or schedule is called - from tasklet itself), it is rescheduled for later. + * If this tasklet is already running on another CPU, it is rescheduled + for later. + * Schedule must not be called from the tasklet itself (a lockup occurs) * Tasklet is strictly serialized wrt itself, but not wrt another tasklets. If client needs some intertask synchronization, he makes it with spinlocks. @@ -368,15 +369,25 @@ struct tasklet_struct name = { NULL, 0, enum { TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */ - TASKLET_STATE_RUN /* Tasklet is running (SMP only) */ + TASKLET_STATE_RUN, /* Tasklet is running (SMP only) */ + TASKLET_STATE_PENDING /* Tasklet is pending */ }; -#ifdef CONFIG_SMP +#define TASKLET_STATEF_SCHED (1 << TASKLET_STATE_SCHED) +#define TASKLET_STATEF_RUN (1 << TASKLET_STATE_RUN) +#define TASKLET_STATEF_PENDING (1 << TASKLET_STATE_PENDING) + +#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) static inline int tasklet_trylock(struct tasklet_struct *t) { return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state); } +static inline int tasklet_tryunlock(struct tasklet_struct *t) +{ + return cmpxchg(&t->state, TASKLET_STATEF_RUN, 0) == TASKLET_STATEF_RUN; +} + static inline void tasklet_unlock(struct tasklet_struct *t) { smp_mb__before_clear_bit(); @@ -389,6 +400,7 @@ static inline void tasklet_unlock_wait(s } #else #define tasklet_trylock(t) 1 +#define tasklet_tryunlock(t) 1 #define tasklet_unlock_wait(t) do { } while (0) #define tasklet_unlock(t) do { } while (0) #endif @@ -437,17 +449,8 @@ static inline void tasklet_disable(struc smp_mb(); } -static inline void tasklet_enable(struct tasklet_struct *t) -{ - smp_mb__before_atomic_dec(); - atomic_dec(&t->count); -} - -static inline void tasklet_hi_enable(struct tasklet_struct *t) -{ - smp_mb__before_atomic_dec(); - atomic_dec(&t->count); -} +extern void tasklet_enable(struct tasklet_struct *t); +extern void tasklet_hi_enable(struct tasklet_struct *t); extern void tasklet_kill(struct tasklet_struct *t); extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu); Index: linux-2.6-tip/kernel/softirq.c =================================================================== --- linux-2.6-tip.orig/kernel/softirq.c +++ linux-2.6-tip/kernel/softirq.c @@ -425,15 +425,45 @@ struct tasklet_head static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec); static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec); +static void inline +__tasklet_common_schedule(struct tasklet_struct *t, struct tasklet_head *head, unsigned int nr) +{ + if (tasklet_trylock(t)) { +again: + /* We may have been preempted before tasklet_trylock + * and __tasklet_action may have already run. + * So double check the sched bit while the takslet + * is locked before adding it to the list. + */ + if (test_bit(TASKLET_STATE_SCHED, &t->state)) { + t->next = NULL; + *head->tail = t; + head->tail = &(t->next); + raise_softirq_irqoff(nr); + tasklet_unlock(t); + } else { + /* This is subtle. If we hit the corner case above + * It is possible that we get preempted right here, + * and another task has successfully called + * tasklet_schedule(), then this function, and + * failed on the trylock. Thus we must be sure + * before releasing the tasklet lock, that the + * SCHED_BIT is clear. Otherwise the tasklet + * may get its SCHED_BIT set, but not added to the + * list + */ + if (!tasklet_tryunlock(t)) + goto again; + } + } +} + void __tasklet_schedule(struct tasklet_struct *t) { unsigned long flags; local_irq_save(flags); - t->next = NULL; - *__get_cpu_var(tasklet_vec).tail = t; - __get_cpu_var(tasklet_vec).tail = &(t->next); - raise_softirq_irqoff(TASKLET_SOFTIRQ); + __tasklet_common_schedule(t, &__get_cpu_var(tasklet_vec), TASKLET_SOFTIRQ); local_irq_restore(flags); } @@ -444,10 +474,7 @@ void __tasklet_hi_schedule(struct taskle unsigned long flags; local_irq_save(flags); - t->next = NULL; - *__get_cpu_var(tasklet_hi_vec).tail = t; - __get_cpu_var(tasklet_hi_vec).tail = &(t->next); - raise_softirq_irqoff(HI_SOFTIRQ); + __tasklet_common_schedule(t, &__get_cpu_var(tasklet_vec), HI_SOFTIRQ); local_irq_restore(flags); } @@ -464,74 +491,125 @@ void __tasklet_hi_schedule_first(struct EXPORT_SYMBOL(__tasklet_hi_schedule_first); -static void tasklet_action(struct softirq_action *a) +void tasklet_enable(struct tasklet_struct *t) { - struct tasklet_struct *list; + if (!atomic_dec_and_test(&t->count)) + return; + if (test_and_clear_bit(TASKLET_STATE_PENDING, &t->state)) + tasklet_schedule(t); +} - local_irq_disable(); - list = __get_cpu_var(tasklet_vec).head; - __get_cpu_var(tasklet_vec).head = NULL; - __get_cpu_var(tasklet_vec).tail = &__get_cpu_var(tasklet_vec).head; - local_irq_enable(); +EXPORT_SYMBOL(tasklet_enable); + +void tasklet_hi_enable(struct tasklet_struct *t) +{ + if (!atomic_dec_and_test(&t->count)) + return; + if (test_and_clear_bit(TASKLET_STATE_PENDING, &t->state)) + tasklet_hi_schedule(t); +} + +EXPORT_SYMBOL(tasklet_hi_enable); + +static void +__tasklet_action(struct softirq_action *a, struct tasklet_struct *list) +{ + int loops = 1000000; while (list) { struct tasklet_struct *t = list; list = list->next; - if (tasklet_trylock(t)) { - if (!atomic_read(&t->count)) { - if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) - BUG(); - t->func(t->data); - tasklet_unlock(t); - continue; - } - tasklet_unlock(t); + /* + * Should always succeed - after a tasklist got on the + * list (after getting the SCHED bit set from 0 to 1), + * nothing but the tasklet softirq it got queued to can + * lock it: + */ + if (!tasklet_trylock(t)) { + WARN_ON(1); + continue; } - local_irq_disable(); t->next = NULL; - *__get_cpu_var(tasklet_vec).tail = t; - __get_cpu_var(tasklet_vec).tail = &(t->next); - __do_raise_softirq_irqoff(TASKLET_SOFTIRQ); - local_irq_enable(); + + /* + * If we cannot handle the tasklet because it's disabled, + * mark it as pending. tasklet_enable() will later + * re-schedule the tasklet. + */ + if (unlikely(atomic_read(&t->count))) { +out_disabled: + /* implicit unlock: */ + wmb(); + t->state = TASKLET_STATEF_PENDING; + continue; + } + + /* + * After this point on the tasklet might be rescheduled + * on another CPU, but it can only be added to another + * CPU's tasklet list if we unlock the tasklet (which we + * dont do yet). + */ + if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) + WARN_ON(1); + +again: + t->func(t->data); + + /* + * Try to unlock the tasklet. We must use cmpxchg, because + * another CPU might have scheduled or disabled the tasklet. + * We only allow the STATE_RUN -> 0 transition here. + */ + while (!tasklet_tryunlock(t)) { + /* + * If it got disabled meanwhile, bail out: + */ + if (atomic_read(&t->count)) + goto out_disabled; + /* + * If it got scheduled meanwhile, re-execute + * the tasklet function: + */ + if (test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) + goto again; + if (!--loops) { + printk("hm, tasklet state: %08lx\n", t->state); + WARN_ON(1); + tasklet_unlock(t); + break; + } + } } } -static void tasklet_hi_action(struct softirq_action *a) +static void tasklet_action(struct softirq_action *a) { struct tasklet_struct *list; local_irq_disable(); - list = __get_cpu_var(tasklet_hi_vec).head; - __get_cpu_var(tasklet_hi_vec).head = NULL; - __get_cpu_var(tasklet_hi_vec).tail = &__get_cpu_var(tasklet_hi_vec).head; + list = __get_cpu_var(tasklet_vec).head; + __get_cpu_var(tasklet_vec).head = NULL; + __get_cpu_var(tasklet_vec).tail = &__get_cpu_var(tasklet_vec).head; local_irq_enable(); - while (list) { - struct tasklet_struct *t = list; + __tasklet_action(a, list); +} - list = list->next; +static void tasklet_hi_action(struct softirq_action *a) +{ + struct tasklet_struct *list; - if (tasklet_trylock(t)) { - if (!atomic_read(&t->count)) { - if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) - BUG(); - t->func(t->data); - tasklet_unlock(t); - continue; - } - tasklet_unlock(t); - } + local_irq_disable(); + list = __get_cpu_var(tasklet_hi_vec).head; + __get_cpu_var(tasklet_hi_vec).head = NULL; + __get_cpu_var(tasklet_hi_vec).tail = &__get_cpu_var(tasklet_vec).head; + local_irq_enable(); - local_irq_disable(); - t->next = NULL; - *__get_cpu_var(tasklet_hi_vec).tail = t; - __get_cpu_var(tasklet_hi_vec).tail = &(t->next); - __do_raise_softirq_irqoff(HI_SOFTIRQ); - local_irq_enable(); - } + __tasklet_action(a, list); } patches/hack-convert-i_alloc_sem-for-direct_io-craziness.patch0000664000076400007640000000425211160752235023635 0ustar tglxtglxSubject: convert i_alloc_sem for direct_io.c craziness! From: Steven Rostedt Date: Mon, 24 Sep 2007 17:14:26 -0400 (EDT) Hopefully I will get some attention from those that are responsible for fs/direct_io.c Ingo and Thomas, This patch converts the i_alloc_sem into a compat_rw_semaphore for the -rt patch. Seems that the code in fs/direct_io.c does some nasty logic with the i_alloc_sem. For DIO_LOCKING, I'm assuming that the i_alloc_sem is used as a reference counter for pending requests. When the request is made, the down_read is performed. When the request is handled by the block softirq, then that softirq does an up on the request. So the owner is not the same between down and up. When all requests are handled, the semaphore counter should be zero. This keeps away any write access while requests are pending. Now this may all be well and dandy for vanilla Linux, but it breaks miserbly when converted to -rt. 1) In RT rw_semaphores must be up'd by the same thread that down's it. 2) We can't do PI on the correct processes. This patch converts (for now) the i_alloc_sem into a compat_rw_semaphore to give back the old features to the sem. This fixes deadlocks that we've been having WRT direct_io. But unfortunately, it now opens up unbonded priority inversion with this semaphore. But really, those that can be affected by this, shouldn't be doing disk IO anyway. The real fix would be to get rid of the read semaphore trickery in direct_io.c. Signed-off-by: Steve Rostedt Signed-off-by: Ingo Molnar --- include/linux/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/include/linux/fs.h =================================================================== --- linux-2.6-tip.orig/include/linux/fs.h +++ linux-2.6-tip/include/linux/fs.h @@ -671,7 +671,7 @@ struct inode { umode_t i_mode; spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ struct mutex i_mutex; - struct rw_semaphore i_alloc_sem; + struct compat_rw_semaphore i_alloc_sem; const struct inode_operations *i_op; const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ struct super_block *i_sb; patches/spinlock-trylock-cleanup-sungem.patch0000664000076400007640000000141611160752235020512 0ustar tglxtglxSubject: spinlock: trylock cleanup sungem From: Ingo Molnar Date: Wed Feb 04 00:03:15 CET 2009 Signed-off-by: Ingo Molnar --- drivers/net/sungem.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) Index: linux-2.6-tip/drivers/net/sungem.c =================================================================== --- linux-2.6-tip.orig/drivers/net/sungem.c +++ linux-2.6-tip/drivers/net/sungem.c @@ -1032,10 +1032,8 @@ static int gem_start_xmit(struct sk_buff (csum_stuff_off << 21)); } - local_irq_save(flags); - if (!spin_trylock(&gp->tx_lock)) { + if (!spin_trylock_irqsave(&gp->tx_lock, flags)) { /* Tell upper layer to requeue */ - local_irq_restore(flags); return NETDEV_TX_LOCKED; } /* We raced with gem_do_stop() */ patches/disable-irqpoll.patch0000664000076400007640000000211311160752235015340 0ustar tglxtglxSubject: patches/disable-irqpoll.patch Signed-off-by: Ingo Molnar --- kernel/irq/spurious.c | 10 ++++++++++ 1 file changed, 10 insertions(+) Index: linux-2.6-tip/kernel/irq/spurious.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/spurious.c +++ linux-2.6-tip/kernel/irq/spurious.c @@ -300,6 +300,11 @@ MODULE_PARM_DESC(noirqdebug, "Disable ir static int __init irqfixup_setup(char *str) { +#ifdef CONFIG_PREEMPT_RT + printk(KERN_WARNING "irqfixup boot option not supported " + "w/ CONFIG_PREEMPT_RT\n"); + return 1; +#endif irqfixup = 1; printk(KERN_WARNING "Misrouted IRQ fixup support enabled.\n"); printk(KERN_WARNING "This may impact system performance.\n"); @@ -313,6 +318,11 @@ MODULE_PARM_DESC("irqfixup", "0: No fixu static int __init irqpoll_setup(char *str) { +#ifdef CONFIG_PREEMPT_RT + printk(KERN_WARNING "irqpoll boot option not supported " + "w/ CONFIG_PREEMPT_RT\n"); + return 1; +#endif irqfixup = 2; printk(KERN_WARNING "Misrouted IRQ fixup and polling support " "enabled\n"); patches/preempt-realtime-sched-cpupri.patch0000664000076400007640000000113611160752235020121 0ustar tglxtglxSubject: preempt: realtime sched cpupri From: Ingo Molnar Date: Wed Feb 04 00:02:54 CET 2009 Signed-off-by: Ingo Molnar --- kernel/sched_cpupri.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/kernel/sched_cpupri.h =================================================================== --- linux-2.6-tip.orig/kernel/sched_cpupri.h +++ linux-2.6-tip/kernel/sched_cpupri.h @@ -12,7 +12,7 @@ /* values 2-101 are RT priorities 0-99 */ struct cpupri_vec { - spinlock_t lock; + raw_spinlock_t lock; int count; cpumask_var_t mask; }; patches/preempt-realtime-ipc.patch0000664000076400007640000000622311160752235016310 0ustar tglxtglxSubject: preempt: realtime ipc From: Ingo Molnar Date: Wed Feb 04 00:02:52 CET 2009 Signed-off-by: Ingo Molnar --- ipc/mqueue.c | 5 +++++ ipc/msg.c | 25 +++++++++++++++++++------ ipc/sem.c | 6 ++++++ 3 files changed, 30 insertions(+), 6 deletions(-) Index: linux-2.6-tip/ipc/mqueue.c =================================================================== --- linux-2.6-tip.orig/ipc/mqueue.c +++ linux-2.6-tip/ipc/mqueue.c @@ -787,12 +787,17 @@ static inline void pipelined_send(struct struct msg_msg *message, struct ext_wait_queue *receiver) { + /* + * Keep them in one critical section for PREEMPT_RT: + */ + preempt_disable(); receiver->msg = message; list_del(&receiver->list); receiver->state = STATE_PENDING; wake_up_process(receiver->task); smp_wmb(); receiver->state = STATE_READY; + preempt_enable(); } /* pipelined_receive() - if there is task waiting in sys_mq_timedsend() Index: linux-2.6-tip/ipc/msg.c =================================================================== --- linux-2.6-tip.orig/ipc/msg.c +++ linux-2.6-tip/ipc/msg.c @@ -259,12 +259,19 @@ static void expunge_all(struct msg_queue while (tmp != &msq->q_receivers) { struct msg_receiver *msr; + /* + * Make sure that the wakeup doesnt preempt + * this CPU prematurely. (on PREEMPT_RT) + */ + preempt_disable(); + msr = list_entry(tmp, struct msg_receiver, r_list); tmp = tmp->next; msr->r_msg = NULL; - wake_up_process(msr->r_tsk); - smp_mb(); + wake_up_process(msr->r_tsk); /* serializes */ msr->r_msg = ERR_PTR(res); + + preempt_enable(); } } @@ -611,22 +618,28 @@ static inline int pipelined_send(struct !security_msg_queue_msgrcv(msq, msg, msr->r_tsk, msr->r_msgtype, msr->r_mode)) { + /* + * Make sure that the wakeup doesnt preempt + * this CPU prematurely. (on PREEMPT_RT) + */ + preempt_disable(); + list_del(&msr->r_list); if (msr->r_maxsize < msg->m_ts) { msr->r_msg = NULL; - wake_up_process(msr->r_tsk); - smp_mb(); + wake_up_process(msr->r_tsk); /* serializes */ msr->r_msg = ERR_PTR(-E2BIG); } else { msr->r_msg = NULL; msq->q_lrpid = task_pid_vnr(msr->r_tsk); msq->q_rtime = get_seconds(); - wake_up_process(msr->r_tsk); - smp_mb(); + wake_up_process(msr->r_tsk); /* serializes */ msr->r_msg = msg; + preempt_enable(); return 1; } + preempt_enable(); } } return 0; Index: linux-2.6-tip/ipc/sem.c =================================================================== --- linux-2.6-tip.orig/ipc/sem.c +++ linux-2.6-tip/ipc/sem.c @@ -415,6 +415,11 @@ static void update_queue (struct sem_arr struct sem_queue *n; /* + * make sure that the wakeup doesnt preempt + * _this_ cpu prematurely. (on preempt_rt) + */ + preempt_disable(); + /* * Continue scanning. The next operation * that must be checked depends on the type of the * completed operation: @@ -450,6 +455,7 @@ static void update_queue (struct sem_arr */ smp_wmb(); q->status = error; + preempt_enable(); q = n; } else { q = list_entry(q->list.next, struct sem_queue, list); patches/softlockup-add-irq-regs-h.patch0000664000076400007640000000123111160752235017150 0ustar tglxtglxSubject: core: make asm/irq_regs.h available on every platform From: Ingo Molnar the softlockup detector would like to use get_irq_regs(), so generalize the availability on every Linux architecture. (it is fine for an architecture to always return NULL to get_irq_regs(), which it does by default.) Signed-off-by: Ingo Molnar --- include/asm-arm26/irq_regs.h | 1 + 1 file changed, 1 insertion(+) Index: linux-2.6-tip/include/asm-arm26/irq_regs.h =================================================================== --- /dev/null +++ linux-2.6-tip/include/asm-arm26/irq_regs.h @@ -0,0 +1 @@ +#include patches/serial-slow-machines.patch0000664000076400007640000000344711160752235016316 0ustar tglxtglxSubject: serial: slow machines From: Ingo Molnar Date: Wed Feb 04 00:02:57 CET 2009 Signed-off-by: Ingo Molnar --- drivers/char/tty_buffer.c | 4 ++++ drivers/serial/8250.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) Index: linux-2.6-tip/drivers/char/tty_buffer.c =================================================================== --- linux-2.6-tip.orig/drivers/char/tty_buffer.c +++ linux-2.6-tip/drivers/char/tty_buffer.c @@ -482,10 +482,14 @@ void tty_flip_buffer_push(struct tty_str tty->buf.tail->commit = tty->buf.tail->used; spin_unlock_irqrestore(&tty->buf.lock, flags); +#ifndef CONFIG_PREEMPT_RT if (tty->low_latency) flush_to_ldisc(&tty->buf.work.work); else schedule_delayed_work(&tty->buf.work, 1); +#else + flush_to_ldisc(&tty->buf.work.work); +#endif } EXPORT_SYMBOL(tty_flip_buffer_push); Index: linux-2.6-tip/drivers/serial/8250.c =================================================================== --- linux-2.6-tip.orig/drivers/serial/8250.c +++ linux-2.6-tip/drivers/serial/8250.c @@ -1546,7 +1546,10 @@ static irqreturn_t serial8250_interrupt( { struct irq_info *i = dev_id; struct list_head *l, *end = NULL; - int pass_counter = 0, handled = 0; +#ifndef CONFIG_PREEMPT_RT + int pass_counter = 0; +#endif + int handled = 0; DEBUG_INTR("serial8250_interrupt(%d)...", irq); @@ -1584,12 +1587,18 @@ static irqreturn_t serial8250_interrupt( l = l->next; + /* + * On preempt-rt we can be preempted and run in our + * own thread. + */ +#ifndef CONFIG_PREEMPT_RT if (l == i->head && pass_counter++ > PASS_LIMIT) { /* If we hit this, we're dead. */ printk(KERN_ERR "serial8250: too much work for " "irq%d\n", irq); break; } +#endif } while (l != end); spin_unlock(&i->lock); patches/qrcu.patch0000664000076400007640000001463511160752235013243 0ustar tglxtglxSubject: QRCU with lockless fastpath From: "Paul E. McKenney" Hello! This is an updated version of Oleg Nesterov's QRCU that avoids the earlier lock acquisition on the synchronize_qrcu() fastpath. This passes rcutorture on x86 and the weakly ordered POWER. A promela model of the code passes as noted before for 2 readers and 3 updaters and for 3 readers and 2 updaters. 3 readers and 3 updaters runs every machine that I have access to out of memory -- nothing like a little combinatorial explosion! However, after some thought, the proof ended up being simple enough: 1. If synchronize_qrcu() exits too soon, then by definition there has been a reader present during synchronize_srcu()'s full execution. 2. The counter corresponding to this reader will be at least 1 at all times. 3. The synchronize_qrcu() code forces at least one of the counters to be at least one at all times -- if there is a reader, the sum will be at least two. (Unfortunately, we cannot fetch the pair of counters atomically.) 4. Therefore, the only way that synchronize_qrcu()s fastpath can see a sum of 1 is if it races with another synchronize_qrcu() -- the first synchronize_qrcu() must read one of the counters before the second synchronize_qrcu() increments it, and must read the other counter after the second synchronize_qrcu() decrements it. There can be at most one reader present through this entire operation -- otherwise, the first synchronize_qrcu() will see a sum of 2 or greater. 5. But the second synchronize_qrcu() will not release the mutex until after the reader is done. During this time, the first synchronize_qrcu() will always see a sum of at least 2, and therefore cannot take the remainder of the fastpath until the reader is done. 6. Because the second synchronize_qrcu() holds the mutex, no other synchronize_qrcu() can manipulate the counters until the reader is done. A repeat of the race called out in #4 above therefore cannot happen until after the reader is done, in which case it is safe for the first synchronize_qrcu() to proceed. Therefore, two summations of the counter separated by a memory barrier suffices and the implementation shown below also suffices. (And, yes, the fastpath -could- check for a sum of zero and exit immediately, but this would help only in case of a three-way race between two synchronize_qrcu()s and a qrcu_read_unlock(), would add another compare, so is not worth it.) Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar --- include/linux/srcu.h | 22 +++++++++++++ kernel/srcu.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) Index: linux-2.6-tip/include/linux/srcu.h =================================================================== --- linux-2.6-tip.orig/include/linux/srcu.h +++ linux-2.6-tip/include/linux/srcu.h @@ -27,6 +27,8 @@ #ifndef _LINUX_SRCU_H #define _LINUX_SRCU_H +#include + struct srcu_struct_array { int c[2]; }; @@ -50,4 +52,24 @@ void srcu_read_unlock(struct srcu_struct void synchronize_srcu(struct srcu_struct *sp); long srcu_batches_completed(struct srcu_struct *sp); +/* + * fully compatible with srcu, but optimized for writers. + */ + +struct qrcu_struct { + int completed; + atomic_t ctr[2]; + wait_queue_head_t wq; + struct mutex mutex; +}; + +int init_qrcu_struct(struct qrcu_struct *qp); +int qrcu_read_lock(struct qrcu_struct *qp); +void qrcu_read_unlock(struct qrcu_struct *qp, int idx); +void synchronize_qrcu(struct qrcu_struct *qp); + +static inline void cleanup_qrcu_struct(struct qrcu_struct *qp) +{ +} + #endif Index: linux-2.6-tip/kernel/srcu.c =================================================================== --- linux-2.6-tip.orig/kernel/srcu.c +++ linux-2.6-tip/kernel/srcu.c @@ -255,3 +255,89 @@ EXPORT_SYMBOL_GPL(srcu_read_lock); EXPORT_SYMBOL_GPL(srcu_read_unlock); EXPORT_SYMBOL_GPL(synchronize_srcu); EXPORT_SYMBOL_GPL(srcu_batches_completed); + +int init_qrcu_struct(struct qrcu_struct *qp) +{ + qp->completed = 0; + atomic_set(qp->ctr + 0, 1); + atomic_set(qp->ctr + 1, 0); + init_waitqueue_head(&qp->wq); + mutex_init(&qp->mutex); + + return 0; +} + +int qrcu_read_lock(struct qrcu_struct *qp) +{ + for (;;) { + int idx = qp->completed & 0x1; + if (likely(atomic_inc_not_zero(qp->ctr + idx))) + return idx; + } +} + +void qrcu_read_unlock(struct qrcu_struct *qp, int idx) +{ + if (atomic_dec_and_test(qp->ctr + idx)) + wake_up(&qp->wq); +} + +void synchronize_qrcu(struct qrcu_struct *qp) +{ + int idx; + + smp_mb(); /* Force preceding change to happen before fastpath check. */ + + /* + * Fastpath: If the two counters sum to "1" at a given point in + * time, there are no readers. However, it takes two separate + * loads to sample both counters, which won't occur simultaneously. + * So we might race with a counter switch, so that we might see + * ctr[0]==0, then the counter might switch, then we might see + * ctr[1]==1 (unbeknownst to us because there is a reader still + * there). So we do a read memory barrier and recheck. If the + * same race happens again, there must have been a second counter + * switch. This second counter switch could not have happened + * until all preceding readers finished, so if the condition + * is true both times, we may safely proceed. + * + * This relies critically on the atomic increment and atomic + * decrement being seen as executing in order. + */ + + if (atomic_read(&qp->ctr[0]) + atomic_read(&qp->ctr[1]) <= 1) { + smp_rmb(); /* Keep two checks independent. */ + if (atomic_read(&qp->ctr[0]) + atomic_read(&qp->ctr[1]) <= 1) + goto out; + } + + mutex_lock(&qp->mutex); + + idx = qp->completed & 0x1; + if (atomic_read(qp->ctr + idx) == 1) + goto out_unlock; + + atomic_inc(qp->ctr + (idx ^ 0x1)); + + /* + * Prevent subsequent decrement from being seen before previous + * increment -- such an inversion could cause the fastpath + * above to falsely conclude that there were no readers. Also, + * reduce the likelihood that qrcu_read_lock() will loop. + */ + + smp_mb__after_atomic_inc(); + qp->completed++; + + atomic_dec(qp->ctr + idx); + __wait_event(qp->wq, !atomic_read(qp->ctr + idx)); +out_unlock: + mutex_unlock(&qp->mutex); +out: + smp_mb(); /* force subsequent free after qrcu_read_unlock(). */ +} + +EXPORT_SYMBOL_GPL(init_qrcu_struct); +EXPORT_SYMBOL_GPL(qrcu_read_lock); +EXPORT_SYMBOL_GPL(qrcu_read_unlock); +EXPORT_SYMBOL_GPL(synchronize_qrcu); patches/pagealloc-cond-resched-rt-only.patch0000664000076400007640000000434511160752235020153 0ustar tglxtglxSubject: pagealloc-cond-resched-rt-only.patch From: Thomas Gleixner Date: Thu, 19 Mar 2009 12:58:26 +0100 Signed-off-by: Thomas Gleixner --- mm/page_alloc.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) Index: linux-2.6-tip/mm/page_alloc.c =================================================================== --- linux-2.6-tip.orig/mm/page_alloc.c +++ linux-2.6-tip/mm/page_alloc.c @@ -567,7 +567,9 @@ static inline int free_pages_check(struc static void free_pages_bulk(struct zone *zone, struct list_head *list, int order) { - spin_lock(&zone->lock); + unsigned long flags; + + spin_lock_irqsave(&zone->lock, flags); zone_clear_flag(zone, ZONE_ALL_UNRECLAIMABLE); zone->pages_scanned = 0; @@ -576,18 +578,23 @@ free_pages_bulk(struct zone *zone, struc list_del(&page->lru); __free_one_page(page, zone, order); +#ifdef CONFIG_PREEMPT_RT cond_resched_lock(&zone->lock); +#endif } - spin_unlock(&zone->lock); + spin_unlock_irqrestore(&zone->lock, flags); } static void free_one_page(struct zone *zone, struct page *page, int order) { - spin_lock(&zone->lock); + unsigned long flags; + + spin_lock_irqsave(&zone->lock, flags); + zone_clear_flag(zone, ZONE_ALL_UNRECLAIMABLE); zone->pages_scanned = 0; __free_one_page(page, zone, order); - spin_unlock(&zone->lock); + spin_unlock_irqrestore(&zone->lock, flags); } static void __free_pages_ok(struct page *page, unsigned int order) @@ -612,8 +619,8 @@ static void __free_pages_ok(struct page lock_cpu_pcp(&flags, &this_cpu); count_vm_events(PGFREE, 1 << order); - free_one_page(page_zone(page), page, order); unlock_cpu_pcp(flags, this_cpu); + free_one_page(page_zone(page), page, order); } /* @@ -967,7 +974,6 @@ void drain_zone_pages(struct zone *zone, isolate_pcp_pages(to_drain, &pcp->list, &free_list); pcp->count -= to_drain; unlock_cpu_pcp(flags, this_cpu); - free_pages_bulk(zone, &free_list, 0); } #endif @@ -1140,7 +1146,6 @@ static void free_hot_cold_page(struct pa isolate_pcp_pages(pcp->batch, &pcp->list, &free_list); pcp->count -= pcp->batch; put_zone_pcp(zone, flags, this_cpu); - free_pages_bulk(zone, &free_list, 0); } else put_zone_pcp(zone, flags, this_cpu); patches/preempt-realtime-x86-32-gup-kmapatomic.patch0000664000076400007640000001667111160752235021330 0ustar tglxtglxSubject: preempt-realtime-x86-32-gup-kmapatomic.patch From: Thomas Gleixner Date: Mon, 16 Feb 2009 10:27:37 +0100 Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/highmem.h | 8 +++++++- arch/x86/include/asm/paravirt.h | 9 +++++++++ arch/x86/include/asm/pgtable_32.h | 6 ++++++ arch/x86/include/asm/pgtable_64.h | 6 ++++-- arch/x86/kernel/paravirt.c | 5 +++++ arch/x86/mm/gup.c | 6 +++--- arch/x86/mm/highmem_32.c | 5 +++++ 7 files changed, 39 insertions(+), 6 deletions(-) Index: linux-2.6-tip/arch/x86/include/asm/highmem.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/highmem.h +++ linux-2.6-tip/arch/x86/include/asm/highmem.h @@ -64,6 +64,7 @@ void kunmap(struct page *page); void *__kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot); void *__kmap_atomic(struct page *page, enum km_type type); +void *__kmap_atomic_direct(struct page *page, enum km_type type); void __kunmap_atomic(void *kvaddr, enum km_type type); void *__kmap_atomic_pfn(unsigned long pfn, enum km_type type); struct page *__kmap_atomic_to_page(void *ptr); @@ -77,7 +78,8 @@ void *kmap_atomic_prot_pfn(unsigned long struct page *kmap_atomic_to_page(void *ptr); #ifndef CONFIG_PARAVIRT -#define kmap_atomic_pte(page, type) kmap_atomic(page, type) +#define kmap_atomic_pte(page, type) kmap_atomic(page, type) +#define kmap_atomic_pte_direct(page, type) kmap_atomic_direct(page, type) #endif #define flush_cache_kmaps() do { } while (0) @@ -94,12 +96,16 @@ extern void add_highpages_with_active_re # define kmap_atomic_pfn(pfn, type) kmap(pfn_to_page(pfn)) # define kunmap_atomic(kvaddr, type) do { pagefault_enable(); kunmap_virt(kvaddr); } while(0) # define kmap_atomic_to_page(kvaddr) kmap_to_page(kvaddr) +# define kmap_atomic_direct(page, type) __kmap_atomic_direct(page, type) +# define kunmap_atomic_direct(kvaddr, type) __kunmap_atomic(kvaddr, type) #else # define kmap_atomic_prot(page, type, prot) __kmap_atomic_prot(page, type, prot) # define kmap_atomic(page, type) __kmap_atomic(page, type) # define kmap_atomic_pfn(pfn, type) __kmap_atomic_pfn(pfn, type) # define kunmap_atomic(kvaddr, type) __kunmap_atomic(kvaddr, type) # define kmap_atomic_to_page(kvaddr) __kmap_atomic_to_page(kvaddr) +# define kmap_atomic_direct(page, type) __kmap_atomic(page, type) +# define kunmap_atomic_direct(kvaddr, type) __kunmap_atomic(kvaddr, type) #endif #endif /* __KERNEL__ */ Index: linux-2.6-tip/arch/x86/include/asm/paravirt.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/paravirt.h +++ linux-2.6-tip/arch/x86/include/asm/paravirt.h @@ -338,6 +338,7 @@ struct pv_mmu_ops { #ifdef CONFIG_HIGHPTE void *(*kmap_atomic_pte)(struct page *page, enum km_type type); + void *(*kmap_atomic_pte_direct)(struct page *page, enum km_type type); #endif struct pv_lazy_ops lazy_mode; @@ -1134,6 +1135,14 @@ static inline void *kmap_atomic_pte(stru ret = PVOP_CALL2(unsigned long, pv_mmu_ops.kmap_atomic_pte, page, type); return (void *)ret; } + +static inline void *kmap_atomic_pte_direct(struct page *page, enum km_type type) +{ + unsigned long ret; + ret = PVOP_CALL2(unsigned long, pv_mmu_ops.kmap_atomic_pte_direct, + page, type); + return (void *)ret; +} #endif static inline void pte_update(struct mm_struct *mm, unsigned long addr, Index: linux-2.6-tip/arch/x86/include/asm/pgtable_32.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/pgtable_32.h +++ linux-2.6-tip/arch/x86/include/asm/pgtable_32.h @@ -55,14 +55,20 @@ extern void set_pmd_pfn(unsigned long, u #define pte_offset_map_nested(dir, address) \ ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE1) + \ pte_index((address))) +#define pte_offset_map_direct(dir, address) \ + ((pte_t *)kmap_atomic_pte_direct(pmd_page(*(dir)), KM_PTE0) + \ + pte_index((address))) #define pte_unmap(pte) kunmap_atomic((pte), KM_PTE0) #define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1) +#define pte_unmap_direct(pte) kunmap_atomic_direct((pte), KM_PTE0) #else #define pte_offset_map(dir, address) \ ((pte_t *)page_address(pmd_page(*(dir))) + pte_index((address))) #define pte_offset_map_nested(dir, address) pte_offset_map((dir), (address)) +#define pte_offset_map_direct(dir, address) pte_offset_map((dir), (address)) #define pte_unmap(pte) do { } while (0) #define pte_unmap_nested(pte) do { } while (0) +#define pte_unmap_direct(pte) do { } while (0) #endif /* Clear a kernel PTE and flush it from the TLB */ Index: linux-2.6-tip/arch/x86/include/asm/pgtable_64.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/pgtable_64.h +++ linux-2.6-tip/arch/x86/include/asm/pgtable_64.h @@ -130,8 +130,10 @@ static inline int pgd_large(pgd_t pgd) { /* x86-64 always has all page tables mapped. */ #define pte_offset_map(dir, address) pte_offset_kernel((dir), (address)) #define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address)) -#define pte_unmap(pte) /* NOP */ -#define pte_unmap_nested(pte) /* NOP */ +#define pte_offset_map_direct(dir, address) pte_offset_kernel((dir), (address)) +#define pte_unmap(pte) do { } while (0) +#define pte_unmap_nested(pte) do { } while (0) +#define pte_unmap_direct(pte) do { } while (0) #define update_mmu_cache(vma, address, pte) do { } while (0) Index: linux-2.6-tip/arch/x86/kernel/paravirt.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/paravirt.c +++ linux-2.6-tip/arch/x86/kernel/paravirt.c @@ -432,6 +432,10 @@ static void *kmap_atomic_func(struct pag { return kmap_atomic(page, idx); } +static void *kmap_atomic_direct_func(struct page *page, enum km_type idx) +{ + return kmap_atomic_direct(page, idx); +} #endif struct pv_mmu_ops pv_mmu_ops = { @@ -475,6 +479,7 @@ struct pv_mmu_ops pv_mmu_ops = { #ifdef CONFIG_HIGHPTE .kmap_atomic_pte = kmap_atomic_func, + .kmap_atomic_pte_direct = kmap_atomic_direct_func, #endif #if PAGETABLE_LEVELS >= 3 Index: linux-2.6-tip/arch/x86/mm/gup.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/gup.c +++ linux-2.6-tip/arch/x86/mm/gup.c @@ -77,13 +77,13 @@ static noinline int gup_pte_range(pmd_t if (write) mask |= _PAGE_RW; - ptep = pte_offset_map(&pmd, addr); + ptep = pte_offset_map_direct(&pmd, addr); do { pte_t pte = gup_get_pte(ptep); struct page *page; if ((pte_flags(pte) & (mask | _PAGE_SPECIAL)) != mask) { - pte_unmap(ptep); + pte_unmap_direct(ptep); return 0; } VM_BUG_ON(!pfn_valid(pte_pfn(pte))); @@ -93,7 +93,7 @@ static noinline int gup_pte_range(pmd_t (*nr)++; } while (ptep++, addr += PAGE_SIZE, addr != end); - pte_unmap(ptep - 1); + pte_unmap_direct(ptep - 1); return 1; } Index: linux-2.6-tip/arch/x86/mm/highmem_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/highmem_32.c +++ linux-2.6-tip/arch/x86/mm/highmem_32.c @@ -113,6 +113,11 @@ void *__kmap_atomic_prot(struct page *pa return (void *)vaddr; } +void *__kmap_atomic_direct(struct page *page, enum km_type type) +{ + return __kmap_atomic_prot(page, type, kmap_prot); +} + void *__kmap_atomic(struct page *page, enum km_type type) { return kmap_atomic_prot(page, type, kmap_prot); patches/rt-mutex-core-mutex-fixes.patch0000664000076400007640000000506711161723467017265 0ustar tglxtglxSubject: add -rt extra-version From: Ingo Molnar add -rt extra-version. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Signed-off-by: Steven Rostedt --- include/linux/mutex.h | 4 ++-- kernel/rt.c | 6 +++--- kernel/sched.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) Index: linux-2.6-tip/include/linux/mutex.h =================================================================== --- linux-2.6-tip.orig/include/linux/mutex.h +++ linux-2.6-tip/include/linux/mutex.h @@ -38,7 +38,7 @@ struct mutex { struct mutex mutexname = __MUTEX_INITIALIZER(mutexname) extern void -_mutex_init(struct mutex *lock, char *name, struct lock_class_key *key); +__mutex_init(struct mutex *lock, char *name, struct lock_class_key *key); extern void __lockfunc _mutex_lock(struct mutex *lock); extern int __lockfunc _mutex_lock_interruptible(struct mutex *lock); @@ -75,7 +75,7 @@ extern void __lockfunc _mutex_unlock(str do { \ static struct lock_class_key __key; \ \ - _mutex_init((mutex), #mutex, &__key); \ + __mutex_init((mutex), #mutex, &__key); \ } while (0) #else Index: linux-2.6-tip/kernel/rt.c =================================================================== --- linux-2.6-tip.orig/kernel/rt.c +++ linux-2.6-tip/kernel/rt.c @@ -83,7 +83,7 @@ void zap_rt_locks(void) /* * struct mutex functions */ -void _mutex_init(struct mutex *lock, char *name, struct lock_class_key *key) +void __mutex_init(struct mutex *lock, char *name, struct lock_class_key *key) { #ifdef CONFIG_DEBUG_LOCK_ALLOC /* @@ -94,7 +94,7 @@ void _mutex_init(struct mutex *lock, cha #endif __rt_mutex_init(&lock->lock, name); } -EXPORT_SYMBOL(_mutex_init); +EXPORT_SYMBOL(__mutex_init); void __lockfunc _mutex_lock(struct mutex *lock) { @@ -550,7 +550,7 @@ int rt_down_timeout(struct semaphore *se do { jiffies_to_timespec(jiff, &ts); hrtimer_init_on_stack(&t.timer, HRTIMER_MODE_REL, CLOCK_MONOTONIC); - t.timer.expires = timespec_to_ktime(ts); + t.timer._expires = timespec_to_ktime(ts); ret = rt_mutex_timed_lock(&sem->lock, &t, 0); if (ret != -EINTR) Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -4875,7 +4875,7 @@ need_resched: } EXPORT_SYMBOL(schedule); -#ifdef CONFIG_SMP +#if defined(CONFIG_SMP) && !defined(CONFIG_PREEMPT_RT) /* * Look out! "owner" is an entirely speculative pointer * access and not reliable. patches/bh-uptodate-lock.patch0000664000076400007640000001117411161723465015432 0ustar tglxtglxSubject: patches/bh-uptodate-lock.patch Signed-off-by: Ingo Molnar --- fs/buffer.c | 20 ++++++++------------ fs/ntfs/aops.c | 9 +++------ include/linux/buffer_head.h | 5 +---- 3 files changed, 12 insertions(+), 22 deletions(-) Index: linux-2.6-tip/fs/buffer.c =================================================================== --- linux-2.6-tip.orig/fs/buffer.c +++ linux-2.6-tip/fs/buffer.c @@ -469,8 +469,7 @@ static void end_buffer_async_read(struct * decide that the page is now completely done. */ first = page_buffers(page); - local_irq_save(flags); - bit_spin_lock(BH_Uptodate_Lock, &first->b_state); + spin_lock_irqsave(&first->b_uptodate_lock, flags); clear_buffer_async_read(bh); unlock_buffer(bh); tmp = bh; @@ -483,8 +482,7 @@ static void end_buffer_async_read(struct } tmp = tmp->b_this_page; } while (tmp != bh); - bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); - local_irq_restore(flags); + spin_unlock_irqrestore(&first->b_uptodate_lock, flags); /* * If none of the buffers had errors and they are all @@ -496,8 +494,7 @@ static void end_buffer_async_read(struct return; still_busy: - bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); - local_irq_restore(flags); + spin_unlock_irqrestore(&first->b_uptodate_lock, flags); return; } @@ -532,8 +529,7 @@ static void end_buffer_async_write(struc } first = page_buffers(page); - local_irq_save(flags); - bit_spin_lock(BH_Uptodate_Lock, &first->b_state); + spin_lock_irqsave(&first->b_uptodate_lock, flags); clear_buffer_async_write(bh); unlock_buffer(bh); @@ -545,14 +541,12 @@ static void end_buffer_async_write(struc } tmp = tmp->b_this_page; } - bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); - local_irq_restore(flags); + spin_unlock_irqrestore(&first->b_uptodate_lock, flags); end_page_writeback(page); return; still_busy: - bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); - local_irq_restore(flags); + spin_unlock_irqrestore(&first->b_uptodate_lock, flags); return; } @@ -3301,6 +3295,7 @@ struct buffer_head *alloc_buffer_head(gf struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); if (ret) { INIT_LIST_HEAD(&ret->b_assoc_buffers); + spin_lock_init(&ret->b_uptodate_lock); get_cpu_var(bh_accounting).nr++; recalc_bh_state(); put_cpu_var(bh_accounting); @@ -3312,6 +3307,7 @@ EXPORT_SYMBOL(alloc_buffer_head); void free_buffer_head(struct buffer_head *bh) { BUG_ON(!list_empty(&bh->b_assoc_buffers)); + BUG_ON(spin_is_locked(&bh->b_uptodate_lock)); kmem_cache_free(bh_cachep, bh); get_cpu_var(bh_accounting).nr--; recalc_bh_state(); Index: linux-2.6-tip/fs/ntfs/aops.c =================================================================== --- linux-2.6-tip.orig/fs/ntfs/aops.c +++ linux-2.6-tip/fs/ntfs/aops.c @@ -107,8 +107,7 @@ static void ntfs_end_buffer_async_read(s "0x%llx.", (unsigned long long)bh->b_blocknr); } first = page_buffers(page); - local_irq_save(flags); - bit_spin_lock(BH_Uptodate_Lock, &first->b_state); + spin_lock_irqsave(&first->b_uptodate_lock, flags); clear_buffer_async_read(bh); unlock_buffer(bh); tmp = bh; @@ -123,8 +122,7 @@ static void ntfs_end_buffer_async_read(s } tmp = tmp->b_this_page; } while (tmp != bh); - bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); - local_irq_restore(flags); + spin_unlock_irqrestore(&first->b_uptodate_lock, flags); /* * If none of the buffers had errors then we can set the page uptodate, * but we first have to perform the post read mst fixups, if the @@ -159,8 +157,7 @@ static void ntfs_end_buffer_async_read(s unlock_page(page); return; still_busy: - bit_spin_unlock(BH_Uptodate_Lock, &first->b_state); - local_irq_restore(flags); + spin_unlock_irqrestore(&first->b_uptodate_lock, flags); return; } Index: linux-2.6-tip/include/linux/buffer_head.h =================================================================== --- linux-2.6-tip.orig/include/linux/buffer_head.h +++ linux-2.6-tip/include/linux/buffer_head.h @@ -21,10 +21,6 @@ enum bh_state_bits { BH_Dirty, /* Is dirty */ BH_Lock, /* Is locked */ BH_Req, /* Has been submitted for I/O */ - BH_Uptodate_Lock,/* Used by the first bh in a page, to serialise - * IO completion of other buffers in the page - */ - BH_Mapped, /* Has a disk mapping */ BH_New, /* Disk mapping was newly created by get_block */ BH_Async_Read, /* Is under end_buffer_async_read I/O */ @@ -74,6 +70,7 @@ struct buffer_head { struct address_space *b_assoc_map; /* mapping this buffer is associated with */ atomic_t b_count; /* users using this buffer_head */ + spinlock_t b_uptodate_lock; }; /* patches/preempt-realtime-sched.patch0000664000076400007640000006573411161723462016640 0ustar tglxtglxSubject: preempt: realtime sched From: Ingo Molnar Date: Wed Feb 04 00:02:55 CET 2009 Signed-off-by: Ingo Molnar --- include/linux/hardirq.h | 13 - include/linux/sched.h | 47 +++++ kernel/mutex.c | 6 kernel/sched.c | 387 +++++++++++++++++++++++++++++++++++++++--------- kernel/sched_rt.c | 54 ++++++ lib/kernel_lock.c | 5 6 files changed, 424 insertions(+), 88 deletions(-) Index: linux-2.6-tip/include/linux/hardirq.h =================================================================== --- linux-2.6-tip.orig/include/linux/hardirq.h +++ linux-2.6-tip/include/linux/hardirq.h @@ -94,19 +94,6 @@ #define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0) #ifdef CONFIG_PREEMPT -# define PREEMPT_CHECK_OFFSET 1 -#else -# define PREEMPT_CHECK_OFFSET 0 -#endif - -/* - * Check whether we were atomic before we did preempt_disable(): - * (used by the scheduler) - */ -#define in_atomic_preempt_off() \ - ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET) - -#ifdef CONFIG_PREEMPT # define preemptible() (preempt_count() == 0 && !irqs_disabled()) # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) #else Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -92,6 +92,16 @@ struct sched_param { #include +#ifdef CONFIG_PREEMPT +extern int kernel_preemption; +#else +# define kernel_preemption 0 +#endif +#ifdef CONFIG_PREEMPT_VOLUNTARY +extern int voluntary_preemption; +#else +# define voluntary_preemption 0 +#endif #ifdef CONFIG_PREEMPT_SOFTIRQS extern int softirq_preemption; #else @@ -229,6 +239,28 @@ extern struct semaphore kernel_sem; #define set_task_state(tsk, state_value) \ set_mb((tsk)->state, (state_value)) +// #define PREEMPT_DIRECT + +#ifdef CONFIG_X86_LOCAL_APIC +extern void nmi_show_all_regs(void); +#else +# define nmi_show_all_regs() do { } while (0) +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct exec_domain; + /* * set_current_state() includes a barrier so that the write of current->state * is correctly serialised wrt the caller's subsequent test of whether to @@ -363,6 +395,11 @@ extern signed long schedule_timeout_unin asmlinkage void __schedule(void); asmlinkage void schedule(void); extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); +/* + * This one can be called with interrupts disabled, only + * to be used by lowlevel arch code! + */ +asmlinkage void __sched __schedule(void); struct nsproxy; struct user_namespace; @@ -1645,6 +1682,15 @@ extern struct pid *cad_pid; extern void free_task(struct task_struct *tsk); #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) +#ifdef CONFIG_PREEMPT_RT +extern void __put_task_struct_cb(struct rcu_head *rhp); + +static inline void put_task_struct(struct task_struct *t) +{ + if (atomic_dec_and_test(&t->usage)) + call_rcu(&t->rcu, __put_task_struct_cb); +} +#else extern void __put_task_struct(struct task_struct *t); static inline void put_task_struct(struct task_struct *t) @@ -1652,6 +1698,7 @@ static inline void put_task_struct(struc if (atomic_dec_and_test(&t->usage)) __put_task_struct(t); } +#endif extern cputime_t task_utime(struct task_struct *p); extern cputime_t task_stime(struct task_struct *p); Index: linux-2.6-tip/kernel/mutex.c =================================================================== --- linux-2.6-tip.orig/kernel/mutex.c +++ linux-2.6-tip/kernel/mutex.c @@ -248,7 +248,13 @@ __mutex_lock_common(struct mutex *lock, /* didnt get the lock, go to sleep: */ spin_unlock_mutex(&lock->wait_lock, flags); + + local_irq_disable(); + __preempt_enable_no_resched(); __schedule(); + preempt_disable(); + local_irq_enable(); + spin_lock_mutex(&lock->wait_lock, flags); } Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -4,6 +4,7 @@ * Kernel scheduler and related syscalls * * Copyright (C) 1991-2002 Linus Torvalds + * Copyright (C) 2004 Red Hat, Inc., Ingo Molnar * * 1996-12-23 Modified by Dave Grothe to fix bugs in semaphores and * make semaphores SMP safe @@ -16,6 +17,7 @@ * by Davide Libenzi, preemptible kernel bits by Robert Love. * 2003-09-03 Interactivity tuning by Con Kolivas. * 2004-04-02 Scheduler domains code by Nick Piggin + * 2004-10-13 Real-Time Preemption support by Ingo Molnar * 2007-04-15 Work begun on replacing all interactivity tuning with a * fair scheduling design by Con Kolivas. * 2007-05-05 Load balancing (smp-nice) and other improvements @@ -60,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -105,6 +108,20 @@ #define NICE_0_LOAD SCHED_LOAD_SCALE #define NICE_0_SHIFT SCHED_LOAD_SHIFT +#if (BITS_PER_LONG < 64) +#define JIFFIES_TO_NS64(TIME) \ + ((unsigned long long)(TIME) * ((unsigned long) (1000000000 / HZ))) + +#define NS64_TO_JIFFIES(TIME) \ + ((((unsigned long long)((TIME)) >> BITS_PER_LONG) * \ + (1 + NS_TO_JIFFIES(~0UL))) + NS_TO_JIFFIES((unsigned long)(TIME))) +#else /* BITS_PER_LONG < 64 */ + +#define NS64_TO_JIFFIES(TIME) NS_TO_JIFFIES(TIME) +#define JIFFIES_TO_NS64(TIME) JIFFIES_TO_NS(TIME) + +#endif /* BITS_PER_LONG < 64 */ + /* * These are the 'tuning knobs' of the scheduler: * @@ -148,6 +165,32 @@ static inline void sg_inc_cpu_power(stru } #endif +#define TASK_PREEMPTS_CURR(p, rq) \ + ((p)->prio < (rq)->curr->prio) + +/* + * Tweaks for current + */ + +#ifdef CURRENT_PTR +struct task_struct * const ___current = &init_task; +struct task_struct ** const current_ptr = (struct task_struct ** const)&___current; +struct thread_info * const current_ti = &init_thread_union.thread_info; +struct thread_info ** const current_ti_ptr = (struct thread_info ** const)¤t_ti; + +EXPORT_SYMBOL(___current); +EXPORT_SYMBOL(current_ti); + +/* + * The scheduler itself doesnt want 'current' to be cached + * during context-switches: + */ +# undef current +# define current __current() +# undef current_thread_info +# define current_thread_info() __current_thread_info() +#endif + static inline int rt_policy(int policy) { if (unlikely(policy == SCHED_FIFO || policy == SCHED_RR)) @@ -170,7 +213,7 @@ struct rt_prio_array { struct rt_bandwidth { /* nests inside the rq lock: */ - spinlock_t rt_runtime_lock; + raw_spinlock_t rt_runtime_lock; ktime_t rt_period; u64 rt_runtime; struct hrtimer rt_period_timer; @@ -500,11 +543,12 @@ struct rt_rq { int overloaded; struct plist_head pushable_tasks; #endif + unsigned long rt_nr_uninterruptible; int rt_throttled; u64 rt_time; u64 rt_runtime; /* Nests inside the rq lock: */ - spinlock_t rt_runtime_lock; + raw_spinlock_t rt_runtime_lock; #ifdef CONFIG_RT_GROUP_SCHED unsigned long rt_nr_boosted; @@ -567,7 +611,7 @@ static struct root_domain def_root_domai */ struct rq { /* runqueue lock: */ - spinlock_t lock; + raw_spinlock_t lock; /* * nr_running and cpu_load should be in the same cacheline because @@ -605,6 +649,8 @@ struct rq { */ unsigned long nr_uninterruptible; + unsigned long switch_timestamp; + unsigned long slice_avg; struct task_struct *curr, *idle; unsigned long next_balance; struct mm_struct *prev_mm; @@ -662,6 +708,13 @@ struct rq { /* BKL stats */ unsigned int bkl_count; + + /* RT-overload stats: */ + unsigned long rto_schedule; + unsigned long rto_schedule_tail; + unsigned long rto_wakeup; + unsigned long rto_pulled; + unsigned long rto_pushed; #endif }; @@ -889,11 +942,23 @@ static inline u64 global_rt_runtime(void return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC; } +/* + * We really dont want to do anything complex within switch_to() + * on PREEMPT_RT - this check enforces this. + */ +#ifdef prepare_arch_switch +# ifdef CONFIG_PREEMPT_RT +# error FIXME +# else +# define _finish_arch_switch finish_arch_switch +# endif +#endif + #ifndef prepare_arch_switch # define prepare_arch_switch(next) do { } while (0) #endif #ifndef finish_arch_switch -# define finish_arch_switch(prev) do { } while (0) +# define _finish_arch_switch(prev) do { } while (0) #endif static inline int task_current(struct rq *rq, struct task_struct *p) @@ -924,7 +989,7 @@ static inline void finish_lock_switch(st */ spin_acquire(&rq->lock.dep_map, 0, 0, _THIS_IP_); - spin_unlock_irq(&rq->lock); + spin_unlock(&rq->lock); } #else /* __ARCH_WANT_UNLOCKED_CTXSW */ @@ -965,8 +1030,8 @@ static inline void finish_lock_switch(st smp_wmb(); prev->oncpu = 0; #endif -#ifndef __ARCH_WANT_INTERRUPTS_ON_CTXSW - local_irq_enable(); +#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW + local_irq_disable(); #endif } #endif /* __ARCH_WANT_UNLOCKED_CTXSW */ @@ -1840,6 +1905,8 @@ static inline int normal_prio(struct tas prio = MAX_RT_PRIO-1 - p->rt_priority; else prio = __normal_prio(p); + +// trace_special_pid(p->pid, PRIO(p), __PRIO(prio)); return prio; } @@ -2421,6 +2488,13 @@ try_to_wake_up(struct task_struct *p, un } #endif +#ifdef CONFIG_PREEMPT_RT + /* + * sync wakeups can increase wakeup latencies: + */ + if (rt_task(p)) + sync = 0; +#endif smp_wmb(); rq = task_rq_lock(p, &flags); update_rq_clock(rq); @@ -2504,7 +2578,10 @@ out_running: trace_sched_wakeup(rq, p, success); check_preempt_curr(rq, p, sync); - p->state = TASK_RUNNING; + if (mutex) + p->state = TASK_RUNNING_MUTEX; + else + p->state = TASK_RUNNING; #ifdef CONFIG_SMP if (p->sched_class->task_wake_up) p->sched_class->task_wake_up(rq, p); @@ -2785,7 +2862,7 @@ static void finish_task_switch(struct rq * Manfred Spraul */ prev_state = prev->state; - finish_arch_switch(prev); + _finish_arch_switch(prev); perf_counter_task_sched_in(current, cpu_of(rq)); finish_lock_switch(rq, prev); #ifdef CONFIG_SMP @@ -2813,12 +2890,16 @@ static void finish_task_switch(struct rq asmlinkage void schedule_tail(struct task_struct *prev) __releases(rq->lock) { - struct rq *rq = this_rq(); - - finish_task_switch(rq, prev); + preempt_disable(); + BUG_ON((preempt_count() & 0xffff) != 2); + finish_task_switch(this_rq(), prev); + __preempt_enable_no_resched(); + local_irq_enable(); #ifdef __ARCH_WANT_UNLOCKED_CTXSW /* In this case, finish_task_switch does not reenable preemption */ preempt_enable(); +#else + preempt_check_resched(); #endif if (current->set_child_tid) put_user(task_pid_vnr(current), current->set_child_tid); @@ -2866,6 +2947,11 @@ context_switch(struct rq *rq, struct tas spin_release(&rq->lock.dep_map, 1, _THIS_IP_); #endif +#ifdef CURRENT_PTR + barrier(); + *current_ptr = next; + *current_ti_ptr = next->thread_info; +#endif /* Here we just switch the register state and the stack. */ switch_to(prev, next, prev); @@ -2912,6 +2998,11 @@ unsigned long nr_uninterruptible(void) return sum; } +unsigned long nr_uninterruptible_cpu(int cpu) +{ + return cpu_rq(cpu)->nr_uninterruptible; +} + unsigned long long nr_context_switches(void) { int i; @@ -4628,6 +4719,8 @@ void scheduler_tick(void) sched_clock_tick(); + BUG_ON(!irqs_disabled()); + spin_lock(&rq->lock); update_rq_clock(rq); update_cpu_load(rq); @@ -4707,8 +4800,8 @@ static noinline void __schedule_bug(stru { struct pt_regs *regs = get_irq_regs(); - printk(KERN_ERR "BUG: scheduling while atomic: %s/%d/0x%08x\n", - prev->comm, prev->pid, preempt_count()); + printk(KERN_ERR "BUG: scheduling while atomic: %s/0x%08x/%d, CPU#%d\n", + prev->comm, preempt_count(), prev->pid, smp_processor_id()); debug_show_held_locks(prev); print_modules(); @@ -4726,12 +4819,14 @@ static noinline void __schedule_bug(stru */ static inline void schedule_debug(struct task_struct *prev) { +// WARN_ON(system_state == SYSTEM_BOOTING); + /* * Test if we are atomic. Since do_exit() needs to call into * schedule() atomically, we ignore that path for now. * Otherwise, whine if we are scheduling when we should not be. */ - if (unlikely(in_atomic_preempt_off() && !prev->exit_state)) + if (unlikely(in_atomic() && !prev->exit_state)) __schedule_bug(prev); profile_hit(SCHED_PROFILING, __builtin_return_address(0)); @@ -4816,10 +4911,11 @@ asmlinkage void __sched __schedule(void) switch_count = &prev->nivcsw; release_kernel_lock(prev); -need_resched_nonpreemptible: schedule_debug(prev); + preempt_disable(); + if (sched_feat(HRTICK)) hrtick_clear(rq); @@ -4827,14 +4923,20 @@ need_resched_nonpreemptible: update_rq_clock(rq); clear_tsk_need_resched(prev); - if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) { + if ((prev->state & ~TASK_RUNNING_MUTEX) && + !(preempt_count() & PREEMPT_ACTIVE)) { if (unlikely(signal_pending_state(prev->state, prev))) prev->state = TASK_RUNNING; - else + else { + touch_softlockup_watchdog(); deactivate_task(rq, prev, 1); + } switch_count = &prev->nvcsw; } + if (preempt_count() & PREEMPT_ACTIVE) + sub_preempt_count(PREEMPT_ACTIVE); + #ifdef CONFIG_SMP if (prev->sched_class->pre_schedule) prev->sched_class->pre_schedule(rq, prev); @@ -4861,19 +4963,26 @@ need_resched_nonpreemptible: */ cpu = smp_processor_id(); rq = cpu_rq(cpu); - } else - spin_unlock_irq(&rq->lock); + __preempt_enable_no_resched(); + } else { + __preempt_enable_no_resched(); + spin_unlock(&rq->lock); + } - if (unlikely(reacquire_kernel_lock(current) < 0)) - goto need_resched_nonpreemptible; + reacquire_kernel_lock(current); + BUG_ON(preempt_count() & 0xffff); } asmlinkage void __sched schedule(void) { + BUG_ON((preempt_count() & 0xffff) && !current->exit_state); need_resched: - preempt_disable(); + local_irq_disable(); __schedule(); - __preempt_enable_no_resched(); + local_irq_enable(); + + BUG_ON(preempt_count() & 0xffff); + if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) goto need_resched; } @@ -4941,6 +5050,35 @@ out: #endif #ifdef CONFIG_PREEMPT + +/* + * Global flag to turn preemption off on a CONFIG_PREEMPT kernel: + */ +int kernel_preemption = 1; + +static int __init preempt_setup (char *str) +{ + if (!strncmp(str, "off", 3)) { + if (kernel_preemption) { + printk(KERN_INFO "turning off kernel preemption!\n"); + kernel_preemption = 0; + } + return 1; + } + if (!strncmp(str, "on", 2)) { + if (!kernel_preemption) { + printk(KERN_INFO "turning on kernel preemption!\n"); + kernel_preemption = 1; + } + return 1; + } + get_option(&str, &kernel_preemption); + + return 1; +} + +__setup("preempt=", preempt_setup); + /* * this is the entry point to schedule() from in-kernel preemption * off of preempt_enable. Kernel preemptions off return from interrupt @@ -4952,6 +5090,8 @@ asmlinkage void __sched preempt_schedule struct task_struct *task = current; int saved_lock_depth; + if (!kernel_preemption) + return; /* * If there is a non-zero preempt_count or interrupts are disabled, * we do not want to preempt the current task. Just return.. @@ -4960,6 +5100,7 @@ asmlinkage void __sched preempt_schedule return; do { + local_irq_disable(); add_preempt_count(PREEMPT_ACTIVE); /* @@ -4969,9 +5110,9 @@ asmlinkage void __sched preempt_schedule */ saved_lock_depth = task->lock_depth; task->lock_depth = -1; - schedule(); + __schedule(); task->lock_depth = saved_lock_depth; - sub_preempt_count(PREEMPT_ACTIVE); + local_irq_enable(); /* * Check again in case we missed a preemption opportunity @@ -4983,10 +5124,10 @@ asmlinkage void __sched preempt_schedule EXPORT_SYMBOL(preempt_schedule); /* - * this is the entry point to schedule() from kernel preemption - * off of irq context. - * Note, that this is called and return with irqs disabled. This will - * protect us against recursive calling from irq. + * this is is the entry point for the IRQ return path. Called with + * interrupts disabled. To avoid infinite irq-entry recursion problems + * with fast-paced IRQ sources we do all of this carefully to never + * enable interrupts again. */ asmlinkage void __sched preempt_schedule_irq(void) { @@ -4994,10 +5135,17 @@ asmlinkage void __sched preempt_schedule struct task_struct *task = current; int saved_lock_depth; - /* Catch callers which need to be fixed */ - WARN_ON_ONCE(ti->preempt_count || !irqs_disabled()); + if (!kernel_preemption) + return; + /* + * If there is a non-zero preempt_count then just return. + * (interrupts are disabled) + */ + if (unlikely(ti->preempt_count)) + return; do { + local_irq_disable(); add_preempt_count(PREEMPT_ACTIVE); /* @@ -5007,11 +5155,9 @@ asmlinkage void __sched preempt_schedule */ saved_lock_depth = task->lock_depth; task->lock_depth = -1; - local_irq_enable(); - schedule(); + __schedule(); local_irq_disable(); task->lock_depth = saved_lock_depth; - sub_preempt_count(PREEMPT_ACTIVE); /* * Check again in case we missed a preemption opportunity @@ -5396,6 +5542,8 @@ void task_setprio(struct task_struct *p, p->prio = prio; +// trace_special_pid(p->pid, __PRIO(oldprio), PRIO(p)); + if (running) p->sched_class->set_curr_task(rq); if (on_rq) { @@ -5403,6 +5551,8 @@ void task_setprio(struct task_struct *p, check_class_changed(rq, p, prev_class, oldprio, running); } +// trace_special(prev_resched, _need_resched(), 0); + task_rq_unlock(rq, &flags); } @@ -6042,14 +6192,51 @@ SYSCALL_DEFINE0(sched_yield) */ spin_unlock_no_resched(&rq->lock); - schedule(); + __schedule(); + + local_irq_enable(); + preempt_check_resched(); return 0; } +#if defined(CONFIG_DEBUG_SPINLOCK_SLEEP) || defined(CONFIG_DEBUG_PREEMPT) +void __might_sleep(char *file, int line) +{ +#ifdef in_atomic + static unsigned long prev_jiffy; /* ratelimiting */ + + if ((!in_atomic() && !irqs_disabled()) || + system_state != SYSTEM_RUNNING || oops_in_progress) + return; + + if (debug_direct_keyboard && hardirq_count()) + return; + + if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) + return; + prev_jiffy = jiffies; + + printk(KERN_ERR + "BUG: sleeping function called from invalid context at %s:%d\n", + file, line); + printk(KERN_ERR + "in_atomic(): %d, irqs_disabled(): %d, pid: %d, name: %s\n", + in_atomic(), irqs_disabled(), + current->pid, current->comm); + + debug_show_held_locks(current); + if (irqs_disabled()) + print_irqtrace_events(current); + dump_stack(); +#endif +} +EXPORT_SYMBOL(__might_sleep); +#endif + static void __cond_resched(void) { -#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP +#if defined(CONFIG_DEBUG_SPINLOCK_SLEEP) || defined(CONFIG_DEBUG_PREEMPT) __might_sleep(__FILE__, __LINE__); #endif /* @@ -6058,10 +6245,11 @@ static void __cond_resched(void) * cond_resched() call. */ do { + local_irq_disable(); add_preempt_count(PREEMPT_ACTIVE); - schedule(); - sub_preempt_count(PREEMPT_ACTIVE); + __schedule(); } while (need_resched()); + local_irq_enable(); } int __sched _cond_resched(void) @@ -6101,6 +6289,25 @@ int __cond_resched_raw_spinlock(raw_spin } EXPORT_SYMBOL(__cond_resched_raw_spinlock); +#ifdef CONFIG_PREEMPT_RT + +int __cond_resched_spinlock(spinlock_t *lock) +{ +#if (defined(CONFIG_SMP) && defined(CONFIG_PREEMPT)) || defined(CONFIG_PREEMPT_RT) + if (lock->break_lock) { + lock->break_lock = 0; + spin_unlock_no_resched(lock); + __cond_resched(); + spin_lock(lock); + return 1; + } +#endif + return 0; +} +EXPORT_SYMBOL(__cond_resched_spinlock); + +#endif + /* * Voluntarily preempt a process context that has softirqs disabled: */ @@ -6147,11 +6354,15 @@ int cond_resched_hardirq_context(void) WARN_ON_ONCE(!irqs_disabled()); if (hardirq_need_resched()) { +#ifndef CONFIG_PREEMPT_RT irq_exit(); +#endif local_irq_enable(); __cond_resched(); +#ifndef CONFIG_PREEMPT_RT local_irq_disable(); __irq_enter(); +#endif return 1; } @@ -6159,17 +6370,58 @@ int cond_resched_hardirq_context(void) } EXPORT_SYMBOL(cond_resched_hardirq_context); +#ifdef CONFIG_PREEMPT_VOLUNTARY + +int voluntary_preemption = 1; + +EXPORT_SYMBOL(voluntary_preemption); + +static int __init voluntary_preempt_setup (char *str) +{ + if (!strncmp(str, "off", 3)) + voluntary_preemption = 0; + else + get_option(&str, &voluntary_preemption); + if (!voluntary_preemption) + printk("turning off voluntary preemption!\n"); + + return 1; +} + +__setup("voluntary-preempt=", voluntary_preempt_setup); + +#endif + /** * yield - yield the current processor to other threads. * * This is a shortcut for kernel-space yielding - it marks the * thread runnable and calls sys_sched_yield(). */ -void __sched yield(void) +void __sched __yield(void) { set_current_state(TASK_RUNNING); sys_sched_yield(); } + +void __sched yield(void) +{ + static int once = 1; + + /* + * it's a bug to rely on yield() with RT priorities. We print + * the first occurance after bootup ... this will still give + * us an idea about the scope of the problem, without spamming + * the syslog: + */ + if (once && rt_task(current)) { + once = 0; + printk(KERN_ERR "BUG: %s:%d RT task yield()-ing!\n", + current->comm, current->pid); + dump_stack(); + } + __yield(); +} EXPORT_SYMBOL(yield); /* @@ -6346,6 +6598,7 @@ void sched_show_task(struct task_struct void show_state_filter(unsigned long state_filter) { struct task_struct *g, *p; + int do_unlock = 1; #if BITS_PER_LONG == 32 printk(KERN_INFO @@ -6354,7 +6607,16 @@ void show_state_filter(unsigned long sta printk(KERN_INFO " task PC stack pid father\n"); #endif +#ifdef CONFIG_PREEMPT_RT + if (!read_trylock(&tasklist_lock)) { + printk("hm, tasklist_lock write-locked.\n"); + printk("ignoring ...\n"); + do_unlock = 0; + } +#else read_lock(&tasklist_lock); +#endif + do_each_thread(g, p) { /* * reset the NMI-timeout, listing all files on a slow @@ -6370,7 +6632,8 @@ void show_state_filter(unsigned long sta #ifdef CONFIG_SCHED_DEBUG sysrq_sched_debug_show(); #endif - read_unlock(&tasklist_lock); + if (do_unlock) + read_unlock(&tasklist_lock); /* * Only show locks if all tasks are dumped: */ @@ -6542,11 +6805,18 @@ EXPORT_SYMBOL_GPL(set_cpus_allowed_ptr); static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu) { struct rq *rq_dest, *rq_src; + unsigned long flags; int ret = 0, on_rq; if (unlikely(!cpu_active(dest_cpu))) return ret; + /* + * PREEMPT_RT: this relies on write_lock_irq(&tasklist_lock) + * disabling interrupts - which on PREEMPT_RT does not do: + */ + local_irq_save(flags); + rq_src = cpu_rq(src_cpu); rq_dest = cpu_rq(dest_cpu); @@ -6571,6 +6841,8 @@ done: ret = 1; fail: double_rq_unlock(rq_src, rq_dest); + local_irq_restore(flags); + return ret; } @@ -8877,6 +9149,9 @@ void __init sched_init(void) atomic_inc(&init_mm.mm_count); enter_lazy_tlb(&init_mm, current); +#ifdef CONFIG_PREEMPT_RT + printk("Real-Time Preemption Support (C) 2004-2007 Ingo Molnar\n"); +#endif /* * Make us the idle thread. Technically, schedule() should not be * called from this thread, however somewhere below it might be, @@ -8901,36 +9176,6 @@ void __init sched_init(void) scheduler_running = 1; } -#if defined(CONFIG_DEBUG_SPINLOCK_SLEEP) || defined(CONFIG_DEBUG_PREEMPT) -void __might_sleep(char *file, int line) -{ -#ifdef in_atomic - static unsigned long prev_jiffy; /* ratelimiting */ - - if ((!in_atomic() && !irqs_disabled()) || - system_state != SYSTEM_RUNNING || oops_in_progress) - return; - if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) - return; - prev_jiffy = jiffies; - - printk(KERN_ERR - "BUG: sleeping function called from invalid context at %s:%d\n", - file, line); - printk(KERN_ERR - "in_atomic(): %d, irqs_disabled(): %d, pid: %d, name: %s\n", - in_atomic(), irqs_disabled(), - current->pid, current->comm); - - debug_show_held_locks(current); - if (irqs_disabled()) - print_irqtrace_events(current); - dump_stack(); -#endif -} -EXPORT_SYMBOL(__might_sleep); -#endif - #ifdef CONFIG_MAGIC_SYSRQ static void normalize_task(struct rq *rq, struct task_struct *p) { Index: linux-2.6-tip/kernel/sched_rt.c =================================================================== --- linux-2.6-tip.orig/kernel/sched_rt.c +++ linux-2.6-tip/kernel/sched_rt.c @@ -844,6 +844,48 @@ static void dequeue_rt_entity(struct sch } } +static inline void incr_rt_nr_uninterruptible(struct task_struct *p, + struct rq *rq) +{ + rq->rt.rt_nr_uninterruptible++; +} + +static inline void decr_rt_nr_uninterruptible(struct task_struct *p, + struct rq *rq) +{ + rq->rt.rt_nr_uninterruptible--; +} + +unsigned long rt_nr_running(void) +{ + unsigned long i, sum = 0; + + for_each_online_cpu(i) + sum += cpu_rq(i)->rt.rt_nr_running; + + return sum; +} + +unsigned long rt_nr_running_cpu(int cpu) +{ + return cpu_rq(cpu)->rt.rt_nr_running; +} + +unsigned long rt_nr_uninterruptible(void) +{ + unsigned long i, sum = 0; + + for_each_online_cpu(i) + sum += cpu_rq(i)->rt.rt_nr_uninterruptible; + + return sum; +} + +unsigned long rt_nr_uninterruptible_cpu(int cpu) +{ + return cpu_rq(cpu)->rt.rt_nr_uninterruptible; +} + /* * Adding/removing a task to/from a priority array: */ @@ -856,6 +898,9 @@ static void enqueue_task_rt(struct rq *r enqueue_rt_entity(rt_se); + if (p->state == TASK_UNINTERRUPTIBLE) + decr_rt_nr_uninterruptible(p, rq); + if (!task_current(rq, p) && p->rt.nr_cpus_allowed > 1) enqueue_pushable_task(rq, p); @@ -867,6 +912,10 @@ static void dequeue_task_rt(struct rq *r struct sched_rt_entity *rt_se = &p->rt; update_curr_rt(rq); + + if (p->state == TASK_UNINTERRUPTIBLE) + incr_rt_nr_uninterruptible(p, rq); + dequeue_rt_entity(rt_se); dequeue_pushable_task(rq, p); @@ -1453,8 +1502,10 @@ static int pull_rt_task(struct rq *this_ static void pre_schedule_rt(struct rq *rq, struct task_struct *prev) { /* Try to pull RT tasks here if we lower this rq's prio */ - if (unlikely(rt_task(prev)) && rq->rt.highest_prio.curr > prev->prio) + if (unlikely(rt_task(prev)) && rq->rt.highest_prio.curr > prev->prio) { pull_rt_task(rq); + schedstat_inc(rq, rto_schedule); + } } /* @@ -1536,7 +1587,6 @@ static void set_cpus_allowed_rt(struct t */ if (weight > 1) enqueue_pushable_task(rq, p); - } if ((p->rt.nr_cpus_allowed <= 1) && (weight > 1)) { Index: linux-2.6-tip/lib/kernel_lock.c =================================================================== --- linux-2.6-tip.orig/lib/kernel_lock.c +++ linux-2.6-tip/lib/kernel_lock.c @@ -41,16 +41,17 @@ int __lockfunc __reacquire_kernel_lock(v struct task_struct *task = current; int saved_lock_depth = task->lock_depth; + local_irq_enable(); BUG_ON(saved_lock_depth < 0); task->lock_depth = -1; - __preempt_enable_no_resched(); down(&kernel_sem); - preempt_disable(); task->lock_depth = saved_lock_depth; + local_irq_disable(); + return 0; } patches/preempt-rt-no-slub.patch0000664000076400007640000000115011161723446015734 0ustar tglxtglxSubject: preempt: rt no slub From: Ingo Molnar Date: Wed Feb 04 00:02:29 CET 2009 Signed-off-by: Ingo Molnar --- init/Kconfig | 1 + 1 file changed, 1 insertion(+) Index: linux-2.6-tip/init/Kconfig =================================================================== --- linux-2.6-tip.orig/init/Kconfig +++ linux-2.6-tip/init/Kconfig @@ -1009,6 +1009,7 @@ config SLAB config SLUB bool "SLUB (Unqueued Allocator)" + depends on !PREEMPT_RT help SLUB is a slab allocator that minimizes cache line usage instead of managing queues of cached objects (SLAB approach). patches/revert-bkl-cleanup.patch0000664000076400007640000000126411160752235015765 0ustar tglxtglxSubject: revert-bkl-cleanup.patch From: Thomas Gleixner Date: Mon, 09 Mar 2009 12:20:55 +0100 Signed-off-by: Thomas Gleixner --- lib/kernel_lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/lib/kernel_lock.c =================================================================== --- linux-2.6-tip.orig/lib/kernel_lock.c +++ linux-2.6-tip/lib/kernel_lock.c @@ -39,7 +39,7 @@ static __cacheline_aligned_in_smp DEFIN int __lockfunc __reacquire_kernel_lock(void) { while (!_raw_spin_trylock(&kernel_flag)) { - if (need_resched()) + if (test_thread_flag(TIF_NEED_RESCHED)) return -EAGAIN; cpu_relax(); } patches/lockdep-rt-recursion-limit-fix.patch0000664000076400007640000000454411160752235020242 0ustar tglxtglxSubject: patches/lockdep-rt-recursion-limit-fix.patch OK, I sent this out once before but it must have slipped under the radar. http://lkml.org/lkml/2007/6/28/325 My config fails miserably with lockdep: kernel/lockdep.c: In function 'find_usage_forwards': kernel/lockdep.c:814: error: 'RECURSION_LIMIT' undeclared (first use in this function) kernel/lockdep.c:814: error: (Each undeclared identifier is reported only once kernel/lockdep.c:814: error: for each function it appears in.) kernel/lockdep.c:815: warning: implicit declaration of function 'print_infinite_recursion_bug' kernel/lockdep.c: In function 'find_usage_backwards': kernel/lockdep.c:856: error: 'RECURSION_LIMIT' undeclared (first use in this function) make[1]: *** [kernel/lockdep.o] Error 1 But this patch fixes it nicely. Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- kernel/lockdep.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) Index: linux-2.6-tip/kernel/lockdep.c =================================================================== --- linux-2.6-tip.orig/kernel/lockdep.c +++ linux-2.6-tip/kernel/lockdep.c @@ -844,6 +844,21 @@ out_unlock_set: return class; } +#if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_TRACE_IRQFLAGS) + +#define RECURSION_LIMIT 40 + +static int noinline print_infinite_recursion_bug(void) +{ + if (!debug_locks_off_graph_unlock()) + return 0; + + WARN_ON(1); + + return 0; +} +#endif /* CONFIG_PROVE_LOCKING || CONFIG_TRACE_IRQFLAGS */ + #ifdef CONFIG_PROVE_LOCKING /* * Allocate a lockdep entry. (assumes the graph_lock held, returns @@ -975,18 +990,6 @@ static noinline int print_circular_bug_t return 0; } -#define RECURSION_LIMIT 40 - -static int noinline print_infinite_recursion_bug(void) -{ - if (!debug_locks_off_graph_unlock()) - return 0; - - WARN_ON(1); - - return 0; -} - unsigned long __lockdep_count_forward_deps(struct lock_class *class, unsigned int depth) { @@ -1179,6 +1182,7 @@ find_usage_backwards(struct lock_class * return 1; } +#ifdef CONFIG_PROVE_LOCKING static int print_bad_irq_dependency(struct task_struct *curr, struct held_lock *prev, @@ -1239,6 +1243,7 @@ print_bad_irq_dependency(struct task_str return 0; } +#endif /* CONFIG_PROVE_LOCKING */ static int check_usage(struct task_struct *curr, struct held_lock *prev, patches/preempt-irqs-Kconfig.patch0000664000076400007640000000225211160752235016267 0ustar tglxtglxSubject: preempt: irqs Kconfig From: Ingo Molnar Date: Wed Feb 04 00:03:07 CET 2009 Signed-off-by: Ingo Molnar --- kernel/Kconfig.preempt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) Index: linux-2.6-tip/kernel/Kconfig.preempt =================================================================== --- linux-2.6-tip.orig/kernel/Kconfig.preempt +++ linux-2.6-tip/kernel/Kconfig.preempt @@ -68,3 +68,22 @@ config PREEMPT_SOFTIRQS Say N if you are unsure. +config PREEMPT_HARDIRQS + bool "Thread Hardirqs" + default n + depends on GENERIC_HARDIRQS_NO__DO_IRQ + select PREEMPT_SOFTIRQS + help + This option reduces the latency of the kernel by 'threading' + hardirqs. This means that all (or selected) hardirqs will run + in their own kernel thread context. While this helps latency, + this feature can also reduce performance. + + The threading of hardirqs can also be controlled via the + /proc/sys/kernel/hardirq_preemption runtime flag and the + hardirq-preempt=0/1 boot-time option. Per-irq threading can + be enabled/disable via the /proc/irq///threaded + runtime flags. + + Say N if you are unsure. + patches/printk-in-atomic.patch0000664000076400007640000000533411160752235015452 0ustar tglxtglxSubject: patches/printk-in-atomic.patch From: Clark Williams Signed-off-by: Ingo Molnar --- arch/x86/kernel/early_printk.c | 4 ++-- drivers/char/vt.c | 2 +- include/linux/console.h | 11 +++++++++++ kernel/printk.c | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) Index: linux-2.6-tip/arch/x86/kernel/early_printk.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/early_printk.c +++ linux-2.6-tip/arch/x86/kernel/early_printk.c @@ -59,7 +59,7 @@ static void early_vga_write(struct conso static struct console early_vga_console = { .name = "earlyvga", .write = early_vga_write, - .flags = CON_PRINTBUFFER, + .flags = CON_PRINTBUFFER | CON_ATOMIC, .index = -1, }; @@ -156,7 +156,7 @@ static __init void early_serial_init(cha static struct console early_serial_console = { .name = "earlyser", .write = early_serial_write, - .flags = CON_PRINTBUFFER, + .flags = CON_PRINTBUFFER | CON_ATOMIC, .index = -1, }; Index: linux-2.6-tip/drivers/char/vt.c =================================================================== --- linux-2.6-tip.orig/drivers/char/vt.c +++ linux-2.6-tip/drivers/char/vt.c @@ -2538,7 +2538,7 @@ static struct console vt_console_driver .write = vt_console_print, .device = vt_console_device, .unblank = unblank_screen, - .flags = CON_PRINTBUFFER, + .flags = CON_PRINTBUFFER | CON_ATOMIC, .index = -1, }; #endif Index: linux-2.6-tip/include/linux/console.h =================================================================== --- linux-2.6-tip.orig/include/linux/console.h +++ linux-2.6-tip/include/linux/console.h @@ -93,6 +93,17 @@ void give_up_console(const struct consw #define CON_BOOT (8) #define CON_ANYTIME (16) /* Safe to call when cpu is offline */ #define CON_BRL (32) /* Used for a braille device */ +#define CON_ATOMIC (64) /* Safe to call in PREEMPT_RT atomic */ + +#ifdef CONFIG_PREEMPT_RT +# define console_atomic_safe(con) \ + (((con)->flags & CON_ATOMIC) || \ + (!in_atomic() && !irqs_disabled()) || \ + (system_state != SYSTEM_RUNNING) || \ + oops_in_progress) +#else +# define console_atomic_safe(con) (1) +#endif struct console { char name[16]; Index: linux-2.6-tip/kernel/printk.c =================================================================== --- linux-2.6-tip.orig/kernel/printk.c +++ linux-2.6-tip/kernel/printk.c @@ -395,6 +395,7 @@ static void __call_console_drivers(unsig for (con = console_drivers; con; con = con->next) { if ((con->flags & CON_ENABLED) && con->write && + console_atomic_safe(con) && (cpu_online(raw_smp_processor_id()) || (con->flags & CON_ANYTIME))) { set_printk_might_sleep(1); patches/rt-sched-groups.patch0000664000076400007640000000152611160752235015312 0ustar tglxtglxSubject: rt: sched groups From: Ingo Molnar Date: Wed Feb 04 00:02:19 CET 2009 Signed-off-by: Ingo Molnar --- kernel/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/kernel/cgroup.c =================================================================== --- linux-2.6-tip.orig/kernel/cgroup.c +++ linux-2.6-tip/kernel/cgroup.c @@ -155,7 +155,7 @@ list_for_each_entry(_root, &roots, root_ /* the list of cgroups eligible for automatic release. Protected by * release_list_lock */ static LIST_HEAD(release_list); -static DEFINE_SPINLOCK(release_list_lock); +static DEFINE_RAW_SPINLOCK(release_list_lock); static void cgroup_release_agent(struct work_struct *work); static DECLARE_WORK(release_agent_work, cgroup_release_agent); static void check_for_release(struct cgroup *cgrp); patches/hrtimer-no-printk.patch0000664000076400007640000000124211160752235015650 0ustar tglxtglxSubject: hrtimer: no printk From: Ingo Molnar Date: Wed Feb 04 00:02:45 CET 2009 Signed-off-by: Ingo Molnar --- kernel/hrtimer.c | 2 -- 1 file changed, 2 deletions(-) Index: linux-2.6-tip/kernel/hrtimer.c =================================================================== --- linux-2.6-tip.orig/kernel/hrtimer.c +++ linux-2.6-tip/kernel/hrtimer.c @@ -697,8 +697,6 @@ static int hrtimer_switch_to_hres(void) /* "Retrigger" the interrupt to get things going */ retrigger_next_event(NULL); local_irq_restore(flags); - printk(KERN_DEBUG "Switched to high resolution mode on CPU %d\n", - smp_processor_id()); return 1; } patches/preempt-realtime-timer-cpu-hotplug-fix.patch0000664000076400007640000000256211160752235021710 0ustar tglxtglxSubject: rt: fix timer hotplug From: Ingo Molnar Date: Mon Feb 09 23:23:06 CET 2009 Here we are in the CPU_DEAD notifier, and we must not sleep nor enable interrupts. Signed-off-by: Ingo Molnar --- kernel/timer.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) Index: linux-2.6-tip/kernel/timer.c =================================================================== --- linux-2.6-tip.orig/kernel/timer.c +++ linux-2.6-tip/kernel/timer.c @@ -1730,6 +1730,7 @@ static void __cpuinit migrate_timers(int { struct tvec_base *old_base; struct tvec_base *new_base; + unsigned long flags; int i; BUG_ON(cpu_online(cpu)); @@ -1739,8 +1740,11 @@ static void __cpuinit migrate_timers(int * The caller is globally serialized and nobody else * takes two locks at once, deadlock is not possible. */ - spin_lock_irq(&new_base->lock); - spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING); + local_irq_save(flags); + while (!spin_trylock(&new_base->lock)) + cpu_relax(); + while (!spin_trylock(&old_base->lock)) + cpu_relax(); BUG_ON(old_base->running_timer); @@ -1754,7 +1758,9 @@ static void __cpuinit migrate_timers(int } spin_unlock(&old_base->lock); - spin_unlock_irq(&new_base->lock); + spin_unlock(&new_base->lock); + local_irq_restore(flags); + put_cpu_var(tvec_bases); } #endif /* CONFIG_HOTPLUG_CPU */ patches/preempt-realtime-init-show-enabled-debugs.patch0000664000076400007640000001031111160752235022306 0ustar tglxtglxSubject: preempt: realtime init show enabled debugs From: Ingo Molnar Date: Wed Feb 04 00:02:51 CET 2009 Signed-off-by: Ingo Molnar --- init/main.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) Index: linux-2.6-tip/init/main.c =================================================================== --- linux-2.6-tip.orig/init/main.c +++ linux-2.6-tip/init/main.c @@ -457,6 +457,8 @@ static noinline void __init_refok rest_i { int pid; + system_state = SYSTEM_BOOTING_SCHEDULER_OK; + kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND); numa_default_policy(); pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES); @@ -697,6 +699,9 @@ asmlinkage void __init start_kernel(void ftrace_init(); +#ifdef CONFIG_PREEMPT_RT + WARN_ON(irqs_disabled()); +#endif /* Do the rest non-__init'ed, we're now alive */ rest_init(); } @@ -786,12 +791,14 @@ static void __init do_basic_setup(void) static void __init do_pre_smp_initcalls(void) { initcall_t *call; + extern int spawn_desched_task(void); /* kmemcheck must initialize before all early initcalls: */ kmemcheck_init(); for (call = __initcall_start; call < __early_initcall_end; call++) do_one_initcall(*call); + spawn_desched_task(); } static void run_init_process(char *init_filename) @@ -826,6 +833,9 @@ static noinline int init_post(void) printk(KERN_WARNING "Failed to execute %s\n", ramdisk_execute_command); } +#ifdef CONFIG_PREEMPT_RT + WARN_ON(irqs_disabled()); +#endif /* * We try each of these until one succeeds. @@ -891,7 +901,51 @@ static int __init kernel_init(void * unu ramdisk_execute_command = NULL; prepare_namespace(); } +#ifdef CONFIG_PREEMPT_RT + WARN_ON(irqs_disabled()); +#endif +#define DEBUG_COUNT (defined(CONFIG_DEBUG_RT_MUTEXES) + defined(CONFIG_CRITICAL_PREEMPT_TIMING) + defined(CONFIG_CRITICAL_IRQSOFF_TIMING) + defined(CONFIG_FUNCTION_TRACE) + defined(CONFIG_DEBUG_SLAB) + defined(CONFIG_DEBUG_PAGEALLOC) + defined(CONFIG_LOCKDEP)) + +#if DEBUG_COUNT > 0 + printk(KERN_ERR "*****************************************************************************\n"); + printk(KERN_ERR "* *\n"); +#if DEBUG_COUNT == 1 + printk(KERN_ERR "* REMINDER, the following debugging option is turned on in your .config: *\n"); +#else + printk(KERN_ERR "* REMINDER, the following debugging options are turned on in your .config: *\n"); +#endif + printk(KERN_ERR "* *\n"); +#ifdef CONFIG_DEBUG_RT_MUTEXES + printk(KERN_ERR "* CONFIG_DEBUG_RT_MUTEXES *\n"); +#endif +#ifdef CONFIG_CRITICAL_PREEMPT_TIMING + printk(KERN_ERR "* CONFIG_CRITICAL_PREEMPT_TIMING *\n"); +#endif +#ifdef CONFIG_CRITICAL_IRQSOFF_TIMING + printk(KERN_ERR "* CONFIG_CRITICAL_IRQSOFF_TIMING *\n"); +#endif +#ifdef CONFIG_FUNCTION_TRACE + printk(KERN_ERR "* CONFIG_FUNCTION_TRACE *\n"); +#endif +#ifdef CONFIG_DEBUG_SLAB + printk(KERN_ERR "* CONFIG_DEBUG_SLAB *\n"); +#endif +#ifdef CONFIG_DEBUG_PAGEALLOC + printk(KERN_ERR "* CONFIG_DEBUG_PAGEALLOC *\n"); +#endif +#ifdef CONFIG_LOCKDEP + printk(KERN_ERR "* CONFIG_LOCKDEP *\n"); +#endif + printk(KERN_ERR "* *\n"); +#if DEBUG_COUNT == 1 + printk(KERN_ERR "* it may increase runtime overhead and latencies. *\n"); +#else + printk(KERN_ERR "* they may increase runtime overhead and latencies. *\n"); +#endif + printk(KERN_ERR "* *\n"); + printk(KERN_ERR "*****************************************************************************\n"); +#endif /* * Ok, we have completed the initial bootup, and * we're essentially up and running. Get rid of the patches/kmap-atomic-prepare.patch0000664000076400007640000000742711160752235016130 0ustar tglxtglxSubject: patches/kmap-atomic-prepare.patch With the separation of pagefault_{disable,enable}() from the preempt_count a previously overlooked dependancy became painfully clear. kmap_atomic() is per cpu and relies not only on disabling the pagefault handler, but really needs preemption disabled too. make this explicit now - so that we can change pagefault_disable(). Signed-off-by: Peter Zijlstra Signed-off-by: Ingo Molnar --- arch/mips/mm/highmem.c | 5 ++++- arch/sparc/mm/highmem.c | 4 +++- arch/x86/mm/highmem_32.c | 4 +++- include/asm-frv/highmem.h | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) Index: linux-2.6-tip/arch/mips/mm/highmem.c =================================================================== --- linux-2.6-tip.orig/arch/mips/mm/highmem.c +++ linux-2.6-tip/arch/mips/mm/highmem.c @@ -38,7 +38,7 @@ void *__kmap_atomic(struct page *page, e enum fixed_addresses idx; unsigned long vaddr; - /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ + preempt_disable(); pagefault_disable(); if (!PageHighMem(page)) return page_address(page); @@ -63,6 +63,7 @@ void __kunmap_atomic(void *kvaddr, enum if (vaddr < FIXADDR_START) { // FIXME pagefault_enable(); + preempt_enable(); return; } @@ -78,6 +79,7 @@ void __kunmap_atomic(void *kvaddr, enum #endif pagefault_enable(); + preempt_enable(); } /* @@ -89,6 +91,7 @@ void *kmap_atomic_pfn(unsigned long pfn, enum fixed_addresses idx; unsigned long vaddr; + preempt_disable(); pagefault_disable(); idx = type + KM_TYPE_NR*smp_processor_id(); Index: linux-2.6-tip/arch/sparc/mm/highmem.c =================================================================== --- linux-2.6-tip.orig/arch/sparc/mm/highmem.c +++ linux-2.6-tip/arch/sparc/mm/highmem.c @@ -34,7 +34,7 @@ void *kmap_atomic(struct page *page, enu unsigned long idx; unsigned long vaddr; - /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ + preempt_disable(); pagefault_disable(); if (!PageHighMem(page)) return page_address(page); @@ -72,6 +72,7 @@ void kunmap_atomic(void *kvaddr, enum km if (vaddr < FIXADDR_START) { // FIXME pagefault_enable(); + preempt_enable(); return; } @@ -98,6 +99,7 @@ void kunmap_atomic(void *kvaddr, enum km #endif pagefault_enable(); + preempt_enable(); } EXPORT_SYMBOL(kunmap_atomic); Index: linux-2.6-tip/arch/x86/mm/highmem_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/highmem_32.c +++ linux-2.6-tip/arch/x86/mm/highmem_32.c @@ -96,7 +96,7 @@ void *__kmap_atomic_prot(struct page *pa enum fixed_addresses idx; unsigned long vaddr; - /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ + preempt_disable(); pagefault_disable(); if (!PageHighMem(page)) @@ -140,6 +140,7 @@ void __kunmap_atomic(void *kvaddr, enum arch_flush_lazy_mmu_mode(); pagefault_enable(); + preempt_enable(); } /* @@ -148,6 +149,7 @@ void __kunmap_atomic(void *kvaddr, enum */ void *__kmap_atomic_pfn(unsigned long pfn, enum km_type type) { + preempt_disable(); return kmap_atomic_prot_pfn(pfn, type, kmap_prot); } EXPORT_SYMBOL_GPL(__kmap_atomic_pfn); /* temporarily in use by i915 GEM until vmap */ Index: linux-2.6-tip/include/asm-frv/highmem.h =================================================================== --- linux-2.6-tip.orig/include/asm-frv/highmem.h +++ linux-2.6-tip/include/asm-frv/highmem.h @@ -115,6 +115,7 @@ static inline void *kmap_atomic(struct p { unsigned long paddr; + preempt_disable(); pagefault_disable(); paddr = page_to_phys(page); @@ -171,6 +172,7 @@ static inline void kunmap_atomic(void *k BUG(); } pagefault_enable(); + preempt_enable(); } #endif /* !__ASSEMBLY__ */ patches/aacraid-compat-sem.patch0000664000076400007640000000137411160752235015714 0ustar tglxtglxSubject: aacraid: compat sem From: Ingo Molnar Date: Wed Feb 04 00:02:14 CET 2009 Signed-off-by: Ingo Molnar --- drivers/scsi/aacraid/aacraid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/drivers/scsi/aacraid/aacraid.h =================================================================== --- linux-2.6-tip.orig/drivers/scsi/aacraid/aacraid.h +++ linux-2.6-tip/drivers/scsi/aacraid/aacraid.h @@ -789,7 +789,7 @@ struct fib { * This is the event the sendfib routine will wait on if the * caller did not pass one and this is synch io. */ - struct semaphore event_wait; + struct compat_semaphore event_wait; spinlock_t event_lock; u32 done; /* gets set to 1 when fib is complete */ patches/replace-bugon-by-warn-on.patch0000664000076400007640000000136211160752235016774 0ustar tglxtglxSubject: replace: bugon by warn on From: Ingo Molnar Date: Wed Feb 04 00:03:14 CET 2009 Signed-off-by: Ingo Molnar --- arch/x86/mm/highmem_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/arch/x86/mm/highmem_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/highmem_32.c +++ linux-2.6-tip/arch/x86/mm/highmem_32.c @@ -85,7 +85,7 @@ void *kmap_atomic_prot(struct page *page idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); - BUG_ON(!pte_none(*(kmap_pte-idx))); + WARN_ON_ONCE(!pte_none(*(kmap_pte-idx))); set_pte(kmap_pte-idx, mk_pte(page, prot)); arch_flush_lazy_mmu_mode(); patches/adaptive-spinlock-lite-v2.patch0000664000076400007640000001354011161723441017156 0ustar tglxtglxSubject: adaptive spinlocks lite From: Steven Rostedt After talking with Gregory Haskins about how they implemented his version of adaptive spinlocks and before I actually looked at their code, I was thinking about it while lying in bed. I always thought that adaptive spinlocks were to spin for a short period of time based off of some heuristic and then sleep. This idea is totally bogus. No heuristic can account for a bunch of different activities. But Gregory mentioned something to me that made a hell of a lot of sense. And that is to only spin while the owner is running. If the owner is running, then it would seem that it would be quicker to spin then to take the scheduling hit. While lying awake in bed, it dawned on me that we could simply spin in the fast lock and never touch the "has waiters" flag, which would keep the owner from going into the slow path. Also, the task itself is preemptible while spinning so this would not affect latencies. The only trick was to not have the owner get freed between the time you saw the owner and the time you check its run queue. This was easily solved by simply grabing the RCU read lock because freeing of a task must happen after a grace period. I first tried to stay only in the fast path. This works fine until you want to guarantee that the highest prio task gets the lock next. I tried all sorts of hackeries and found that there was too many cases where we can miss. I finally concurred with Gregory, and decided that going into the slow path was the way to go. I then started looking into what the guys over at Novell did. The had the basic idea correct, but went way overboard in the implementation, making it far more complex than it needed to be. I rewrote their work using the ideas from my original patch, and simplified it quite a bit. This is the patch that they wanted to do ;-) Special thanks goes out to Gregory Haskins, Sven Dietrich and Peter Morreale, for proving that adaptive spin locks certainly *can* make a difference. Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- include/linux/sched.h | 2 + kernel/rtmutex.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++--- kernel/sched.c | 5 +++ 3 files changed, 68 insertions(+), 3 deletions(-) Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -2568,6 +2568,8 @@ static inline void mm_init_owner(struct #define TASK_STATE_TO_CHAR_STR "RSDTtZX" +extern int task_is_current(struct task_struct *task); + #endif /* __KERNEL__ */ #endif Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -8,6 +8,12 @@ * Copyright (C) 2005 Kihon Technologies Inc., Steven Rostedt * Copyright (C) 2006 Esben Nielsen * + * Adaptive Spinlocks: + * Copyright (C) 2008 Novell, Inc., Gregory Haskins, Sven Dietrich, + * and Peter Morreale, + * Adaptive Spinlocks simplification: + * Copyright (C) 2008 Red Hat, Inc., Steven Rostedt + * * See Documentation/rt-mutex-design.txt for details. */ #include @@ -674,6 +680,54 @@ update_current(unsigned long new_state, *saved_state = TASK_RUNNING; } +#ifdef CONFIG_SMP +static int adaptive_wait(struct rt_mutex_waiter *waiter, + struct task_struct *orig_owner) +{ + int sleep = 0; + + for (;;) { + + /* we are the owner? */ + if (!waiter->task) + break; + + /* + * We need to read the owner of the lock and then check + * its state. But we can't let the owner task be freed + * while we read the state. We grab the rcu_lock and + * this makes sure that the owner task wont disappear + * between testing that it still has the lock, and checking + * its state. + */ + rcu_read_lock(); + /* Owner changed? Then lets update the original */ + if (orig_owner != rt_mutex_owner(waiter->lock)) { + rcu_read_unlock(); + break; + } + + /* Owner went to bed, so should we */ + if (!task_is_current(orig_owner)) { + sleep = 1; + rcu_read_unlock(); + break; + } + rcu_read_unlock(); + + cpu_relax(); + } + + return sleep; +} +#else +static int adaptive_wait(struct rt_mutex_waiter *waiter, + struct task_struct *orig_owner) +{ + return 1; +} +#endif + /* * Slow path lock function spin_lock style: this variant is very * careful not to miss any non-lock wakeups. @@ -689,6 +743,7 @@ rt_spin_lock_slowlock(struct rt_mutex *l { struct rt_mutex_waiter waiter; unsigned long saved_state, state, flags; + struct task_struct *orig_owner; debug_rt_mutex_init_waiter(&waiter); waiter.task = NULL; @@ -741,13 +796,16 @@ rt_spin_lock_slowlock(struct rt_mutex *l saved_flags = current->flags & PF_NOSCHED; current->lock_depth = -1; current->flags &= ~PF_NOSCHED; + orig_owner = rt_mutex_owner(lock); spin_unlock_irqrestore(&lock->wait_lock, flags); debug_rt_mutex_print_deadlock(&waiter); - update_current(TASK_UNINTERRUPTIBLE, &saved_state); - if (waiter.task) - schedule_rt_mutex(lock); + if (adaptive_wait(&waiter, orig_owner)) { + update_current(TASK_UNINTERRUPTIBLE, &saved_state); + if (waiter.task) + schedule_rt_mutex(lock); + } spin_lock_irqsave(&lock->wait_lock, flags); current->flags |= saved_flags; Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -754,6 +754,11 @@ inline void update_rq_clock(struct rq *r rq->clock = sched_clock_cpu(cpu_of(rq)); } +int task_is_current(struct task_struct *task) +{ + return task_rq(task)->curr == task; +} + /* * Tunables that become constants when CONFIG_SCHED_DEBUG is off: */ patches/adaptive-earlybreak-on-steal.patch0000664000076400007640000000302411160752235017713 0ustar tglxtglxSubject: rtmutex: break out early on first run From: Steven Rostedt Lock stealing and non cmpxchg will always go into the slow path. This patch detects the fact that we didn't go through the work of blocking and will exit early. Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- kernel/rtmutex.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -778,6 +778,7 @@ rt_spin_lock_slowlock(struct rt_mutex *l struct rt_mutex_waiter waiter; unsigned long saved_state, state, flags; struct task_struct *orig_owner; + int missed = 0; debug_rt_mutex_init_waiter(&waiter); waiter.task = NULL; @@ -803,8 +804,14 @@ rt_spin_lock_slowlock(struct rt_mutex *l int saved_lock_depth = current->lock_depth; /* Try to acquire the lock */ - if (do_try_to_take_rt_mutex(lock, STEAL_LATERAL)) + if (do_try_to_take_rt_mutex(lock, STEAL_LATERAL)) { + /* If we never blocked break out now */ + if (!missed) + goto unlock; break; + } + missed = 1; + /* * waiter.task is NULL the first time we come here and * when we have been woken up by the previous owner @@ -863,6 +870,7 @@ rt_spin_lock_slowlock(struct rt_mutex *l */ fixup_rt_mutex_waiters(lock); + unlock: spin_unlock_irqrestore(&lock->wait_lock, flags); debug_rt_mutex_free_waiter(&waiter); patches/pagefault-disable-cleanup.patch0000664000076400007640000001242711161723450017262 0ustar tglxtglxSubject: clean up the page fault disabling logic From: Ingo Molnar decouple the pagefault-disabled logic from the preempt count. Signed-off-by: Ingo Molnar --- arch/arm/mm/fault.c | 2 +- arch/mips/mm/fault.c | 2 +- arch/powerpc/mm/fault.c | 2 +- arch/x86/mm/fault.c | 2 +- include/linux/sched.h | 1 + include/linux/uaccess.h | 33 +++------------------------------ kernel/fork.c | 1 + mm/memory.c | 22 ++++++++++++++++++++++ 8 files changed, 31 insertions(+), 34 deletions(-) Index: linux-2.6-tip/arch/arm/mm/fault.c =================================================================== --- linux-2.6-tip.orig/arch/arm/mm/fault.c +++ linux-2.6-tip/arch/arm/mm/fault.c @@ -258,7 +258,7 @@ do_page_fault(unsigned long addr, unsign * If we're in an interrupt or have no user * context, we must not take the fault.. */ - if (in_atomic() || !mm) + if (in_atomic() || !mm || current->pagefault_disabled) goto no_context; /* Index: linux-2.6-tip/arch/mips/mm/fault.c =================================================================== --- linux-2.6-tip.orig/arch/mips/mm/fault.c +++ linux-2.6-tip/arch/mips/mm/fault.c @@ -69,7 +69,7 @@ asmlinkage void do_page_fault(struct pt_ * If we're in an interrupt or have no user * context, we must not take the fault.. */ - if (in_atomic() || !mm) + if (in_atomic() || !mm || current->pagefault_disabled) goto bad_area_nosemaphore; down_read(&mm->mmap_sem); Index: linux-2.6-tip/arch/powerpc/mm/fault.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/mm/fault.c +++ linux-2.6-tip/arch/powerpc/mm/fault.c @@ -159,7 +159,7 @@ int __kprobes do_page_fault(struct pt_re } #endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/ - if (in_atomic() || mm == NULL) { + if (in_atomic() || mm == NULL || current->pagefault_disabled) { if (!user_mode(regs)) return SIGSEGV; /* in_atomic() in user mode is really bad, Index: linux-2.6-tip/arch/x86/mm/fault.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/fault.c +++ linux-2.6-tip/arch/x86/mm/fault.c @@ -1064,7 +1064,7 @@ do_page_fault(struct pt_regs *regs, unsi * If we're in an interrupt, have no user context or are running * in an atomic region then we must not take the fault: */ - if (unlikely(in_atomic() || !mm)) { + if (unlikely(in_atomic() || !mm || current->pagefault_disabled)) { bad_area_nosemaphore(regs, error_code, address); return; } Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -1381,6 +1381,7 @@ struct task_struct { /* mutex deadlock detection */ struct mutex_waiter *blocked_on; #endif + int pagefault_disabled; #ifdef CONFIG_TRACE_IRQFLAGS unsigned int irq_events; int hardirqs_enabled; Index: linux-2.6-tip/include/linux/uaccess.h =================================================================== --- linux-2.6-tip.orig/include/linux/uaccess.h +++ linux-2.6-tip/include/linux/uaccess.h @@ -6,37 +6,10 @@ /* * These routines enable/disable the pagefault handler in that - * it will not take any locks and go straight to the fixup table. - * - * They have great resemblance to the preempt_disable/enable calls - * and in fact they are identical; this is because currently there is - * no other way to make the pagefault handlers do this. So we do - * disable preemption but we don't necessarily care about that. + * it will not take any MM locks and go straight to the fixup table. */ -static inline void pagefault_disable(void) -{ - inc_preempt_count(); - /* - * make sure to have issued the store before a pagefault - * can hit. - */ - barrier(); -} - -static inline void pagefault_enable(void) -{ - /* - * make sure to issue those last loads/stores before enabling - * the pagefault handler again. - */ - barrier(); - dec_preempt_count(); - /* - * make sure we do.. - */ - barrier(); - preempt_check_resched(); -} +extern void pagefault_disable(void); +extern void pagefault_enable(void); #ifndef ARCH_HAS_NOCACHE_UACCESS Index: linux-2.6-tip/kernel/fork.c =================================================================== --- linux-2.6-tip.orig/kernel/fork.c +++ linux-2.6-tip/kernel/fork.c @@ -1125,6 +1125,7 @@ static struct task_struct *copy_process( p->hardirq_context = 0; p->softirq_context = 0; #endif + p->pagefault_disabled = 0; #ifdef CONFIG_LOCKDEP p->lockdep_depth = 0; /* no locks held yet */ p->curr_chain_key = 0; Index: linux-2.6-tip/mm/memory.c =================================================================== --- linux-2.6-tip.orig/mm/memory.c +++ linux-2.6-tip/mm/memory.c @@ -2845,6 +2845,28 @@ unlock: return 0; } +void pagefault_disable(void) +{ + current->pagefault_disabled++; + /* + * make sure to have issued the store before a pagefault + * can hit. + */ + barrier(); +} +EXPORT_SYMBOL(pagefault_disable); + +void pagefault_enable(void) +{ + /* + * make sure to issue those last loads/stores before enabling + * the pagefault handler again. + */ + barrier(); + current->pagefault_disabled--; +} +EXPORT_SYMBOL(pagefault_enable); + /* * By the time we get here, we already hold the mm semaphore */ patches/revert-sched-changes.patch0000664000076400007640000000327411161723476016275 0ustar tglxtglxSubject: revert-sched-changes.patch From: Thomas Gleixner Date: Sat, 14 Mar 2009 11:22:29 +0100 Signed-off-by: Thomas Gleixner --- kernel/mutex.c | 4 +--- kernel/sched.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) Index: linux-2.6-tip/kernel/mutex.c =================================================================== --- linux-2.6-tip.orig/kernel/mutex.c +++ linux-2.6-tip/kernel/mutex.c @@ -248,9 +248,7 @@ __mutex_lock_common(struct mutex *lock, /* didnt get the lock, go to sleep: */ spin_unlock_mutex(&lock->wait_lock, flags); - preempt_enable_no_resched(); - schedule(); - preempt_disable(); + __schedule(); spin_lock_mutex(&lock->wait_lock, flags); } Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -4759,15 +4759,13 @@ pick_next_task(struct rq *rq) /* * schedule() is the main scheduler function. */ -asmlinkage void __sched schedule(void) +asmlinkage void __sched __schedule(void) { struct task_struct *prev, *next; unsigned long *switch_count; struct rq *rq; int cpu; -need_resched: - preempt_disable(); cpu = smp_processor_id(); rq = cpu_rq(cpu); rcu_qsctr_inc(cpu); @@ -4825,9 +4823,15 @@ need_resched_nonpreemptible: if (unlikely(reacquire_kernel_lock(current) < 0)) goto need_resched_nonpreemptible; +} +asmlinkage void __sched schedule(void) +{ +need_resched: + preempt_disable(); + __schedule(); preempt_enable_no_resched(); - if (need_resched()) + if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) goto need_resched; } EXPORT_SYMBOL(schedule); patches/preempt-realtime-btrfs-locking-workaround.patch0000664000076400007640000000172611160752235022475 0ustar tglxtglxSubject: rt: btrfs locking fix/workaround From: Ingo Molnar Date: Sun Feb 08 16:59:53 CET 2009 - btrfs_path_lock_waiting() looks rather dubious and there's no spin_is_contended() method on PREEMPT_RT - so exclude this for now => needs a proper fix later. Either this code gets zapped from btrfs upstream, or we add spin_is_contended() to PREEMPT_RT too. Signed-off-by: Ingo Molnar --- fs/btrfs/locking.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6-tip/fs/btrfs/locking.c =================================================================== --- linux-2.6-tip.orig/fs/btrfs/locking.c +++ linux-2.6-tip/fs/btrfs/locking.c @@ -93,6 +93,7 @@ static int btrfs_spin_on_block(struct ex */ int btrfs_try_spin_lock(struct extent_buffer *eb) { +#ifndef CONFIG_PREEMPT_RT int i; spin_nested(eb); @@ -110,6 +111,7 @@ int btrfs_try_spin_lock(struct extent_bu return 1; spin_unlock(&eb->lock); } +#endif return 0; } patches/highmem-revert-mainline.patch0000664000076400007640000000147011160752235016777 0ustar tglxtglxSubject: highmem: revert mainline From: Ingo Molnar Date: Wed Feb 04 00:02:35 CET 2009 Signed-off-by: Ingo Molnar --- mm/highmem.c | 10 ---------- 1 file changed, 10 deletions(-) Index: linux-2.6-tip/mm/highmem.c =================================================================== --- linux-2.6-tip.orig/mm/highmem.c +++ linux-2.6-tip/mm/highmem.c @@ -108,16 +108,6 @@ static void flush_all_zero_pkmaps(void) flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP)); } -/** - * kmap_flush_unused - flush all unused kmap mappings in order to remove stray mappings - */ -void kmap_flush_unused(void) -{ - spin_lock(&kmap_lock); - flush_all_zero_pkmaps(); - spin_unlock(&kmap_lock); -} - static inline unsigned long map_new_virtual(struct page *page) { unsigned long vaddr; patches/percpu-locked-mm.patch0000664000076400007640000002056111160752235015430 0ustar tglxtglxSubject: patches/percpu-locked-mm.patch Signed-off-by: Ingo Molnar --- arch/x86/mm/init_32.c | 2 - arch/x86/mm/init_64.c | 2 - include/asm-generic/percpu.h | 18 ++++++++++ include/asm-generic/tlb.h | 9 +++-- mm/swap.c | 72 ++++++++++++++++++++++++++++++++++--------- 5 files changed, 82 insertions(+), 21 deletions(-) Index: linux-2.6-tip/arch/x86/mm/init_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/init_32.c +++ linux-2.6-tip/arch/x86/mm/init_32.c @@ -54,7 +54,7 @@ unsigned long max_low_pfn_mapped; unsigned long max_pfn_mapped; -DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); +DEFINE_PER_CPU_LOCKED(struct mmu_gather, mmu_gathers); unsigned long highstart_pfn, highend_pfn; static noinline int do_test_wp_bit(void); Index: linux-2.6-tip/arch/x86/mm/init_64.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/init_64.c +++ linux-2.6-tip/arch/x86/mm/init_64.c @@ -60,7 +60,7 @@ unsigned long max_pfn_mapped; static unsigned long dma_reserve __initdata; -DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); +DEFINE_PER_CPU_LOCKED(struct mmu_gather, mmu_gathers); static int __init parse_direct_gbpages_off(char *arg) { Index: linux-2.6-tip/include/asm-generic/percpu.h =================================================================== --- linux-2.6-tip.orig/include/asm-generic/percpu.h +++ linux-2.6-tip/include/asm-generic/percpu.h @@ -9,6 +9,9 @@ */ #define per_cpu_var(var) per_cpu__##var +#define __per_cpu_var_lock(var) per_cpu__lock_##var##_locked +#define __per_cpu_var_lock_var(var) per_cpu__##var##_locked + #ifdef CONFIG_SMP /* @@ -60,6 +63,14 @@ extern unsigned long __per_cpu_offset[NR #define __raw_get_cpu_var(var) \ (*SHIFT_PERCPU_PTR(&per_cpu_var(var), __my_cpu_offset)) +#define per_cpu_lock(var, cpu) \ + (*SHIFT_PERCPU_PTR(&__per_cpu_var_lock(var), per_cpu_offset(cpu))) +#define per_cpu_var_locked(var, cpu) \ + (*SHIFT_PERCPU_PTR(&__per_cpu_var_lock_var(var), per_cpu_offset(cpu))) +#define __get_cpu_lock(var, cpu) \ + per_cpu_lock(var, cpu) +#define __get_cpu_var_locked(var, cpu) \ + per_cpu_var_locked(var, cpu) #ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA extern void setup_per_cpu_areas(void); @@ -68,9 +79,11 @@ extern void setup_per_cpu_areas(void); #else /* ! SMP */ #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu_var(var))) +#define per_cpu_var_locked(var, cpu) (*((void)(cpu), &__per_cpu_var_lock_var(var))) #define __get_cpu_var(var) per_cpu_var(var) #define __raw_get_cpu_var(var) per_cpu_var(var) - +#define __get_cpu_lock(var, cpu) __per_cpu_var_lock(var) +#define __get_cpu_var_locked(var, cpu) __per_cpu_var_lock_var(var) #endif /* SMP */ #ifndef PER_CPU_ATTRIBUTES @@ -79,6 +92,9 @@ extern void setup_per_cpu_areas(void); #define DECLARE_PER_CPU(type, name) extern PER_CPU_ATTRIBUTES \ __typeof__(type) per_cpu_var(name) +#define DECLARE_PER_CPU_LOCKED(type, name) \ + extern PER_CPU_ATTRIBUTES spinlock_t __per_cpu_var_lock(name); \ + extern PER_CPU_ATTRIBUTES __typeof__(type) __per_cpu_var_lock_var(name) /* * Optional methods for optimized non-lvalue per-cpu variable access. Index: linux-2.6-tip/include/asm-generic/tlb.h =================================================================== --- linux-2.6-tip.orig/include/asm-generic/tlb.h +++ linux-2.6-tip/include/asm-generic/tlb.h @@ -41,11 +41,12 @@ struct mmu_gather { unsigned int nr; /* set to ~0U means fast mode */ unsigned int need_flush;/* Really unmapped some ptes? */ unsigned int fullmm; /* non-zero means full mm flush */ + int cpu; struct page * pages[FREE_PTE_NR]; }; /* Users of the generic TLB shootdown code must declare this storage space. */ -DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); +DECLARE_PER_CPU_LOCKED(struct mmu_gather, mmu_gathers); /* tlb_gather_mmu * Return a pointer to an initialized struct mmu_gather. @@ -53,8 +54,10 @@ DECLARE_PER_CPU(struct mmu_gather, mmu_g static inline struct mmu_gather * tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) { - struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); + int cpu; + struct mmu_gather *tlb = &get_cpu_var_locked(mmu_gathers, &cpu); + tlb->cpu = cpu; tlb->mm = mm; /* Use fast mode if only one CPU is online */ @@ -90,7 +93,7 @@ tlb_finish_mmu(struct mmu_gather *tlb, u /* keep the page table cache within bounds */ check_pgt_cache(); - put_cpu_var(mmu_gathers); + put_cpu_var_locked(mmu_gathers, tlb->cpu); } /* tlb_remove_page Index: linux-2.6-tip/mm/swap.c =================================================================== --- linux-2.6-tip.orig/mm/swap.c +++ linux-2.6-tip/mm/swap.c @@ -30,14 +30,49 @@ #include #include #include +#include #include "internal.h" /* How many pages do we try to swap or page in/out together? */ int page_cluster; -static DEFINE_PER_CPU(struct pagevec[NR_LRU_LISTS], lru_add_pvecs); -static DEFINE_PER_CPU(struct pagevec, lru_rotate_pvecs); +/* + * On PREEMPT_RT we don't want to disable preemption for cpu variables. + * We grab a cpu and then use that cpu to lock the variables accordingly. + * + * (On !PREEMPT_RT this turns into normal preempt-off sections, as before.) + */ +static DEFINE_PER_CPU_LOCKED(struct pagevec[NR_LRU_LISTS], lru_add_pvecs); +static DEFINE_PER_CPU_LOCKED(struct pagevec, lru_rotate_pvecs); + +#define swap_get_cpu_var_irq_save(var, flags, cpu) \ + ({ \ + (void)flags; \ + &get_cpu_var_locked(var, &cpu); \ + }) + +#define swap_put_cpu_var_irq_restore(var, flags, cpu) \ + put_cpu_var_locked(var, cpu) + +#define swap_get_cpu_var(var, cpu) \ + &get_cpu_var_locked(var, &cpu) + +#define swap_put_cpu_var(var, cpu) \ + put_cpu_var_locked(var, cpu) + +#define swap_per_cpu_lock(var, cpu) \ + ({ \ + spin_lock(&__get_cpu_lock(var, cpu)); \ + &__get_cpu_var_locked(var, cpu); \ + }) + +#define swap_per_cpu_unlock(var, cpu) \ + spin_unlock(&__get_cpu_lock(var, cpu)); + +#define swap_get_cpu() raw_smp_processor_id() + +#define swap_put_cpu() /* * This path almost never happens for VM activity - pages are normally @@ -141,13 +176,13 @@ void rotate_reclaimable_page(struct pag !PageUnevictable(page) && PageLRU(page)) { struct pagevec *pvec; unsigned long flags; + int cpu; page_cache_get(page); - local_irq_save(flags); - pvec = &__get_cpu_var(lru_rotate_pvecs); + pvec = swap_get_cpu_var_irq_save(lru_rotate_pvecs, flags, cpu); if (!pagevec_add(pvec, page)) pagevec_move_tail(pvec); - local_irq_restore(flags); + swap_put_cpu_var_irq_restore(lru_rotate_pvecs, flags, cpu); } } @@ -216,12 +251,14 @@ EXPORT_SYMBOL(mark_page_accessed); void __lru_cache_add(struct page *page, enum lru_list lru) { - struct pagevec *pvec = &get_cpu_var(lru_add_pvecs)[lru]; + struct pagevec *pvec; + int cpu; + pvec = swap_get_cpu_var(lru_add_pvecs, cpu)[lru]; page_cache_get(page); if (!pagevec_add(pvec, page)) ____pagevec_lru_add(pvec, lru); - put_cpu_var(lru_add_pvecs); + swap_put_cpu_var(lru_add_pvecs, cpu); } /** @@ -271,31 +308,36 @@ void add_page_to_unevictable_list(struct */ static void drain_cpu_pagevecs(int cpu) { - struct pagevec *pvecs = per_cpu(lru_add_pvecs, cpu); - struct pagevec *pvec; + struct pagevec *pvecs, *pvec; int lru; + pvecs = swap_per_cpu_lock(lru_add_pvecs, cpu)[0]; for_each_lru(lru) { pvec = &pvecs[lru - LRU_BASE]; if (pagevec_count(pvec)) ____pagevec_lru_add(pvec, lru); } + swap_per_cpu_unlock(lru_add_pvecs, cpu); - pvec = &per_cpu(lru_rotate_pvecs, cpu); + pvec = swap_per_cpu_lock(lru_rotate_pvecs, cpu); if (pagevec_count(pvec)) { unsigned long flags; /* No harm done if a racing interrupt already did this */ - local_irq_save(flags); + local_irq_save_nort(flags); pagevec_move_tail(pvec); - local_irq_restore(flags); + local_irq_restore_nort(flags); } + swap_per_cpu_unlock(lru_rotate_pvecs, cpu); } void lru_add_drain(void) { - drain_cpu_pagevecs(get_cpu()); - put_cpu(); + int cpu; + + cpu = swap_get_cpu(); + drain_cpu_pagevecs(cpu); + swap_put_cpu(); } static void lru_add_drain_per_cpu(struct work_struct *dummy) @@ -369,7 +411,7 @@ void release_pages(struct page **pages, } __pagevec_free(&pages_to_free); pagevec_reinit(&pages_to_free); - } + } } if (zone) spin_unlock_irqrestore(&zone->lru_lock, flags); patches/preempt-realtime-console.patch0000664000076400007640000000371411160752235017201 0ustar tglxtglxSubject: preempt: realtime console From: Ingo Molnar Date: Wed Feb 04 00:02:51 CET 2009 Signed-off-by: Ingo Molnar --- drivers/video/console/fbcon.c | 5 +++-- include/linux/console.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) Index: linux-2.6-tip/drivers/video/console/fbcon.c =================================================================== --- linux-2.6-tip.orig/drivers/video/console/fbcon.c +++ linux-2.6-tip/drivers/video/console/fbcon.c @@ -1203,7 +1203,6 @@ static void fbcon_clear(struct vc_data * { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; u_int y_break; @@ -1235,10 +1234,11 @@ static void fbcon_putcs(struct vc_data * struct display *p = &fb_display[vc->vc_num]; struct fbcon_ops *ops = info->fbcon_par; - if (!fbcon_is_inactive(vc, info)) + if (!fbcon_is_inactive(vc, info)) { ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, get_color(vc, info, scr_readw(s), 1), get_color(vc, info, scr_readw(s), 0)); + } } static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) @@ -3221,6 +3221,7 @@ static const struct consw fb_con = { .con_screen_pos = fbcon_screen_pos, .con_getxy = fbcon_getxy, .con_resize = fbcon_resize, + .con_preemptible = 1, }; static struct notifier_block fbcon_event_notifier = { Index: linux-2.6-tip/include/linux/console.h =================================================================== --- linux-2.6-tip.orig/include/linux/console.h +++ linux-2.6-tip/include/linux/console.h @@ -55,6 +55,7 @@ struct consw { void (*con_invert_region)(struct vc_data *, u16 *, int); u16 *(*con_screen_pos)(struct vc_data *, int); unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *); + int con_preemptible; // can it reschedule from within printk? }; extern const struct consw *conswitchp; patches/cpuhotplug-vs-slab.patch0000664000076400007640000002363411160752235016027 0ustar tglxtglxSubject: cpu-hotplug: vs slab From: Peter Zijlstra Date: Tue, 10 Jun 2008 13:13:00 +0200 Fix up the slab allocator to be cpu-hotplug safe (again, pure -rt regression). On -rt we protect per-cpu state by locks instead of disabling preemption/irqs. This keeps all the code preemptible at the cost of possible remote memory access. The race was that cpu-hotplug - which assumes to be cpu local and non- preemptible, didn't take the per-cpu lock. This also means that the normal lock acquire needs to be aware of cpus getting off-lined while its waiting. Clean up some of the macro mess while we're there. Signed-off-by: Peter Zijlstra --- mm/slab.c | 143 ++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 98 insertions(+), 45 deletions(-) Index: linux-2.6-tip/mm/slab.c =================================================================== --- linux-2.6-tip.orig/mm/slab.c +++ linux-2.6-tip/mm/slab.c @@ -129,43 +129,99 @@ * the CPU number of the lock there. */ #ifndef CONFIG_PREEMPT_RT + # define slab_irq_disable(cpu) \ do { local_irq_disable(); (cpu) = smp_processor_id(); } while (0) # define slab_irq_enable(cpu) local_irq_enable() + +static inline void slab_irq_disable_this_rt(int cpu) +{ +} + +static inline void slab_irq_enable_rt(int cpu) +{ +} + # define slab_irq_save(flags, cpu) \ do { local_irq_save(flags); (cpu) = smp_processor_id(); } while (0) # define slab_irq_restore(flags, cpu) local_irq_restore(flags) + /* * In the __GFP_WAIT case we enable/disable interrupts on !PREEMPT_RT, * which has no per-CPU locking effect since we are holding the cache * lock in that case already. - * - * (On PREEMPT_RT, these are NOPs, but we have to drop/get the irq locks.) */ -# define slab_irq_disable_nort(cpu) slab_irq_disable(cpu) -# define slab_irq_enable_nort(cpu) slab_irq_enable(cpu) -# define slab_irq_disable_rt(flags) do { (void)(flags); } while (0) -# define slab_irq_enable_rt(flags) do { (void)(flags); } while (0) +static void slab_irq_enable_GFP_WAIT(gfp_t flags, int *cpu) +{ + if (flags & __GFP_WAIT) + local_irq_enable(); +} + +static void slab_irq_disable_GFP_WAIT(gfp_t flags, int *cpu) +{ + if (flags & __GFP_WAIT) + local_irq_disable(); +} + # define slab_spin_lock_irq(lock, cpu) \ do { spin_lock_irq(lock); (cpu) = smp_processor_id(); } while (0) -# define slab_spin_unlock_irq(lock, cpu) \ - spin_unlock_irq(lock) +# define slab_spin_unlock_irq(lock, cpu) spin_unlock_irq(lock) + # define slab_spin_lock_irqsave(lock, flags, cpu) \ do { spin_lock_irqsave(lock, flags); (cpu) = smp_processor_id(); } while (0) # define slab_spin_unlock_irqrestore(lock, flags, cpu) \ do { spin_unlock_irqrestore(lock, flags); } while (0) -#else + +#else /* CONFIG_PREEMPT_RT */ + +/* + * Instead of serializing the per-cpu state by disabling interrupts we do so + * by a lock. This keeps the code preemptable - albeit at the cost of remote + * memory access when the task does get migrated away. + */ DEFINE_PER_CPU_LOCKED(int, slab_irq_locks) = { 0, }; -# define slab_irq_disable(cpu) (void)get_cpu_var_locked(slab_irq_locks, &(cpu)) -# define slab_irq_enable(cpu) put_cpu_var_locked(slab_irq_locks, cpu) + +static void _slab_irq_disable(int *cpu) +{ + get_cpu_var_locked(slab_irq_locks, cpu); +} + +#define slab_irq_disable(cpu) _slab_irq_disable(&(cpu)) + +static inline void slab_irq_enable(int cpu) +{ + put_cpu_var_locked(slab_irq_locks, cpu); +} + +static inline void slab_irq_disable_this_rt(int cpu) +{ + spin_lock(&__get_cpu_lock(slab_irq_locks, cpu)); +} + +static inline void slab_irq_enable_rt(int cpu) +{ + spin_unlock(&__get_cpu_lock(slab_irq_locks, cpu)); +} + # define slab_irq_save(flags, cpu) \ do { slab_irq_disable(cpu); (void) (flags); } while (0) # define slab_irq_restore(flags, cpu) \ do { slab_irq_enable(cpu); (void) (flags); } while (0) -# define slab_irq_disable_rt(cpu) slab_irq_disable(cpu) -# define slab_irq_enable_rt(cpu) slab_irq_enable(cpu) -# define slab_irq_disable_nort(cpu) do { } while (0) -# define slab_irq_enable_nort(cpu) do { } while (0) + +/* + * On PREEMPT_RT we have to drop the locks unconditionally to avoid lock + * recursion on the cache_grow()->alloc_slabmgmt() path. + */ +static void slab_irq_enable_GFP_WAIT(gfp_t flags, int *cpu) +{ + slab_irq_enable(*cpu); +} + +static void slab_irq_disable_GFP_WAIT(gfp_t flags, int *cpu) +{ + slab_irq_disable(*cpu); +} + # define slab_spin_lock_irq(lock, cpu) \ do { slab_irq_disable(cpu); spin_lock(lock); } while (0) # define slab_spin_unlock_irq(lock, cpu) \ @@ -174,7 +230,8 @@ DEFINE_PER_CPU_LOCKED(int, slab_irq_lock do { slab_irq_disable(cpu); spin_lock_irqsave(lock, flags); } while (0) # define slab_spin_unlock_irqrestore(lock, flags, cpu) \ do { spin_unlock_irqrestore(lock, flags); slab_irq_enable(cpu); } while (0) -#endif + +#endif /* CONFIG_PREEMPT_RT */ /* * DEBUG - 1 for kmem_cache_create() to honour; SLAB_RED_ZONE & SLAB_POISON. @@ -1149,7 +1206,7 @@ cache_free_alien(struct kmem_cache *cach } #endif -static void __cpuinit cpuup_canceled(long cpu) +static void __cpuinit cpuup_canceled(int cpu) { struct kmem_cache *cachep; struct kmem_list3 *l3 = NULL; @@ -1160,7 +1217,7 @@ static void __cpuinit cpuup_canceled(lon struct array_cache *nc; struct array_cache *shared; struct array_cache **alien; - int this_cpu; + int orig_cpu = cpu; /* cpu is dead; no one can alloc from it. */ nc = cachep->array[cpu]; @@ -1170,31 +1227,30 @@ static void __cpuinit cpuup_canceled(lon if (!l3) goto free_array_cache; - slab_spin_lock_irq(&l3->list_lock, this_cpu); + spin_lock_irq(&l3->list_lock); /* Free limit for this kmem_list3 */ l3->free_limit -= cachep->batchcount; if (nc) free_block(cachep, nc->entry, nc->avail, node, - &this_cpu); + &cpu); if (!cpus_empty(*mask)) { - slab_spin_unlock_irq(&l3->list_lock, - this_cpu); + spin_unlock_irq(&l3->list_lock); goto free_array_cache; } shared = l3->shared; if (shared) { free_block(cachep, shared->entry, - shared->avail, node, &this_cpu); + shared->avail, node, &cpu); l3->shared = NULL; } alien = l3->alien; l3->alien = NULL; - slab_spin_unlock_irq(&l3->list_lock, this_cpu); + spin_unlock_irq(&l3->list_lock); kfree(shared); if (alien) { @@ -1203,6 +1259,7 @@ static void __cpuinit cpuup_canceled(lon } free_array_cache: kfree(nc); + BUG_ON(cpu != orig_cpu); } /* * In the previous loop, all the objects were freed to @@ -1217,13 +1274,12 @@ free_array_cache: } } -static int __cpuinit cpuup_prepare(long cpu) +static int __cpuinit cpuup_prepare(int cpu) { struct kmem_cache *cachep; struct kmem_list3 *l3 = NULL; int node = cpu_to_node(cpu); const int memsize = sizeof(struct kmem_list3); - int this_cpu; /* * We need to do this right in the beginning since @@ -1254,11 +1310,11 @@ static int __cpuinit cpuup_prepare(long cachep->nodelists[node] = l3; } - slab_spin_lock_irq(&cachep->nodelists[node]->list_lock, this_cpu); + spin_lock_irq(&cachep->nodelists[node]->list_lock); cachep->nodelists[node]->free_limit = (1 + nr_cpus_node(node)) * cachep->batchcount + cachep->num; - slab_spin_unlock_irq(&cachep->nodelists[node]->list_lock, this_cpu); + spin_unlock_irq(&cachep->nodelists[node]->list_lock); } /* @@ -1295,7 +1351,7 @@ static int __cpuinit cpuup_prepare(long l3 = cachep->nodelists[node]; BUG_ON(!l3); - slab_spin_lock_irq(&l3->list_lock, this_cpu); + spin_lock_irq(&l3->list_lock); if (!l3->shared) { /* * We are serialised from CPU_DEAD or @@ -1310,7 +1366,7 @@ static int __cpuinit cpuup_prepare(long alien = NULL; } #endif - slab_spin_unlock_irq(&l3->list_lock, this_cpu); + spin_unlock_irq(&l3->list_lock); kfree(shared); free_alien_cache(alien); } @@ -1326,11 +1382,14 @@ static int __cpuinit cpuup_callback(stru long cpu = (long)hcpu; int err = 0; + switch (action) { case CPU_UP_PREPARE: case CPU_UP_PREPARE_FROZEN: mutex_lock(&cache_chain_mutex); + slab_irq_disable_this_rt(cpu); err = cpuup_prepare(cpu); + slab_irq_enable_rt(cpu); mutex_unlock(&cache_chain_mutex); break; case CPU_ONLINE: @@ -1369,10 +1428,14 @@ static int __cpuinit cpuup_callback(stru case CPU_UP_CANCELED: case CPU_UP_CANCELED_FROZEN: mutex_lock(&cache_chain_mutex); + slab_irq_disable_this_rt(cpu); cpuup_canceled(cpu); + slab_irq_enable_rt(cpu); mutex_unlock(&cache_chain_mutex); break; } + + return err ? NOTIFY_BAD : NOTIFY_OK; } @@ -2834,9 +2897,7 @@ static int cache_grow(struct kmem_cache offset *= cachep->colour_off; - if (local_flags & __GFP_WAIT) - slab_irq_enable_nort(*this_cpu); - slab_irq_enable_rt(*this_cpu); + slab_irq_enable_GFP_WAIT(local_flags, this_cpu); /* * The test for missing atomic flag is performed here, rather than @@ -2865,9 +2926,7 @@ static int cache_grow(struct kmem_cache cache_init_objs(cachep, slabp); - slab_irq_disable_rt(*this_cpu); - if (local_flags & __GFP_WAIT) - slab_irq_disable_nort(*this_cpu); + slab_irq_disable_GFP_WAIT(local_flags, this_cpu); check_irq_off(); spin_lock(&l3->list_lock); @@ -2881,9 +2940,7 @@ static int cache_grow(struct kmem_cache opps1: kmem_freepages(cachep, objp); failed: - slab_irq_disable_rt(*this_cpu); - if (local_flags & __GFP_WAIT) - slab_irq_disable_nort(*this_cpu); + slab_irq_disable_GFP_WAIT(local_flags, this_cpu); return 0; } @@ -3268,16 +3325,12 @@ retry: * We may trigger various forms of reclaim on the allowed * set and go into memory reserves if necessary. */ - if (local_flags & __GFP_WAIT) - slab_irq_enable_nort(*this_cpu); - slab_irq_enable_rt(*this_cpu); + slab_irq_enable_GFP_WAIT(local_flags, this_cpu); kmem_flagcheck(cache, flags); obj = kmem_getpages(cache, local_flags, -1); - slab_irq_disable_rt(*this_cpu); - if (local_flags & __GFP_WAIT) - slab_irq_disable_nort(*this_cpu); + slab_irq_disable_GFP_WAIT(local_flags, this_cpu); if (obj) { /* patches/highmem_rewrite.patch0000664000076400007640000004044711160752235015450 0ustar tglxtglxSubject: mm: remove kmap_lock Eradicate global locks. - kmap_lock is removed by extensive use of atomic_t and a new flush scheme. - pool_lock is removed by using the pkmap index for the page_address_maps and modifying set_page_address to only allow NULL<->virt transitions. Signed-off-by: Peter Zijlstra Signed-off-by: Ingo Molnar --- include/linux/mm.h | 32 ++- mm/highmem.c | 447 +++++++++++++++++++++++++++++------------------------ 2 files changed, 276 insertions(+), 203 deletions(-) Index: linux-2.6-tip/include/linux/mm.h =================================================================== --- linux-2.6-tip.orig/include/linux/mm.h +++ linux-2.6-tip/include/linux/mm.h @@ -603,23 +603,39 @@ static __always_inline void *lowmem_page #endif #if defined(WANT_PAGE_VIRTUAL) -#define page_address(page) ((page)->virtual) -#define set_page_address(page, address) \ - do { \ - (page)->virtual = (address); \ - } while(0) -#define page_address_init() do { } while(0) +/* + * wrap page->virtual so it is safe to set/read locklessly + */ +#define page_address(page) \ + ({ typeof((page)->virtual) v = (page)->virtual; \ + smp_read_barrier_depends(); \ + v; }) + +static inline int set_page_address(struct page *page, void *address) +{ + if (address) + return cmpxchg(&page->virtual, NULL, address) == NULL; + else { + /* + * cmpxchg is a bit abused because it is not guaranteed + * safe wrt direct assignment on all platforms. + */ + void *virt = page->virtual; + return cmpxchg(&page->vitrual, virt, NULL) == virt; + } +} +void page_address_init(void); #endif #if defined(HASHED_PAGE_VIRTUAL) void *page_address(struct page *page); -void set_page_address(struct page *page, void *virtual); +int set_page_address(struct page *page, void *virtual); void page_address_init(void); #endif #if !defined(HASHED_PAGE_VIRTUAL) && !defined(WANT_PAGE_VIRTUAL) #define page_address(page) lowmem_page_address(page) -#define set_page_address(page, address) do { } while(0) +#define set_page_address(page, address) (0) #define page_address_init() do { } while(0) #endif Index: linux-2.6-tip/mm/highmem.c =================================================================== --- linux-2.6-tip.orig/mm/highmem.c +++ linux-2.6-tip/mm/highmem.c @@ -14,6 +14,11 @@ * based on Linus' idea. * * Copyright (C) 1999 Ingo Molnar + * + * Largely rewritten to get rid of all global locks + * + * Copyright (C) 2006 Red Hat, Inc., Peter Zijlstra + * */ #include @@ -27,18 +32,14 @@ #include #include #include + #include +#include -/* - * Virtual_count is not a pure "count". - * 0 means that it is not mapped, and has not been mapped - * since a TLB flush - it is usable. - * 1 means that there are no users, but it has been mapped - * since the last TLB flush - so we can't use it. - * n means that there are (n-1) current users of it. - */ #ifdef CONFIG_HIGHMEM +static int __set_page_address(struct page *page, void *virtual, int pos); + unsigned long totalhigh_pages __read_mostly; EXPORT_SYMBOL(totalhigh_pages); @@ -59,174 +60,203 @@ unsigned int nr_free_highpages (void) return pages; } -static int pkmap_count[LAST_PKMAP]; -static unsigned int last_pkmap_nr; -static __cacheline_aligned_in_smp DEFINE_SPINLOCK(kmap_lock); +/* + * count is not a pure "count". + * 0 means its owned exclusively by someone + * 1 means its free for use - either mapped or not. + * n means that there are (n-1) current users of it. + */ +static atomic_t pkmap_count[LAST_PKMAP]; +static atomic_t pkmap_hand; pte_t * pkmap_page_table; static DECLARE_WAIT_QUEUE_HEAD(pkmap_map_wait); - -static void flush_all_zero_pkmaps(void) +/* + * Try to free a given kmap slot. + * + * Returns: + * -1 - in use + * 0 - free, no TLB flush needed + * 1 - free, needs TLB flush + */ +static int pkmap_try_free(int pos) { - int i; - int need_flush = 0; - - flush_cache_kmaps(); + if (atomic_cmpxchg(&pkmap_count[pos], 1, 0) != 1) + return -1; - for (i = 0; i < LAST_PKMAP; i++) { - struct page *page; + /* + * TODO: add a young bit to make it CLOCK + */ + if (!pte_none(pkmap_page_table[pos])) { + struct page *page = pte_page(pkmap_page_table[pos]); + unsigned long addr = PKMAP_ADDR(pos); + pte_t *ptep = &pkmap_page_table[pos]; + + VM_BUG_ON(addr != (unsigned long)page_address(page)); + + if (!__set_page_address(page, NULL, pos)) + BUG(); + flush_kernel_dcache_page(page); + pte_clear(&init_mm, addr, ptep); - /* - * zero means we don't have anything to do, - * >1 means that it is still in use. Only - * a count of 1 means that it is free but - * needs to be unmapped - */ - if (pkmap_count[i] != 1) - continue; - pkmap_count[i] = 0; + return 1; + } - /* sanity check */ - BUG_ON(pte_none(pkmap_page_table[i])); + return 0; +} - /* - * Don't need an atomic fetch-and-clear op here; - * no-one has the page mapped, and cannot get at - * its virtual address (and hence PTE) without first - * getting the kmap_lock (which is held here). - * So no dangers, even with speculative execution. - */ - page = pte_page(pkmap_page_table[i]); - pte_clear(&init_mm, (unsigned long)page_address(page), - &pkmap_page_table[i]); +static inline void pkmap_put(atomic_t *counter) +{ + switch (atomic_dec_return(counter)) { + case 0: + BUG(); - set_page_address(page, NULL); - need_flush = 1; + case 1: + wake_up(&pkmap_map_wait); } - if (need_flush) - flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP)); } -static inline unsigned long map_new_virtual(struct page *page) +#define TLB_BATCH 32 + +static int pkmap_get_free(void) { - unsigned long vaddr; - int count; + int i, pos, flush; + DECLARE_WAITQUEUE(wait, current); -start: - count = LAST_PKMAP; - /* Find an empty entry */ - for (;;) { - last_pkmap_nr = (last_pkmap_nr + 1) & LAST_PKMAP_MASK; - if (!last_pkmap_nr) { - flush_all_zero_pkmaps(); - count = LAST_PKMAP; - } - if (!pkmap_count[last_pkmap_nr]) - break; /* Found a usable entry */ - if (--count) - continue; +restart: + for (i = 0; i < LAST_PKMAP; i++) { + pos = atomic_inc_return(&pkmap_hand) % LAST_PKMAP; + flush = pkmap_try_free(pos); + if (flush >= 0) + goto got_one; + } + + /* + * wait for somebody else to unmap their entries + */ + __set_current_state(TASK_UNINTERRUPTIBLE); + add_wait_queue(&pkmap_map_wait, &wait); + schedule(); + remove_wait_queue(&pkmap_map_wait, &wait); + + goto restart; + +got_one: + if (flush) { +#if 0 + flush_tlb_kernel_range(PKMAP_ADDR(pos), PKMAP_ADDR(pos+1)); +#else + int pos2 = (pos + 1) % LAST_PKMAP; + int nr; + int entries[TLB_BATCH]; /* - * Sleep for somebody else to unmap their entries + * For those architectures that cannot help but flush the + * whole TLB, flush some more entries to make it worthwhile. + * Scan ahead of the hand to minimise search distances. */ - { - DECLARE_WAITQUEUE(wait, current); + for (i = 0, nr = 0; i < LAST_PKMAP && nr < TLB_BATCH; + i++, pos2 = (pos2 + 1) % LAST_PKMAP) { - __set_current_state(TASK_UNINTERRUPTIBLE); - add_wait_queue(&pkmap_map_wait, &wait); - spin_unlock(&kmap_lock); - schedule(); - remove_wait_queue(&pkmap_map_wait, &wait); - spin_lock(&kmap_lock); - - /* Somebody else might have mapped it while we slept */ - if (page_address(page)) - return (unsigned long)page_address(page); + flush = pkmap_try_free(pos2); + if (flush < 0) + continue; + + if (!flush) { + atomic_t *counter = &pkmap_count[pos2]; + VM_BUG_ON(atomic_read(counter) != 0); + atomic_set(counter, 2); + pkmap_put(counter); + } else + entries[nr++] = pos2; + } + flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP)); - /* Re-start */ - goto start; + for (i = 0; i < nr; i++) { + atomic_t *counter = &pkmap_count[entries[i]]; + VM_BUG_ON(atomic_read(counter) != 0); + atomic_set(counter, 2); + pkmap_put(counter); } +#endif } - vaddr = PKMAP_ADDR(last_pkmap_nr); - set_pte_at(&init_mm, vaddr, - &(pkmap_page_table[last_pkmap_nr]), mk_pte(page, kmap_prot)); + return pos; +} + +static unsigned long pkmap_insert(struct page *page) +{ + int pos = pkmap_get_free(); + unsigned long vaddr = PKMAP_ADDR(pos); + pte_t *ptep = &pkmap_page_table[pos]; + pte_t entry = mk_pte(page, kmap_prot); + atomic_t *counter = &pkmap_count[pos]; + + VM_BUG_ON(atomic_read(counter) != 0); - pkmap_count[last_pkmap_nr] = 1; - set_page_address(page, (void *)vaddr); + set_pte_at(&init_mm, vaddr, ptep, entry); + if (unlikely(!__set_page_address(page, (void *)vaddr, pos))) { + /* + * concurrent pkmap_inserts for this page - + * the other won the race, release this entry. + * + * we can still clear the pte without a tlb flush since + * it couldn't have been used yet. + */ + pte_clear(&init_mm, vaddr, ptep); + VM_BUG_ON(atomic_read(counter) != 0); + atomic_set(counter, 2); + pkmap_put(counter); + vaddr = 0; + } else + atomic_set(counter, 2); return vaddr; } -/** - * kmap_high - map a highmem page into memory - * @page: &struct page to map - * - * Returns the page's virtual memory address. - * - * We cannot call this from interrupts, as it may block. - */ -void *kmap_high(struct page *page) + void *kmap_high(struct page *page) { unsigned long vaddr; - - /* - * For highmem pages, we can't trust "virtual" until - * after we have the lock. - */ - spin_lock(&kmap_lock); +again: vaddr = (unsigned long)page_address(page); + if (vaddr) { + atomic_t *counter = &pkmap_count[PKMAP_NR(vaddr)]; + if (atomic_inc_not_zero(counter)) { + /* + * atomic_inc_not_zero implies a (memory) barrier on success + * so page address will be reloaded. + */ + unsigned long vaddr2 = (unsigned long)page_address(page); + if (likely(vaddr == vaddr2)) + return (void *)vaddr; + + /* + * Oops, we got someone else. + * + * This can happen if we get preempted after + * page_address() and before atomic_inc_not_zero() + * and during that preemption this slot is freed and + * reused. + */ + pkmap_put(counter); + goto again; + } + } + + vaddr = pkmap_insert(page); if (!vaddr) - vaddr = map_new_virtual(page); - pkmap_count[PKMAP_NR(vaddr)]++; - BUG_ON(pkmap_count[PKMAP_NR(vaddr)] < 2); - spin_unlock(&kmap_lock); - return (void*) vaddr; + goto again; + + return (void *)vaddr; } EXPORT_SYMBOL(kmap_high); -/** - * kunmap_high - map a highmem page into memory - * @page: &struct page to unmap - */ -void kunmap_high(struct page *page) + void kunmap_high(struct page *page) { - unsigned long vaddr; - unsigned long nr; - int need_wakeup; - - spin_lock(&kmap_lock); - vaddr = (unsigned long)page_address(page); + unsigned long vaddr = (unsigned long)page_address(page); BUG_ON(!vaddr); - nr = PKMAP_NR(vaddr); - - /* - * A count must never go down to zero - * without a TLB flush! - */ - need_wakeup = 0; - switch (--pkmap_count[nr]) { - case 0: - BUG(); - case 1: - /* - * Avoid an unnecessary wake_up() function call. - * The common case is pkmap_count[] == 1, but - * no waiters. - * The tasks queued in the wait-queue are guarded - * by both the lock in the wait-queue-head and by - * the kmap_lock. As the kmap_lock is held here, - * no need for the wait-queue-head's lock. Simply - * test if the queue is empty. - */ - need_wakeup = waitqueue_active(&pkmap_map_wait); - } - spin_unlock(&kmap_lock); - - /* do wake-up, if needed, race-free outside of the spin lock */ - if (need_wakeup) - wake_up(&pkmap_map_wait); + pkmap_put(&pkmap_count[PKMAP_NR(vaddr)]); } EXPORT_SYMBOL(kunmap_high); @@ -237,19 +267,13 @@ EXPORT_SYMBOL(kunmap_high); #define PA_HASH_ORDER 7 /* - * Describes one page->virtual association + * Describes one page->virtual address association. */ -struct page_address_map { +static struct page_address_map { struct page *page; void *virtual; struct list_head list; -}; - -/* - * page_address_map freelist, allocated from page_address_maps. - */ -static struct list_head page_address_pool; /* freelist */ -static spinlock_t pool_lock; /* protects page_address_pool */ +} page_address_maps[LAST_PKMAP]; /* * Hash table bucket @@ -270,29 +294,37 @@ static struct page_address_slot *page_sl * * Returns the page's virtual address. */ -void *page_address(struct page *page) -{ - unsigned long flags; - void *ret; - struct page_address_slot *pas; - if (!PageHighMem(page)) - return lowmem_page_address(page); +static void *__page_address(struct page_address_slot *pas, struct page *page) +{ + void *ret = NULL; - pas = page_slot(page); - ret = NULL; - spin_lock_irqsave(&pas->lock, flags); if (!list_empty(&pas->lh)) { struct page_address_map *pam; list_for_each_entry(pam, &pas->lh, list) { if (pam->page == page) { ret = pam->virtual; - goto done; + break; } } } -done: + + return ret; +} + +void *page_address(struct page *page) +{ + unsigned long flags; + void *ret; + struct page_address_slot *pas; + + if (!PageHighMem(page)) + return lowmem_page_address(page); + + pas = page_slot(page); + spin_lock_irqsave(&pas->lock, flags); + ret = __page_address(pas, page); spin_unlock_irqrestore(&pas->lock, flags); return ret; } @@ -304,62 +336,87 @@ EXPORT_SYMBOL(page_address); * @page: &struct page to set * @virtual: virtual address to use */ -void set_page_address(struct page *page, void *virtual) +static int __set_page_address(struct page *page, void *virtual, int pos) { + int ret = 0; unsigned long flags; struct page_address_slot *pas; struct page_address_map *pam; - BUG_ON(!PageHighMem(page)); + VM_BUG_ON(!PageHighMem(page)); + VM_BUG_ON(atomic_read(&pkmap_count[pos]) != 0); + VM_BUG_ON(pos < 0 || pos >= LAST_PKMAP); pas = page_slot(page); - if (virtual) { /* Add */ - BUG_ON(list_empty(&page_address_pool)); + pam = &page_address_maps[pos]; - spin_lock_irqsave(&pool_lock, flags); - pam = list_entry(page_address_pool.next, - struct page_address_map, list); - list_del(&pam->list); - spin_unlock_irqrestore(&pool_lock, flags); - - pam->page = page; - pam->virtual = virtual; - - spin_lock_irqsave(&pas->lock, flags); - list_add_tail(&pam->list, &pas->lh); - spin_unlock_irqrestore(&pas->lock, flags); - } else { /* Remove */ - spin_lock_irqsave(&pas->lock, flags); - list_for_each_entry(pam, &pas->lh, list) { - if (pam->page == page) { - list_del(&pam->list); - spin_unlock_irqrestore(&pas->lock, flags); - spin_lock_irqsave(&pool_lock, flags); - list_add_tail(&pam->list, &page_address_pool); - spin_unlock_irqrestore(&pool_lock, flags); - goto done; - } + spin_lock_irqsave(&pas->lock, flags); + if (virtual) { /* add */ + VM_BUG_ON(!list_empty(&pam->list)); + + if (!__page_address(pas, page)) { + pam->page = page; + pam->virtual = virtual; + list_add_tail(&pam->list, &pas->lh); + ret = 1; + } + } else { /* remove */ + if (!list_empty(&pam->list)) { + list_del_init(&pam->list); + ret = 1; } - spin_unlock_irqrestore(&pas->lock, flags); } -done: - return; + spin_unlock_irqrestore(&pas->lock, flags); + + return ret; } -static struct page_address_map page_address_maps[LAST_PKMAP]; +int set_page_address(struct page *page, void *virtual) +{ + /* + * set_page_address is not supposed to be called when using + * hashed virtual addresses. + */ + BUG(); + return 0; +} -void __init page_address_init(void) +void __init __page_address_init(void) { int i; - INIT_LIST_HEAD(&page_address_pool); for (i = 0; i < ARRAY_SIZE(page_address_maps); i++) - list_add(&page_address_maps[i].list, &page_address_pool); + INIT_LIST_HEAD(&page_address_maps[i].list); + for (i = 0; i < ARRAY_SIZE(page_address_htable); i++) { INIT_LIST_HEAD(&page_address_htable[i].lh); spin_lock_init(&page_address_htable[i].lock); } - spin_lock_init(&pool_lock); +} + +#elif defined (CONFIG_HIGHMEM) /* HASHED_PAGE_VIRTUAL */ + +static int __set_page_address(struct page *page, void *virtual, int pos) +{ + return set_page_address(page, virtual); +} + +#endif /* defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) */ + +#if defined(CONFIG_HIGHMEM) || defined(HASHED_PAGE_VIRTUAL) + +void __init page_address_init(void) +{ +#ifdef CONFIG_HIGHMEM + int i; + + for (i = 0; i < ARRAY_SIZE(pkmap_count); i++) + atomic_set(&pkmap_count[i], 1); +#endif + +#ifdef HASHED_PAGE_VIRTUAL + __page_address_init(); +#endif } #endif /* defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) */ patches/shorten-posix-cpu-timers-name.patch0000664000076400007640000000202111160752235020101 0ustar tglxtglxSubject: rt: shorten posix_cpu_timers/ kernel thread names From: Arnaldo Carvalho de Melo Date: Wed, 13 Aug 2008 15:42:11 -0300 Shorten the softirq kernel thread names because they always overflow the limited comm length, appearing as "posix_cpu_timer" CPU# times. Done on 2.6.24.7, but probably applicable to later kernels. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar --- kernel/posix-cpu-timers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/kernel/posix-cpu-timers.c =================================================================== --- linux-2.6-tip.orig/kernel/posix-cpu-timers.c +++ linux-2.6-tip/kernel/posix-cpu-timers.c @@ -1540,7 +1540,7 @@ static int posix_cpu_thread_call(struct switch (action) { case CPU_UP_PREPARE: p = kthread_create(posix_cpu_timers_thread, hcpu, - "posix_cpu_timers/%d",cpu); + "posixcputmr/%d",cpu); if (IS_ERR(p)) return NOTIFY_BAD; p->flags |= PF_NOFREEZE; patches/preempt-irqs-arm.patch0000664000076400007640000000103511161723431015461 0ustar tglxtglx--- arch/arm/common/time-acorn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/arch/arm/common/time-acorn.c =================================================================== --- linux-2.6-tip.orig/arch/arm/common/time-acorn.c +++ linux-2.6-tip/arch/arm/common/time-acorn.c @@ -75,7 +75,7 @@ ioc_timer_interrupt(int irq, void *dev_i static struct irqaction ioc_timer_irq = { .name = "timer", - .flags = IRQF_DISABLED, + .flags = IRQF_DISABLED | IRQF_NODELAY, .handler = ioc_timer_interrupt }; patches/dont-let-rt-rw_semaphores-do-non_owner-locks.patch0000664000076400007640000000743411160752235023030 0ustar tglxtglxSubject: Don't let -rt rw_semaphors do _non_owner locks From: Steven Rostedt Date: Tue, 25 Sep 2007 11:29:51 -0400 (EDT) -- On Tue, 25 Sep 2007, Peter Zijlstra wrote: > How about teaching {up,down}_read_non_owner() to barf on rw_semaphore > in -rt? > Sure thing! This patch prevents rw_semaphore in PREEMPT_RT from performing down_read_non_owner and up_read_non_owner. If this must be used, then either convert to a completion or use compat_rw_semaphore. Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- include/linux/rt_lock.h | 15 +++++---------- kernel/rt.c | 45 --------------------------------------------- 2 files changed, 5 insertions(+), 55 deletions(-) Index: linux-2.6-tip/include/linux/rt_lock.h =================================================================== --- linux-2.6-tip.orig/include/linux/rt_lock.h +++ linux-2.6-tip/include/linux/rt_lock.h @@ -205,25 +205,20 @@ do { \ __rt_rwsem_init((sem), #sem, &__key); \ } while (0) +extern void __dont_do_this_in_rt(struct rw_semaphore *rwsem); + +#define rt_down_read_non_owner(rwsem) __dont_do_this_in_rt(rwsem) +#define rt_up_read_non_owner(rwsem) __dont_do_this_in_rt(rwsem) + extern void rt_down_write(struct rw_semaphore *rwsem); extern void rt_down_read_nested(struct rw_semaphore *rwsem, int subclass); extern void rt_down_write_nested(struct rw_semaphore *rwsem, int subclass); extern void rt_down_read(struct rw_semaphore *rwsem); -#ifdef CONFIG_DEBUG_LOCK_ALLOC -extern void rt_down_read_non_owner(struct rw_semaphore *rwsem); -#else -# define rt_down_read_non_owner(rwsem) rt_down_read(rwsem) -#endif extern int rt_down_write_trylock(struct rw_semaphore *rwsem); extern int rt_down_read_trylock(struct rw_semaphore *rwsem); extern void rt_up_read(struct rw_semaphore *rwsem); -#ifdef CONFIG_DEBUG_LOCK_ALLOC -extern void rt_up_read_non_owner(struct rw_semaphore *rwsem); -#else -# define rt_up_read_non_owner(rwsem) rt_up_read(rwsem) -#endif extern void rt_up_write(struct rw_semaphore *rwsem); extern void rt_downgrade_write(struct rw_semaphore *rwsem); Index: linux-2.6-tip/kernel/rt.c =================================================================== --- linux-2.6-tip.orig/kernel/rt.c +++ linux-2.6-tip/kernel/rt.c @@ -342,25 +342,6 @@ void rt_up_read(struct rw_semaphore *rw } EXPORT_SYMBOL(rt_up_read); -#ifdef CONFIG_DEBUG_LOCK_ALLOC -void rt_up_read_non_owner(struct rw_semaphore *rwsem) -{ - unsigned long flags; - /* - * Read locks within the self-held write lock succeed. - */ - spin_lock_irqsave(&rwsem->lock.wait_lock, flags); - if (rt_mutex_real_owner(&rwsem->lock) == current && rwsem->read_depth) { - spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); - rwsem->read_depth--; - return; - } - spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); - rt_mutex_unlock(&rwsem->lock); -} -EXPORT_SYMBOL(rt_up_read_non_owner); -#endif - /* * downgrade a write lock into a read lock * - just wake up any readers at the front of the queue @@ -451,32 +432,6 @@ void rt_down_read_nested(struct rw_sema } EXPORT_SYMBOL(rt_down_read_nested); - -#ifdef CONFIG_DEBUG_LOCK_ALLOC - -/* - * Same as rt_down_read() but no lockdep calls: - */ -void rt_down_read_non_owner(struct rw_semaphore *rwsem) -{ - unsigned long flags; - /* - * Read locks within the write lock succeed. - */ - spin_lock_irqsave(&rwsem->lock.wait_lock, flags); - - if (rt_mutex_real_owner(&rwsem->lock) == current) { - spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); - rwsem->read_depth++; - return; - } - spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); - rt_mutex_lock(&rwsem->lock); -} -EXPORT_SYMBOL(rt_down_read_non_owner); - -#endif - void __rt_rwsem_init(struct rw_semaphore *rwsem, char *name, struct lock_class_key *key) { patches/rt-apis.patch0000664000076400007640000000643211160752235013644 0ustar tglxtglxSubject: patches/rt-apis.patch add new, -rt specific IRQ API variants. Maps to the same as before on non-PREEMPT_RT. include/linux/bottom_half.h | 8 ++++++++ include/linux/interrupt.h | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) Signed-off-by: Ingo Molnar Index: linux-2.6-tip/include/linux/bottom_half.h =================================================================== --- linux-2.6-tip.orig/include/linux/bottom_half.h +++ linux-2.6-tip/include/linux/bottom_half.h @@ -1,9 +1,17 @@ #ifndef _LINUX_BH_H #define _LINUX_BH_H +#ifdef CONFIG_PREEMPT_RT +# define local_bh_disable() do { } while (0) +# define __local_bh_disable(ip) do { } while (0) +# define _local_bh_enable() do { } while (0) +# define local_bh_enable() do { } while (0) +# define local_bh_enable_ip(ip) do { } while (0) +#else extern void local_bh_disable(void); extern void _local_bh_enable(void); extern void local_bh_enable(void); extern void local_bh_enable_ip(unsigned long ip); +#endif #endif /* _LINUX_BH_H */ Index: linux-2.6-tip/include/linux/interrupt.h =================================================================== --- linux-2.6-tip.orig/include/linux/interrupt.h +++ linux-2.6-tip/include/linux/interrupt.h @@ -112,7 +112,7 @@ extern void devm_free_irq(struct device #ifdef CONFIG_LOCKDEP # define local_irq_enable_in_hardirq() do { } while (0) #else -# define local_irq_enable_in_hardirq() local_irq_enable() +# define local_irq_enable_in_hardirq() local_irq_enable_nort() #endif extern void disable_irq_nosync(unsigned int irq); @@ -526,4 +526,37 @@ extern int arch_probe_nr_irqs(void); extern int arch_early_irq_init(void); extern int arch_init_chip_data(struct irq_desc *desc, int cpu); +#ifdef CONFIG_PREEMPT_RT +# define local_irq_disable_nort() do { } while (0) +# define local_irq_enable_nort() do { } while (0) +# define local_irq_enable_rt() local_irq_enable() +# define local_irq_save_nort(flags) do { local_save_flags(flags); } while (0) +# define local_irq_restore_nort(flags) do { (void)(flags); } while (0) +# define spin_lock_nort(lock) do { } while (0) +# define spin_unlock_nort(lock) do { } while (0) +# define spin_lock_bh_nort(lock) do { } while (0) +# define spin_unlock_bh_nort(lock) do { } while (0) +# define spin_lock_rt(lock) spin_lock(lock) +# define spin_unlock_rt(lock) spin_unlock(lock) +# define smp_processor_id_rt(cpu) (cpu) +# define in_atomic_rt() (!oops_in_progress && \ + (in_atomic() || irqs_disabled())) +# define read_trylock_rt(lock) ({read_lock(lock); 1; }) +#else +# define local_irq_disable_nort() local_irq_disable() +# define local_irq_enable_nort() local_irq_enable() +# define local_irq_enable_rt() do { } while (0) +# define local_irq_save_nort(flags) local_irq_save(flags) +# define local_irq_restore_nort(flags) local_irq_restore(flags) +# define spin_lock_rt(lock) do { } while (0) +# define spin_unlock_rt(lock) do { } while (0) +# define spin_lock_nort(lock) spin_lock(lock) +# define spin_unlock_nort(lock) spin_unlock(lock) +# define spin_lock_bh_nort(lock) spin_lock_bh(lock) +# define spin_unlock_bh_nort(lock) spin_unlock_bh(lock) +# define smp_processor_id_rt(cpu) smp_processor_id() +# define in_atomic_rt() 0 +# define read_trylock_rt(lock) read_trylock(lock) +#endif + #endif patches/net-core-preempt-fix.patch0000664000076400007640000000113511160752235016232 0ustar tglxtglxSubject: net: core preempt fix From: Ingo Molnar Date: Wed Feb 04 00:03:01 CET 2009 Signed-off-by: Ingo Molnar --- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/net/core/dev.c =================================================================== --- linux-2.6-tip.orig/net/core/dev.c +++ linux-2.6-tip/net/core/dev.c @@ -1986,8 +1986,8 @@ int netif_rx_ni(struct sk_buff *skb) { int err; - preempt_disable(); err = netif_rx(skb); + preempt_disable(); if (local_softirq_pending()) do_softirq(); preempt_enable(); patches/rt-slab-new.patch0000664000076400007640000011441211160752235014416 0ustar tglxtglxSubject: patches/rt-slab-new.patch new slab port. Signed-off-by: Ingo Molnar Folded in: From ak@suse.de Wed Sep 26 10:34:53 2007 Date: Mon, 17 Sep 2007 15:36:59 +0200 From: Andi Kleen To: mingo@elte.hu, Thomas Gleixner Cc: linux-rt-users@vger.kernel.org __do_cache_allow/alternate_node_alloc() need to pass the this_cpu variable from the caller to cache_grow(); otherwise the slab lock for the wrong CPU can be released when a task switches CPUs inside cache_grow(). Signed-off-by: Andi Kleen --- mm/slab.c | 493 +++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 316 insertions(+), 177 deletions(-) Index: linux-2.6-tip/mm/slab.c =================================================================== --- linux-2.6-tip.orig/mm/slab.c +++ linux-2.6-tip/mm/slab.c @@ -120,6 +120,63 @@ #include /* + * On !PREEMPT_RT, raw irq flags are used as a per-CPU locking + * mechanism. + * + * On PREEMPT_RT, we use per-CPU locks for this. That's why the + * calling convention is changed slightly: a new 'flags' argument + * is passed to 'irq disable/enable' - the PREEMPT_RT code stores + * the CPU number of the lock there. + */ +#ifndef CONFIG_PREEMPT_RT +# define slab_irq_disable(cpu) \ + do { local_irq_disable(); (cpu) = smp_processor_id(); } while (0) +# define slab_irq_enable(cpu) local_irq_enable() +# define slab_irq_save(flags, cpu) \ + do { local_irq_save(flags); (cpu) = smp_processor_id(); } while (0) +# define slab_irq_restore(flags, cpu) local_irq_restore(flags) +/* + * In the __GFP_WAIT case we enable/disable interrupts on !PREEMPT_RT, + * which has no per-CPU locking effect since we are holding the cache + * lock in that case already. + * + * (On PREEMPT_RT, these are NOPs, but we have to drop/get the irq locks.) + */ +# define slab_irq_disable_nort() local_irq_disable() +# define slab_irq_enable_nort() local_irq_enable() +# define slab_irq_disable_rt(flags) do { (void)(flags); } while (0) +# define slab_irq_enable_rt(flags) do { (void)(flags); } while (0) +# define slab_spin_lock_irq(lock, cpu) \ + do { spin_lock_irq(lock); (cpu) = smp_processor_id(); } while (0) +# define slab_spin_unlock_irq(lock, cpu) \ + spin_unlock_irq(lock) +# define slab_spin_lock_irqsave(lock, flags, cpu) \ + do { spin_lock_irqsave(lock, flags); (cpu) = smp_processor_id(); } while (0) +# define slab_spin_unlock_irqrestore(lock, flags, cpu) \ + do { spin_unlock_irqrestore(lock, flags); } while (0) +#else +DEFINE_PER_CPU_LOCKED(int, slab_irq_locks) = { 0, }; +# define slab_irq_disable(cpu) (void)get_cpu_var_locked(slab_irq_locks, &(cpu)) +# define slab_irq_enable(cpu) put_cpu_var_locked(slab_irq_locks, cpu) +# define slab_irq_save(flags, cpu) \ + do { slab_irq_disable(cpu); (void) (flags); } while (0) +# define slab_irq_restore(flags, cpu) \ + do { slab_irq_enable(cpu); (void) (flags); } while (0) +# define slab_irq_disable_rt(cpu) slab_irq_disable(cpu) +# define slab_irq_enable_rt(cpu) slab_irq_enable(cpu) +# define slab_irq_disable_nort() do { } while (0) +# define slab_irq_enable_nort() do { } while (0) +# define slab_spin_lock_irq(lock, cpu) \ + do { slab_irq_disable(cpu); spin_lock(lock); } while (0) +# define slab_spin_unlock_irq(lock, cpu) \ + do { spin_unlock(lock); slab_irq_enable(cpu); } while (0) +# define slab_spin_lock_irqsave(lock, flags, cpu) \ + do { slab_irq_disable(cpu); spin_lock_irqsave(lock, flags); } while (0) +# define slab_spin_unlock_irqrestore(lock, flags, cpu) \ + do { spin_unlock_irqrestore(lock, flags); slab_irq_enable(cpu); } while (0) +#endif + +/* * DEBUG - 1 for kmem_cache_create() to honour; SLAB_RED_ZONE & SLAB_POISON. * 0 for faster, smaller code (especially in the critical paths). * @@ -315,7 +372,7 @@ struct kmem_list3 __initdata initkmem_li static int drain_freelist(struct kmem_cache *cache, struct kmem_list3 *l3, int tofree); static void free_block(struct kmem_cache *cachep, void **objpp, int len, - int node); + int node, int *this_cpu); static int enable_cpucache(struct kmem_cache *cachep); static void cache_reap(struct work_struct *unused); @@ -685,9 +742,10 @@ int slab_is_available(void) static DEFINE_PER_CPU(struct delayed_work, reap_work); -static inline struct array_cache *cpu_cache_get(struct kmem_cache *cachep) +static inline struct array_cache * +cpu_cache_get(struct kmem_cache *cachep, int this_cpu) { - return cachep->array[smp_processor_id()]; + return cachep->array[this_cpu]; } static inline struct kmem_cache *__find_general_cachep(size_t size, @@ -921,7 +979,7 @@ static int transfer_objects(struct array #ifndef CONFIG_NUMA #define drain_alien_cache(cachep, alien) do { } while (0) -#define reap_alien(cachep, l3) do { } while (0) +#define reap_alien(cachep, l3, this_cpu) do { } while (0) static inline struct array_cache **alloc_alien_cache(int node, int limit) { @@ -932,27 +990,29 @@ static inline void free_alien_cache(stru { } -static inline int cache_free_alien(struct kmem_cache *cachep, void *objp) +static inline int +cache_free_alien(struct kmem_cache *cachep, void *objp, int *this_cpu) { return 0; } static inline void *alternate_node_alloc(struct kmem_cache *cachep, - gfp_t flags) + gfp_t flags, int *this_cpu) { return NULL; } static inline void *____cache_alloc_node(struct kmem_cache *cachep, - gfp_t flags, int nodeid) + gfp_t flags, int nodeid, int *this_cpu) { return NULL; } #else /* CONFIG_NUMA */ -static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int); -static void *alternate_node_alloc(struct kmem_cache *, gfp_t); +static void *____cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, + int nodeid, int *this_cpu); +static void *alternate_node_alloc(struct kmem_cache *, gfp_t, int *); static struct array_cache **alloc_alien_cache(int node, int limit) { @@ -993,7 +1053,8 @@ static void free_alien_cache(struct arra } static void __drain_alien_cache(struct kmem_cache *cachep, - struct array_cache *ac, int node) + struct array_cache *ac, int node, + int *this_cpu) { struct kmem_list3 *rl3 = cachep->nodelists[node]; @@ -1007,7 +1068,7 @@ static void __drain_alien_cache(struct k if (rl3->shared) transfer_objects(rl3->shared, ac, ac->limit); - free_block(cachep, ac->entry, ac->avail, node); + free_block(cachep, ac->entry, ac->avail, node, this_cpu); ac->avail = 0; spin_unlock(&rl3->list_lock); } @@ -1016,15 +1077,16 @@ static void __drain_alien_cache(struct k /* * Called from cache_reap() to regularly drain alien caches round robin. */ -static void reap_alien(struct kmem_cache *cachep, struct kmem_list3 *l3) +static void +reap_alien(struct kmem_cache *cachep, struct kmem_list3 *l3, int *this_cpu) { - int node = __get_cpu_var(reap_node); + int node = per_cpu(reap_node, *this_cpu); if (l3->alien) { struct array_cache *ac = l3->alien[node]; if (ac && ac->avail && spin_trylock_irq(&ac->lock)) { - __drain_alien_cache(cachep, ac, node); + __drain_alien_cache(cachep, ac, node, this_cpu); spin_unlock_irq(&ac->lock); } } @@ -1033,21 +1095,22 @@ static void reap_alien(struct kmem_cache static void drain_alien_cache(struct kmem_cache *cachep, struct array_cache **alien) { - int i = 0; + int i = 0, this_cpu; struct array_cache *ac; unsigned long flags; for_each_online_node(i) { ac = alien[i]; if (ac) { - spin_lock_irqsave(&ac->lock, flags); - __drain_alien_cache(cachep, ac, i); - spin_unlock_irqrestore(&ac->lock, flags); + slab_spin_lock_irqsave(&ac->lock, flags, this_cpu); + __drain_alien_cache(cachep, ac, i, &this_cpu); + slab_spin_unlock_irqrestore(&ac->lock, flags, this_cpu); } } } -static inline int cache_free_alien(struct kmem_cache *cachep, void *objp) +static inline int +cache_free_alien(struct kmem_cache *cachep, void *objp, int *this_cpu) { struct slab *slabp = virt_to_slab(objp); int nodeid = slabp->nodeid; @@ -1071,13 +1134,13 @@ static inline int cache_free_alien(struc spin_lock(&alien->lock); if (unlikely(alien->avail == alien->limit)) { STATS_INC_ACOVERFLOW(cachep); - __drain_alien_cache(cachep, alien, nodeid); + __drain_alien_cache(cachep, alien, nodeid, this_cpu); } alien->entry[alien->avail++] = objp; spin_unlock(&alien->lock); } else { spin_lock(&(cachep->nodelists[nodeid])->list_lock); - free_block(cachep, &objp, 1, nodeid); + free_block(cachep, &objp, 1, nodeid, this_cpu); spin_unlock(&(cachep->nodelists[nodeid])->list_lock); } return 1; @@ -1095,6 +1158,7 @@ static void __cpuinit cpuup_canceled(lon struct array_cache *nc; struct array_cache *shared; struct array_cache **alien; + int this_cpu; /* cpu is dead; no one can alloc from it. */ nc = cachep->array[cpu]; @@ -1104,29 +1168,31 @@ static void __cpuinit cpuup_canceled(lon if (!l3) goto free_array_cache; - spin_lock_irq(&l3->list_lock); + slab_spin_lock_irq(&l3->list_lock, this_cpu); /* Free limit for this kmem_list3 */ l3->free_limit -= cachep->batchcount; if (nc) - free_block(cachep, nc->entry, nc->avail, node); + free_block(cachep, nc->entry, nc->avail, node, + &this_cpu); if (!cpus_empty(*mask)) { - spin_unlock_irq(&l3->list_lock); + slab_spin_unlock_irq(&l3->list_lock, + this_cpu); goto free_array_cache; } shared = l3->shared; if (shared) { free_block(cachep, shared->entry, - shared->avail, node); + shared->avail, node, &this_cpu); l3->shared = NULL; } alien = l3->alien; l3->alien = NULL; - spin_unlock_irq(&l3->list_lock); + slab_spin_unlock_irq(&l3->list_lock, this_cpu); kfree(shared); if (alien) { @@ -1155,6 +1221,7 @@ static int __cpuinit cpuup_prepare(long struct kmem_list3 *l3 = NULL; int node = cpu_to_node(cpu); const int memsize = sizeof(struct kmem_list3); + int this_cpu; /* * We need to do this right in the beginning since @@ -1185,11 +1252,11 @@ static int __cpuinit cpuup_prepare(long cachep->nodelists[node] = l3; } - spin_lock_irq(&cachep->nodelists[node]->list_lock); + slab_spin_lock_irq(&cachep->nodelists[node]->list_lock, this_cpu); cachep->nodelists[node]->free_limit = (1 + nr_cpus_node(node)) * cachep->batchcount + cachep->num; - spin_unlock_irq(&cachep->nodelists[node]->list_lock); + slab_spin_unlock_irq(&cachep->nodelists[node]->list_lock, this_cpu); } /* @@ -1226,7 +1293,7 @@ static int __cpuinit cpuup_prepare(long l3 = cachep->nodelists[node]; BUG_ON(!l3); - spin_lock_irq(&l3->list_lock); + slab_spin_lock_irq(&l3->list_lock, this_cpu); if (!l3->shared) { /* * We are serialised from CPU_DEAD or @@ -1241,7 +1308,7 @@ static int __cpuinit cpuup_prepare(long alien = NULL; } #endif - spin_unlock_irq(&l3->list_lock); + slab_spin_unlock_irq(&l3->list_lock, this_cpu); kfree(shared); free_alien_cache(alien); } @@ -1318,11 +1385,13 @@ static void init_list(struct kmem_cache int nodeid) { struct kmem_list3 *ptr; + int this_cpu; ptr = kmalloc_node(sizeof(struct kmem_list3), GFP_KERNEL, nodeid); BUG_ON(!ptr); - local_irq_disable(); + WARN_ON(spin_is_locked(&list->list_lock)); + slab_irq_disable(this_cpu); memcpy(ptr, list, sizeof(struct kmem_list3)); /* * Do not assume that spinlocks can be initialized via memcpy: @@ -1331,7 +1400,7 @@ static void init_list(struct kmem_cache MAKE_ALL_LISTS(cachep, ptr, nodeid); cachep->nodelists[nodeid] = ptr; - local_irq_enable(); + slab_irq_enable(this_cpu); } /* @@ -1494,36 +1563,34 @@ void __init kmem_cache_init(void) /* 4) Replace the bootstrap head arrays */ { struct array_cache *ptr; + int this_cpu; ptr = kmalloc(sizeof(struct arraycache_init), GFP_KERNEL); - local_irq_disable(); - BUG_ON(cpu_cache_get(&cache_cache) != &initarray_cache.cache); - memcpy(ptr, cpu_cache_get(&cache_cache), - sizeof(struct arraycache_init)); + slab_irq_disable(this_cpu); + BUG_ON(cpu_cache_get(&cache_cache, this_cpu) != &initarray_cache.cache); + memcpy(ptr, cpu_cache_get(&cache_cache, this_cpu), + sizeof(struct arraycache_init)); /* * Do not assume that spinlocks can be initialized via memcpy: */ spin_lock_init(&ptr->lock); - - cache_cache.array[smp_processor_id()] = ptr; - local_irq_enable(); + cache_cache.array[this_cpu] = ptr; + slab_irq_enable(this_cpu); ptr = kmalloc(sizeof(struct arraycache_init), GFP_KERNEL); - local_irq_disable(); - BUG_ON(cpu_cache_get(malloc_sizes[INDEX_AC].cs_cachep) - != &initarray_generic.cache); - memcpy(ptr, cpu_cache_get(malloc_sizes[INDEX_AC].cs_cachep), - sizeof(struct arraycache_init)); + slab_irq_disable(this_cpu); + BUG_ON(cpu_cache_get(malloc_sizes[INDEX_AC].cs_cachep, this_cpu) + != &initarray_generic.cache); + memcpy(ptr, cpu_cache_get(malloc_sizes[INDEX_AC].cs_cachep, this_cpu), + sizeof(struct arraycache_init)); /* * Do not assume that spinlocks can be initialized via memcpy: */ spin_lock_init(&ptr->lock); - - malloc_sizes[INDEX_AC].cs_cachep->array[smp_processor_id()] = - ptr; - local_irq_enable(); + malloc_sizes[INDEX_AC].cs_cachep->array[this_cpu] = ptr; + slab_irq_enable(this_cpu); } /* 5) Replace the bootstrap kmem_list3's */ { @@ -1687,7 +1754,7 @@ static void store_stackinfo(struct kmem_ *addr++ = 0x12345678; *addr++ = caller; - *addr++ = smp_processor_id(); + *addr++ = raw_smp_processor_id(); size -= 3 * sizeof(unsigned long); { unsigned long *sptr = &caller; @@ -1877,6 +1944,10 @@ static void slab_destroy_debugcheck(stru } #endif +static void +__cache_free(struct kmem_cache *cachep, void *objp, int *this_cpu); + + /** * slab_destroy - destroy and release all objects in a slab * @cachep: cache pointer being destroyed @@ -1886,7 +1957,8 @@ static void slab_destroy_debugcheck(stru * Before calling the slab must have been unlinked from the cache. The * cache-lock is not held/needed. */ -static void slab_destroy(struct kmem_cache *cachep, struct slab *slabp) +static void +slab_destroy(struct kmem_cache *cachep, struct slab *slabp, int *this_cpu) { void *addr = slabp->s_mem - slabp->colouroff; @@ -1900,8 +1972,12 @@ static void slab_destroy(struct kmem_cac call_rcu(&slab_rcu->head, kmem_rcu_free); } else { kmem_freepages(cachep, addr); - if (OFF_SLAB(cachep)) - kmem_cache_free(cachep->slabp_cache, slabp); + if (OFF_SLAB(cachep)) { + if (this_cpu) + __cache_free(cachep->slabp_cache, slabp, this_cpu); + else + kmem_cache_free(cachep->slabp_cache, slabp); + } } } @@ -1998,6 +2074,8 @@ static size_t calculate_slab_order(struc static int __init_refok setup_cpu_cache(struct kmem_cache *cachep) { + int this_cpu; + if (g_cpucache_up == FULL) return enable_cpucache(cachep); @@ -2041,10 +2119,12 @@ static int __init_refok setup_cpu_cache( jiffies + REAPTIMEOUT_LIST3 + ((unsigned long)cachep) % REAPTIMEOUT_LIST3; - cpu_cache_get(cachep)->avail = 0; - cpu_cache_get(cachep)->limit = BOOT_CPUCACHE_ENTRIES; - cpu_cache_get(cachep)->batchcount = 1; - cpu_cache_get(cachep)->touched = 0; + this_cpu = raw_smp_processor_id(); + + cpu_cache_get(cachep, this_cpu)->avail = 0; + cpu_cache_get(cachep, this_cpu)->limit = BOOT_CPUCACHE_ENTRIES; + cpu_cache_get(cachep, this_cpu)->batchcount = 1; + cpu_cache_get(cachep, this_cpu)->touched = 0; cachep->batchcount = 1; cachep->limit = BOOT_CPUCACHE_ENTRIES; return 0; @@ -2335,19 +2415,19 @@ EXPORT_SYMBOL(kmem_cache_create); #if DEBUG static void check_irq_off(void) { +/* + * On PREEMPT_RT we use locks to protect the per-CPU lists, + * and keep interrupts enabled. + */ +#ifndef CONFIG_PREEMPT_RT BUG_ON(!irqs_disabled()); +#endif } static void check_irq_on(void) { +#ifndef CONFIG_PREEMPT_RT BUG_ON(irqs_disabled()); -} - -static void check_spinlock_acquired(struct kmem_cache *cachep) -{ -#ifdef CONFIG_SMP - check_irq_off(); - assert_spin_locked(&cachep->nodelists[numa_node_id()]->list_lock); #endif } @@ -2362,7 +2442,6 @@ static void check_spinlock_acquired_node #else #define check_irq_off() do { } while(0) #define check_irq_on() do { } while(0) -#define check_spinlock_acquired(x) do { } while(0) #define check_spinlock_acquired_node(x, y) do { } while(0) #endif @@ -2370,26 +2449,60 @@ static void drain_array(struct kmem_cach struct array_cache *ac, int force, int node); -static void do_drain(void *arg) +static void __do_drain(void *arg, int this_cpu) { struct kmem_cache *cachep = arg; + int node = cpu_to_node(this_cpu); struct array_cache *ac; - int node = numa_node_id(); check_irq_off(); - ac = cpu_cache_get(cachep); + ac = cpu_cache_get(cachep, this_cpu); spin_lock(&cachep->nodelists[node]->list_lock); - free_block(cachep, ac->entry, ac->avail, node); + free_block(cachep, ac->entry, ac->avail, node, &this_cpu); spin_unlock(&cachep->nodelists[node]->list_lock); ac->avail = 0; } +#ifdef CONFIG_PREEMPT_RT +static void do_drain(void *arg, int this_cpu) +{ + __do_drain(arg, this_cpu); +} +#else +static void do_drain(void *arg) +{ + __do_drain(arg, smp_processor_id()); +} +#endif + +#ifdef CONFIG_PREEMPT_RT +/* + * execute func() for all CPUs. On PREEMPT_RT we dont actually have + * to run on the remote CPUs - we only have to take their CPU-locks. + * (This is a rare operation, so cacheline bouncing is not an issue.) + */ +static void +slab_on_each_cpu(void (*func)(void *arg, int this_cpu), void *arg) +{ + unsigned int i; + + check_irq_on(); + for_each_online_cpu(i) { + spin_lock(&__get_cpu_lock(slab_irq_locks, i)); + func(arg, i); + spin_unlock(&__get_cpu_lock(slab_irq_locks, i)); + } +} +#else +# define slab_on_each_cpu(func, cachep) on_each_cpu(func, cachep, 1) +#endif + static void drain_cpu_caches(struct kmem_cache *cachep) { struct kmem_list3 *l3; int node; - on_each_cpu(do_drain, cachep, 1); + slab_on_each_cpu(do_drain, cachep); check_irq_on(); for_each_online_node(node) { l3 = cachep->nodelists[node]; @@ -2414,16 +2527,16 @@ static int drain_freelist(struct kmem_ca struct kmem_list3 *l3, int tofree) { struct list_head *p; - int nr_freed; + int nr_freed, this_cpu; struct slab *slabp; nr_freed = 0; while (nr_freed < tofree && !list_empty(&l3->slabs_free)) { - spin_lock_irq(&l3->list_lock); + slab_spin_lock_irq(&l3->list_lock, this_cpu); p = l3->slabs_free.prev; if (p == &l3->slabs_free) { - spin_unlock_irq(&l3->list_lock); + slab_spin_unlock_irq(&l3->list_lock, this_cpu); goto out; } @@ -2432,13 +2545,9 @@ static int drain_freelist(struct kmem_ca BUG_ON(slabp->inuse); #endif list_del(&slabp->list); - /* - * Safe to drop the lock. The slab is no longer linked - * to the cache. - */ l3->free_objects -= cache->num; - spin_unlock_irq(&l3->list_lock); - slab_destroy(cache, slabp); + slab_destroy(cache, slabp, &this_cpu); + slab_spin_unlock_irq(&l3->list_lock, this_cpu); nr_freed++; } out: @@ -2694,8 +2803,8 @@ static void slab_map_pages(struct kmem_c * Grow (by 1) the number of slabs within a cache. This is called by * kmem_cache_alloc() when there are no active objs left in a cache. */ -static int cache_grow(struct kmem_cache *cachep, - gfp_t flags, int nodeid, void *objp) +static int cache_grow(struct kmem_cache *cachep, gfp_t flags, int nodeid, + void *objp, int *this_cpu) { struct slab *slabp; size_t offset; @@ -2724,7 +2833,8 @@ static int cache_grow(struct kmem_cache offset *= cachep->colour_off; if (local_flags & __GFP_WAIT) - local_irq_enable(); + slab_irq_enable_nort(); + slab_irq_enable_rt(*this_cpu); /* * The test for missing atomic flag is performed here, rather than @@ -2753,8 +2863,10 @@ static int cache_grow(struct kmem_cache cache_init_objs(cachep, slabp); + slab_irq_disable_rt(*this_cpu); if (local_flags & __GFP_WAIT) - local_irq_disable(); + slab_irq_disable_nort(); + check_irq_off(); spin_lock(&l3->list_lock); @@ -2767,8 +2879,9 @@ static int cache_grow(struct kmem_cache opps1: kmem_freepages(cachep, objp); failed: + slab_irq_disable_rt(*this_cpu); if (local_flags & __GFP_WAIT) - local_irq_disable(); + slab_irq_disable_nort(); return 0; } @@ -2890,7 +3003,8 @@ bad: #define check_slabp(x,y) do { } while(0) #endif -static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags) +static void * +cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags, int *this_cpu) { int batchcount; struct kmem_list3 *l3; @@ -2900,7 +3014,7 @@ static void *cache_alloc_refill(struct k retry: check_irq_off(); node = numa_node_id(); - ac = cpu_cache_get(cachep); + ac = cpu_cache_get(cachep, *this_cpu); batchcount = ac->batchcount; if (!ac->touched && batchcount > BATCHREFILL_LIMIT) { /* @@ -2910,7 +3024,7 @@ retry: */ batchcount = BATCHREFILL_LIMIT; } - l3 = cachep->nodelists[node]; + l3 = cachep->nodelists[cpu_to_node(*this_cpu)]; BUG_ON(ac->avail > 0 || !l3); spin_lock(&l3->list_lock); @@ -2933,7 +3047,7 @@ retry: slabp = list_entry(entry, struct slab, list); check_slabp(cachep, slabp); - check_spinlock_acquired(cachep); + check_spinlock_acquired_node(cachep, cpu_to_node(*this_cpu)); /* * The slab was either on partial or free list so @@ -2947,8 +3061,9 @@ retry: STATS_INC_ACTIVE(cachep); STATS_SET_HIGH(cachep); - ac->entry[ac->avail++] = slab_get_obj(cachep, slabp, - node); + ac->entry[ac->avail++] = + slab_get_obj(cachep, slabp, + cpu_to_node(*this_cpu)); } check_slabp(cachep, slabp); @@ -2967,10 +3082,10 @@ alloc_done: if (unlikely(!ac->avail)) { int x; - x = cache_grow(cachep, flags | GFP_THISNODE, node, NULL); + x = cache_grow(cachep, flags | GFP_THISNODE, cpu_to_node(*this_cpu), NULL, this_cpu); /* cache_grow can reenable interrupts, then ac could change. */ - ac = cpu_cache_get(cachep); + ac = cpu_cache_get(cachep, *this_cpu); if (!x && ac->avail == 0) /* no objects in sight? abort */ return NULL; @@ -3057,21 +3172,22 @@ static bool slab_should_failslab(struct return should_failslab(obj_size(cachep), flags); } -static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags) +static inline void * +____cache_alloc(struct kmem_cache *cachep, gfp_t flags, int *this_cpu) { void *objp; struct array_cache *ac; check_irq_off(); - ac = cpu_cache_get(cachep); + ac = cpu_cache_get(cachep, *this_cpu); if (likely(ac->avail)) { STATS_INC_ALLOCHIT(cachep); ac->touched = 1; objp = ac->entry[--ac->avail]; } else { STATS_INC_ALLOCMISS(cachep); - objp = cache_alloc_refill(cachep, flags); + objp = cache_alloc_refill(cachep, flags, this_cpu); } return objp; } @@ -3083,7 +3199,8 @@ static inline void *____cache_alloc(stru * If we are in_interrupt, then process context, including cpusets and * mempolicy, may not apply and should not be used for allocation policy. */ -static void *alternate_node_alloc(struct kmem_cache *cachep, gfp_t flags) +static void *alternate_node_alloc(struct kmem_cache *cachep, gfp_t flags, + int *this_cpu) { int nid_alloc, nid_here; @@ -3095,7 +3212,7 @@ static void *alternate_node_alloc(struct else if (current->mempolicy) nid_alloc = slab_node(current->mempolicy); if (nid_alloc != nid_here) - return ____cache_alloc_node(cachep, flags, nid_alloc); + return ____cache_alloc_node(cachep, flags, nid_alloc, this_cpu); return NULL; } @@ -3107,7 +3224,7 @@ static void *alternate_node_alloc(struct * allocator to do its reclaim / fallback magic. We then insert the * slab into the proper nodelist and then allocate from it. */ -static void *fallback_alloc(struct kmem_cache *cache, gfp_t flags) +static void *fallback_alloc(struct kmem_cache *cache, gfp_t flags, int *this_cpu) { struct zonelist *zonelist; gfp_t local_flags; @@ -3135,7 +3252,8 @@ retry: cache->nodelists[nid] && cache->nodelists[nid]->free_objects) { obj = ____cache_alloc_node(cache, - flags | GFP_THISNODE, nid); + flags | GFP_THISNODE, nid, + this_cpu); if (obj) break; } @@ -3149,19 +3267,24 @@ retry: * set and go into memory reserves if necessary. */ if (local_flags & __GFP_WAIT) - local_irq_enable(); + slab_irq_enable_nort(); + slab_irq_enable_rt(*this_cpu); + kmem_flagcheck(cache, flags); obj = kmem_getpages(cache, local_flags, -1); + + slab_irq_disable_rt(*this_cpu); if (local_flags & __GFP_WAIT) - local_irq_disable(); + slab_irq_disable_nort(); + if (obj) { /* * Insert into the appropriate per node queues */ nid = page_to_nid(virt_to_page(obj)); - if (cache_grow(cache, flags, nid, obj)) { + if (cache_grow(cache, flags, nid, obj, this_cpu)) { obj = ____cache_alloc_node(cache, - flags | GFP_THISNODE, nid); + flags | GFP_THISNODE, nid, this_cpu); if (!obj) /* * Another processor may allocate the @@ -3182,7 +3305,7 @@ retry: * A interface to enable slab creation on nodeid */ static void *____cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, - int nodeid) + int nodeid, int *this_cpu) { struct list_head *entry; struct slab *slabp; @@ -3230,11 +3353,11 @@ retry: must_grow: spin_unlock(&l3->list_lock); - x = cache_grow(cachep, flags | GFP_THISNODE, nodeid, NULL); + x = cache_grow(cachep, flags | GFP_THISNODE, nodeid, NULL, this_cpu); if (x) goto retry; - return fallback_alloc(cachep, flags); + return fallback_alloc(cachep, flags, this_cpu); done: return obj; @@ -3257,6 +3380,7 @@ __cache_alloc_node(struct kmem_cache *ca void *caller) { unsigned long save_flags; + int this_cpu; void *ptr; lockdep_trace_alloc(flags); @@ -3265,32 +3389,33 @@ __cache_alloc_node(struct kmem_cache *ca return NULL; cache_alloc_debugcheck_before(cachep, flags); - local_irq_save(save_flags); + + slab_irq_save(save_flags, this_cpu); if (unlikely(nodeid == -1)) - nodeid = numa_node_id(); + nodeid = cpu_to_node(this_cpu); if (unlikely(!cachep->nodelists[nodeid])) { /* Node not bootstrapped yet */ - ptr = fallback_alloc(cachep, flags); + ptr = fallback_alloc(cachep, flags, &this_cpu); goto out; } - if (nodeid == numa_node_id()) { + if (nodeid == cpu_to_node(this_cpu)) { /* * Use the locally cached objects if possible. * However ____cache_alloc does not allow fallback * to other nodes. It may fail while we still have * objects on other nodes available. */ - ptr = ____cache_alloc(cachep, flags); + ptr = ____cache_alloc(cachep, flags, &this_cpu); if (ptr) goto out; } /* ___cache_alloc_node can fall back to other nodes */ - ptr = ____cache_alloc_node(cachep, flags, nodeid); + ptr = ____cache_alloc_node(cachep, flags, nodeid, &this_cpu); out: - local_irq_restore(save_flags); + slab_irq_restore(save_flags, this_cpu); ptr = cache_alloc_debugcheck_after(cachep, flags, ptr, caller); if (likely(ptr)) @@ -3303,33 +3428,33 @@ __cache_alloc_node(struct kmem_cache *ca } static __always_inline void * -__do_cache_alloc(struct kmem_cache *cache, gfp_t flags) +__do_cache_alloc(struct kmem_cache *cache, gfp_t flags, int *this_cpu) { void *objp; if (unlikely(current->flags & (PF_SPREAD_SLAB | PF_MEMPOLICY))) { - objp = alternate_node_alloc(cache, flags); + objp = alternate_node_alloc(cache, flags, this_cpu); if (objp) goto out; } - objp = ____cache_alloc(cache, flags); + objp = ____cache_alloc(cache, flags, this_cpu); /* * We may just have run out of memory on the local node. * ____cache_alloc_node() knows how to locate memory on other nodes */ - if (!objp) - objp = ____cache_alloc_node(cache, flags, numa_node_id()); - + if (!objp) + objp = ____cache_alloc_node(cache, flags, + cpu_to_node(*this_cpu), this_cpu); out: return objp; } #else static __always_inline void * -__do_cache_alloc(struct kmem_cache *cachep, gfp_t flags) +__do_cache_alloc(struct kmem_cache *cachep, gfp_t flags, int *this_cpu) { - return ____cache_alloc(cachep, flags); + return ____cache_alloc(cachep, flags, this_cpu); } #endif /* CONFIG_NUMA */ @@ -3338,6 +3463,7 @@ static __always_inline void * __cache_alloc(struct kmem_cache *cachep, gfp_t flags, void *caller) { unsigned long save_flags; + int this_cpu; void *objp; lockdep_trace_alloc(flags); @@ -3346,9 +3472,9 @@ __cache_alloc(struct kmem_cache *cachep, return NULL; cache_alloc_debugcheck_before(cachep, flags); - local_irq_save(save_flags); - objp = __do_cache_alloc(cachep, flags); - local_irq_restore(save_flags); + slab_irq_save(save_flags, this_cpu); + objp = __do_cache_alloc(cachep, flags, &this_cpu); + slab_irq_restore(save_flags, this_cpu); objp = cache_alloc_debugcheck_after(cachep, flags, objp, caller); prefetchw(objp); @@ -3365,7 +3491,7 @@ __cache_alloc(struct kmem_cache *cachep, * Caller needs to acquire correct kmem_list's list_lock */ static void free_block(struct kmem_cache *cachep, void **objpp, int nr_objects, - int node) + int node, int *this_cpu) { int i; struct kmem_list3 *l3; @@ -3394,7 +3520,7 @@ static void free_block(struct kmem_cache * a different cache, refer to comments before * alloc_slabmgmt. */ - slab_destroy(cachep, slabp); + slab_destroy(cachep, slabp, this_cpu); } else { list_add(&slabp->list, &l3->slabs_free); } @@ -3408,11 +3534,12 @@ static void free_block(struct kmem_cache } } -static void cache_flusharray(struct kmem_cache *cachep, struct array_cache *ac) +static void +cache_flusharray(struct kmem_cache *cachep, struct array_cache *ac, int *this_cpu) { int batchcount; struct kmem_list3 *l3; - int node = numa_node_id(); + int node = cpu_to_node(*this_cpu); batchcount = ac->batchcount; #if DEBUG @@ -3434,7 +3561,7 @@ static void cache_flusharray(struct kmem } } - free_block(cachep, ac->entry, batchcount, node); + free_block(cachep, ac->entry, batchcount, node, this_cpu); free_done: #if STATS { @@ -3463,9 +3590,9 @@ free_done: * Release an obj back to its cache. If the obj has a constructed state, it must * be in this state _before_ it is released. Called with disabled ints. */ -static inline void __cache_free(struct kmem_cache *cachep, void *objp) +static void __cache_free(struct kmem_cache *cachep, void *objp, int *this_cpu) { - struct array_cache *ac = cpu_cache_get(cachep); + struct array_cache *ac = cpu_cache_get(cachep, *this_cpu); check_irq_off(); objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0)); @@ -3479,7 +3606,7 @@ static inline void __cache_free(struct k * variable to skip the call, which is mostly likely to be present in * the cache. */ - if (numa_platform && cache_free_alien(cachep, objp)) + if (numa_platform && cache_free_alien(cachep, objp, this_cpu)) return; if (likely(ac->avail < ac->limit)) { @@ -3488,7 +3615,7 @@ static inline void __cache_free(struct k return; } else { STATS_INC_FREEMISS(cachep); - cache_flusharray(cachep, ac); + cache_flusharray(cachep, ac, this_cpu); ac->entry[ac->avail++] = objp; } } @@ -3689,13 +3816,14 @@ EXPORT_SYMBOL(__kmalloc); void kmem_cache_free(struct kmem_cache *cachep, void *objp) { unsigned long flags; + int this_cpu; - local_irq_save(flags); + slab_irq_save(flags, this_cpu); debug_check_no_locks_freed(objp, obj_size(cachep)); if (!(cachep->flags & SLAB_DEBUG_OBJECTS)) debug_check_no_obj_freed(objp, obj_size(cachep)); - __cache_free(cachep, objp); - local_irq_restore(flags); + __cache_free(cachep, objp, &this_cpu); + slab_irq_restore(flags, this_cpu); kmemtrace_mark_free(KMEMTRACE_TYPE_CACHE, _RET_IP_, objp); } @@ -3714,16 +3842,17 @@ void kfree(const void *objp) { struct kmem_cache *c; unsigned long flags; + int this_cpu; if (unlikely(ZERO_OR_NULL_PTR(objp))) return; - local_irq_save(flags); + slab_irq_save(flags, this_cpu); kfree_debugcheck(objp); c = virt_to_cache(objp); debug_check_no_locks_freed(objp, obj_size(c)); debug_check_no_obj_freed(objp, obj_size(c)); - __cache_free(c, (void *)objp); - local_irq_restore(flags); + __cache_free(c, (void *)objp, &this_cpu); + slab_irq_restore(flags, this_cpu); kmemtrace_mark_free(KMEMTRACE_TYPE_KMALLOC, _RET_IP_, objp); } @@ -3746,7 +3875,7 @@ EXPORT_SYMBOL_GPL(kmem_cache_name); */ static int alloc_kmemlist(struct kmem_cache *cachep) { - int node; + int node, this_cpu; struct kmem_list3 *l3; struct array_cache *new_shared; struct array_cache **new_alien = NULL; @@ -3774,11 +3903,11 @@ static int alloc_kmemlist(struct kmem_ca if (l3) { struct array_cache *shared = l3->shared; - spin_lock_irq(&l3->list_lock); + slab_spin_lock_irq(&l3->list_lock, this_cpu); if (shared) free_block(cachep, shared->entry, - shared->avail, node); + shared->avail, node, &this_cpu); l3->shared = new_shared; if (!l3->alien) { @@ -3787,7 +3916,7 @@ static int alloc_kmemlist(struct kmem_ca } l3->free_limit = (1 + nr_cpus_node(node)) * cachep->batchcount + cachep->num; - spin_unlock_irq(&l3->list_lock); + slab_spin_unlock_irq(&l3->list_lock, this_cpu); kfree(shared); free_alien_cache(new_alien); continue; @@ -3834,42 +3963,50 @@ struct ccupdate_struct { struct array_cache *new[NR_CPUS]; }; -static void do_ccupdate_local(void *info) +static void __do_ccupdate_local(void *info, int this_cpu) { struct ccupdate_struct *new = info; struct array_cache *old; check_irq_off(); - old = cpu_cache_get(new->cachep); + old = cpu_cache_get(new->cachep, this_cpu); - new->cachep->array[smp_processor_id()] = new->new[smp_processor_id()]; - new->new[smp_processor_id()] = old; + new->cachep->array[this_cpu] = new->new[this_cpu]; + new->new[this_cpu] = old; +} + +#ifdef CONFIG_PREEMPT_RT +static void do_ccupdate_local(void *arg, int this_cpu) +{ + __do_ccupdate_local(arg, this_cpu); +} +#else +static void do_ccupdate_local(void *arg) +{ + __do_ccupdate_local(arg, smp_processor_id()); } +#endif /* Always called with the cache_chain_mutex held */ static int do_tune_cpucache(struct kmem_cache *cachep, int limit, int batchcount, int shared) { - struct ccupdate_struct *new; - int i; - - new = kzalloc(sizeof(*new), GFP_KERNEL); - if (!new) - return -ENOMEM; + struct ccupdate_struct new; + int i, this_cpu; + memset(&new.new, 0, sizeof(new.new)); for_each_online_cpu(i) { - new->new[i] = alloc_arraycache(cpu_to_node(i), limit, + new.new[i] = alloc_arraycache(cpu_to_node(i), limit, batchcount); - if (!new->new[i]) { + if (!new.new[i]) { for (i--; i >= 0; i--) - kfree(new->new[i]); - kfree(new); + kfree(new.new[i]); return -ENOMEM; } } - new->cachep = cachep; + new.cachep = cachep; - on_each_cpu(do_ccupdate_local, (void *)new, 1); + slab_on_each_cpu(do_ccupdate_local, (void *)&new); check_irq_on(); cachep->batchcount = batchcount; @@ -3877,15 +4014,15 @@ static int do_tune_cpucache(struct kmem_ cachep->shared = shared; for_each_online_cpu(i) { - struct array_cache *ccold = new->new[i]; + struct array_cache *ccold = new.new[i]; if (!ccold) continue; - spin_lock_irq(&cachep->nodelists[cpu_to_node(i)]->list_lock); - free_block(cachep, ccold->entry, ccold->avail, cpu_to_node(i)); - spin_unlock_irq(&cachep->nodelists[cpu_to_node(i)]->list_lock); + slab_spin_lock_irq(&cachep->nodelists[cpu_to_node(i)]->list_lock, this_cpu); + free_block(cachep, ccold->entry, ccold->avail, cpu_to_node(i), &this_cpu); + slab_spin_unlock_irq(&cachep->nodelists[cpu_to_node(i)]->list_lock, this_cpu); kfree(ccold); } - kfree(new); + return alloc_kmemlist(cachep); } @@ -3949,26 +4086,26 @@ static int enable_cpucache(struct kmem_c * if drain_array() is used on the shared array. */ void drain_array(struct kmem_cache *cachep, struct kmem_list3 *l3, - struct array_cache *ac, int force, int node) + struct array_cache *ac, int force, int node) { - int tofree; + int tofree, this_cpu; if (!ac || !ac->avail) return; if (ac->touched && !force) { ac->touched = 0; } else { - spin_lock_irq(&l3->list_lock); + slab_spin_lock_irq(&l3->list_lock, this_cpu); if (ac->avail) { tofree = force ? ac->avail : (ac->limit + 4) / 5; if (tofree > ac->avail) tofree = (ac->avail + 1) / 2; - free_block(cachep, ac->entry, tofree, node); + free_block(cachep, ac->entry, tofree, node, &this_cpu); ac->avail -= tofree; memmove(ac->entry, &(ac->entry[tofree]), sizeof(void *) * ac->avail); } - spin_unlock_irq(&l3->list_lock); + slab_spin_unlock_irq(&l3->list_lock, this_cpu); } } @@ -3986,11 +4123,12 @@ void drain_array(struct kmem_cache *cach */ static void cache_reap(struct work_struct *w) { + int this_cpu = raw_smp_processor_id(), node = cpu_to_node(this_cpu); struct kmem_cache *searchp; struct kmem_list3 *l3; - int node = numa_node_id(); struct delayed_work *work = container_of(w, struct delayed_work, work); + int work_done = 0; if (!mutex_trylock(&cache_chain_mutex)) /* Give up. Setup the next iteration. */ @@ -4006,9 +4144,10 @@ static void cache_reap(struct work_struc */ l3 = searchp->nodelists[node]; - reap_alien(searchp, l3); + reap_alien(searchp, l3, &this_cpu); - drain_array(searchp, l3, cpu_cache_get(searchp), 0, node); + drain_array(searchp, l3, cpu_cache_get(searchp, this_cpu), + 0, node); /* * These are racy checks but it does not matter @@ -4097,7 +4236,7 @@ static int s_show(struct seq_file *m, vo unsigned long num_slabs, free_objects = 0, shared_avail = 0; const char *name; char *error = NULL; - int node; + int this_cpu, node; struct kmem_list3 *l3; active_objs = 0; @@ -4108,7 +4247,7 @@ static int s_show(struct seq_file *m, vo continue; check_irq_on(); - spin_lock_irq(&l3->list_lock); + slab_spin_lock_irq(&l3->list_lock, this_cpu); list_for_each_entry(slabp, &l3->slabs_full, list) { if (slabp->inuse != cachep->num && !error) @@ -4133,7 +4272,7 @@ static int s_show(struct seq_file *m, vo if (l3->shared) shared_avail += l3->shared->avail; - spin_unlock_irq(&l3->list_lock); + slab_spin_unlock_irq(&l3->list_lock, this_cpu); } num_slabs += active_slabs; num_objs = num_slabs * cachep->num; @@ -4342,7 +4481,7 @@ static int leaks_show(struct seq_file *m struct kmem_list3 *l3; const char *name; unsigned long *n = m->private; - int node; + int node, this_cpu; int i; if (!(cachep->flags & SLAB_STORE_USER)) @@ -4360,13 +4499,13 @@ static int leaks_show(struct seq_file *m continue; check_irq_on(); - spin_lock_irq(&l3->list_lock); + slab_spin_lock_irq(&l3->list_lock, this_cpu); list_for_each_entry(slabp, &l3->slabs_full, list) handle_slab(n, cachep, slabp); list_for_each_entry(slabp, &l3->slabs_partial, list) handle_slab(n, cachep, slabp); - spin_unlock_irq(&l3->list_lock); + slab_spin_unlock_irq(&l3->list_lock, this_cpu); } name = cachep->name; if (n[0] == n[1]) { patches/adapt-remove-extra-try-to-lock.patch0000664000076400007640000000254011160752235020150 0ustar tglxtglxSubject: remove the extra call to try_to_take_lock From: Gregory Haskins Date: Tue, 20 May 2008 10:49:36 -0400 [ The following text is in the "utf-8" character set. ] [ Your display is set for the "iso-8859-1" character set. ] [ Some characters may be displayed incorrectly. ] From: Peter W. Morreale Remove the redundant attempt to get the lock. While it is true that the exit path with this patch adds an un-necessary xchg (in the event the lock is granted without further traversal in the loop) experimentation shows that we almost never encounter this situation. Signed-off-by: Peter W. Morreale Signed-off-by: Gregory Haskins Signed-off-by: Ingo Molnar --- kernel/rtmutex.c | 6 ------ 1 file changed, 6 deletions(-) Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -785,12 +785,6 @@ rt_spin_lock_slowlock(struct rt_mutex *l spin_lock_irqsave(&lock->wait_lock, flags); init_lists(lock); - /* Try to acquire the lock again: */ - if (do_try_to_take_rt_mutex(lock, STEAL_LATERAL)) { - spin_unlock_irqrestore(&lock->wait_lock, flags); - return; - } - BUG_ON(rt_mutex_owner(lock) == current); /* patches/neptune-no-at-keyboard.patch0000664000076400007640000000350311160752235016551 0ustar tglxtglxSubject: neptune: no at keyboard From: Ingo Molnar Date: Wed Feb 04 00:03:15 CET 2009 Signed-off-by: Ingo Molnar --- drivers/input/keyboard/atkbd.c | 15 +++++++++++++++ drivers/input/mouse/psmouse-base.c | 15 +++++++++++++++ 2 files changed, 30 insertions(+) Index: linux-2.6-tip/drivers/input/keyboard/atkbd.c =================================================================== --- linux-2.6-tip.orig/drivers/input/keyboard/atkbd.c +++ linux-2.6-tip/drivers/input/keyboard/atkbd.c @@ -1556,8 +1556,23 @@ static struct dmi_system_id atkbd_dmi_qu { } }; +static int __read_mostly noatkbd; + +static int __init noatkbd_setup(char *str) +{ + noatkbd = 1; + printk(KERN_INFO "debug: not setting up AT keyboard.\n"); + + return 1; +} + +__setup("noatkbd", noatkbd_setup); + static int __init atkbd_init(void) { + if (noatkbd) + return 0; + dmi_check_system(atkbd_dmi_quirk_table); return serio_register_driver(&atkbd_drv); Index: linux-2.6-tip/drivers/input/mouse/psmouse-base.c =================================================================== --- linux-2.6-tip.orig/drivers/input/mouse/psmouse-base.c +++ linux-2.6-tip/drivers/input/mouse/psmouse-base.c @@ -1645,10 +1645,25 @@ static int psmouse_get_maxproto(char *bu return sprintf(buffer, "%s\n", psmouse_protocol_by_type(type)->name); } +static int __read_mostly nopsmouse; + +static int __init nopsmouse_setup(char *str) +{ + nopsmouse = 1; + printk(KERN_INFO "debug: not setting up psmouse.\n"); + + return 1; +} + +__setup("nopsmouse", nopsmouse_setup); + static int __init psmouse_init(void) { int err; + if (nopsmouse) + return 0; + kpsmoused_wq = create_singlethread_workqueue("kpsmoused"); if (!kpsmoused_wq) { printk(KERN_ERR "psmouse: failed to create kpsmoused workqueue\n"); patches/preempt-realtime-core.patch0000664000076400007640000007423111160752235016471 0ustar tglxtglxSubject: preempt: realtime core From: Ingo Molnar Date: Wed Feb 04 00:02:53 CET 2009 Signed-off-by: Ingo Molnar --- include/linux/hardirq.h | 6 +- include/linux/kernel.h | 9 +++- include/linux/profile.h | 12 +++-- include/linux/radix-tree.h | 13 ++++++ include/linux/smp.h | 11 +++++ include/linux/smp_lock.h | 2 include/linux/workqueue.h | 3 + kernel/Kconfig.preempt | 91 ++++++++++++++++++++++++++++++--------------- kernel/exit.c | 20 ++++++--- kernel/fork.c | 12 +++++ kernel/futex.c | 10 +++- kernel/notifier.c | 4 - kernel/signal.c | 4 + kernel/softirq.c | 14 +++++- kernel/sys.c | 1 kernel/user.c | 4 - kernel/workqueue.c | 54 +++++++++++++++++++++++++- lib/Kconfig.debug | 4 + lib/Makefile | 3 - lib/kernel_lock.c | 14 +++++- lib/locking-selftest.c | 29 +++++++++----- lib/radix-tree.c | 6 ++ 22 files changed, 257 insertions(+), 69 deletions(-) Index: linux-2.6-tip/include/linux/hardirq.h =================================================================== --- linux-2.6-tip.orig/include/linux/hardirq.h +++ linux-2.6-tip/include/linux/hardirq.h @@ -75,9 +75,9 @@ * Are we doing bottom half or hardware interrupt processing? * Are we in a softirq context? Interrupt context? */ -#define in_irq() (hardirq_count()) -#define in_softirq() (softirq_count()) -#define in_interrupt() (irq_count()) +#define in_irq() (hardirq_count() || (current->flags & PF_HARDIRQ)) +#define in_softirq() (softirq_count() || (current->flags & PF_SOFTIRQ)) +#define in_interrupt() (irq_count()) /* * Are we in NMI context? Index: linux-2.6-tip/include/linux/kernel.h =================================================================== --- linux-2.6-tip.orig/include/linux/kernel.h +++ linux-2.6-tip/include/linux/kernel.h @@ -122,7 +122,7 @@ extern int _cond_resched(void); # define might_resched() do { } while (0) #endif -#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP +#if defined(CONFIG_DEBUG_SPINLOCK_SLEEP) || defined(CONFIG_DEBUG_PREEMPT) void __might_sleep(char *file, int line); /** * might_sleep - annotation for functions that can sleep @@ -278,6 +278,12 @@ extern void printk_tick(void); extern void asmlinkage __attribute__((format(printf, 1, 2))) early_printk(const char *fmt, ...); +#ifdef CONFIG_PREEMPT_RT +extern void zap_rt_locks(void); +#else +# define zap_rt_locks() do { } while (0) +#endif + unsigned long int_sqrt(unsigned long); static inline void console_silent(void) @@ -306,6 +312,7 @@ extern int root_mountflags; /* Values used for system_state */ extern enum system_states { SYSTEM_BOOTING, + SYSTEM_BOOTING_SCHEDULER_OK, SYSTEM_RUNNING, SYSTEM_HALT, SYSTEM_POWER_OFF, Index: linux-2.6-tip/include/linux/profile.h =================================================================== --- linux-2.6-tip.orig/include/linux/profile.h +++ linux-2.6-tip/include/linux/profile.h @@ -4,14 +4,16 @@ #include #include #include +#include #include #include -#define CPU_PROFILING 1 -#define SCHED_PROFILING 2 -#define SLEEP_PROFILING 3 -#define KVM_PROFILING 4 +#define CPU_PROFILING 1 +#define SCHED_PROFILING 2 +#define SLEEP_PROFILING 3 +#define KVM_PROFILING 4 +#define PREEMPT_PROFILING 5 struct proc_dir_entry; struct pt_regs; @@ -36,6 +38,8 @@ enum profile_type { PROFILE_MUNMAP }; +extern int prof_pid; + #ifdef CONFIG_PROFILING extern int prof_on __read_mostly; Index: linux-2.6-tip/include/linux/radix-tree.h =================================================================== --- linux-2.6-tip.orig/include/linux/radix-tree.h +++ linux-2.6-tip/include/linux/radix-tree.h @@ -167,7 +167,18 @@ radix_tree_gang_lookup_slot(struct radix unsigned long first_index, unsigned int max_items); unsigned long radix_tree_next_hole(struct radix_tree_root *root, unsigned long index, unsigned long max_scan); +/* + * On a mutex based kernel we can freely schedule within the radix code: + */ +#ifdef CONFIG_PREEMPT_RT +static inline int radix_tree_preload(gfp_t gfp_mask) +{ + return 0; +} +#else int radix_tree_preload(gfp_t gfp_mask); +#endif + void radix_tree_init(void); void *radix_tree_tag_set(struct radix_tree_root *root, unsigned long index, unsigned int tag); @@ -187,7 +198,9 @@ int radix_tree_tagged(struct radix_tree_ static inline void radix_tree_preload_end(void) { +#ifndef CONFIG_PREEMPT_RT preempt_enable(); +#endif } #endif /* _LINUX_RADIX_TREE_H */ Index: linux-2.6-tip/include/linux/smp.h =================================================================== --- linux-2.6-tip.orig/include/linux/smp.h +++ linux-2.6-tip/include/linux/smp.h @@ -50,6 +50,16 @@ extern void smp_send_stop(void); */ extern void smp_send_reschedule(int cpu); +/* + * trigger a reschedule on all other CPUs: + */ +extern void smp_send_reschedule_allbutself(void); + +/* + * trigger a reschedule on all other CPUs: + */ +extern void smp_send_reschedule_allbutself(void); + /* * Prepare machine for booting other CPUs. @@ -142,6 +152,7 @@ static inline int up_smp_call_function(v 0; \ }) static inline void smp_send_reschedule(int cpu) { } +static inline void smp_send_reschedule_allbutself(void) { } #define num_booting_cpus() 1 #define smp_prepare_boot_cpu() do {} while (0) #define smp_call_function_mask(mask, func, info, wait) \ Index: linux-2.6-tip/include/linux/smp_lock.h =================================================================== --- linux-2.6-tip.orig/include/linux/smp_lock.h +++ linux-2.6-tip/include/linux/smp_lock.h @@ -45,7 +45,7 @@ static inline void cycle_kernel_lock(voi #define unlock_kernel() do { } while(0) #define release_kernel_lock(task) do { } while(0) #define cycle_kernel_lock() do { } while(0) -#define reacquire_kernel_lock(task) 0 +#define reacquire_kernel_lock(task) do { } while(0) #define kernel_locked() 1 #endif /* CONFIG_LOCK_KERNEL */ Index: linux-2.6-tip/include/linux/workqueue.h =================================================================== --- linux-2.6-tip.orig/include/linux/workqueue.h +++ linux-2.6-tip/include/linux/workqueue.h @@ -190,6 +190,9 @@ __create_workqueue_key(const char *name, #define create_freezeable_workqueue(name) __create_workqueue((name), 1, 1, 0) #define create_singlethread_workqueue(name) __create_workqueue((name), 1, 0, 0) +extern void set_workqueue_prio(struct workqueue_struct *wq, int policy, + int rt_priority, int nice); + extern void destroy_workqueue(struct workqueue_struct *wq); extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); Index: linux-2.6-tip/kernel/Kconfig.preempt =================================================================== --- linux-2.6-tip.orig/kernel/Kconfig.preempt +++ linux-2.6-tip/kernel/Kconfig.preempt @@ -1,14 +1,13 @@ - choice - prompt "Preemption Model" - default PREEMPT_NONE + prompt "Preemption Mode" + default PREEMPT_RT config PREEMPT_NONE bool "No Forced Preemption (Server)" help - This is the traditional Linux preemption model, geared towards + This is the traditional Linux preemption model geared towards throughput. It will still provide good latencies most of the - time, but there are no guarantees and occasional longer delays + time but there are no guarantees and occasional long delays are possible. Select this option if you are building a kernel for a server or @@ -21,7 +20,7 @@ config PREEMPT_VOLUNTARY help This option reduces the latency of the kernel by adding more "explicit preemption points" to the kernel code. These new - preemption points have been selected to reduce the maximum + preemption points have been selected to minimize the maximum latency of rescheduling, providing faster application reactions, at the cost of slightly lower throughput. @@ -33,38 +32,73 @@ config PREEMPT_VOLUNTARY Select this if you are building a kernel for a desktop system. -config PREEMPT +config PREEMPT_DESKTOP bool "Preemptible Kernel (Low-Latency Desktop)" help This option reduces the latency of the kernel by making - all kernel code (that is not executing in a critical section) + all kernel code that is not executing in a critical section preemptible. This allows reaction to interactive events by permitting a low priority process to be preempted involuntarily even if it is in kernel mode executing a system call and would - otherwise not be about to reach a natural preemption point. - This allows applications to run more 'smoothly' even when the - system is under load, at the cost of slightly lower throughput - and a slight runtime overhead to kernel code. + otherwise not about to reach a preemption point. This allows + applications to run more 'smoothly' even when the system is + under load, at the cost of slighly lower throughput and a + slight runtime overhead to kernel code. + + (According to profiles, when this mode is selected then even + during kernel-intense workloads the system is in an immediately + preemptible state more than 50% of the time.) Select this if you are building a kernel for a desktop or embedded system with latency requirements in the milliseconds range. +config PREEMPT_RT + bool "Complete Preemption (Real-Time)" + select PREEMPT_SOFTIRQS + select PREEMPT_HARDIRQS + select PREEMPT_RCU + select RT_MUTEXES + help + This option further reduces the scheduling latency of the + kernel by replacing almost every spinlock used by the kernel + with preemptible mutexes and thus making all but the most + critical kernel code involuntarily preemptible. The remaining + handful of lowlevel non-preemptible codepaths are short and + have a deterministic latency of a couple of tens of + microseconds (depending on the hardware). This also allows + applications to run more 'smoothly' even when the system is + under load, at the cost of lower throughput and runtime + overhead to kernel code. + + (According to profiles, when this mode is selected then even + during kernel-intense workloads the system is in an immediately + preemptible state more than 95% of the time.) + + Select this if you are building a kernel for a desktop, + embedded or real-time system with guaranteed latency + requirements of 100 usecs or lower. + endchoice +config PREEMPT + bool + default y + depends on PREEMPT_DESKTOP || PREEMPT_RT + config PREEMPT_SOFTIRQS bool "Thread Softirqs" default n # depends on PREEMPT help This option reduces the latency of the kernel by 'threading' - soft interrupts. This means that all softirqs will execute - in softirqd's context. While this helps latency, it can also - reduce performance. - - The threading of softirqs can also be controlled via - /proc/sys/kernel/softirq_preemption runtime flag and the - sofirq-preempt=0/1 boot-time option. + soft interrupts. This means that all softirqs will execute + in softirqd's context. While this helps latency, it can also + reduce performance. + + The threading of softirqs can also be controlled via + /proc/sys/kernel/softirq_preemption runtime flag and the + sofirq-preempt=0/1 boot-time option. Say N if you are unsure. @@ -75,15 +109,14 @@ config PREEMPT_HARDIRQS select PREEMPT_SOFTIRQS help This option reduces the latency of the kernel by 'threading' - hardirqs. This means that all (or selected) hardirqs will run - in their own kernel thread context. While this helps latency, - this feature can also reduce performance. - - The threading of hardirqs can also be controlled via the - /proc/sys/kernel/hardirq_preemption runtime flag and the - hardirq-preempt=0/1 boot-time option. Per-irq threading can - be enabled/disable via the /proc/irq///threaded - runtime flags. + hardirqs. This means that all (or selected) hardirqs will run + in their own kernel thread context. While this helps latency, + this feature can also reduce performance. + + The threading of hardirqs can also be controlled via the + /proc/sys/kernel/hardirq_preemption runtime flag and the + hardirq-preempt=0/1 boot-time option. Per-irq threading can + be enabled/disable via the /proc/irq///threaded + runtime flags. Say N if you are unsure. - Index: linux-2.6-tip/kernel/exit.c =================================================================== --- linux-2.6-tip.orig/kernel/exit.c +++ linux-2.6-tip/kernel/exit.c @@ -75,7 +75,9 @@ static void __unhash_process(struct task detach_pid(p, PIDTYPE_SID); list_del_rcu(&p->tasks); + preempt_disable(); __get_cpu_var(process_counts)--; + preempt_enable(); } list_del_rcu(&p->thread_group); list_del_init(&p->sibling); @@ -726,9 +728,11 @@ static void exit_mm(struct task_struct * task_lock(tsk); tsk->mm = NULL; up_read(&mm->mmap_sem); + preempt_disable(); // FIXME enter_lazy_tlb(mm, current); /* We don't want this task to be frozen prematurely */ clear_freeze_flag(tsk); + preempt_enable(); task_unlock(tsk); mm_update_next_owner(mm); mmput(mm); @@ -1118,14 +1122,17 @@ NORET_TYPE void do_exit(long code) if (tsk->splice_pipe) __free_pipe_info(tsk->splice_pipe); - preempt_disable(); +again: + local_irq_disable(); /* causes final put_task_struct in finish_task_switch(). */ tsk->state = TASK_DEAD; - schedule(); - BUG(); - /* Avoid "noreturn function does return". */ - for (;;) - cpu_relax(); /* For when BUG is null */ + __schedule(); + printk(KERN_ERR "BUG: dead task %s:%d back from the grave!\n", + current->comm, current->pid); + printk(KERN_ERR ".... flags: %08x, count: %d, state: %08lx\n", + current->flags, atomic_read(¤t->usage), current->state); + printk(KERN_ERR ".... trying again ...\n"); + goto again; } EXPORT_SYMBOL_GPL(do_exit); @@ -1574,6 +1581,7 @@ static int wait_consider_task(struct tas int __user *stat_addr, struct rusage __user *ru) { int ret = eligible_child(type, pid, options, p); + BUG_ON(!atomic_read(&p->usage)); if (!ret) return ret; Index: linux-2.6-tip/kernel/fork.c =================================================================== --- linux-2.6-tip.orig/kernel/fork.c +++ linux-2.6-tip/kernel/fork.c @@ -176,6 +176,16 @@ void __put_task_struct(struct task_struc free_task(tsk); } +#ifdef CONFIG_PREEMPT_RT +void __put_task_struct_cb(struct rcu_head *rhp) +{ + struct task_struct *tsk = container_of(rhp, struct task_struct, rcu); + + __put_task_struct(tsk); + +} +#endif + /* * macro override instead of weak attribute alias, to workaround * gcc 4.1.0 and 4.1.1 bugs with weak attribute and empty functions. @@ -1241,11 +1251,13 @@ static struct task_struct *copy_process( * to ensure it is on a valid CPU (and if not, just force it back to * parent's CPU). This avoids alot of nasty races. */ + preempt_disable(); p->cpus_allowed = current->cpus_allowed; p->rt.nr_cpus_allowed = current->rt.nr_cpus_allowed; if (unlikely(!cpu_isset(task_cpu(p), p->cpus_allowed) || !cpu_online(task_cpu(p)))) set_task_cpu(p, smp_processor_id()); + preempt_enable(); /* CLONE_PARENT re-uses the old parent */ if (clone_flags & (CLONE_PARENT|CLONE_THREAD)) { Index: linux-2.6-tip/kernel/futex.c =================================================================== --- linux-2.6-tip.orig/kernel/futex.c +++ linux-2.6-tip/kernel/futex.c @@ -867,7 +867,7 @@ retry_private: plist_del(&this->list, &hb1->chain); plist_add(&this->list, &hb2->chain); this->lock_ptr = &hb2->lock; -#ifdef CONFIG_DEBUG_PI_LIST +#if defined(CONFIG_DEBUG_PI_LIST) && !defined(CONFIG_PREEMPT_RT) this->list.plist.lock = &hb2->lock; #endif } @@ -925,7 +925,7 @@ static inline void queue_me(struct futex prio = min(current->normal_prio, MAX_RT_PRIO); plist_node_init(&q->list, prio); -#ifdef CONFIG_DEBUG_PI_LIST +#if defined(CONFIG_DEBUG_PI_LIST) && !defined(CONFIG_PREEMPT_RT) q->list.plist.lock = &hb->lock; #endif plist_add(&q->list, &hb->chain); @@ -1203,6 +1203,10 @@ retry_private: * q.lock_ptr != 0 is not safe, because of ordering against wakeup. */ if (likely(!plist_node_empty(&q.list))) { + unsigned long nosched_flag = current->flags & PF_NOSCHED; + + current->flags &= ~PF_NOSCHED; + if (!abs_time) schedule(); else { @@ -1233,6 +1237,8 @@ retry_private: destroy_hrtimer_on_stack(&t.timer); } + + current->flags |= nosched_flag; } __set_current_state(TASK_RUNNING); Index: linux-2.6-tip/kernel/notifier.c =================================================================== --- linux-2.6-tip.orig/kernel/notifier.c +++ linux-2.6-tip/kernel/notifier.c @@ -71,7 +71,7 @@ static int notifier_chain_unregister(str * @returns: notifier_call_chain returns the value returned by the * last notifier function called. */ -static int __kprobes notifier_call_chain(struct notifier_block **nl, +static int __kprobes notrace notifier_call_chain(struct notifier_block **nl, unsigned long val, void *v, int nr_to_call, int *nr_calls) { @@ -217,7 +217,7 @@ int blocking_notifier_chain_register(str * not yet working and interrupts must remain disabled. At * such times we must not call down_write(). */ - if (unlikely(system_state == SYSTEM_BOOTING)) + if (unlikely(system_state < SYSTEM_RUNNING)) return notifier_chain_register(&nh->head, n); down_write(&nh->rwsem); Index: linux-2.6-tip/kernel/signal.c =================================================================== --- linux-2.6-tip.orig/kernel/signal.c +++ linux-2.6-tip/kernel/signal.c @@ -821,7 +821,9 @@ static int send_signal(int sig, struct s trace_sched_signal_send(sig, t); +#ifdef CONFIG_SMP assert_spin_locked(&t->sighand->siglock); +#endif if (!prepare_signal(sig, t)) return 0; @@ -1576,6 +1578,7 @@ static void ptrace_stop(int exit_code, i if (may_ptrace_stop()) { do_notify_parent_cldstop(current, CLD_TRAPPED); read_unlock(&tasklist_lock); + current->flags &= ~PF_NOSCHED; schedule(); } else { /* @@ -1644,6 +1647,7 @@ finish_stop(int stop_count) } do { + current->flags &= ~PF_NOSCHED; schedule(); } while (try_to_freeze()); /* Index: linux-2.6-tip/kernel/softirq.c =================================================================== --- linux-2.6-tip.orig/kernel/softirq.c +++ linux-2.6-tip/kernel/softirq.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -133,6 +134,8 @@ static void trigger_softirqs(void) } } +#ifndef CONFIG_PREEMPT_RT + /* * This one is for softirq.c-internal use, * where hardirqs are disabled legitimately: @@ -234,6 +237,8 @@ void local_bh_enable_ip(unsigned long ip } EXPORT_SYMBOL(local_bh_enable_ip); +#endif + /* * We restart softirq processing MAX_SOFTIRQ_RESTART times, * and we fall back to softirqd after that. @@ -633,7 +638,7 @@ void tasklet_kill(struct tasklet_struct while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { do - yield(); + msleep(1); while (test_bit(TASKLET_STATE_SCHED, &t->state)); } tasklet_unlock_wait(t); @@ -1041,6 +1046,11 @@ int softirq_preemption = 1; EXPORT_SYMBOL(softirq_preemption); +/* + * Real-Time Preemption depends on softirq threading: + */ +#ifndef CONFIG_PREEMPT_RT + static int __init softirq_preempt_setup (char *str) { if (!strncmp(str, "off", 3)) @@ -1054,7 +1064,7 @@ static int __init softirq_preempt_setup } __setup("softirq-preempt=", softirq_preempt_setup); - +#endif #endif #ifdef CONFIG_SMP Index: linux-2.6-tip/kernel/sys.c =================================================================== --- linux-2.6-tip.orig/kernel/sys.c +++ linux-2.6-tip/kernel/sys.c @@ -38,6 +38,7 @@ #include #include +#include #include #include Index: linux-2.6-tip/kernel/user.c =================================================================== --- linux-2.6-tip.orig/kernel/user.c +++ linux-2.6-tip/kernel/user.c @@ -405,11 +405,11 @@ void free_uid(struct user_struct *up) if (!up) return; - local_irq_save(flags); + local_irq_save_nort(flags); if (atomic_dec_and_lock(&up->__count, &uidhash_lock)) free_user(up, flags); else - local_irq_restore(flags); + local_irq_restore_nort(flags); } struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid) Index: linux-2.6-tip/kernel/workqueue.c =================================================================== --- linux-2.6-tip.orig/kernel/workqueue.c +++ linux-2.6-tip/kernel/workqueue.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,8 @@ #include #include +#include + /* * The per-CPU workqueue (if single thread, we always use the first * possible cpu). @@ -162,13 +165,14 @@ static void __queue_work(struct cpu_work * * We queue the work to the CPU on which it was submitted, but if the CPU dies * it can be processed by another CPU. + * + * Especially no such guarantee on PREEMPT_RT. */ int queue_work(struct workqueue_struct *wq, struct work_struct *work) { - int ret; + int ret = 0, cpu = raw_smp_processor_id(); - ret = queue_work_on(get_cpu(), wq, work); - put_cpu(); + ret = queue_work_on(cpu, wq, work); return ret; } @@ -909,6 +913,49 @@ static void cleanup_workqueue_thread(str cwq->thread = NULL; } +void set_workqueue_thread_prio(struct workqueue_struct *wq, int cpu, + int policy, int rt_priority, int nice) +{ + struct sched_param param = { .sched_priority = rt_priority }; + struct cpu_workqueue_struct *cwq; + mm_segment_t oldfs = get_fs(); + struct task_struct *p; + unsigned long flags; + int ret; + + cwq = per_cpu_ptr(wq->cpu_wq, cpu); + spin_lock_irqsave(&cwq->lock, flags); + p = cwq->thread; + spin_unlock_irqrestore(&cwq->lock, flags); + + set_user_nice(p, nice); + + set_fs(KERNEL_DS); + ret = sys_sched_setscheduler(p->pid, policy, ¶m); + set_fs(oldfs); + + WARN_ON(ret); +} + +void set_workqueue_prio(struct workqueue_struct *wq, int policy, + int rt_priority, int nice) +{ + int cpu; + + /* We don't need the distraction of CPUs appearing and vanishing. */ + get_online_cpus(); + spin_lock(&workqueue_lock); + if (is_wq_single_threaded(wq)) + set_workqueue_thread_prio(wq, 0, policy, rt_priority, nice); + else { + for_each_online_cpu(cpu) + set_workqueue_thread_prio(wq, cpu, policy, + rt_priority, nice); + } + spin_unlock(&workqueue_lock); + put_online_cpus(); +} + /** * destroy_workqueue - safely terminate a workqueue * @wq: target workqueue @@ -1035,6 +1082,7 @@ void __init init_workqueues(void) hotcpu_notifier(workqueue_cpu_callback, 0); keventd_wq = create_workqueue("events"); BUG_ON(!keventd_wq); + set_workqueue_prio(keventd_wq, SCHED_FIFO, 1, -20); #ifdef CONFIG_SMP work_on_cpu_wq = create_workqueue("work_on_cpu"); BUG_ON(!work_on_cpu_wq); Index: linux-2.6-tip/lib/Kconfig.debug =================================================================== --- linux-2.6-tip.orig/lib/Kconfig.debug +++ linux-2.6-tip/lib/Kconfig.debug @@ -364,6 +364,8 @@ config DEBUG_RT_MUTEXES help This allows rt mutex semantics violations and rt mutex related deadlocks (lockups) to be detected and reported automatically. + When realtime preemption is enabled this includes spinlocks, + rwlocks, mutexes and (rw)semaphores config DEBUG_PI_LIST bool @@ -387,7 +389,7 @@ config DEBUG_SPINLOCK config DEBUG_MUTEXES bool "Mutex debugging: basic checks" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && !PREEMPT_RT help This feature allows mutex semantics violations to be detected and reported. Index: linux-2.6-tip/lib/Makefile =================================================================== --- linux-2.6-tip.orig/lib/Makefile +++ linux-2.6-tip/lib/Makefile @@ -34,7 +34,8 @@ obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o -lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o +obj-$(CONFIG_PREEMPT_RT) += plist.o +obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o lib-$(CONFIG_GENERIC_FIND_FIRST_BIT) += find_next_bit.o lib-$(CONFIG_GENERIC_FIND_NEXT_BIT) += find_next_bit.o Index: linux-2.6-tip/lib/kernel_lock.c =================================================================== --- linux-2.6-tip.orig/lib/kernel_lock.c +++ linux-2.6-tip/lib/kernel_lock.c @@ -35,6 +35,8 @@ DECLARE_MUTEX(kernel_sem); * about recursion, both due to the down() and due to the enabling of * preemption. schedule() will re-check the preemption flag after * reacquiring the semaphore. + * + * Called with interrupts disabled. */ int __lockfunc __reacquire_kernel_lock(void) { @@ -68,11 +70,15 @@ void __lockfunc lock_kernel(void) struct task_struct *task = current; int depth = task->lock_depth + 1; - if (likely(!depth)) + if (likely(!depth)) { /* * No recursion worries - we set up lock_depth _after_ */ down(&kernel_sem); +#ifdef CONFIG_DEBUG_RT_MUTEXES + current->last_kernel_lock = __builtin_return_address(0); +#endif + } task->lock_depth = depth; } @@ -83,8 +89,12 @@ void __lockfunc unlock_kernel(void) BUG_ON(task->lock_depth < 0); - if (likely(--task->lock_depth < 0)) + if (likely(--task->lock_depth == -1)) { +#ifdef CONFIG_DEBUG_RT_MUTEXES + current->last_kernel_lock = NULL; +#endif up(&kernel_sem); + } } EXPORT_SYMBOL(lock_kernel); Index: linux-2.6-tip/lib/locking-selftest.c =================================================================== --- linux-2.6-tip.orig/lib/locking-selftest.c +++ linux-2.6-tip/lib/locking-selftest.c @@ -158,7 +158,7 @@ static void init_shared_classes(void) local_bh_disable(); \ local_irq_disable(); \ lockdep_softirq_enter(); \ - WARN_ON(!in_softirq()); + /* FIXME: preemptible softirqs. WARN_ON(!in_softirq()); */ #define SOFTIRQ_EXIT() \ lockdep_softirq_exit(); \ @@ -550,6 +550,11 @@ GENERATE_TESTCASE(init_held_rsem) #undef E /* + * FIXME: turns these into raw-spinlock tests on -rt + */ +#ifndef CONFIG_PREEMPT_RT + +/* * locking an irq-safe lock with irqs enabled: */ #define E1() \ @@ -890,6 +895,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_ #include "locking-selftest-softirq.h" // GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion2_soft) +#endif /* !CONFIG_PREEMPT_RT */ + #ifdef CONFIG_DEBUG_LOCK_ALLOC # define I_SPINLOCK(x) lockdep_reset_lock(&lock_##x.dep_map) # define I_RWLOCK(x) lockdep_reset_lock(&rwlock_##x.dep_map) @@ -1004,7 +1011,7 @@ static inline void print_testname(const #define DO_TESTCASE_1(desc, name, nr) \ print_testname(desc"/"#nr); \ - dotest(name##_##nr, SUCCESS, LOCKTYPE_RWLOCK); \ + dotest(name##_##nr, SUCCESS, LOCKTYPE_RWLOCK); \ printk("\n"); #define DO_TESTCASE_1B(desc, name, nr) \ @@ -1012,17 +1019,17 @@ static inline void print_testname(const dotest(name##_##nr, FAILURE, LOCKTYPE_RWLOCK); \ printk("\n"); -#define DO_TESTCASE_3(desc, name, nr) \ - print_testname(desc"/"#nr); \ - dotest(name##_spin_##nr, FAILURE, LOCKTYPE_SPIN); \ - dotest(name##_wlock_##nr, FAILURE, LOCKTYPE_RWLOCK); \ +#define DO_TESTCASE_3(desc, name, nr) \ + print_testname(desc"/"#nr); \ + dotest(name##_spin_##nr, FAILURE, LOCKTYPE_SPIN); \ + dotest(name##_wlock_##nr, FAILURE, LOCKTYPE_RWLOCK); \ dotest(name##_rlock_##nr, SUCCESS, LOCKTYPE_RWLOCK); \ printk("\n"); -#define DO_TESTCASE_3RW(desc, name, nr) \ - print_testname(desc"/"#nr); \ +#define DO_TESTCASE_3RW(desc, name, nr) \ + print_testname(desc"/"#nr); \ dotest(name##_spin_##nr, FAILURE, LOCKTYPE_SPIN|LOCKTYPE_RWLOCK);\ - dotest(name##_wlock_##nr, FAILURE, LOCKTYPE_RWLOCK); \ + dotest(name##_wlock_##nr, FAILURE, LOCKTYPE_RWLOCK); \ dotest(name##_rlock_##nr, SUCCESS, LOCKTYPE_RWLOCK); \ printk("\n"); @@ -1053,7 +1060,7 @@ static inline void print_testname(const print_testname(desc); \ dotest(name##_spin, FAILURE, LOCKTYPE_SPIN); \ dotest(name##_wlock, FAILURE, LOCKTYPE_RWLOCK); \ - dotest(name##_rlock, SUCCESS, LOCKTYPE_RWLOCK); \ + dotest(name##_rlock, SUCCESS, LOCKTYPE_RWLOCK); \ dotest(name##_mutex, FAILURE, LOCKTYPE_MUTEX); \ dotest(name##_wsem, FAILURE, LOCKTYPE_RWSEM); \ dotest(name##_rsem, FAILURE, LOCKTYPE_RWSEM); \ @@ -1185,6 +1192,7 @@ void locking_selftest(void) /* * irq-context testcases: */ +#ifndef CONFIG_PREEMPT_RT DO_TESTCASE_2x6("irqs-on + irq-safe-A", irqsafe1); DO_TESTCASE_2x3("sirq-safe-A => hirqs-on", irqsafe2A); DO_TESTCASE_2x6("safe-A + irqs-on", irqsafe2B); @@ -1194,6 +1202,7 @@ void locking_selftest(void) DO_TESTCASE_6x2("irq read-recursion", irq_read_recursion); // DO_TESTCASE_6x2B("irq read-recursion #2", irq_read_recursion2); +#endif if (unexpected_testcase_failures) { printk("-----------------------------------------------------------------\n"); Index: linux-2.6-tip/lib/radix-tree.c =================================================================== --- linux-2.6-tip.orig/lib/radix-tree.c +++ linux-2.6-tip/lib/radix-tree.c @@ -157,12 +157,14 @@ radix_tree_node_alloc(struct radix_tree_ * succeed in getting a node here (and never reach * kmem_cache_alloc) */ + rtp = &get_cpu_var(radix_tree_preloads); rtp = &__get_cpu_var(radix_tree_preloads); if (rtp->nr) { ret = rtp->nodes[rtp->nr - 1]; rtp->nodes[rtp->nr - 1] = NULL; rtp->nr--; } + put_cpu_var(radix_tree_preloads); } if (ret == NULL) ret = kmem_cache_alloc(radix_tree_node_cachep, gfp_mask); @@ -195,6 +197,8 @@ radix_tree_node_free(struct radix_tree_n call_rcu(&node->rcu_head, radix_tree_node_rcu_free); } +#ifndef CONFIG_PREEMPT_RT + /* * Load up this CPU's radix_tree_node buffer with sufficient objects to * ensure that the addition of a single element in the tree cannot fail. On @@ -227,6 +231,8 @@ out: } EXPORT_SYMBOL(radix_tree_preload); +#endif + /* * Return the maximum key which can be store into a * radix tree with height HEIGHT. patches/preempt-realtime-x86_64.patch0000664000076400007640000001742411161723463016502 0ustar tglxtglxSubject: patches/preempt-realtime-x86_64.patch Signed-off-by: Ingo Molnar --- arch/x86/include/asm/acpi.h | 4 ++-- arch/x86/include/asm/i8259.h | 2 +- arch/x86/include/asm/spinlock.h | 6 +++--- arch/x86/include/asm/tlbflush.h | 2 ++ arch/x86/include/asm/vgtod.h | 2 +- arch/x86/kernel/apic/io_apic.c | 4 ++-- arch/x86/kernel/apic/nmi.c | 2 ++ arch/x86/kernel/early_printk.c | 2 +- arch/x86/kernel/head64.c | 6 +++++- arch/x86/kernel/i8259.c | 2 +- arch/x86/kernel/process_64.c | 6 ++++-- arch/x86/kernel/signal.c | 7 +++++++ arch/x86/kernel/smp.c | 10 ++++++++++ arch/x86/mm/tlb.c | 2 +- 14 files changed, 42 insertions(+), 15 deletions(-) Index: linux-2.6-tip/arch/x86/include/asm/acpi.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/acpi.h +++ linux-2.6-tip/arch/x86/include/asm/acpi.h @@ -50,8 +50,8 @@ #define ACPI_ASM_MACROS #define BREAKPOINT3 -#define ACPI_DISABLE_IRQS() local_irq_disable() -#define ACPI_ENABLE_IRQS() local_irq_enable() +#define ACPI_DISABLE_IRQS() local_irq_disable_nort() +#define ACPI_ENABLE_IRQS() local_irq_enable_nort() #define ACPI_FLUSH_CPU_CACHE() wbinvd() int __acpi_acquire_global_lock(unsigned int *lock); Index: linux-2.6-tip/arch/x86/include/asm/i8259.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/i8259.h +++ linux-2.6-tip/arch/x86/include/asm/i8259.h @@ -24,7 +24,7 @@ extern unsigned int cached_irq_mask; #define SLAVE_ICW4_DEFAULT 0x01 #define PIC_ICW4_AEOI 2 -extern spinlock_t i8259A_lock; +extern raw_spinlock_t i8259A_lock; extern void init_8259A(int auto_eoi); extern void enable_8259A_irq(unsigned int irq); Index: linux-2.6-tip/arch/x86/include/asm/spinlock.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/spinlock.h +++ linux-2.6-tip/arch/x86/include/asm/spinlock.h @@ -295,8 +295,8 @@ static inline void __raw_write_unlock(__ : "+m" (rw->lock) : "i" (RW_LOCK_BIAS) : "memory"); } -#define _raw_spin_relax(lock) cpu_relax() -#define _raw_read_relax(lock) cpu_relax() -#define _raw_write_relax(lock) cpu_relax() +#define __raw_spin_relax(lock) cpu_relax() +#define __raw_read_relax(lock) cpu_relax() +#define __raw_write_relax(lock) cpu_relax() #endif /* _ASM_X86_SPINLOCK_H */ Index: linux-2.6-tip/arch/x86/include/asm/tlbflush.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/tlbflush.h +++ linux-2.6-tip/arch/x86/include/asm/tlbflush.h @@ -17,7 +17,9 @@ static inline void __native_flush_tlb(void) { + preempt_disable(); write_cr3(read_cr3()); + preempt_enable(); } static inline void __native_flush_tlb_global(void) Index: linux-2.6-tip/arch/x86/include/asm/vgtod.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/vgtod.h +++ linux-2.6-tip/arch/x86/include/asm/vgtod.h @@ -5,7 +5,7 @@ #include struct vsyscall_gtod_data { - seqlock_t lock; + raw_seqlock_t lock; /* open coded 'struct timespec' */ time_t wall_time_sec; Index: linux-2.6-tip/arch/x86/kernel/apic/io_apic.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/apic/io_apic.c +++ linux-2.6-tip/arch/x86/kernel/apic/io_apic.c @@ -72,8 +72,8 @@ */ int sis_apic_bug = -1; -static DEFINE_SPINLOCK(ioapic_lock); -static DEFINE_SPINLOCK(vector_lock); +static DEFINE_RAW_SPINLOCK(ioapic_lock); +static DEFINE_RAW_SPINLOCK(vector_lock); /* * # of IRQ routing registers Index: linux-2.6-tip/arch/x86/kernel/apic/nmi.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/apic/nmi.c +++ linux-2.6-tip/arch/x86/kernel/apic/nmi.c @@ -90,7 +90,9 @@ static inline unsigned int get_timer_irq */ static __init void nmi_cpu_busy(void *data) { +#ifndef CONFIG_PREEMPT_RT local_irq_enable_in_hardirq(); +#endif /* * Intentionally don't use cpu_relax here. This is * to make sure that the performance counter really ticks, Index: linux-2.6-tip/arch/x86/kernel/early_printk.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/early_printk.c +++ linux-2.6-tip/arch/x86/kernel/early_printk.c @@ -881,7 +881,7 @@ static int __initdata early_console_init asmlinkage void early_printk(const char *fmt, ...) { - char buf[512]; + static char buf[512]; int n; va_list ap; Index: linux-2.6-tip/arch/x86/kernel/head64.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/head64.c +++ linux-2.6-tip/arch/x86/kernel/head64.c @@ -30,7 +30,11 @@ static void __init zap_identity_mappings { pgd_t *pgd = pgd_offset_k(0UL); pgd_clear(pgd); - __flush_tlb_all(); + /* + * preempt_disable/enable does not work this early in the + * bootup yet: + */ + write_cr3(read_cr3()); } /* Don't add a printk in there. printk relies on the PDA which is not initialized Index: linux-2.6-tip/arch/x86/kernel/i8259.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/i8259.c +++ linux-2.6-tip/arch/x86/kernel/i8259.c @@ -32,8 +32,8 @@ */ static int i8259A_auto_eoi; -DEFINE_SPINLOCK(i8259A_lock); static void mask_and_ack_8259A(unsigned int); +DEFINE_RAW_SPINLOCK(i8259A_lock); struct irq_chip i8259A_chip = { .name = "XT-PIC", Index: linux-2.6-tip/arch/x86/kernel/process_64.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/process_64.c +++ linux-2.6-tip/arch/x86/kernel/process_64.c @@ -155,9 +155,11 @@ void cpu_idle(void) } tick_nohz_restart_sched_tick(); - preempt_enable_no_resched(); - schedule(); + local_irq_disable(); + __preempt_enable_no_resched(); + __schedule(); preempt_disable(); + local_irq_enable(); } } Index: linux-2.6-tip/arch/x86/kernel/signal.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/signal.c +++ linux-2.6-tip/arch/x86/kernel/signal.c @@ -783,6 +783,13 @@ static void do_signal(struct pt_regs *re int signr; sigset_t *oldset; +#ifdef CONFIG_PREEMPT_RT + /* + * Fully-preemptible kernel does not need interrupts disabled: + */ + local_irq_enable(); + preempt_check_resched(); +#endif /* * We want the common case to go fast, which is why we may in certain * cases get here from kernel mode. Just return without doing anything Index: linux-2.6-tip/arch/x86/kernel/smp.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/smp.c +++ linux-2.6-tip/arch/x86/kernel/smp.c @@ -120,6 +120,16 @@ static void native_smp_send_reschedule(i apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR); } +/* + * this function sends a 'reschedule' IPI to all other CPUs. + * This is used when RT tasks are starving and other CPUs + * might be able to run them: + */ +void smp_send_reschedule_allbutself(void) +{ + apic->send_IPI_allbutself(RESCHEDULE_VECTOR); +} + void native_send_call_func_single_ipi(int cpu) { apic->send_IPI_mask(cpumask_of(cpu), CALL_FUNCTION_SINGLE_VECTOR); Index: linux-2.6-tip/arch/x86/mm/tlb.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/tlb.c +++ linux-2.6-tip/arch/x86/mm/tlb.c @@ -40,8 +40,8 @@ union smp_flush_state { struct { struct mm_struct *flush_mm; unsigned long flush_va; - spinlock_t tlbstate_lock; DECLARE_BITMAP(flush_cpumask, NR_CPUS); + raw_spinlock_t tlbstate_lock; }; char pad[CONFIG_X86_INTERNODE_CACHE_BYTES]; } ____cacheline_internodealigned_in_smp; patches/powerpc-rawlocks.patch0000664000076400007640000003011711160752235015564 0ustar tglxtglxSubject: powerpc-rawlocks.patch From: Thomas Gleixner Date: Fri, 20 Mar 2009 17:47:17 +0100 Signed-off-by: Thomas Gleixner --- arch/powerpc/include/asm/mpic.h | 2 +- arch/powerpc/include/asm/pmac_feature.h | 2 +- arch/powerpc/include/asm/rtas.h | 2 +- arch/powerpc/kernel/irq.c | 2 +- arch/powerpc/kernel/pmc.c | 2 +- arch/powerpc/kernel/prom.c | 2 +- arch/powerpc/kernel/rtas.c | 2 +- arch/powerpc/kernel/traps.c | 9 +++++++-- arch/powerpc/mm/hash_native_64.c | 2 +- arch/powerpc/platforms/cell/beat_htab.c | 2 +- arch/powerpc/platforms/cell/beat_interrupt.c | 2 +- arch/powerpc/platforms/chrp/smp.c | 2 +- arch/powerpc/platforms/powermac/feature.c | 2 +- arch/powerpc/platforms/powermac/nvram.c | 2 +- arch/powerpc/platforms/powermac/pic.c | 2 +- arch/powerpc/platforms/pseries/eeh.c | 2 +- arch/powerpc/platforms/pseries/smp.c | 2 +- arch/powerpc/sysdev/i8259.c | 2 +- arch/powerpc/sysdev/ipic.c | 2 +- arch/powerpc/sysdev/mpic.c | 2 +- drivers/of/base.c | 2 +- 21 files changed, 27 insertions(+), 22 deletions(-) Index: linux-2.6-tip/arch/powerpc/include/asm/mpic.h =================================================================== --- linux-2.6-tip.orig/arch/powerpc/include/asm/mpic.h +++ linux-2.6-tip/arch/powerpc/include/asm/mpic.h @@ -281,7 +281,7 @@ struct mpic #ifdef CONFIG_MPIC_U3_HT_IRQS /* The fixup table */ struct mpic_irq_fixup *fixups; - spinlock_t fixup_lock; + raw_spinlock_t fixup_lock; #endif /* Register access method */ Index: linux-2.6-tip/arch/powerpc/include/asm/pmac_feature.h =================================================================== --- linux-2.6-tip.orig/arch/powerpc/include/asm/pmac_feature.h +++ linux-2.6-tip/arch/powerpc/include/asm/pmac_feature.h @@ -378,7 +378,7 @@ extern struct macio_chip* macio_find(str * Those are exported by pmac feature for internal use by arch code * only like the platform function callbacks, do not use directly in drivers */ -extern spinlock_t feature_lock; +extern raw_spinlock_t feature_lock; extern struct device_node *uninorth_node; extern u32 __iomem *uninorth_base; Index: linux-2.6-tip/arch/powerpc/include/asm/rtas.h =================================================================== --- linux-2.6-tip.orig/arch/powerpc/include/asm/rtas.h +++ linux-2.6-tip/arch/powerpc/include/asm/rtas.h @@ -58,7 +58,7 @@ struct rtas_t { unsigned long entry; /* physical address pointer */ unsigned long base; /* physical address pointer */ unsigned long size; - spinlock_t lock; + raw_spinlock_t lock; struct rtas_args args; struct device_node *dev; /* virtual address pointer */ }; Index: linux-2.6-tip/arch/powerpc/kernel/irq.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/kernel/irq.c +++ linux-2.6-tip/arch/powerpc/kernel/irq.c @@ -443,7 +443,7 @@ void do_softirq(void) */ static LIST_HEAD(irq_hosts); -static DEFINE_SPINLOCK(irq_big_lock); +static DEFINE_RAW_SPINLOCK(irq_big_lock); static unsigned int revmap_trees_allocated; static DEFINE_MUTEX(revmap_trees_mutex); struct irq_map_entry irq_map[NR_IRQS]; Index: linux-2.6-tip/arch/powerpc/kernel/pmc.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/kernel/pmc.c +++ linux-2.6-tip/arch/powerpc/kernel/pmc.c @@ -37,7 +37,7 @@ static void dummy_perf(struct pt_regs *r } -static DEFINE_SPINLOCK(pmc_owner_lock); +static DEFINE_RAW_SPINLOCK(pmc_owner_lock); static void *pmc_owner_caller; /* mostly for debugging */ perf_irq_t perf_irq = dummy_perf; Index: linux-2.6-tip/arch/powerpc/kernel/prom.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/kernel/prom.c +++ linux-2.6-tip/arch/powerpc/kernel/prom.c @@ -81,7 +81,7 @@ struct boot_param_header *initial_boot_p extern struct device_node *allnodes; /* temporary while merging */ -extern rwlock_t devtree_lock; /* temporary while merging */ +extern raw_rwlock_t devtree_lock; /* temporary while merging */ /* export that to outside world */ struct device_node *of_chosen; Index: linux-2.6-tip/arch/powerpc/kernel/rtas.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/kernel/rtas.c +++ linux-2.6-tip/arch/powerpc/kernel/rtas.c @@ -40,7 +40,7 @@ #include struct rtas_t rtas = { - .lock = SPIN_LOCK_UNLOCKED + .lock = RAW_SPIN_LOCK_UNLOCKED(lock) }; EXPORT_SYMBOL(rtas); Index: linux-2.6-tip/arch/powerpc/kernel/traps.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/kernel/traps.c +++ linux-2.6-tip/arch/powerpc/kernel/traps.c @@ -96,11 +96,11 @@ static inline void pmac_backlight_unblan int die(const char *str, struct pt_regs *regs, long err) { static struct { - spinlock_t lock; + raw_spinlock_t lock; u32 lock_owner; int lock_owner_depth; } die = { - .lock = __SPIN_LOCK_UNLOCKED(die.lock), + .lock = _RAW_SPIN_LOCK_UNLOCKED(die.lock), .lock_owner = -1, .lock_owner_depth = 0 }; @@ -187,6 +187,11 @@ void _exception(int signr, struct pt_reg addr, regs->nip, regs->link, code); } +#ifdef CONFIG_PREEMPT_RT + local_irq_enable(); + preempt_check_resched(); +#endif + memset(&info, 0, sizeof(info)); info.si_signo = signr; info.si_code = code; Index: linux-2.6-tip/arch/powerpc/mm/hash_native_64.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/mm/hash_native_64.c +++ linux-2.6-tip/arch/powerpc/mm/hash_native_64.c @@ -36,7 +36,7 @@ #define HPTE_LOCK_BIT 3 -static DEFINE_SPINLOCK(native_tlbie_lock); +static DEFINE_RAW_SPINLOCK(native_tlbie_lock); static inline void __tlbie(unsigned long va, int psize, int ssize) { Index: linux-2.6-tip/arch/powerpc/platforms/cell/beat_htab.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/platforms/cell/beat_htab.c +++ linux-2.6-tip/arch/powerpc/platforms/cell/beat_htab.c @@ -40,7 +40,7 @@ #define DBG_LOW(fmt...) do { } while (0) #endif -static DEFINE_SPINLOCK(beat_htab_lock); +static DEFINE_RAW_SPINLOCK(beat_htab_lock); static inline unsigned int beat_read_mask(unsigned hpte_group) { Index: linux-2.6-tip/arch/powerpc/platforms/cell/beat_interrupt.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/platforms/cell/beat_interrupt.c +++ linux-2.6-tip/arch/powerpc/platforms/cell/beat_interrupt.c @@ -30,7 +30,7 @@ #include "beat_wrapper.h" #define MAX_IRQS NR_IRQS -static DEFINE_SPINLOCK(beatic_irq_mask_lock); +static DEFINE_RAW_SPINLOCK(beatic_irq_mask_lock); static uint64_t beatic_irq_mask_enable[(MAX_IRQS+255)/64]; static uint64_t beatic_irq_mask_ack[(MAX_IRQS+255)/64]; Index: linux-2.6-tip/arch/powerpc/platforms/chrp/smp.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/platforms/chrp/smp.c +++ linux-2.6-tip/arch/powerpc/platforms/chrp/smp.c @@ -42,7 +42,7 @@ static void __devinit smp_chrp_setup_cpu mpic_setup_this_cpu(); } -static DEFINE_SPINLOCK(timebase_lock); +static DEFINE_RAW_SPINLOCK(timebase_lock); static unsigned int timebase_upper = 0, timebase_lower = 0; void __devinit smp_chrp_give_timebase(void) Index: linux-2.6-tip/arch/powerpc/platforms/powermac/feature.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/platforms/powermac/feature.c +++ linux-2.6-tip/arch/powerpc/platforms/powermac/feature.c @@ -59,7 +59,7 @@ extern struct device_node *k2_skiplist[2 * We use a single global lock to protect accesses. Each driver has * to take care of its own locking */ -DEFINE_SPINLOCK(feature_lock); +DEFINE_RAW_SPINLOCK(feature_lock); #define LOCK(flags) spin_lock_irqsave(&feature_lock, flags); #define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags); Index: linux-2.6-tip/arch/powerpc/platforms/powermac/nvram.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/platforms/powermac/nvram.c +++ linux-2.6-tip/arch/powerpc/platforms/powermac/nvram.c @@ -80,7 +80,7 @@ static int is_core_99; static int core99_bank = 0; static int nvram_partitions[3]; // XXX Turn that into a sem -static DEFINE_SPINLOCK(nv_lock); +static DEFINE_RAW_SPINLOCK(nv_lock); static int (*core99_write_bank)(int bank, u8* datas); static int (*core99_erase_bank)(int bank); Index: linux-2.6-tip/arch/powerpc/platforms/powermac/pic.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/platforms/powermac/pic.c +++ linux-2.6-tip/arch/powerpc/platforms/powermac/pic.c @@ -57,7 +57,7 @@ static int max_irqs; static int max_real_irqs; static u32 level_mask[4]; -static DEFINE_SPINLOCK(pmac_pic_lock); +static DEFINE_RAW_SPINLOCK(pmac_pic_lock); #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) static unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; Index: linux-2.6-tip/arch/powerpc/platforms/pseries/eeh.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/platforms/pseries/eeh.c +++ linux-2.6-tip/arch/powerpc/platforms/pseries/eeh.c @@ -100,7 +100,7 @@ int eeh_subsystem_enabled; EXPORT_SYMBOL(eeh_subsystem_enabled); /* Lock to avoid races due to multiple reports of an error */ -static DEFINE_SPINLOCK(confirm_error_lock); +static DEFINE_RAW_SPINLOCK(confirm_error_lock); /* Buffer for reporting slot-error-detail rtas calls. Its here * in BSS, and not dynamically alloced, so that it ends up in Index: linux-2.6-tip/arch/powerpc/platforms/pseries/smp.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/platforms/pseries/smp.c +++ linux-2.6-tip/arch/powerpc/platforms/pseries/smp.c @@ -118,7 +118,7 @@ static void __devinit smp_xics_setup_cpu } #endif /* CONFIG_XICS */ -static DEFINE_SPINLOCK(timebase_lock); +static DEFINE_RAW_SPINLOCK(timebase_lock); static unsigned long timebase = 0; static void __devinit pSeries_give_timebase(void) Index: linux-2.6-tip/arch/powerpc/sysdev/i8259.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/sysdev/i8259.c +++ linux-2.6-tip/arch/powerpc/sysdev/i8259.c @@ -23,7 +23,7 @@ static unsigned char cached_8259[2] = { #define cached_A1 (cached_8259[0]) #define cached_21 (cached_8259[1]) -static DEFINE_SPINLOCK(i8259_lock); +static DEFINE_RAW_SPINLOCK(i8259_lock); static struct irq_host *i8259_host; Index: linux-2.6-tip/arch/powerpc/sysdev/ipic.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/sysdev/ipic.c +++ linux-2.6-tip/arch/powerpc/sysdev/ipic.c @@ -32,7 +32,7 @@ static struct ipic * primary_ipic; static struct irq_chip ipic_level_irq_chip, ipic_edge_irq_chip; -static DEFINE_SPINLOCK(ipic_lock); +static DEFINE_RAW_SPINLOCK(ipic_lock); static struct ipic_info ipic_info[] = { [1] = { Index: linux-2.6-tip/arch/powerpc/sysdev/mpic.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/sysdev/mpic.c +++ linux-2.6-tip/arch/powerpc/sysdev/mpic.c @@ -46,7 +46,7 @@ static struct mpic *mpics; static struct mpic *mpic_primary; -static DEFINE_SPINLOCK(mpic_lock); +static DEFINE_RAW_SPINLOCK(mpic_lock); #ifdef CONFIG_PPC32 /* XXX for now */ #ifdef CONFIG_IRQ_ALL_CPUS Index: linux-2.6-tip/drivers/of/base.c =================================================================== --- linux-2.6-tip.orig/drivers/of/base.c +++ linux-2.6-tip/drivers/of/base.c @@ -25,7 +25,7 @@ struct device_node *allnodes; /* use when traversing tree through the allnext, child, sibling, * or parent members of struct device_node. */ -DEFINE_RWLOCK(devtree_lock); +DEFINE_RAW_RWLOCK(devtree_lock); int of_n_addr_cells(struct device_node *np) { patches/preempt-realtime-net.patch0000664000076400007640000004047511160752235016332 0ustar tglxtglxSubject: preempt: realtime net From: Ingo Molnar Date: Wed Feb 04 00:02:46 CET 2009 Signed-off-by: Ingo Molnar --- include/linux/netdevice.h | 8 ++--- include/net/dn_dev.h | 6 +-- net/core/dev.c | 41 +++++++++++++++++++++++--- net/core/netpoll.c | 62 +++++++++++++++++++++++++--------------- net/decnet/dn_dev.c | 44 ++++++++++++++-------------- net/ipv4/icmp.c | 5 ++- net/ipv4/route.c | 4 +- net/ipv6/netfilter/ip6_tables.c | 2 - net/sched/sch_generic.c | 13 +++++--- 9 files changed, 121 insertions(+), 64 deletions(-) Index: linux-2.6-tip/include/linux/netdevice.h =================================================================== --- linux-2.6-tip.orig/include/linux/netdevice.h +++ linux-2.6-tip/include/linux/netdevice.h @@ -1634,14 +1634,14 @@ static inline void __netif_tx_lock(struc static inline void __netif_tx_lock_bh(struct netdev_queue *txq) { spin_lock_bh(&txq->_xmit_lock); - txq->xmit_lock_owner = smp_processor_id(); + txq->xmit_lock_owner = raw_smp_processor_id(); } static inline int __netif_tx_trylock(struct netdev_queue *txq) { int ok = spin_trylock(&txq->_xmit_lock); if (likely(ok)) - txq->xmit_lock_owner = smp_processor_id(); + txq->xmit_lock_owner = raw_smp_processor_id(); return ok; } @@ -1669,7 +1669,7 @@ static inline void netif_tx_lock(struct int cpu; spin_lock(&dev->tx_global_lock); - cpu = smp_processor_id(); + cpu = raw_smp_processor_id(); for (i = 0; i < dev->num_tx_queues; i++) { struct netdev_queue *txq = netdev_get_tx_queue(dev, i); @@ -1733,7 +1733,7 @@ static inline void netif_tx_disable(stru int cpu; local_bh_disable(); - cpu = smp_processor_id(); + cpu = raw_smp_processor_id(); for (i = 0; i < dev->num_tx_queues; i++) { struct netdev_queue *txq = netdev_get_tx_queue(dev, i); Index: linux-2.6-tip/include/net/dn_dev.h =================================================================== --- linux-2.6-tip.orig/include/net/dn_dev.h +++ linux-2.6-tip/include/net/dn_dev.h @@ -76,9 +76,9 @@ struct dn_dev_parms { int priority; /* Priority to be a router */ char *name; /* Name for sysctl */ int ctl_name; /* Index for sysctl */ - int (*up)(struct net_device *); - void (*down)(struct net_device *); - void (*timer3)(struct net_device *, struct dn_ifaddr *ifa); + int (*dn_up)(struct net_device *); + void (*dn_down)(struct net_device *); + void (*dn_timer3)(struct net_device *, struct dn_ifaddr *ifa); void *sysctl; }; Index: linux-2.6-tip/net/core/dev.c =================================================================== --- linux-2.6-tip.orig/net/core/dev.c +++ linux-2.6-tip/net/core/dev.c @@ -1879,9 +1879,16 @@ gso: Either shot noqueue qdisc, it is even simpler 8) */ if (dev->flags & IFF_UP) { - int cpu = smp_processor_id(); /* ok because BHs are off */ + int cpu = raw_smp_processor_id(); /* ok because BHs are off */ + /* + * No need to check for recursion with threaded interrupts: + */ +#ifdef CONFIG_PREEMPT_RT + if (1) { +#else if (txq->xmit_lock_owner != cpu) { +#endif HARD_TX_LOCK(dev, txq, cpu); @@ -1999,7 +2006,8 @@ EXPORT_SYMBOL(netif_rx_ni); static void net_tx_action(struct softirq_action *h) { - struct softnet_data *sd = &__get_cpu_var(softnet_data); + struct softnet_data *sd = &per_cpu(softnet_data, + raw_smp_processor_id()); if (sd->completion_queue) { struct sk_buff *clist; @@ -2015,6 +2023,11 @@ static void net_tx_action(struct softirq WARN_ON(atomic_read(&skb->users)); __kfree_skb(skb); + /* + * Safe to reschedule - the list is private + * at this point. + */ + cond_resched_softirq_context(); } } @@ -2033,6 +2046,22 @@ static void net_tx_action(struct softirq head = head->next_sched; root_lock = qdisc_lock(q); + /* + * We are executing in softirq context here, and + * if softirqs are preemptible, we must avoid + * infinite reactivation of the softirq by + * either the tx handler, or by netif_schedule(). + * (it would result in an infinitely looping + * softirq context) + * So we take the spinlock unconditionally. + */ +#ifdef CONFIG_PREEMPT_SOFTIRQS + spin_lock(root_lock); + smp_mb__before_clear_bit(); + clear_bit(__QDISC_STATE_SCHED, &q->state); + qdisc_run(q); + spin_unlock(root_lock); +#else if (spin_trylock(root_lock)) { smp_mb__before_clear_bit(); clear_bit(__QDISC_STATE_SCHED, @@ -2049,6 +2078,7 @@ static void net_tx_action(struct softirq &q->state); } } +#endif } } } @@ -2257,7 +2287,7 @@ int netif_receive_skb(struct sk_buff *sk skb->dev = orig_dev->master; } - __get_cpu_var(netdev_rx_stat).total++; + per_cpu(netdev_rx_stat, raw_smp_processor_id()).total++; skb_reset_network_header(skb); skb_reset_transport_header(skb); @@ -2578,9 +2608,10 @@ EXPORT_SYMBOL(napi_gro_frags); static int process_backlog(struct napi_struct *napi, int quota) { int work = 0; - struct softnet_data *queue = &__get_cpu_var(softnet_data); + struct softnet_data *queue; unsigned long start_time = jiffies; + queue = &per_cpu(softnet_data, raw_smp_processor_id()); napi->weight = weight_p; do { struct sk_buff *skb; @@ -2614,7 +2645,7 @@ void __napi_schedule(struct napi_struct local_irq_save(flags); list_add_tail(&n->poll_list, &__get_cpu_var(softnet_data).poll_list); - __raise_softirq_irqoff(NET_RX_SOFTIRQ); + raise_softirq_irqoff(NET_RX_SOFTIRQ); local_irq_restore(flags); } EXPORT_SYMBOL(__napi_schedule); Index: linux-2.6-tip/net/core/netpoll.c =================================================================== --- linux-2.6-tip.orig/net/core/netpoll.c +++ linux-2.6-tip/net/core/netpoll.c @@ -68,20 +68,20 @@ static void queue_process(struct work_st txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); - local_irq_save(flags); + local_irq_save_nort(flags); __netif_tx_lock(txq, smp_processor_id()); if (netif_tx_queue_stopped(txq) || netif_tx_queue_frozen(txq) || ops->ndo_start_xmit(skb, dev) != NETDEV_TX_OK) { skb_queue_head(&npinfo->txq, skb); __netif_tx_unlock(txq); - local_irq_restore(flags); + local_irq_restore_nort(flags); schedule_delayed_work(&npinfo->tx_work, HZ/10); return; } __netif_tx_unlock(txq); - local_irq_restore(flags); + local_irq_restore_nort(flags); } } @@ -151,7 +151,7 @@ static void poll_napi(struct net_device int budget = 16; list_for_each_entry(napi, &dev->napi_list, dev_list) { - if (napi->poll_owner != smp_processor_id() && + if (napi->poll_owner != raw_smp_processor_id() && spin_trylock(&napi->poll_lock)) { budget = poll_one_napi(dev->npinfo, napi, budget); spin_unlock(&napi->poll_lock); @@ -208,30 +208,35 @@ static void refill_skbs(void) static void zap_completion_queue(void) { - unsigned long flags; struct softnet_data *sd = &get_cpu_var(softnet_data); + struct sk_buff *clist = NULL; + unsigned long flags; if (sd->completion_queue) { - struct sk_buff *clist; local_irq_save(flags); clist = sd->completion_queue; sd->completion_queue = NULL; local_irq_restore(flags); - - while (clist != NULL) { - struct sk_buff *skb = clist; - clist = clist->next; - if (skb->destructor) { - atomic_inc(&skb->users); - dev_kfree_skb_any(skb); /* put this one back */ - } else { - __kfree_skb(skb); - } - } } + + /* + * Took the list private, can drop our softnet + * reference: + */ put_cpu_var(softnet_data); + + while (clist != NULL) { + struct sk_buff *skb = clist; + clist = clist->next; + if (skb->destructor) { + atomic_inc(&skb->users); + dev_kfree_skb_any(skb); /* put this one back */ + } else { + __kfree_skb(skb); + } + } } static struct sk_buff *find_skb(struct netpoll *np, int len, int reserve) @@ -239,13 +244,26 @@ static struct sk_buff *find_skb(struct n int count = 0; struct sk_buff *skb; +#ifdef CONFIG_PREEMPT_RT + /* + * On -rt skb_pool.lock is schedulable, so if we are + * in an atomic context we just try to dequeue from the + * pool and fail if we cannot get one. + */ + if (in_atomic() || irqs_disabled()) + goto pick_atomic; +#endif zap_completion_queue(); refill_skbs(); repeat: skb = alloc_skb(len, GFP_ATOMIC); - if (!skb) + if (!skb) { +#ifdef CONFIG_PREEMPT_RT +pick_atomic: +#endif skb = skb_dequeue(&skb_pool); + } if (!skb) { if (++count < 10) { @@ -265,7 +283,7 @@ static int netpoll_owner_active(struct n struct napi_struct *napi; list_for_each_entry(napi, &dev->napi_list, dev_list) { - if (napi->poll_owner == smp_processor_id()) + if (napi->poll_owner == raw_smp_processor_id()) return 1; } return 0; @@ -291,7 +309,7 @@ static void netpoll_send_skb(struct netp txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); - local_irq_save(flags); + local_irq_save_nort(flags); /* try until next clock tick */ for (tries = jiffies_to_usecs(1)/USEC_PER_POLL; tries > 0; --tries) { @@ -310,7 +328,7 @@ static void netpoll_send_skb(struct netp udelay(USEC_PER_POLL); } - local_irq_restore(flags); + local_irq_restore_nort(flags); } if (status != NETDEV_TX_OK) { @@ -731,7 +749,7 @@ int netpoll_setup(struct netpoll *np) np->name); break; } - cond_resched(); + schedule_timeout_uninterruptible(1); } /* If carrier appears to come up instantly, we don't Index: linux-2.6-tip/net/decnet/dn_dev.c =================================================================== --- linux-2.6-tip.orig/net/decnet/dn_dev.c +++ linux-2.6-tip/net/decnet/dn_dev.c @@ -90,9 +90,9 @@ static struct dn_dev_parms dn_dev_list[] .t3 = 10, .name = "ethernet", .ctl_name = NET_DECNET_CONF_ETHER, - .up = dn_eth_up, - .down = dn_eth_down, - .timer3 = dn_send_brd_hello, + .dn_up = dn_eth_up, + .dn_down = dn_eth_down, + .dn_timer3 = dn_send_brd_hello, }, { .type = ARPHRD_IPGRE, /* DECnet tunneled over GRE in IP */ @@ -102,7 +102,7 @@ static struct dn_dev_parms dn_dev_list[] .t3 = 10, .name = "ipgre", .ctl_name = NET_DECNET_CONF_GRE, - .timer3 = dn_send_brd_hello, + .dn_timer3 = dn_send_brd_hello, }, #if 0 { @@ -113,7 +113,7 @@ static struct dn_dev_parms dn_dev_list[] .t3 = 120, .name = "x25", .ctl_name = NET_DECNET_CONF_X25, - .timer3 = dn_send_ptp_hello, + .dn_timer3 = dn_send_ptp_hello, }, #endif #if 0 @@ -125,7 +125,7 @@ static struct dn_dev_parms dn_dev_list[] .t3 = 10, .name = "ppp", .ctl_name = NET_DECNET_CONF_PPP, - .timer3 = dn_send_brd_hello, + .dn_timer3 = dn_send_brd_hello, }, #endif { @@ -136,7 +136,7 @@ static struct dn_dev_parms dn_dev_list[] .t3 = 120, .name = "ddcmp", .ctl_name = NET_DECNET_CONF_DDCMP, - .timer3 = dn_send_ptp_hello, + .dn_timer3 = dn_send_ptp_hello, }, { .type = ARPHRD_LOOPBACK, /* Loopback interface - always last */ @@ -146,7 +146,7 @@ static struct dn_dev_parms dn_dev_list[] .t3 = 10, .name = "loopback", .ctl_name = NET_DECNET_CONF_LOOPBACK, - .timer3 = dn_send_brd_hello, + .dn_timer3 = dn_send_brd_hello, } }; @@ -305,11 +305,11 @@ static int dn_forwarding_proc(ctl_table */ tmp = dn_db->parms.forwarding; dn_db->parms.forwarding = old; - if (dn_db->parms.down) - dn_db->parms.down(dev); + if (dn_db->parms.dn_down) + dn_db->parms.dn_down(dev); dn_db->parms.forwarding = tmp; - if (dn_db->parms.up) - dn_db->parms.up(dev); + if (dn_db->parms.dn_up) + dn_db->parms.dn_up(dev); } return err; @@ -343,11 +343,11 @@ static int dn_forwarding_sysctl(ctl_tabl if (value > 2) return -EINVAL; - if (dn_db->parms.down) - dn_db->parms.down(dev); + if (dn_db->parms.dn_down) + dn_db->parms.dn_down(dev); dn_db->parms.forwarding = value; - if (dn_db->parms.up) - dn_db->parms.up(dev); + if (dn_db->parms.dn_up) + dn_db->parms.dn_up(dev); } return 0; @@ -1078,10 +1078,10 @@ static void dn_dev_timer_func(unsigned l struct dn_ifaddr *ifa; if (dn_db->t3 <= dn_db->parms.t2) { - if (dn_db->parms.timer3) { + if (dn_db->parms.dn_timer3) { for(ifa = dn_db->ifa_list; ifa; ifa = ifa->ifa_next) { if (!(ifa->ifa_flags & IFA_F_SECONDARY)) - dn_db->parms.timer3(dev, ifa); + dn_db->parms.dn_timer3(dev, ifa); } } dn_db->t3 = dn_db->parms.t3; @@ -1140,8 +1140,8 @@ static struct dn_dev *dn_dev_create(stru return NULL; } - if (dn_db->parms.up) { - if (dn_db->parms.up(dev) < 0) { + if (dn_db->parms.dn_up) { + if (dn_db->parms.dn_up(dev) < 0) { neigh_parms_release(&dn_neigh_table, dn_db->neigh_parms); dev->dn_ptr = NULL; kfree(dn_db); @@ -1235,8 +1235,8 @@ static void dn_dev_delete(struct net_dev dn_dev_check_default(dev); neigh_ifdown(&dn_neigh_table, dev); - if (dn_db->parms.down) - dn_db->parms.down(dev); + if (dn_db->parms.dn_down) + dn_db->parms.dn_down(dev); dev->dn_ptr = NULL; Index: linux-2.6-tip/net/ipv4/icmp.c =================================================================== --- linux-2.6-tip.orig/net/ipv4/icmp.c +++ linux-2.6-tip/net/ipv4/icmp.c @@ -201,7 +201,10 @@ static const struct icmp_control icmp_po */ static struct sock *icmp_sk(struct net *net) { - return net->ipv4.icmp_sk[smp_processor_id()]; + /* + * Should be safe on PREEMPT_SOFTIRQS/HARDIRQS to use raw-smp-processor-id: + */ + return net->ipv4.icmp_sk[raw_smp_processor_id()]; } static inline struct sock *icmp_xmit_lock(struct net *net) Index: linux-2.6-tip/net/ipv4/route.c =================================================================== --- linux-2.6-tip.orig/net/ipv4/route.c +++ linux-2.6-tip/net/ipv4/route.c @@ -204,13 +204,13 @@ struct rt_hash_bucket { }; #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || \ - defined(CONFIG_PROVE_LOCKING) + defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_PREEMPT_RT) /* * Instead of using one spinlock for each rt_hash_bucket, we use a table of spinlocks * The size of this table is a power of two and depends on the number of CPUS. * (on lockdep we have a quite big spinlock_t, so keep the size down there) */ -#ifdef CONFIG_LOCKDEP +#if defined(CONFIG_LOCKDEP) || defined(CONFIG_PREEMPT_RT) # define RT_HASH_LOCK_SZ 256 #else # if NR_CPUS >= 32 Index: linux-2.6-tip/net/ipv6/netfilter/ip6_tables.c =================================================================== --- linux-2.6-tip.orig/net/ipv6/netfilter/ip6_tables.c +++ linux-2.6-tip/net/ipv6/netfilter/ip6_tables.c @@ -376,7 +376,7 @@ ip6t_do_table(struct sk_buff *skb, read_lock_bh(&table->lock); IP_NF_ASSERT(table->valid_hooks & (1 << hook)); private = table->private; - table_base = (void *)private->entries[smp_processor_id()]; + table_base = (void *)private->entries[raw_smp_processor_id()]; e = get_entry(table_base, private->hook_entry[hook]); /* For return from builtin chain */ Index: linux-2.6-tip/net/sched/sch_generic.c =================================================================== --- linux-2.6-tip.orig/net/sched/sch_generic.c +++ linux-2.6-tip/net/sched/sch_generic.c @@ -12,6 +12,7 @@ */ #include +#include #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include /* Main transmission queue. */ @@ -78,7 +80,7 @@ static inline int handle_dev_cpu_collisi { int ret; - if (unlikely(dev_queue->xmit_lock_owner == smp_processor_id())) { + if (unlikely(dev_queue->xmit_lock_owner == raw_smp_processor_id())) { /* * Same CPU holding the lock. It may be a transient * configuration error, when hard_start_xmit() recurses. We @@ -141,7 +143,7 @@ static inline int qdisc_restart(struct Q dev = qdisc_dev(q); txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); - HARD_TX_LOCK(dev, txq, smp_processor_id()); + HARD_TX_LOCK(dev, txq, raw_smp_processor_id()); if (!netif_tx_queue_stopped(txq) && !netif_tx_queue_frozen(txq)) ret = dev_hard_start_xmit(skb, dev, txq); @@ -691,9 +693,12 @@ void dev_deactivate(struct net_device *d /* Wait for outstanding qdisc-less dev_queue_xmit calls. */ synchronize_rcu(); - /* Wait for outstanding qdisc_run calls. */ + /* + * Wait for outstanding qdisc_run calls. + * TODO: shouldnt this be wakeup-based, instead of polling it? + */ while (some_qdisc_is_busy(dev)) - yield(); + msleep(1); } static void dev_init_scheduler_queue(struct net_device *dev, patches/rt-page_alloc.c-cleanup.patch0000664000076400007640000000130211160752235016633 0ustar tglxtglxSubject: rt: page_alloc.c cleanup From: Ingo Molnar Date: Sun Feb 08 15:59:46 CET 2009 Signed-off-by: Ingo Molnar --- mm/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6-tip/mm/page_alloc.c =================================================================== --- linux-2.6-tip.orig/mm/page_alloc.c +++ linux-2.6-tip/mm/page_alloc.c @@ -1000,10 +1000,12 @@ void drain_local_pages(void *arg) drain_pages(smp_processor_id()); } +#ifdef CONFIG_PREEMPT_RT static void drain_local_pages_work(struct work_struct *wrk) { drain_pages(smp_processor_id()); } +#endif /* * Spill all the per-cpu pages from all CPUs back into the buddy allocator patches/cputimer-thread-rt-fix.patch0000664000076400007640000000127711160752235016573 0ustar tglxtglxSubject: cputimer: thread rt fix From: Ingo Molnar Date: Wed Feb 04 00:02:58 CET 2009 Signed-off-by: Ingo Molnar --- kernel/posix-cpu-timers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/kernel/posix-cpu-timers.c =================================================================== --- linux-2.6-tip.orig/kernel/posix-cpu-timers.c +++ linux-2.6-tip/kernel/posix-cpu-timers.c @@ -1523,7 +1523,7 @@ void run_posix_cpu_timers(struct task_st per_cpu(posix_timer_tasklist, cpu) = tsk; } /* XXX signal the thread somehow */ - wake_up_process(per_cpu(posix_timer_task,cpu)); + wake_up_process(per_cpu(posix_timer_task, cpu)); } /* patches/preempt-realtime-disable-workqueue-tracer-on-preempt-rt.patch0000664000076400007640000000514311160752235025152 0ustar tglxtglxSubject: rt: no workqueue tracer From: Ingo Molnar Date: Tue Feb 10 00:30:42 CET 2009 Turn it off for now: BUG: sleeping function called from invalid context at kernel/rtmutex.c:683 in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: init 1 lock held by init/1: #0: (&cwq->lock){--..}, at: [] __queue_work+0x21/0x50 Pid: 1, comm: init Not tainted 2.6.29-rc4-rt0-tip #186 Call Trace: [] ? __debug_show_held_locks+0x13/0x30 [] __might_sleep+0x141/0x180 [] __lock_text_start+0x56/0xd0 [] ? ftrace_call+0x5/0x2b [] probe_workqueue_insertion+0x18/0xc0 [] insert_work+0x87/0x190 [] __queue_work+0x33/0x50 [] queue_work_on+0xaf/0xc0 [] queue_work+0x16/0x20 [] call_usermodehelper_exec+0xff/0x130 [] ? prepare_usermodehelper_creds+0x15c/0x180 [] ? prepare_usermodehelper_creds+0x15c/0x180 [] kobject_uevent_env+0x8f1/0x900 [] ? ftrace_call+0x5/0x2b [] kobject_uevent+0xb/0x10 [] device_add+0x793/0xa70 [] device_register+0x1e/0x30 [] device_create_vargs+0x13e/0x180 [] device_create+0x31/0x40 [] ? ftrace_call+0x5/0x2b [] vcs_make_sysfs+0x3b/0x70 [] con_open+0x128/0x160 [] tty_open+0x2fd/0x7a0 [] chrdev_open+0x185/0x230 [] ? chrdev_open+0x0/0x230 [] __dentry_open+0x1ff/0x4c0 [] nameidata_to_filp+0x4c/0x80 [] do_filp_open+0x39e/0xd20 [] ? __spin_unlock_irqrestore+0x74/0xb0 [] ? rt_spin_lock_slowunlock+0x5a/0xa0 [] ? alloc_fd+0xa4/0x1e0 [] do_sys_open+0xd3/0x160 [] sys_open+0x20/0x30 [] system_call_fastpath+0x16/0x1b Signed-off-by: Ingo Molnar --- kernel/trace/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/kernel/trace/Kconfig =================================================================== --- linux-2.6-tip.orig/kernel/trace/Kconfig +++ linux-2.6-tip/kernel/trace/Kconfig @@ -318,7 +318,7 @@ config KMEMTRACE If unsure, say N. config WORKQUEUE_TRACER - bool "Trace workqueues" + bool "Trace workqueues" if !PREEMPT_RT select TRACING help The workqueue tracer provides some statistical informations patches/preempt-realtime-warn-and-bug-on.patch0000664000076400007640000000221011160752235020421 0ustar tglxtglxSubject: preempt: realtime warn and bug on From: Ingo Molnar Date: Wed Feb 04 00:02:59 CET 2009 Signed-off-by: Ingo Molnar --- include/asm-generic/bug.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) Index: linux-2.6-tip/include/asm-generic/bug.h =================================================================== --- linux-2.6-tip.orig/include/asm-generic/bug.h +++ linux-2.6-tip/include/asm-generic/bug.h @@ -3,6 +3,8 @@ #include +extern void __WARN_ON(const char *func, const char *file, const int line); + #ifdef CONFIG_BUG #ifdef CONFIG_GENERIC_BUG @@ -139,4 +141,16 @@ __WARN(int condition, const char *fmt, . # define WARN_ON_SMP(x) do { } while (0) #endif +#ifdef CONFIG_PREEMPT_RT +# define BUG_ON_RT(c) BUG_ON(c) +# define BUG_ON_NONRT(c) do { } while (0) +# define WARN_ON_RT(condition) WARN_ON(condition) +# define WARN_ON_NONRT(condition) do { } while (0) +#else +# define BUG_ON_RT(c) do { } while (0) +# define BUG_ON_NONRT(c) BUG_ON(c) +# define WARN_ON_RT(condition) do { } while (0) +# define WARN_ON_NONRT(condition) WARN_ON(condition) +#endif + #endif patches/nfs-stats-miss-preemption.patch0000664000076400007640000000227111160752235017335 0ustar tglxtglxSubject: nfs: fix missing preemption check From: Thomas Gleixner Date: Sun, 27 Jul 2008 00:54:19 +0200 NFS iostats use get_cpu()/put_cpu_no_preempt(). That misses a preemption check for no good reason and introduces long latencies when a wakeup of a higher priority task happens in the preempt disabled region. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- fs/nfs/iostat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6-tip/fs/nfs/iostat.h =================================================================== --- linux-2.6-tip.orig/fs/nfs/iostat.h +++ linux-2.6-tip/fs/nfs/iostat.h @@ -28,7 +28,7 @@ static inline void nfs_inc_server_stats( cpu = get_cpu(); iostats = per_cpu_ptr(server->io_stats, cpu); iostats->events[stat]++; - put_cpu_no_resched(); + put_cpu(); } static inline void nfs_inc_stats(const struct inode *inode, @@ -47,7 +47,7 @@ static inline void nfs_add_server_stats( cpu = get_cpu(); iostats = per_cpu_ptr(server->io_stats, cpu); iostats->bytes[stat] += addend; - put_cpu_no_resched(); + put_cpu(); } static inline void nfs_add_stats(const struct inode *inode, patches/printk-dont-bug-on-sched.patch0000664000076400007640000000243711160752235017010 0ustar tglxtglxSubject: printk: dont bug on sched From: Ingo Molnar Date: Wed Feb 04 00:02:19 CET 2009 Signed-off-by: Ingo Molnar --- kernel/rtmutex.c | 9 +++++++++ 1 file changed, 9 insertions(+) Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "rtmutex_common.h" @@ -635,6 +636,9 @@ rt_spin_lock_fastlock(struct rt_mutex *l /* Temporary HACK! */ if (!current->in_printk) might_sleep(); + else if (in_atomic() || irqs_disabled()) + /* don't grab locks for printk in atomic */ + return; if (likely(rt_mutex_cmpxchg(lock, NULL, current))) rt_mutex_deadlock_account_lock(lock, current); @@ -646,6 +650,11 @@ static inline void rt_spin_lock_fastunlock(struct rt_mutex *lock, void (*slowfn)(struct rt_mutex *lock)) { + /* Temporary HACK! */ + if (current->in_printk && (in_atomic() || irqs_disabled())) + /* don't grab locks for printk in atomic */ + return; + if (likely(rt_mutex_cmpxchg(lock, current, NULL))) rt_mutex_deadlock_account_unlock(current); else patches/preempt-realtime-usb.patch0000664000076400007640000000623311160752235016327 0ustar tglxtglxSubject: preempt: realtime usb From: Ingo Molnar Date: Wed Feb 04 00:02:47 CET 2009 Signed-off-by: Ingo Molnar --- drivers/net/usb/usbnet.c | 2 ++ drivers/usb/core/devio.c | 5 +++-- drivers/usb/core/message.c | 13 +++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) Index: linux-2.6-tip/drivers/net/usb/usbnet.c =================================================================== --- linux-2.6-tip.orig/drivers/net/usb/usbnet.c +++ linux-2.6-tip/drivers/net/usb/usbnet.c @@ -903,6 +903,8 @@ static void tx_complete (struct urb *urb urb->dev = NULL; entry->state = tx_done; + spin_lock_rt(&dev->txq.lock); + spin_unlock_rt(&dev->txq.lock); defer_bh(dev, skb, &dev->txq); } Index: linux-2.6-tip/drivers/usb/core/devio.c =================================================================== --- linux-2.6-tip.orig/drivers/usb/core/devio.c +++ linux-2.6-tip/drivers/usb/core/devio.c @@ -325,10 +325,11 @@ static void async_completed(struct urb * struct async *as = urb->context; struct dev_state *ps = as->ps; struct siginfo sinfo; + unsigned long flags; - spin_lock(&ps->lock); + spin_lock_irqsave(&ps->lock, flags); list_move_tail(&as->asynclist, &ps->async_completed); - spin_unlock(&ps->lock); + spin_unlock_irqrestore(&ps->lock, flags); as->status = urb->status; if (as->signr) { sinfo.si_signo = as->signr; Index: linux-2.6-tip/drivers/usb/core/message.c =================================================================== --- linux-2.6-tip.orig/drivers/usb/core/message.c +++ linux-2.6-tip/drivers/usb/core/message.c @@ -268,8 +268,9 @@ static void sg_complete(struct urb *urb) { struct usb_sg_request *io = urb->context; int status = urb->status; + unsigned long flags; - spin_lock(&io->lock); + spin_lock_irqsave (&io->lock, flags); /* In 2.5 we require hcds' endpoint queues not to progress after fault * reports, until the completion callback (this!) returns. That lets @@ -303,7 +304,7 @@ static void sg_complete(struct urb *urb) * unlink pending urbs so they won't rx/tx bad data. * careful: unlink can sometimes be synchronous... */ - spin_unlock(&io->lock); + spin_unlock_irqrestore (&io->lock, flags); for (i = 0, found = 0; i < io->entries; i++) { if (!io->urbs [i] || !io->urbs [i]->dev) continue; @@ -318,7 +319,7 @@ static void sg_complete(struct urb *urb) } else if (urb == io->urbs [i]) found = 1; } - spin_lock(&io->lock); + spin_lock_irqsave (&io->lock, flags); } urb->dev = NULL; @@ -328,7 +329,7 @@ static void sg_complete(struct urb *urb) if (!io->count) complete(&io->complete); - spin_unlock(&io->lock); + spin_unlock_irqrestore (&io->lock, flags); } @@ -595,7 +596,7 @@ void usb_sg_cancel(struct usb_sg_request int i; io->status = -ECONNRESET; - spin_unlock(&io->lock); + spin_unlock_irqrestore(&io->lock, flags); for (i = 0; i < io->entries; i++) { int retval; @@ -606,7 +607,7 @@ void usb_sg_cancel(struct usb_sg_request dev_warn(&io->dev->dev, "%s, unlink --> %d\n", __func__, retval); } - spin_lock(&io->lock); + spin_lock_irqsave(&io->lock, flags); } spin_unlock_irqrestore(&io->lock, flags); } patches/rt-mutex-core.patch0000664000076400007640000053461011161723470015004 0ustar tglxtglxSubject: rt: mutex core From: Ingo Molnar Date: Tue Feb 03 23:55:27 CET 2009 Signed-off-by: Ingo Molnar --- drivers/input/ff-memless.c | 1 fs/proc/array.c | 27 + include/linux/bit_spinlock.h | 4 include/linux/init_task.h | 3 include/linux/mutex.h | 63 +++ include/linux/pickop.h | 32 + include/linux/plist.h | 4 include/linux/rt_lock.h | 286 +++++++++++++++ include/linux/rtmutex.h | 6 include/linux/rwsem-spinlock.h | 35 - include/linux/rwsem.h | 108 ++++- include/linux/sched.h | 80 +++- include/linux/semaphore.h | 77 +++- include/linux/seqlock.h | 270 ++++++++++++-- include/linux/spinlock.h | 686 +++++++++++++++++++++++++------------- include/linux/spinlock_api_smp.h | 91 ++--- include/linux/spinlock_api_up.h | 74 ++-- include/linux/spinlock_types.h | 61 ++- include/linux/spinlock_types_up.h | 6 include/linux/spinlock_up.h | 8 kernel/Makefile | 6 kernel/fork.c | 10 kernel/futex.c | 4 kernel/lockdep.c | 2 kernel/rt.c | 634 +++++++++++++++++++++++++++++++++++ kernel/rtmutex-debug.c | 108 ++--- kernel/rtmutex.c | 450 ++++++++++++++++++++++-- kernel/rwsem.c | 44 +- kernel/sched.c | 66 ++- kernel/sched_clock.c | 4 kernel/semaphore.c | 46 +- kernel/spinlock.c | 278 +++++++++------ lib/dec_and_lock.c | 4 lib/kernel_lock.c | 4 lib/locking-selftest.c | 6 lib/plist.c | 2 lib/rwsem-spinlock.c | 29 - lib/rwsem.c | 6 lib/spinlock_debug.c | 64 +-- 39 files changed, 2920 insertions(+), 769 deletions(-) Index: linux-2.6-tip/drivers/input/ff-memless.c =================================================================== --- linux-2.6-tip.orig/drivers/input/ff-memless.c +++ linux-2.6-tip/drivers/input/ff-memless.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include Index: linux-2.6-tip/fs/proc/array.c =================================================================== --- linux-2.6-tip.orig/fs/proc/array.c +++ linux-2.6-tip/fs/proc/array.c @@ -133,12 +133,13 @@ static inline void task_name(struct seq_ */ static const char *task_state_array[] = { "R (running)", /* 0 */ - "S (sleeping)", /* 1 */ - "D (disk sleep)", /* 2 */ - "T (stopped)", /* 4 */ - "T (tracing stop)", /* 8 */ - "Z (zombie)", /* 16 */ - "X (dead)" /* 32 */ + "M (running-mutex)", /* 1 */ + "S (sleeping)", /* 2 */ + "D (disk sleep)", /* 4 */ + "T (stopped)", /* 8 */ + "T (tracing stop)", /* 16 */ + "Z (zombie)", /* 32 */ + "X (dead)" /* 64 */ }; static inline const char *get_task_state(struct task_struct *tsk) @@ -320,6 +321,19 @@ static inline void task_context_switch_c p->nivcsw); } +#define get_blocked_on(t) (-1) + +static inline void show_blocked_on(struct seq_file *m, struct task_struct *p) +{ + pid_t pid = get_blocked_on(p); + + if (pid < 0) + return; + + seq_printf(m, "BlckOn: %d\n", pid); +} + + int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task) { @@ -339,6 +353,7 @@ int proc_pid_status(struct seq_file *m, task_show_regs(m, task); #endif task_context_switch_counts(m, task); + show_blocked_on(m, task); return 0; } Index: linux-2.6-tip/include/linux/bit_spinlock.h =================================================================== --- linux-2.6-tip.orig/include/linux/bit_spinlock.h +++ linux-2.6-tip/include/linux/bit_spinlock.h @@ -1,6 +1,8 @@ #ifndef __LINUX_BIT_SPINLOCK_H #define __LINUX_BIT_SPINLOCK_H +#if 0 + /* * bit-based spin_lock() * @@ -91,5 +93,7 @@ static inline int bit_spin_is_locked(int #endif } +#endif + #endif /* __LINUX_BIT_SPINLOCK_H */ Index: linux-2.6-tip/include/linux/init_task.h =================================================================== --- linux-2.6-tip.orig/include/linux/init_task.h +++ linux-2.6-tip/include/linux/init_task.h @@ -10,6 +10,7 @@ #include #include #include +#include extern struct files_struct init_files; extern struct fs_struct init_fs; @@ -186,8 +187,8 @@ extern struct cred init_cred; .journal_info = NULL, \ .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ .fs_excl = ATOMIC_INIT(0), \ - .pi_lock = __SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ .timer_slack_ns = 50000, /* 50 usec default slack */ \ + .pi_lock = RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ .pids = { \ [PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \ [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ Index: linux-2.6-tip/include/linux/mutex.h =================================================================== --- linux-2.6-tip.orig/include/linux/mutex.h +++ linux-2.6-tip/include/linux/mutex.h @@ -12,11 +12,73 @@ #include #include +#include #include #include #include +#ifdef CONFIG_PREEMPT_RT + +#include + +struct mutex { + struct rt_mutex lock; +#ifdef CONFIG_DEBUG_LOCK_ALLOC + struct lockdep_map dep_map; +#endif +}; + +#define __MUTEX_INITIALIZER(mutexname) \ + { \ + .lock = __RT_MUTEX_INITIALIZER(mutexname.lock) \ + } + +#define DEFINE_MUTEX(mutexname) \ + struct mutex mutexname = __MUTEX_INITIALIZER(mutexname) + +extern void +_mutex_init(struct mutex *lock, char *name, struct lock_class_key *key); + +extern void __lockfunc _mutex_lock(struct mutex *lock); +extern int __lockfunc _mutex_lock_interruptible(struct mutex *lock); +extern int __lockfunc _mutex_lock_killable(struct mutex *lock); +extern void __lockfunc _mutex_lock_nested(struct mutex *lock, int subclass); +extern int __lockfunc _mutex_lock_interruptible_nested(struct mutex *lock, int subclass); +extern int __lockfunc _mutex_lock_killable_nested(struct mutex *lock, int subclass); +extern int __lockfunc _mutex_trylock(struct mutex *lock); +extern void __lockfunc _mutex_unlock(struct mutex *lock); + +#define mutex_is_locked(l) rt_mutex_is_locked(&(l)->lock) +#define mutex_lock(l) _mutex_lock(l) +#define mutex_lock_interruptible(l) _mutex_lock_interruptible(l) +#define mutex_lock_killable(l) _mutex_lock_killable(l) +#define mutex_trylock(l) _mutex_trylock(l) +#define mutex_unlock(l) _mutex_unlock(l) +#define mutex_destroy(l) rt_mutex_destroy(&(l)->lock) + +#ifdef CONFIG_DEBUG_LOCK_ALLOC +# define mutex_lock_nested(l, s) _mutex_lock_nested(l, s) +# define mutex_lock_interruptible_nested(l, s) \ + _mutex_lock_interruptible_nested(l, s) +# define mutex_lock_killable_nested(l, s) \ + _mutex_lock_killable_nested(l, s) +#else +# define mutex_lock_nested(l, s) _mutex_lock(l) +# define mutex_lock_interruptible_nested(l, s) \ + _mutex_lock_interruptible(l) +# define mutex_lock_killable_nested(l, s) \ + _mutex_lock_killable(l) +#endif + +# define mutex_init(mutex) \ +do { \ + static struct lock_class_key __key; \ + \ + _mutex_init((mutex), #mutex, &__key); \ +} while (0) + +#else /* * Simple, straightforward mutexes with strict semantics: * @@ -152,3 +214,4 @@ extern int mutex_trylock(struct mutex *l extern void mutex_unlock(struct mutex *lock); #endif +#endif Index: linux-2.6-tip/include/linux/pickop.h =================================================================== --- /dev/null +++ linux-2.6-tip/include/linux/pickop.h @@ -0,0 +1,32 @@ +#ifndef _LINUX_PICKOP_H +#define _LINUX_PICKOP_H + +#undef PICK_TYPE_EQUAL +#define PICK_TYPE_EQUAL(var, type) \ + __builtin_types_compatible_p(typeof(var), type) + +extern int __bad_func_type(void); + +#define PICK_FUNCTION(type1, type2, func1, func2, arg0, ...) \ +do { \ + if (PICK_TYPE_EQUAL((arg0), type1)) \ + func1((type1)(arg0), ##__VA_ARGS__); \ + else if (PICK_TYPE_EQUAL((arg0), type2)) \ + func2((type2)(arg0), ##__VA_ARGS__); \ + else __bad_func_type(); \ +} while (0) + +#define PICK_FUNCTION_RET(type1, type2, func1, func2, arg0, ...) \ +({ \ + unsigned long __ret; \ + \ + if (PICK_TYPE_EQUAL((arg0), type1)) \ + __ret = func1((type1)(arg0), ##__VA_ARGS__); \ + else if (PICK_TYPE_EQUAL((arg0), type2)) \ + __ret = func2((type2)(arg0), ##__VA_ARGS__); \ + else __ret = __bad_func_type(); \ + \ + __ret; \ +}) + +#endif /* _LINUX_PICKOP_H */ Index: linux-2.6-tip/include/linux/plist.h =================================================================== --- linux-2.6-tip.orig/include/linux/plist.h +++ linux-2.6-tip/include/linux/plist.h @@ -81,7 +81,7 @@ struct plist_head { struct list_head prio_list; struct list_head node_list; #ifdef CONFIG_DEBUG_PI_LIST - spinlock_t *lock; + raw_spinlock_t *lock; #endif }; @@ -128,7 +128,7 @@ struct plist_node { * @lock: list spinlock, remembered for debugging */ static inline void -plist_head_init(struct plist_head *head, spinlock_t *lock) +plist_head_init(struct plist_head *head, raw_spinlock_t *lock) { INIT_LIST_HEAD(&head->prio_list); INIT_LIST_HEAD(&head->node_list); Index: linux-2.6-tip/include/linux/rt_lock.h =================================================================== --- /dev/null +++ linux-2.6-tip/include/linux/rt_lock.h @@ -0,0 +1,286 @@ +#ifndef __LINUX_RT_LOCK_H +#define __LINUX_RT_LOCK_H + +/* + * Real-Time Preemption Support + * + * started by Ingo Molnar: + * + * Copyright (C) 2004, 2005 Red Hat, Inc., Ingo Molnar + * + * This file contains the main data structure definitions. + */ +#include +#include +#include + +#ifdef CONFIG_PREEMPT_RT +/* + * spinlocks - an RT mutex plus lock-break field: + */ +typedef struct { + struct rt_mutex lock; + unsigned int break_lock; +#ifdef CONFIG_DEBUG_LOCK_ALLOC + struct lockdep_map dep_map; +#endif +} spinlock_t; + +#ifdef CONFIG_DEBUG_RT_MUTEXES +# define __SPIN_LOCK_UNLOCKED(name) \ + (spinlock_t) { { .wait_lock = _RAW_SPIN_LOCK_UNLOCKED(name) \ + , .save_state = 1, .file = __FILE__, .line = __LINE__ }, SPIN_DEP_MAP_INIT(name) } +#else +# define __SPIN_LOCK_UNLOCKED(name) \ + (spinlock_t) { { .wait_lock = _RAW_SPIN_LOCK_UNLOCKED(name) }, SPIN_DEP_MAP_INIT(name) } +#endif +# define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(spin_old_style) +#else /* !PREEMPT_RT */ + typedef raw_spinlock_t spinlock_t; +# ifdef CONFIG_DEBUG_SPINLOCK +# define _SPIN_LOCK_UNLOCKED \ + { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, \ + .magic = SPINLOCK_MAGIC, \ + .owner = SPINLOCK_OWNER_INIT, \ + .owner_cpu = -1 } +# else +# define _SPIN_LOCK_UNLOCKED \ + { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED } +# endif +# define SPIN_LOCK_UNLOCKED _SPIN_LOCK_UNLOCKED +# define __SPIN_LOCK_UNLOCKED(name) _SPIN_LOCK_UNLOCKED +#endif + +#define __DEFINE_SPINLOCK(name) \ + spinlock_t name = __SPIN_LOCK_UNLOCKED(name) + +#define DEFINE_SPINLOCK(name) \ + spinlock_t name __cacheline_aligned_in_smp = __SPIN_LOCK_UNLOCKED(name) + +#ifdef CONFIG_PREEMPT_RT + +/* + * RW-semaphores are a spinlock plus a reader-depth count. + * + * Note that the semantics are different from the usual + * Linux rw-sems, in PREEMPT_RT mode we do not allow + * multiple readers to hold the lock at once, we only allow + * a read-lock owner to read-lock recursively. This is + * better for latency, makes the implementation inherently + * fair and makes it simpler as well: + */ +struct rw_semaphore { + struct rt_mutex lock; + int read_depth; +#ifdef CONFIG_DEBUG_LOCK_ALLOC + struct lockdep_map dep_map; +#endif +}; + +/* + * rwlocks - an RW semaphore plus lock-break field: + */ +typedef struct { + struct rt_mutex lock; + int read_depth; + unsigned int break_lock; +#ifdef CONFIG_DEBUG_LOCK_ALLOC + struct lockdep_map dep_map; +#endif +} rwlock_t; + +# ifdef CONFIG_DEBUG_RT_MUTEXES +# define __RW_LOCK_UNLOCKED(name) (rwlock_t) \ + { .lock = { .wait_lock = _RAW_SPIN_LOCK_UNLOCKED(name), \ + .save_state = 1, .file = __FILE__, .line = __LINE__ } } +# else +# define __RW_LOCK_UNLOCKED(name) (rwlock_t) \ + { .lock = { .wait_lock = _RAW_SPIN_LOCK_UNLOCKED(name) } } +# endif +#else /* !PREEMPT_RT */ + + typedef raw_rwlock_t rwlock_t; +# ifdef CONFIG_DEBUG_SPINLOCK +# define _RW_LOCK_UNLOCKED \ + (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED, \ + .magic = RWLOCK_MAGIC, \ + .owner = SPINLOCK_OWNER_INIT, \ + .owner_cpu = -1 } +# else +# define _RW_LOCK_UNLOCKED \ + (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED } +# endif +# define __RW_LOCK_UNLOCKED(name) _RW_LOCK_UNLOCKED +#endif + +#define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(rw_old_style) + +#define DEFINE_RWLOCK(name) \ + rwlock_t name __cacheline_aligned_in_smp = __RW_LOCK_UNLOCKED(name) + +#ifdef CONFIG_PREEMPT_RT + +/* + * Semaphores - a spinlock plus the semaphore count: + */ +struct semaphore { + atomic_t count; + struct rt_mutex lock; +}; + +#define DECLARE_MUTEX(name) \ +struct semaphore name = \ + { .count = { 1 }, .lock = __RT_MUTEX_INITIALIZER(name.lock) } + +extern void +__sema_init(struct semaphore *sem, int val, char *name, char *file, int line); + +#define rt_sema_init(sem, val) \ + __sema_init(sem, val, #sem, __FILE__, __LINE__) + +extern void +__init_MUTEX(struct semaphore *sem, char *name, char *file, int line); +#define rt_init_MUTEX(sem) \ + __init_MUTEX(sem, #sem, __FILE__, __LINE__) + +extern void there_is_no_init_MUTEX_LOCKED_for_RT_semaphores(void); + +/* + * No locked initialization for RT semaphores + */ +#define rt_init_MUTEX_LOCKED(sem) \ + there_is_no_init_MUTEX_LOCKED_for_RT_semaphores() +extern void rt_down(struct semaphore *sem); +extern int rt_down_interruptible(struct semaphore *sem); +extern int rt_down_timeout(struct semaphore *sem, long jiffies); +extern int rt_down_trylock(struct semaphore *sem); +extern void rt_up(struct semaphore *sem); + +#define rt_sem_is_locked(s) rt_mutex_is_locked(&(s)->lock) +#define rt_sema_count(s) atomic_read(&(s)->count) + +extern int __bad_func_type(void); + +#include + +/* + * PICK_SEM_OP() is a small redirector to allow less typing of the lock + * types struct compat_semaphore, struct semaphore, at the front of the + * PICK_FUNCTION macro. + */ +#define PICK_SEM_OP(...) PICK_FUNCTION(struct compat_semaphore *, \ + struct semaphore *, ##__VA_ARGS__) +#define PICK_SEM_OP_RET(...) PICK_FUNCTION_RET(struct compat_semaphore *,\ + struct semaphore *, ##__VA_ARGS__) + +#define sema_init(sem, val) \ + PICK_SEM_OP(compat_sema_init, rt_sema_init, sem, val) + +#define init_MUTEX(sem) PICK_SEM_OP(compat_init_MUTEX, rt_init_MUTEX, sem) + +#define init_MUTEX_LOCKED(sem) \ + PICK_SEM_OP(compat_init_MUTEX_LOCKED, rt_init_MUTEX_LOCKED, sem) + +#define down(sem) PICK_SEM_OP(compat_down, rt_down, sem) + +#define down_timeout(sem, jiff) \ + PICK_SEM_OP_RET(compat_down_timeout, rt_down_timeout, sem, jiff) + +#define down_interruptible(sem) \ + PICK_SEM_OP_RET(compat_down_interruptible, rt_down_interruptible, sem) + +#define down_trylock(sem) \ + PICK_SEM_OP_RET(compat_down_trylock, rt_down_trylock, sem) + +#define up(sem) PICK_SEM_OP(compat_up, rt_up, sem) + +/* + * rwsems: + */ + +#define __RWSEM_INITIALIZER(name) \ + { .lock = __RT_MUTEX_INITIALIZER(name.lock) } + +#define DECLARE_RWSEM(lockname) \ + struct rw_semaphore lockname = __RWSEM_INITIALIZER(lockname) + +extern void __rt_rwsem_init(struct rw_semaphore *rwsem, char *name, + struct lock_class_key *key); + +# define rt_init_rwsem(sem) \ +do { \ + static struct lock_class_key __key; \ + \ + __rt_rwsem_init((sem), #sem, &__key); \ +} while (0) + +extern void rt_down_write(struct rw_semaphore *rwsem); +extern void +rt_down_read_nested(struct rw_semaphore *rwsem, int subclass); +extern void +rt_down_write_nested(struct rw_semaphore *rwsem, int subclass); +extern void rt_down_read(struct rw_semaphore *rwsem); +#ifdef CONFIG_DEBUG_LOCK_ALLOC +extern void rt_down_read_non_owner(struct rw_semaphore *rwsem); +#else +# define rt_down_read_non_owner(rwsem) rt_down_read(rwsem) +#endif +extern int rt_down_write_trylock(struct rw_semaphore *rwsem); +extern int rt_down_read_trylock(struct rw_semaphore *rwsem); +extern void rt_up_read(struct rw_semaphore *rwsem); +#ifdef CONFIG_DEBUG_LOCK_ALLOC +extern void rt_up_read_non_owner(struct rw_semaphore *rwsem); +#else +# define rt_up_read_non_owner(rwsem) rt_up_read(rwsem) +#endif +extern void rt_up_write(struct rw_semaphore *rwsem); +extern void rt_downgrade_write(struct rw_semaphore *rwsem); + +# define rt_rwsem_is_locked(rws) (rt_mutex_is_locked(&(rws)->lock)) + +#define PICK_RWSEM_OP(...) PICK_FUNCTION(struct compat_rw_semaphore *, \ + struct rw_semaphore *, ##__VA_ARGS__) +#define PICK_RWSEM_OP_RET(...) PICK_FUNCTION_RET(struct compat_rw_semaphore *,\ + struct rw_semaphore *, ##__VA_ARGS__) + +#define init_rwsem(rwsem) PICK_RWSEM_OP(compat_init_rwsem, rt_init_rwsem, rwsem) + +#define down_read(rwsem) PICK_RWSEM_OP(compat_down_read, rt_down_read, rwsem) + +#define down_read_non_owner(rwsem) \ + PICK_RWSEM_OP(compat_down_read_non_owner, rt_down_read_non_owner, rwsem) + +#define down_read_trylock(rwsem) \ + PICK_RWSEM_OP_RET(compat_down_read_trylock, rt_down_read_trylock, rwsem) + +#define down_write(rwsem) PICK_RWSEM_OP(compat_down_write, rt_down_write, rwsem) + +#define down_read_nested(rwsem, subclass) \ + PICK_RWSEM_OP(compat_down_read_nested, rt_down_read_nested, \ + rwsem, subclass) + +#define down_write_nested(rwsem, subclass) \ + PICK_RWSEM_OP(compat_down_write_nested, rt_down_write_nested, \ + rwsem, subclass) + +#define down_write_trylock(rwsem) \ + PICK_RWSEM_OP_RET(compat_down_write_trylock, rt_down_write_trylock,\ + rwsem) + +#define up_read(rwsem) PICK_RWSEM_OP(compat_up_read, rt_up_read, rwsem) + +#define up_read_non_owner(rwsem) \ + PICK_RWSEM_OP(compat_up_read_non_owner, rt_up_read_non_owner, rwsem) + +#define up_write(rwsem) PICK_RWSEM_OP(compat_up_write, rt_up_write, rwsem) + +#define downgrade_write(rwsem) \ + PICK_RWSEM_OP(compat_downgrade_write, rt_downgrade_write, rwsem) + +#define rwsem_is_locked(rwsem) \ + PICK_RWSEM_OP_RET(compat_rwsem_is_locked, rt_rwsem_is_locked, rwsem) + +#endif /* CONFIG_PREEMPT_RT */ + +#endif + Index: linux-2.6-tip/include/linux/rtmutex.h =================================================================== --- linux-2.6-tip.orig/include/linux/rtmutex.h +++ linux-2.6-tip/include/linux/rtmutex.h @@ -24,7 +24,7 @@ * @owner: the mutex owner */ struct rt_mutex { - spinlock_t wait_lock; + raw_spinlock_t wait_lock; struct plist_head wait_list; struct task_struct *owner; #ifdef CONFIG_DEBUG_RT_MUTEXES @@ -63,7 +63,7 @@ struct hrtimer_sleeper; #endif #define __RT_MUTEX_INITIALIZER(mutexname) \ - { .wait_lock = __SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ + { .wait_lock = RAW_SPIN_LOCK_UNLOCKED(mutexname) \ , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list, mutexname.wait_lock) \ , .owner = NULL \ __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} @@ -88,6 +88,8 @@ extern void rt_mutex_destroy(struct rt_m extern void rt_mutex_lock(struct rt_mutex *lock); extern int rt_mutex_lock_interruptible(struct rt_mutex *lock, int detect_deadlock); +extern int rt_mutex_lock_killable(struct rt_mutex *lock, + int detect_deadlock); extern int rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout, int detect_deadlock); Index: linux-2.6-tip/include/linux/rwsem-spinlock.h =================================================================== --- linux-2.6-tip.orig/include/linux/rwsem-spinlock.h +++ linux-2.6-tip/include/linux/rwsem-spinlock.h @@ -28,7 +28,7 @@ struct rwsem_waiter; * - if activity is -1 then there is one active writer * - if wait_list is not empty, then there are processes waiting for the semaphore */ -struct rw_semaphore { +struct compat_rw_semaphore { __s32 activity; spinlock_t wait_lock; struct list_head wait_list; @@ -43,33 +43,32 @@ struct rw_semaphore { # define __RWSEM_DEP_MAP_INIT(lockname) #endif -#define __RWSEM_INITIALIZER(name) \ -{ 0, __SPIN_LOCK_UNLOCKED(name.wait_lock), LIST_HEAD_INIT((name).wait_list) \ - __RWSEM_DEP_MAP_INIT(name) } +#define __COMPAT_RWSEM_INITIALIZER(name) \ +{ 0, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) } -#define DECLARE_RWSEM(name) \ - struct rw_semaphore name = __RWSEM_INITIALIZER(name) +#define COMPAT_DECLARE_RWSEM(name) \ + struct compat_rw_semaphore name = __COMPAT_RWSEM_INITIALIZER(name) -extern void __init_rwsem(struct rw_semaphore *sem, const char *name, +extern void __compat_init_rwsem(struct compat_rw_semaphore *sem, const char *name, struct lock_class_key *key); -#define init_rwsem(sem) \ +#define compat_init_rwsem(sem) \ do { \ static struct lock_class_key __key; \ \ - __init_rwsem((sem), #sem, &__key); \ + __compat_init_rwsem((sem), #sem, &__key); \ } while (0) -extern void __down_read(struct rw_semaphore *sem); -extern int __down_read_trylock(struct rw_semaphore *sem); -extern void __down_write(struct rw_semaphore *sem); -extern void __down_write_nested(struct rw_semaphore *sem, int subclass); -extern int __down_write_trylock(struct rw_semaphore *sem); -extern void __up_read(struct rw_semaphore *sem); -extern void __up_write(struct rw_semaphore *sem); -extern void __downgrade_write(struct rw_semaphore *sem); +extern void __down_read(struct compat_rw_semaphore *sem); +extern int __down_read_trylock(struct compat_rw_semaphore *sem); +extern void __down_write(struct compat_rw_semaphore *sem); +extern void __down_write_nested(struct compat_rw_semaphore *sem, int subclass); +extern int __down_write_trylock(struct compat_rw_semaphore *sem); +extern void __up_read(struct compat_rw_semaphore *sem); +extern void __up_write(struct compat_rw_semaphore *sem); +extern void __downgrade_write(struct compat_rw_semaphore *sem); -static inline int rwsem_is_locked(struct rw_semaphore *sem) +static inline int compat_rwsem_is_locked(struct compat_rw_semaphore *sem) { return (sem->activity != 0); } Index: linux-2.6-tip/include/linux/rwsem.h =================================================================== --- linux-2.6-tip.orig/include/linux/rwsem.h +++ linux-2.6-tip/include/linux/rwsem.h @@ -9,53 +9,68 @@ #include +#ifdef CONFIG_PREEMPT_RT +# include +#endif + #include #include #include #include -struct rw_semaphore; +#ifndef CONFIG_PREEMPT_RT +/* + * On !PREEMPT_RT all rw-semaphores are compat: + */ +#define compat_rw_semaphore rw_semaphore +#endif + +struct compat_rw_semaphore; #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK -#include /* use a generic implementation */ +# include /* use a generic implementation */ +# ifndef CONFIG_PREEMPT_RT +# define __RWSEM_INITIALIZER __COMPAT_RWSEM_INITIALIZER +# define DECLARE_RWSEM COMPAT_DECLARE_RWSEM +# endif #else -#include /* use an arch-specific implementation */ +# include /* use an arch-specific implementation */ #endif /* * lock for reading */ -extern void down_read(struct rw_semaphore *sem); +extern void compat_down_read(struct compat_rw_semaphore *sem); /* * trylock for reading -- returns 1 if successful, 0 if contention */ -extern int down_read_trylock(struct rw_semaphore *sem); +extern int compat_down_read_trylock(struct compat_rw_semaphore *sem); /* * lock for writing */ -extern void down_write(struct rw_semaphore *sem); +extern void compat_down_write(struct compat_rw_semaphore *sem); /* * trylock for writing -- returns 1 if successful, 0 if contention */ -extern int down_write_trylock(struct rw_semaphore *sem); +extern int compat_down_write_trylock(struct compat_rw_semaphore *sem); /* * release a read lock */ -extern void up_read(struct rw_semaphore *sem); +extern void compat_up_read(struct compat_rw_semaphore *sem); /* * release a write lock */ -extern void up_write(struct rw_semaphore *sem); +extern void compat_up_write(struct compat_rw_semaphore *sem); /* * downgrade write lock to read lock */ -extern void downgrade_write(struct rw_semaphore *sem); +extern void compat_downgrade_write(struct compat_rw_semaphore *sem); #ifdef CONFIG_DEBUG_LOCK_ALLOC /* @@ -71,21 +86,78 @@ extern void downgrade_write(struct rw_se * lockdep_set_class() at lock initialization time. * See Documentation/lockdep-design.txt for more details.) */ -extern void down_read_nested(struct rw_semaphore *sem, int subclass); -extern void down_write_nested(struct rw_semaphore *sem, int subclass); +extern void +compat_down_read_nested(struct compat_rw_semaphore *sem, int subclass); +extern void +compat_down_write_nested(struct compat_rw_semaphore *sem, int subclass); /* * Take/release a lock when not the owner will release it. * * [ This API should be avoided as much as possible - the * proper abstraction for this case is completions. ] */ -extern void down_read_non_owner(struct rw_semaphore *sem); -extern void up_read_non_owner(struct rw_semaphore *sem); +extern void +compat_down_read_non_owner(struct compat_rw_semaphore *sem); +extern void +compat_up_read_non_owner(struct compat_rw_semaphore *sem); #else -# define down_read_nested(sem, subclass) down_read(sem) -# define down_write_nested(sem, subclass) down_write(sem) -# define down_read_non_owner(sem) down_read(sem) -# define up_read_non_owner(sem) up_read(sem) +# define compat_down_read_nested(sem, subclass) compat_down_read(sem) +# define compat_down_write_nested(sem, subclass) compat_down_write(sem) +# define compat_down_read_non_owner(sem) compat_down_read(sem) +# define compat_up_read_non_owner(sem) compat_up_read(sem) #endif +#ifndef CONFIG_PREEMPT_RT + +#define DECLARE_RWSEM COMPAT_DECLARE_RWSEM + +/* + * NOTE, lockdep: this has to be a macro, so that separate class-keys + * get generated by the compiler, if the same function does multiple + * init_rwsem() calls to different rwsems. + */ +#define init_rwsem(rwsem) compat_init_rwsem(rwsem) + +static inline void down_read(struct compat_rw_semaphore *rwsem) +{ + compat_down_read(rwsem); +} +static inline int down_read_trylock(struct compat_rw_semaphore *rwsem) +{ + return compat_down_read_trylock(rwsem); +} +static inline void down_write(struct compat_rw_semaphore *rwsem) +{ + compat_down_write(rwsem); +} +static inline int down_write_trylock(struct compat_rw_semaphore *rwsem) +{ + return compat_down_write_trylock(rwsem); +} +static inline void up_read(struct compat_rw_semaphore *rwsem) +{ + compat_up_read(rwsem); +} +static inline void up_write(struct compat_rw_semaphore *rwsem) +{ + compat_up_write(rwsem); +} +static inline void downgrade_write(struct compat_rw_semaphore *rwsem) +{ + compat_downgrade_write(rwsem); +} +static inline int rwsem_is_locked(struct compat_rw_semaphore *sem) +{ + return compat_rwsem_is_locked(sem); +} +# define down_read_nested(sem, subclass) \ + compat_down_read_nested(sem, subclass) +# define down_write_nested(sem, subclass) \ + compat_down_write_nested(sem, subclass) +# define down_read_non_owner(sem) \ + compat_down_read_non_owner(sem) +# define up_read_non_owner(sem) \ + compat_up_read_non_owner(sem) +#endif /* !CONFIG_PREEMPT_RT */ + #endif /* _LINUX_RWSEM_H */ Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -176,6 +176,7 @@ print_cfs_rq(struct seq_file *m, int cpu #endif extern unsigned long long time_sync_thresh; +extern struct semaphore kernel_sem; /* * Task state bitmask. NOTE! These bits are also @@ -188,16 +189,17 @@ extern unsigned long long time_sync_thre * mistake. */ #define TASK_RUNNING 0 -#define TASK_INTERRUPTIBLE 1 -#define TASK_UNINTERRUPTIBLE 2 -#define __TASK_STOPPED 4 -#define __TASK_TRACED 8 +#define TASK_RUNNING_MUTEX 1 +#define TASK_INTERRUPTIBLE 2 +#define TASK_UNINTERRUPTIBLE 4 +#define __TASK_STOPPED 8 +#define __TASK_TRACED 16 /* in tsk->exit_state */ -#define EXIT_ZOMBIE 16 -#define EXIT_DEAD 32 +#define EXIT_ZOMBIE 32 +#define EXIT_DEAD 64 /* in tsk->state again */ -#define TASK_DEAD 64 -#define TASK_WAKEKILL 128 +#define TASK_DEAD 128 +#define TASK_WAKEKILL 256 /* Convenience macros for the sake of set_task_state */ #define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) @@ -206,10 +208,12 @@ extern unsigned long long time_sync_thre /* Convenience macros for the sake of wake_up */ #define TASK_NORMAL (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE) -#define TASK_ALL (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED) +#define TASK_ALL (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED | \ + TASK_RUNNING_MUTEX) /* get_task_state() */ -#define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \ +#define TASK_REPORT (TASK_RUNNING | TASK_RUNNING_MUTEX | \ + TASK_INTERRUPTIBLE | \ TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \ __TASK_TRACED) @@ -506,7 +510,7 @@ struct task_cputime { struct thread_group_cputimer { struct task_cputime cputime; int running; - spinlock_t lock; + raw_spinlock_t lock; }; /* @@ -1325,7 +1329,7 @@ struct task_struct { spinlock_t alloc_lock; /* Protection of the PI data structures: */ - spinlock_t pi_lock; + raw_spinlock_t pi_lock; #ifdef CONFIG_RT_MUTEXES /* PI waiters blocked on a rt_mutex held by this task */ @@ -1362,6 +1366,26 @@ struct task_struct { gfp_t lockdep_reclaim_gfp; #endif +/* realtime bits */ + +#define MAX_PREEMPT_TRACE 25 +#define MAX_LOCK_STACK MAX_PREEMPT_TRACE +#ifdef CONFIG_DEBUG_PREEMPT + int lock_count; +# ifdef CONFIG_PREEMPT_RT + struct rt_mutex *owned_lock[MAX_LOCK_STACK]; +# endif +#endif +#ifdef CONFIG_DETECT_SOFTLOCKUP + unsigned long softlockup_count; /* Count to keep track how long the + * thread is in the kernel without + * sleeping. + */ +#endif +#ifdef CONFIG_DEBUG_RT_MUTEXES + void *last_kernel_lock; +#endif + /* journalling filesystem info */ void *journal_info; @@ -1641,6 +1665,7 @@ extern cputime_t task_gtime(struct task_ #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ #define PF_HARDIRQ 0x08000020 /* hardirq context */ +#define PF_NOSCHED 0x00000020 /* Userspace does not expect scheduling */ #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ #define PF_DUMPCORE 0x00000200 /* dumped core */ @@ -1830,6 +1855,7 @@ extern struct task_struct *curr_task(int extern void set_curr_task(int cpu, struct task_struct *p); void yield(void); +void __yield(void); /* * The default (Linux) execution domain. @@ -1897,6 +1923,9 @@ extern void do_timer(unsigned long ticks extern int wake_up_state(struct task_struct *tsk, unsigned int state); extern int wake_up_process(struct task_struct *tsk); +extern int wake_up_process_mutex(struct task_struct * tsk); +extern int wake_up_process_sync(struct task_struct * tsk); +extern int wake_up_process_mutex_sync(struct task_struct * tsk); extern void wake_up_new_task(struct task_struct *tsk, unsigned long clone_flags); #ifdef CONFIG_SMP @@ -2242,7 +2271,13 @@ static inline int cond_resched(void) return _cond_resched(); } #endif -extern int cond_resched_lock(spinlock_t * lock); +extern int __cond_resched_raw_spinlock(raw_spinlock_t *lock); +extern int __cond_resched_spinlock(spinlock_t *spinlock); + +#define cond_resched_lock(lock) \ + PICK_SPIN_OP_RET(__cond_resched_raw_spinlock, __cond_resched_spinlock,\ + lock) + extern int cond_resched_softirq(void); static inline int cond_resched_bkl(void) { @@ -2256,7 +2291,7 @@ extern int cond_resched_hardirq_context( * task waiting?: (technically does not depend on CONFIG_PREEMPT, * but a general need for low latency) */ -static inline int spin_needbreak(spinlock_t *lock) +static inline int __raw_spin_needbreak(raw_spinlock_t *lock) { #ifdef CONFIG_PREEMPT return spin_is_contended(lock); @@ -2282,6 +2317,23 @@ static inline void thread_group_cputime_ { } +#ifdef CONFIG_PREEMPT_RT +static inline int __spin_needbreak(spinlock_t *lock) +{ + return lock->break_lock; +} +#else +static inline int __spin_needbreak(spinlock_t *lock) +{ + /* should never be call outside of RT */ + BUG(); + return 0; +} +#endif + +#define spin_needbreak(lock) \ + PICK_SPIN_OP_RET(__raw_spin_needbreak, __spin_needbreak, lock) + static inline int softirq_need_resched(void) { if (softirq_preemption && (current->flags & PF_SOFTIRQ)) Index: linux-2.6-tip/include/linux/semaphore.h =================================================================== --- linux-2.6-tip.orig/include/linux/semaphore.h +++ linux-2.6-tip/include/linux/semaphore.h @@ -9,41 +9,86 @@ #ifndef __LINUX_SEMAPHORE_H #define __LINUX_SEMAPHORE_H -#include -#include +#ifndef CONFIG_PREEMPT_RT +# define compat_semaphore semaphore +#endif + +# include +# include /* Please don't access any members of this structure directly */ -struct semaphore { +struct compat_semaphore { spinlock_t lock; unsigned int count; struct list_head wait_list; }; -#define __SEMAPHORE_INITIALIZER(name, n) \ +#define __COMPAT_SEMAPHORE_INITIALIZER(name, n) \ { \ .lock = __SPIN_LOCK_UNLOCKED((name).lock), \ .count = n, \ .wait_list = LIST_HEAD_INIT((name).wait_list), \ } -#define DECLARE_MUTEX(name) \ - struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) +#define __COMPAT_DECLARE_SEMAPHORE_GENERIC(name, count) \ + struct compat_semaphore name = __COMPAT_SEMAPHORE_INITIALIZER(name, count) -static inline void sema_init(struct semaphore *sem, int val) +#define COMPAT_DECLARE_MUTEX(name) __COMPAT_DECLARE_SEMAPHORE_GENERIC(name, 1) +static inline void compat_sema_init(struct compat_semaphore *sem, int val) { static struct lock_class_key __key; - *sem = (struct semaphore) __SEMAPHORE_INITIALIZER(*sem, val); + *sem = (struct compat_semaphore) __COMPAT_SEMAPHORE_INITIALIZER(*sem, val); lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0); } -#define init_MUTEX(sem) sema_init(sem, 1) -#define init_MUTEX_LOCKED(sem) sema_init(sem, 0) +#define compat_init_MUTEX(sem) compat_sema_init(sem, 1) +#define compat_init_MUTEX_LOCKED(sem) compat_sema_init(sem, 0) + +extern void compat_down(struct compat_semaphore *sem); +extern int __must_check compat_down_interruptible(struct compat_semaphore *sem); +extern int __must_check compat_down_killable(struct compat_semaphore *sem); +extern int __must_check compat_down_trylock(struct compat_semaphore *sem); +extern int __must_check compat_down_timeout(struct compat_semaphore *sem, long jiffies); +extern void compat_up(struct compat_semaphore *sem); + +#ifdef CONFIG_PREEMPT_RT +# include +#else +#define DECLARE_MUTEX COMPAT_DECLARE_MUTEX -extern void down(struct semaphore *sem); -extern int __must_check down_interruptible(struct semaphore *sem); -extern int __must_check down_killable(struct semaphore *sem); -extern int __must_check down_trylock(struct semaphore *sem); -extern int __must_check down_timeout(struct semaphore *sem, long jiffies); -extern void up(struct semaphore *sem); +static inline void sema_init(struct compat_semaphore *sem, int val) +{ + compat_sema_init(sem, val); +} +static inline void init_MUTEX(struct compat_semaphore *sem) +{ + compat_init_MUTEX(sem); +} +static inline void init_MUTEX_LOCKED(struct compat_semaphore *sem) +{ + compat_init_MUTEX_LOCKED(sem); +} +static inline void down(struct compat_semaphore *sem) +{ + compat_down(sem); +} +static inline int down_interruptible(struct compat_semaphore *sem) +{ + return compat_down_interruptible(sem); +} +static inline int down_trylock(struct compat_semaphore *sem) +{ + return compat_down_trylock(sem); +} +static inline int down_timeout(struct compat_semaphore *sem, long jiffies) +{ + return compat_down_timeout(sem, jiffies); +} + +static inline void up(struct compat_semaphore *sem) +{ + compat_up(sem); +} +#endif /* CONFIG_PREEMPT_RT */ #endif /* __LINUX_SEMAPHORE_H */ Index: linux-2.6-tip/include/linux/seqlock.h =================================================================== --- linux-2.6-tip.orig/include/linux/seqlock.h +++ linux-2.6-tip/include/linux/seqlock.h @@ -32,46 +32,80 @@ typedef struct { unsigned sequence; spinlock_t lock; -} seqlock_t; +} __seqlock_t; + +typedef struct { + unsigned sequence; + raw_spinlock_t lock; +} __raw_seqlock_t; + +#define seqlock_need_resched(seq) lock_need_resched(&(seq)->lock) + +#ifdef CONFIG_PREEMPT_RT +typedef __seqlock_t seqlock_t; +#else +typedef __raw_seqlock_t seqlock_t; +#endif + +typedef __raw_seqlock_t raw_seqlock_t; /* * These macros triggered gcc-3.x compile-time problems. We think these are * OK now. Be cautious. */ -#define __SEQLOCK_UNLOCKED(lockname) \ - { 0, __SPIN_LOCK_UNLOCKED(lockname) } +#define __RAW_SEQLOCK_UNLOCKED(lockname) \ + { 0, RAW_SPIN_LOCK_UNLOCKED(lockname) } + +#ifdef CONFIG_PREEMPT_RT +# define __SEQLOCK_UNLOCKED(lockname) { 0, __SPIN_LOCK_UNLOCKED(lockname) } +#else +# define __SEQLOCK_UNLOCKED(lockname) __RAW_SEQLOCK_UNLOCKED(lockname) +#endif #define SEQLOCK_UNLOCKED \ __SEQLOCK_UNLOCKED(old_style_seqlock_init) -#define seqlock_init(x) \ - do { \ - (x)->sequence = 0; \ - spin_lock_init(&(x)->lock); \ - } while (0) +#define raw_seqlock_init(x) \ + do { *(x) = (raw_seqlock_t) __RAW_SEQLOCK_UNLOCKED(x); spin_lock_init(&(x)->lock); } while (0) + +#define seqlock_init(x) \ + do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); spin_lock_init(&(x)->lock); } while (0) #define DEFINE_SEQLOCK(x) \ seqlock_t x = __SEQLOCK_UNLOCKED(x) +#define DEFINE_RAW_SEQLOCK(name) \ + raw_seqlock_t name __cacheline_aligned_in_smp = \ + __RAW_SEQLOCK_UNLOCKED(name) + + /* Lock out other writers and update the count. * Acts like a normal spin_lock/unlock. * Don't need preempt_disable() because that is in the spin_lock already. */ -static inline void write_seqlock(seqlock_t *sl) +static inline void __write_seqlock(seqlock_t *sl) { spin_lock(&sl->lock); ++sl->sequence; smp_wmb(); } -static inline void write_sequnlock(seqlock_t *sl) +static __always_inline unsigned long __write_seqlock_irqsave(seqlock_t *sl) +{ + __write_seqlock(sl); + return 0; +} + +static inline void __write_sequnlock(seqlock_t *sl) { smp_wmb(); sl->sequence++; spin_unlock(&sl->lock); } -static inline int write_tryseqlock(seqlock_t *sl) +#define __write_sequnlock_irqrestore(sl, flags) __write_sequnlock(sl) + +static inline int __write_tryseqlock(seqlock_t *sl) { int ret = spin_trylock(&sl->lock); @@ -83,7 +117,7 @@ static inline int write_tryseqlock(seqlo } /* Start of read calculation -- fetch last complete writer token */ -static __always_inline unsigned read_seqbegin(const seqlock_t *sl) +static __always_inline unsigned __read_seqbegin(const seqlock_t *sl) { unsigned ret; @@ -103,13 +137,195 @@ repeat: * * If sequence value changed then writer changed data while in section. */ -static __always_inline int read_seqretry(const seqlock_t *sl, unsigned start) +static inline int __read_seqretry(seqlock_t *sl, unsigned iv) +{ + int ret; + + smp_rmb(); + ret = (iv & 1) | (sl->sequence ^ iv); + /* + * If invalid then serialize with the writer, to make sure we + * are not livelocking it: + */ + if (unlikely(ret)) { + unsigned long flags; + spin_lock_irqsave(&sl->lock, flags); + spin_unlock_irqrestore(&sl->lock, flags); + } + return ret; +} + +static __always_inline void __write_seqlock_raw(raw_seqlock_t *sl) +{ + spin_lock(&sl->lock); + ++sl->sequence; + smp_wmb(); +} + +static __always_inline unsigned long +__write_seqlock_irqsave_raw(raw_seqlock_t *sl) +{ + unsigned long flags; + + local_irq_save(flags); + __write_seqlock_raw(sl); + return flags; +} + +static __always_inline void __write_seqlock_irq_raw(raw_seqlock_t *sl) +{ + local_irq_disable(); + __write_seqlock_raw(sl); +} + +static __always_inline void __write_seqlock_bh_raw(raw_seqlock_t *sl) +{ + local_bh_disable(); + __write_seqlock_raw(sl); +} + +static __always_inline void __write_sequnlock_raw(raw_seqlock_t *sl) +{ + smp_wmb(); + sl->sequence++; + spin_unlock(&sl->lock); +} + +static __always_inline void +__write_sequnlock_irqrestore_raw(raw_seqlock_t *sl, unsigned long flags) +{ + __write_sequnlock_raw(sl); + local_irq_restore(flags); + preempt_check_resched(); +} + +static __always_inline void __write_sequnlock_irq_raw(raw_seqlock_t *sl) +{ + __write_sequnlock_raw(sl); + local_irq_enable(); + preempt_check_resched(); +} + +static __always_inline void __write_sequnlock_bh_raw(raw_seqlock_t *sl) +{ + __write_sequnlock_raw(sl); + local_bh_enable(); +} + +static __always_inline int __write_tryseqlock_raw(raw_seqlock_t *sl) +{ + int ret = spin_trylock(&sl->lock); + + if (ret) { + ++sl->sequence; + smp_wmb(); + } + return ret; +} + +static __always_inline unsigned __read_seqbegin_raw(const raw_seqlock_t *sl) +{ + unsigned ret = sl->sequence; + smp_rmb(); + return ret; +} + +static __always_inline int __read_seqretry_raw(const raw_seqlock_t *sl, unsigned start) { smp_rmb(); return (sl->sequence != start); } +extern int __bad_seqlock_type(void); + +/* + * PICK_SEQ_OP() is a small redirector to allow less typing of the lock + * types raw_seqlock_t, seqlock_t, at the front of the PICK_FUNCTION + * macro. + */ +#define PICK_SEQ_OP(...) \ + PICK_FUNCTION(raw_seqlock_t *, seqlock_t *, ##__VA_ARGS__) +#define PICK_SEQ_OP_RET(...) \ + PICK_FUNCTION_RET(raw_seqlock_t *, seqlock_t *, ##__VA_ARGS__) + +#define write_seqlock(sl) PICK_SEQ_OP(__write_seqlock_raw, __write_seqlock, sl) + +#define write_sequnlock(sl) \ + PICK_SEQ_OP(__write_sequnlock_raw, __write_sequnlock, sl) + +#define write_tryseqlock(sl) \ + PICK_SEQ_OP_RET(__write_tryseqlock_raw, __write_tryseqlock, sl) + +#define read_seqbegin(sl) \ + PICK_SEQ_OP_RET(__read_seqbegin_raw, __read_seqbegin, sl) + +#define read_seqretry(sl, iv) \ + PICK_SEQ_OP_RET(__read_seqretry_raw, __read_seqretry, sl, iv) + +#define write_seqlock_irqsave(lock, flags) \ +do { \ + flags = PICK_SEQ_OP_RET(__write_seqlock_irqsave_raw, \ + __write_seqlock_irqsave, lock); \ +} while (0) + +#define write_seqlock_irq(lock) \ + PICK_SEQ_OP(__write_seqlock_irq_raw, __write_seqlock, lock) + +#define write_seqlock_bh(lock) \ + PICK_SEQ_OP(__write_seqlock_bh_raw, __write_seqlock, lock) + +#define write_sequnlock_irqrestore(lock, flags) \ + PICK_SEQ_OP(__write_sequnlock_irqrestore_raw, \ + __write_sequnlock_irqrestore, lock, flags) + +#define write_sequnlock_bh(lock) \ + PICK_SEQ_OP(__write_sequnlock_bh_raw, __write_sequnlock, lock) + +#define write_sequnlock_irq(lock) \ + PICK_SEQ_OP(__write_sequnlock_irq_raw, __write_sequnlock, lock) + +static __always_inline +unsigned long __read_seqbegin_irqsave_raw(raw_seqlock_t *sl) +{ + unsigned long flags; + + local_irq_save(flags); + __read_seqbegin_raw(sl); + return flags; +} + +static __always_inline unsigned long __read_seqbegin_irqsave(seqlock_t *sl) +{ + __read_seqbegin(sl); + return 0; +} + +#define read_seqbegin_irqsave(lock, flags) \ +do { \ + flags = PICK_SEQ_OP_RET(__read_seqbegin_irqsave_raw, \ + __read_seqbegin_irqsave, lock); \ +} while (0) + +static __always_inline int +__read_seqretry_irqrestore(seqlock_t *sl, unsigned iv, unsigned long flags) +{ + return __read_seqretry(sl, iv); +} + +static __always_inline int +__read_seqretry_irqrestore_raw(raw_seqlock_t *sl, unsigned iv, + unsigned long flags) +{ + int ret = read_seqretry(sl, iv); + local_irq_restore(flags); + preempt_check_resched(); + return ret; +} + +#define read_seqretry_irqrestore(lock, iv, flags) \ + PICK_SEQ_OP_RET(__read_seqretry_irqrestore_raw, \ + __read_seqretry_irqrestore, lock, iv, flags) /* * Version using sequence counter only. @@ -166,32 +382,4 @@ static inline void write_seqcount_end(se smp_wmb(); s->sequence++; } - -/* - * Possible sw/hw IRQ protected versions of the interfaces. - */ -#define write_seqlock_irqsave(lock, flags) \ - do { local_irq_save(flags); write_seqlock(lock); } while (0) -#define write_seqlock_irq(lock) \ - do { local_irq_disable(); write_seqlock(lock); } while (0) -#define write_seqlock_bh(lock) \ - do { local_bh_disable(); write_seqlock(lock); } while (0) - -#define write_sequnlock_irqrestore(lock, flags) \ - do { write_sequnlock(lock); local_irq_restore(flags); } while(0) -#define write_sequnlock_irq(lock) \ - do { write_sequnlock(lock); local_irq_enable(); } while(0) -#define write_sequnlock_bh(lock) \ - do { write_sequnlock(lock); local_bh_enable(); } while(0) - -#define read_seqbegin_irqsave(lock, flags) \ - ({ local_irq_save(flags); read_seqbegin(lock); }) - -#define read_seqretry_irqrestore(lock, iv, flags) \ - ({ \ - int ret = read_seqretry(lock, iv); \ - local_irq_restore(flags); \ - ret; \ - }) - #endif /* __LINUX_SEQLOCK_H */ Index: linux-2.6-tip/include/linux/spinlock.h =================================================================== --- linux-2.6-tip.orig/include/linux/spinlock.h +++ linux-2.6-tip/include/linux/spinlock.h @@ -44,6 +44,42 @@ * builds the _spin_*() APIs. * * linux/spinlock.h: builds the final spin_*() APIs. + * + * + * Public types and naming conventions: + * ------------------------------------ + * spinlock_t: type: sleep-lock + * raw_spinlock_t: type: spin-lock (debug) + * + * spin_lock([raw_]spinlock_t): API: acquire lock, both types + * + * + * Internal types and naming conventions: + * ------------------------------------- + * __raw_spinlock_t: type: lowlevel spin-lock + * + * _spin_lock(struct rt_mutex): API: acquire sleep-lock + * __spin_lock(raw_spinlock_t): API: acquire spin-lock (highlevel) + * _raw_spin_lock(raw_spinlock_t): API: acquire spin-lock (debug) + * __raw_spin_lock(__raw_spinlock_t): API: acquire spin-lock (lowlevel) + * + * + * spin_lock(raw_spinlock_t) translates into the following chain of + * calls/inlines/macros, if spin-lock debugging is enabled: + * + * spin_lock() [include/linux/spinlock.h] + * -> __spin_lock() [kernel/spinlock.c] + * -> _raw_spin_lock() [lib/spinlock_debug.c] + * -> __raw_spin_lock() [include/asm/spinlock.h] + * + * spin_lock(spinlock_t) translates into the following chain of + * calls/inlines/macros: + * + * spin_lock() [include/linux/spinlock.h] + * -> _spin_lock() [include/linux/spinlock.h] + * -> rt_spin_lock() [kernel/rtmutex.c] + * -> rt_spin_lock_fastlock() [kernel/rtmutex.c] + * -> rt_spin_lock_slowlock() [kernel/rtmutex.c] */ #include @@ -52,29 +88,15 @@ #include #include #include +#include #include #include +#include +#include #include /* - * Must define these before including other files, inline functions need them - */ -#define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME - -#define LOCK_SECTION_START(extra) \ - ".subsection 1\n\t" \ - extra \ - ".ifndef " LOCK_SECTION_NAME "\n\t" \ - LOCK_SECTION_NAME ":\n\t" \ - ".endif\n" - -#define LOCK_SECTION_END \ - ".previous\n\t" - -#define __lockfunc __attribute__((section(".spinlock.text"))) - -/* * Pull the raw_spinlock_t and raw_rwlock_t definitions: */ #include @@ -90,36 +112,10 @@ extern int __lockfunc generic__raw_read_ # include #endif -#ifdef CONFIG_DEBUG_SPINLOCK - extern void __spin_lock_init(spinlock_t *lock, const char *name, - struct lock_class_key *key); -# define spin_lock_init(lock) \ -do { \ - static struct lock_class_key __key; \ - \ - __spin_lock_init((lock), #lock, &__key); \ -} while (0) - -#else -# define spin_lock_init(lock) \ - do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0) -#endif - -#ifdef CONFIG_DEBUG_SPINLOCK - extern void __rwlock_init(rwlock_t *lock, const char *name, - struct lock_class_key *key); -# define rwlock_init(lock) \ -do { \ - static struct lock_class_key __key; \ - \ - __rwlock_init((lock), #lock, &__key); \ -} while (0) -#else -# define rwlock_init(lock) \ - do { *(lock) = RW_LOCK_UNLOCKED; } while (0) -#endif - -#define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) +/* + * Pull the RT types: + */ +#include #ifdef CONFIG_GENERIC_LOCKBREAK #define spin_is_contended(lock) ((lock)->break_lock) @@ -132,12 +128,6 @@ do { \ #endif /*__raw_spin_is_contended*/ #endif -/** - * spin_unlock_wait - wait until the spinlock gets unlocked - * @lock: the spinlock in question. - */ -#define spin_unlock_wait(lock) __raw_spin_unlock_wait(&(lock)->raw_lock) - /* * Pull the _spin_*()/_read_*()/_write_*() functions/declarations: */ @@ -148,16 +138,16 @@ do { \ #endif #ifdef CONFIG_DEBUG_SPINLOCK - extern void _raw_spin_lock(spinlock_t *lock); -#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) - extern int _raw_spin_trylock(spinlock_t *lock); - extern void _raw_spin_unlock(spinlock_t *lock); - extern void _raw_read_lock(rwlock_t *lock); - extern int _raw_read_trylock(rwlock_t *lock); - extern void _raw_read_unlock(rwlock_t *lock); - extern void _raw_write_lock(rwlock_t *lock); - extern int _raw_write_trylock(rwlock_t *lock); - extern void _raw_write_unlock(rwlock_t *lock); + extern __lockfunc void _raw_spin_lock(raw_spinlock_t *lock); +# define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) + extern __lockfunc int _raw_spin_trylock(raw_spinlock_t *lock); + extern __lockfunc void _raw_spin_unlock(raw_spinlock_t *lock); + extern __lockfunc void _raw_read_lock(raw_rwlock_t *lock); + extern __lockfunc int _raw_read_trylock(raw_rwlock_t *lock); + extern __lockfunc void _raw_read_unlock(raw_rwlock_t *lock); + extern __lockfunc void _raw_write_lock(raw_rwlock_t *lock); + extern __lockfunc int _raw_write_trylock(raw_rwlock_t *lock); + extern __lockfunc void _raw_write_unlock(raw_rwlock_t *lock); #else # define _raw_spin_lock(lock) __raw_spin_lock(&(lock)->raw_lock) # define _raw_spin_lock_flags(lock, flags) \ @@ -172,179 +162,425 @@ do { \ # define _raw_write_unlock(rwlock) __raw_write_unlock(&(rwlock)->raw_lock) #endif -#define read_can_lock(rwlock) __raw_read_can_lock(&(rwlock)->raw_lock) -#define write_can_lock(rwlock) __raw_write_can_lock(&(rwlock)->raw_lock) +extern int __bad_spinlock_type(void); +extern int __bad_rwlock_type(void); + +extern void +__rt_spin_lock_init(spinlock_t *lock, char *name, struct lock_class_key *key); + +extern void __lockfunc rt_spin_lock(spinlock_t *lock); +extern void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass); +extern void __lockfunc rt_spin_unlock(spinlock_t *lock); +extern void __lockfunc rt_spin_unlock_wait(spinlock_t *lock); +extern int __lockfunc +rt_spin_trylock_irqsave(spinlock_t *lock, unsigned long *flags); +extern int __lockfunc rt_spin_trylock(spinlock_t *lock); +extern int _atomic_dec_and_spin_lock(spinlock_t *lock, atomic_t *atomic); + +/* + * lockdep-less calls, for derived types like rwlock: + * (for trylock they can use rt_mutex_trylock() directly. + */ +extern void __lockfunc __rt_spin_lock(struct rt_mutex *lock); +extern void __lockfunc __rt_spin_unlock(struct rt_mutex *lock); + +#ifdef CONFIG_PREEMPT_RT +# define _spin_lock(l) rt_spin_lock(l) +# define _spin_lock_nested(l, s) rt_spin_lock_nested(l, s) +# define _spin_lock_bh(l) rt_spin_lock(l) +# define _spin_lock_irq(l) rt_spin_lock(l) +# define _spin_unlock(l) rt_spin_unlock(l) +# define _spin_unlock_no_resched(l) rt_spin_unlock(l) +# define _spin_unlock_bh(l) rt_spin_unlock(l) +# define _spin_unlock_irq(l) rt_spin_unlock(l) +# define _spin_unlock_irqrestore(l, f) rt_spin_unlock(l) +static inline unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) +{ + rt_spin_lock(lock); + return 0; +} +static inline unsigned long __lockfunc +_spin_lock_irqsave_nested(spinlock_t *lock, int subclass) +{ + rt_spin_lock_nested(lock, subclass); + return 0; +} +#else +static inline unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) +{ + return 0; +} +static inline unsigned long __lockfunc +_spin_lock_irqsave_nested(spinlock_t *lock, int subclass) +{ + return 0; +} +# define _spin_lock(l) do { } while (0) +# define _spin_lock_nested(l, s) do { } while (0) +# define _spin_lock_bh(l) do { } while (0) +# define _spin_lock_irq(l) do { } while (0) +# define _spin_unlock(l) do { } while (0) +# define _spin_unlock_no_resched(l) do { } while (0) +# define _spin_unlock_bh(l) do { } while (0) +# define _spin_unlock_irq(l) do { } while (0) +# define _spin_unlock_irqrestore(l, f) do { } while (0) +#endif + +#define _spin_lock_init(sl, n, f, l) \ +do { \ + static struct lock_class_key __key; \ + \ + __rt_spin_lock_init(sl, n, &__key); \ +} while (0) + +# ifdef CONFIG_PREEMPT_RT +# define _spin_can_lock(l) (!rt_mutex_is_locked(&(l)->lock)) +# define _spin_is_locked(l) rt_mutex_is_locked(&(l)->lock) +# define _spin_unlock_wait(l) rt_spin_unlock_wait(l) + +# define _spin_trylock(l) rt_spin_trylock(l) +# define _spin_trylock_bh(l) rt_spin_trylock(l) +# define _spin_trylock_irq(l) rt_spin_trylock(l) +# define _spin_trylock_irqsave(l,f) rt_spin_trylock_irqsave(l, f) +# else + + extern int this_should_never_be_called_on_non_rt(spinlock_t *lock); +# define TSNBCONRT(l) this_should_never_be_called_on_non_rt(l) +# define _spin_can_lock(l) TSNBCONRT(l) +# define _spin_is_locked(l) TSNBCONRT(l) +# define _spin_unlock_wait(l) TSNBCONRT(l) + +# define _spin_trylock(l) TSNBCONRT(l) +# define _spin_trylock_bh(l) TSNBCONRT(l) +# define _spin_trylock_irq(l) TSNBCONRT(l) +# define _spin_trylock_irqsave(l,f) TSNBCONRT(l) +#endif + +extern void __lockfunc rt_write_lock(rwlock_t *rwlock); +extern void __lockfunc rt_read_lock(rwlock_t *rwlock); +extern int __lockfunc rt_write_trylock(rwlock_t *rwlock); +extern int __lockfunc rt_write_trylock_irqsave(rwlock_t *trylock, + unsigned long *flags); +extern int __lockfunc rt_read_trylock(rwlock_t *rwlock); +extern void __lockfunc rt_write_unlock(rwlock_t *rwlock); +extern void __lockfunc rt_read_unlock(rwlock_t *rwlock); +extern unsigned long __lockfunc rt_write_lock_irqsave(rwlock_t *rwlock); +extern unsigned long __lockfunc rt_read_lock_irqsave(rwlock_t *rwlock); +extern void +__rt_rwlock_init(rwlock_t *rwlock, char *name, struct lock_class_key *key); + +#define _rwlock_init(rwl, n, f, l) \ +do { \ + static struct lock_class_key __key; \ + \ + __rt_rwlock_init(rwl, n, &__key); \ +} while (0) + +#ifdef CONFIG_PREEMPT_RT +# define rt_read_can_lock(rwl) (!rt_mutex_is_locked(&(rwl)->lock)) +# define rt_write_can_lock(rwl) (!rt_mutex_is_locked(&(rwl)->lock)) +#else + extern int rt_rwlock_can_lock_never_call_on_non_rt(rwlock_t *rwlock); +# define rt_read_can_lock(rwl) rt_rwlock_can_lock_never_call_on_non_rt(rwl) +# define rt_write_can_lock(rwl) rt_rwlock_can_lock_never_call_on_non_rt(rwl) +#endif + +# define _read_can_lock(rwl) rt_read_can_lock(rwl) +# define _write_can_lock(rwl) rt_write_can_lock(rwl) + +# define _read_trylock(rwl) rt_read_trylock(rwl) +# define _write_trylock(rwl) rt_write_trylock(rwl) +# define _write_trylock_irqsave(rwl, flags) \ + rt_write_trylock_irqsave(rwl, flags) + +# define _read_lock(rwl) rt_read_lock(rwl) +# define _write_lock(rwl) rt_write_lock(rwl) +# define _read_unlock(rwl) rt_read_unlock(rwl) +# define _write_unlock(rwl) rt_write_unlock(rwl) + +# define _read_lock_bh(rwl) rt_read_lock(rwl) +# define _write_lock_bh(rwl) rt_write_lock(rwl) +# define _read_unlock_bh(rwl) rt_read_unlock(rwl) +# define _write_unlock_bh(rwl) rt_write_unlock(rwl) + +# define _read_lock_irq(rwl) rt_read_lock(rwl) +# define _write_lock_irq(rwl) rt_write_lock(rwl) +# define _read_unlock_irq(rwl) rt_read_unlock(rwl) +# define _write_unlock_irq(rwl) rt_write_unlock(rwl) + +# define _read_lock_irqsave(rwl) rt_read_lock_irqsave(rwl) +# define _write_lock_irqsave(rwl) rt_write_lock_irqsave(rwl) + +# define _read_unlock_irqrestore(rwl, f) rt_read_unlock(rwl) +# define _write_unlock_irqrestore(rwl, f) rt_write_unlock(rwl) + +#ifdef CONFIG_DEBUG_SPINLOCK + extern void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, + struct lock_class_key *key); +# define _raw_spin_lock_init(lock, name, file, line) \ +do { \ + static struct lock_class_key __key; \ + \ + __raw_spin_lock_init((lock), #lock, &__key); \ +} while (0) + +#else +#define __raw_spin_lock_init(lock) \ + do { *(lock) = RAW_SPIN_LOCK_UNLOCKED(lock); } while (0) +# define _raw_spin_lock_init(lock, name, file, line) __raw_spin_lock_init(lock) +#endif + +/* + * PICK_SPIN_OP()/PICK_RW_OP() are simple redirectors for PICK_FUNCTION + */ +#define PICK_SPIN_OP(...) \ + PICK_FUNCTION(raw_spinlock_t *, spinlock_t *, ##__VA_ARGS__) +#define PICK_SPIN_OP_RET(...) \ + PICK_FUNCTION_RET(raw_spinlock_t *, spinlock_t *, ##__VA_ARGS__) +#define PICK_RW_OP(...) PICK_FUNCTION(raw_rwlock_t *, rwlock_t *, ##__VA_ARGS__) +#define PICK_RW_OP_RET(...) \ + PICK_FUNCTION_RET(raw_rwlock_t *, rwlock_t *, ##__VA_ARGS__) + +#define spin_lock_init(lock) \ + PICK_SPIN_OP(_raw_spin_lock_init, _spin_lock_init, lock, #lock, \ + __FILE__, __LINE__) + +#ifdef CONFIG_DEBUG_SPINLOCK + extern void __raw_rwlock_init(raw_rwlock_t *lock, const char *name, + struct lock_class_key *key); +# define _raw_rwlock_init(lock, name, file, line) \ +do { \ + static struct lock_class_key __key; \ + \ + __raw_rwlock_init((lock), #lock, &__key); \ +} while (0) +#else +#define __raw_rwlock_init(lock) \ + do { *(lock) = RAW_RW_LOCK_UNLOCKED(lock); } while (0) +# define _raw_rwlock_init(lock, name, file, line) __raw_rwlock_init(lock) +#endif + +#define rwlock_init(lock) \ + PICK_RW_OP(_raw_rwlock_init, _rwlock_init, lock, #lock, \ + __FILE__, __LINE__) + +#define __spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) + +#define spin_is_locked(lock) \ + PICK_SPIN_OP_RET(__spin_is_locked, _spin_is_locked, lock) + +#define __spin_unlock_wait(lock) __raw_spin_unlock_wait(&(lock)->raw_lock) + +#define spin_unlock_wait(lock) \ + PICK_SPIN_OP(__spin_unlock_wait, _spin_unlock_wait, lock) /* * Define the various spin_lock and rw_lock methods. Note we define these * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various * methods are defined as nops in the case they are not required. */ -#define spin_trylock(lock) __cond_lock(lock, _spin_trylock(lock)) -#define read_trylock(lock) __cond_lock(lock, _read_trylock(lock)) -#define write_trylock(lock) __cond_lock(lock, _write_trylock(lock)) +#define spin_trylock(lock) \ + __cond_lock(lock, PICK_SPIN_OP_RET(__spin_trylock, _spin_trylock, lock)) + +#define read_trylock(lock) \ + __cond_lock(lock, PICK_RW_OP_RET(__read_trylock, _read_trylock, lock)) + +#define write_trylock(lock) \ + __cond_lock(lock, PICK_RW_OP_RET(__write_trylock, _write_trylock, lock)) + +#define write_trylock_irqsave(lock, flags) \ + __cond_lock(lock, PICK_RW_OP_RET(__write_trylock_irqsave, \ + _write_trylock_irqsave, lock, &flags)) + +#define __spin_can_lock(lock) __raw_spin_can_lock(&(lock)->raw_lock) +#define __read_can_lock(lock) __raw_read_can_lock(&(lock)->raw_lock) +#define __write_can_lock(lock) __raw_write_can_lock(&(lock)->raw_lock) + +#define read_can_lock(lock) \ + __cond_lock(lock, PICK_RW_OP_RET(__read_can_lock, _read_can_lock, lock)) + +#define write_can_lock(lock) \ + __cond_lock(lock, PICK_RW_OP_RET(__write_can_lock, _write_can_lock,\ + lock)) -#define spin_lock(lock) _spin_lock(lock) +#define spin_lock(lock) PICK_SPIN_OP(__spin_lock, _spin_lock, lock) #ifdef CONFIG_DEBUG_LOCK_ALLOC -# define spin_lock_nested(lock, subclass) _spin_lock_nested(lock, subclass) -# define spin_lock_nest_lock(lock, nest_lock) \ - do { \ - typecheck(struct lockdep_map *, &(nest_lock)->dep_map);\ - _spin_lock_nest_lock(lock, &(nest_lock)->dep_map); \ - } while (0) +# define spin_lock_nested(lock, subclass) \ + PICK_SPIN_OP(__spin_lock_nested, _spin_lock_nested, lock, subclass) #else -# define spin_lock_nested(lock, subclass) _spin_lock(lock) -# define spin_lock_nest_lock(lock, nest_lock) _spin_lock(lock) +# define spin_lock_nested(lock, subclass) spin_lock(lock) #endif -#define write_lock(lock) _write_lock(lock) -#define read_lock(lock) _read_lock(lock) +#define write_lock(lock) PICK_RW_OP(__write_lock, _write_lock, lock) -#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) +#define read_lock(lock) PICK_RW_OP(__read_lock, _read_lock, lock) -#define spin_lock_irqsave(lock, flags) \ - do { \ - typecheck(unsigned long, flags); \ - flags = _spin_lock_irqsave(lock); \ - } while (0) -#define read_lock_irqsave(lock, flags) \ - do { \ - typecheck(unsigned long, flags); \ - flags = _read_lock_irqsave(lock); \ - } while (0) -#define write_lock_irqsave(lock, flags) \ - do { \ - typecheck(unsigned long, flags); \ - flags = _write_lock_irqsave(lock); \ - } while (0) +# define spin_lock_irqsave(lock, flags) \ +do { \ + BUILD_CHECK_IRQ_FLAGS(flags); \ + flags = PICK_SPIN_OP_RET(__spin_lock_irqsave, _spin_lock_irqsave, \ + lock); \ +} while (0) #ifdef CONFIG_DEBUG_LOCK_ALLOC -#define spin_lock_irqsave_nested(lock, flags, subclass) \ - do { \ - typecheck(unsigned long, flags); \ - flags = _spin_lock_irqsave_nested(lock, subclass); \ - } while (0) -#else -#define spin_lock_irqsave_nested(lock, flags, subclass) \ - do { \ - typecheck(unsigned long, flags); \ - flags = _spin_lock_irqsave(lock); \ - } while (0) -#endif - -#else - -#define spin_lock_irqsave(lock, flags) \ - do { \ - typecheck(unsigned long, flags); \ - _spin_lock_irqsave(lock, flags); \ - } while (0) -#define read_lock_irqsave(lock, flags) \ - do { \ - typecheck(unsigned long, flags); \ - _read_lock_irqsave(lock, flags); \ - } while (0) -#define write_lock_irqsave(lock, flags) \ - do { \ - typecheck(unsigned long, flags); \ - _write_lock_irqsave(lock, flags); \ - } while (0) -#define spin_lock_irqsave_nested(lock, flags, subclass) \ - spin_lock_irqsave(lock, flags) - -#endif - -#define spin_lock_irq(lock) _spin_lock_irq(lock) -#define spin_lock_bh(lock) _spin_lock_bh(lock) - -#define read_lock_irq(lock) _read_lock_irq(lock) -#define read_lock_bh(lock) _read_lock_bh(lock) - -#define write_lock_irq(lock) _write_lock_irq(lock) -#define write_lock_bh(lock) _write_lock_bh(lock) - -/* - * We inline the unlock functions in the nondebug case: - */ -#if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || \ - !defined(CONFIG_SMP) -# define spin_unlock(lock) _spin_unlock(lock) -# define read_unlock(lock) _read_unlock(lock) -# define write_unlock(lock) _write_unlock(lock) -# define spin_unlock_irq(lock) _spin_unlock_irq(lock) -# define read_unlock_irq(lock) _read_unlock_irq(lock) -# define write_unlock_irq(lock) _write_unlock_irq(lock) -#else -# define spin_unlock(lock) \ - do {__raw_spin_unlock(&(lock)->raw_lock); __release(lock); } while (0) -# define read_unlock(lock) \ - do {__raw_read_unlock(&(lock)->raw_lock); __release(lock); } while (0) -# define write_unlock(lock) \ - do {__raw_write_unlock(&(lock)->raw_lock); __release(lock); } while (0) -# define spin_unlock_irq(lock) \ -do { \ - __raw_spin_unlock(&(lock)->raw_lock); \ - __release(lock); \ - local_irq_enable(); \ -} while (0) -# define read_unlock_irq(lock) \ -do { \ - __raw_read_unlock(&(lock)->raw_lock); \ - __release(lock); \ - local_irq_enable(); \ -} while (0) -# define write_unlock_irq(lock) \ -do { \ - __raw_write_unlock(&(lock)->raw_lock); \ - __release(lock); \ - local_irq_enable(); \ -} while (0) -#endif - -#define spin_unlock_irqrestore(lock, flags) \ - do { \ - typecheck(unsigned long, flags); \ - _spin_unlock_irqrestore(lock, flags); \ - } while (0) -#define spin_unlock_bh(lock) _spin_unlock_bh(lock) - -#define read_unlock_irqrestore(lock, flags) \ - do { \ - typecheck(unsigned long, flags); \ - _read_unlock_irqrestore(lock, flags); \ - } while (0) -#define read_unlock_bh(lock) _read_unlock_bh(lock) - -#define write_unlock_irqrestore(lock, flags) \ - do { \ - typecheck(unsigned long, flags); \ - _write_unlock_irqrestore(lock, flags); \ - } while (0) -#define write_unlock_bh(lock) _write_unlock_bh(lock) - -#define spin_trylock_bh(lock) __cond_lock(lock, _spin_trylock_bh(lock)) - -#define spin_trylock_irq(lock) \ -({ \ - local_irq_disable(); \ - spin_trylock(lock) ? \ - 1 : ({ local_irq_enable(); 0; }); \ -}) +# define spin_lock_irqsave_nested(lock, flags, subclass) \ +do { \ + BUILD_CHECK_IRQ_FLAGS(flags); \ + flags = PICK_SPIN_OP_RET(__spin_lock_irqsave_nested, \ + _spin_lock_irqsave_nested, lock, subclass); \ +} while (0) +#else +# define spin_lock_irqsave_nested(lock, flags, subclass) \ + spin_lock_irqsave(lock, flags) +#endif + +# define read_lock_irqsave(lock, flags) \ +do { \ + BUILD_CHECK_IRQ_FLAGS(flags); \ + flags = PICK_RW_OP_RET(__read_lock_irqsave, _read_lock_irqsave, lock);\ +} while (0) + +# define write_lock_irqsave(lock, flags) \ +do { \ + BUILD_CHECK_IRQ_FLAGS(flags); \ + flags = PICK_RW_OP_RET(__write_lock_irqsave, _write_lock_irqsave,lock);\ +} while (0) + +#define spin_lock_irq(lock) PICK_SPIN_OP(__spin_lock_irq, _spin_lock_irq, lock) + +#define spin_lock_bh(lock) PICK_SPIN_OP(__spin_lock_bh, _spin_lock_bh, lock) + +#define read_lock_irq(lock) PICK_RW_OP(__read_lock_irq, _read_lock_irq, lock) + +#define read_lock_bh(lock) PICK_RW_OP(__read_lock_bh, _read_lock_bh, lock) + +#define write_lock_irq(lock) PICK_RW_OP(__write_lock_irq, _write_lock_irq, lock) + +#define write_lock_bh(lock) PICK_RW_OP(__write_lock_bh, _write_lock_bh, lock) + +#define spin_unlock(lock) PICK_SPIN_OP(__spin_unlock, _spin_unlock, lock) + +#define read_unlock(lock) PICK_RW_OP(__read_unlock, _read_unlock, lock) + +#define write_unlock(lock) PICK_RW_OP(__write_unlock, _write_unlock, lock) + +#define spin_unlock_no_resched(lock) \ + PICK_SPIN_OP(__spin_unlock_no_resched, _spin_unlock_no_resched, lock) + +#define spin_unlock_irqrestore(lock, flags) \ +do { \ + BUILD_CHECK_IRQ_FLAGS(flags); \ + PICK_SPIN_OP(__spin_unlock_irqrestore, _spin_unlock_irqrestore, \ + lock, flags); \ +} while (0) + +#define spin_unlock_irq(lock) \ + PICK_SPIN_OP(__spin_unlock_irq, _spin_unlock_irq, lock) +#define spin_unlock_bh(lock) \ + PICK_SPIN_OP(__spin_unlock_bh, _spin_unlock_bh, lock) + +#define read_unlock_irqrestore(lock, flags) \ +do { \ + BUILD_CHECK_IRQ_FLAGS(flags); \ + PICK_RW_OP(__read_unlock_irqrestore, _read_unlock_irqrestore, \ + lock, flags); \ +} while (0) + +#define read_unlock_irq(lock) \ + PICK_RW_OP(__read_unlock_irq, _read_unlock_irq, lock) +#define read_unlock_bh(lock) PICK_RW_OP(__read_unlock_bh, _read_unlock_bh, lock) + +#define write_unlock_irqrestore(lock, flags) \ +do { \ + BUILD_CHECK_IRQ_FLAGS(flags); \ + PICK_RW_OP(__write_unlock_irqrestore, _write_unlock_irqrestore, \ + lock, flags); \ +} while (0) +#define write_unlock_irq(lock) \ + PICK_RW_OP(__write_unlock_irq, _write_unlock_irq, lock) + +#define write_unlock_bh(lock) \ + PICK_RW_OP(__write_unlock_bh, _write_unlock_bh, lock) + +#define spin_trylock_bh(lock) \ + __cond_lock(lock, PICK_SPIN_OP_RET(__spin_trylock_bh, _spin_trylock_bh,\ + lock)) + +#define spin_trylock_irq(lock) \ + __cond_lock(lock, PICK_SPIN_OP_RET(__spin_trylock_irq, \ + _spin_trylock_irq, lock)) #define spin_trylock_irqsave(lock, flags) \ -({ \ - local_irq_save(flags); \ - spin_trylock(lock) ? \ - 1 : ({ local_irq_restore(flags); 0; }); \ -}) + __cond_lock(lock, PICK_SPIN_OP_RET(__spin_trylock_irqsave, \ + _spin_trylock_irqsave, lock, &flags)) -#define write_trylock_irqsave(lock, flags) \ -({ \ - local_irq_save(flags); \ - write_trylock(lock) ? \ - 1 : ({ local_irq_restore(flags); 0; }); \ -}) +/* + * bit-based spin_lock() + * + * Don't use this unless you really need to: spin_lock() and spin_unlock() + * are significantly faster. + */ +static inline void bit_spin_lock(int bitnum, unsigned long *addr) +{ + /* + * Assuming the lock is uncontended, this never enters + * the body of the outer loop. If it is contended, then + * within the inner loop a non-atomic test is used to + * busywait with less bus contention for a good time to + * attempt to acquire the lock bit. + */ +#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) + while (test_and_set_bit(bitnum, addr)) + while (test_bit(bitnum, addr)) + cpu_relax(); +#endif + __acquire(bitlock); +} + +/* + * Return true if it was acquired + */ +static inline int bit_spin_trylock(int bitnum, unsigned long *addr) +{ +#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) + if (test_and_set_bit(bitnum, addr)) + return 0; +#endif + __acquire(bitlock); + return 1; +} + +/* + * bit-based spin_unlock() + */ +static inline void bit_spin_unlock(int bitnum, unsigned long *addr) +{ +#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) + BUG_ON(!test_bit(bitnum, addr)); + smp_mb__before_clear_bit(); + clear_bit(bitnum, addr); +#endif + __release(bitlock); +} + +/* + * Return true if the lock is held. + */ +static inline int bit_spin_is_locked(int bitnum, unsigned long *addr) +{ +#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) + return test_bit(bitnum, addr); +#else + return 1; +#endif +} + +/** + * __raw_spin_can_lock - would __raw_spin_trylock() succeed? + * @lock: the spinlock in question. + */ +#define __raw_spin_can_lock(lock) (!__raw_spin_is_locked(lock)) /* * Pull the atomic_t declaration: @@ -359,14 +595,22 @@ do { \ * Decrements @atomic by 1. If the result is 0, returns true and locks * @lock. Returns false for all other cases. */ -extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); -#define atomic_dec_and_lock(atomic, lock) \ - __cond_lock(lock, _atomic_dec_and_lock(atomic, lock)) +/* "lock on reference count zero" */ +#ifndef ATOMIC_DEC_AND_LOCK +# include + extern int __atomic_dec_and_spin_lock(raw_spinlock_t *lock, atomic_t *atomic); +#endif + +#define atomic_dec_and_lock(atomic, lock) \ + __cond_lock(lock, PICK_SPIN_OP_RET(__atomic_dec_and_spin_lock, \ + _atomic_dec_and_spin_lock, lock, atomic)) /** * spin_can_lock - would spin_trylock() succeed? * @lock: the spinlock in question. */ -#define spin_can_lock(lock) (!spin_is_locked(lock)) +#define spin_can_lock(lock) \ + __cond_lock(lock, PICK_SPIN_OP_RET(__spin_can_lock, _spin_can_lock,\ + lock)) #endif /* __LINUX_SPINLOCK_H */ Index: linux-2.6-tip/include/linux/spinlock_api_smp.h =================================================================== --- linux-2.6-tip.orig/include/linux/spinlock_api_smp.h +++ linux-2.6-tip/include/linux/spinlock_api_smp.h @@ -19,45 +19,60 @@ int in_lock_functions(unsigned long addr #define assert_spin_locked(x) BUG_ON(!spin_is_locked(x)) -void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock); -void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) - __acquires(lock); void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *map) __acquires(lock); -void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock); -void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock); -void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock); -void __lockfunc _read_lock_bh(rwlock_t *lock) __acquires(lock); -void __lockfunc _write_lock_bh(rwlock_t *lock) __acquires(lock); -void __lockfunc _spin_lock_irq(spinlock_t *lock) __acquires(lock); -void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(lock); -void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock); -unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) - __acquires(lock); -unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass) - __acquires(lock); -unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) - __acquires(lock); -unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) - __acquires(lock); -int __lockfunc _spin_trylock(spinlock_t *lock); -int __lockfunc _read_trylock(rwlock_t *lock); -int __lockfunc _write_trylock(rwlock_t *lock); -int __lockfunc _spin_trylock_bh(spinlock_t *lock); -void __lockfunc _spin_unlock(spinlock_t *lock) __releases(lock); -void __lockfunc _read_unlock(rwlock_t *lock) __releases(lock); -void __lockfunc _write_unlock(rwlock_t *lock) __releases(lock); -void __lockfunc _spin_unlock_bh(spinlock_t *lock) __releases(lock); -void __lockfunc _read_unlock_bh(rwlock_t *lock) __releases(lock); -void __lockfunc _write_unlock_bh(rwlock_t *lock) __releases(lock); -void __lockfunc _spin_unlock_irq(spinlock_t *lock) __releases(lock); -void __lockfunc _read_unlock_irq(rwlock_t *lock) __releases(lock); -void __lockfunc _write_unlock_irq(rwlock_t *lock) __releases(lock); -void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) - __releases(lock); -void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) - __releases(lock); -void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) - __releases(lock); +#define ACQUIRE_SPIN __acquires(lock) +#define ACQUIRE_RW __acquires(lock) +#define RELEASE_SPIN __releases(lock) +#define RELEASE_RW __releases(lock) + +void __lockfunc __spin_lock(raw_spinlock_t *lock) ACQUIRE_SPIN; +void __lockfunc __spin_lock_nested(raw_spinlock_t *lock, int subclass) + ACQUIRE_SPIN; +void __lockfunc __read_lock(raw_rwlock_t *lock) ACQUIRE_RW; +void __lockfunc __write_lock(raw_rwlock_t *lock) ACQUIRE_RW; +void __lockfunc __spin_lock_bh(raw_spinlock_t *lock) ACQUIRE_SPIN; +void __lockfunc __read_lock_bh(raw_rwlock_t *lock) ACQUIRE_RW; +void __lockfunc __write_lock_bh(raw_rwlock_t *lock) ACQUIRE_RW; +void __lockfunc __spin_lock_irq(raw_spinlock_t *lock) ACQUIRE_SPIN; +void __lockfunc __read_lock_irq(raw_rwlock_t *lock) ACQUIRE_RW; +void __lockfunc __write_lock_irq(raw_rwlock_t *lock) ACQUIRE_RW; +unsigned long __lockfunc __spin_lock_irqsave(raw_spinlock_t *lock) + ACQUIRE_SPIN; +unsigned long __lockfunc +__spin_lock_irqsave_nested(raw_spinlock_t *lock, int subclass) ACQUIRE_SPIN; +unsigned long __lockfunc __read_lock_irqsave(raw_rwlock_t *lock) + ACQUIRE_RW; +unsigned long __lockfunc __write_lock_irqsave(raw_rwlock_t *lock) + ACQUIRE_RW; +int __lockfunc __spin_trylock(raw_spinlock_t *lock); +int __lockfunc +__spin_trylock_irqsave(raw_spinlock_t *lock, unsigned long *flags); +int __lockfunc __read_trylock(raw_rwlock_t *lock); +int __lockfunc __write_trylock(raw_rwlock_t *lock); +int __lockfunc +__write_trylock_irqsave(raw_rwlock_t *lock, unsigned long *flags); +int __lockfunc __spin_trylock_bh(raw_spinlock_t *lock); +int __lockfunc __spin_trylock_irq(raw_spinlock_t *lock); +void __lockfunc __spin_unlock(raw_spinlock_t *lock) RELEASE_SPIN; +void __lockfunc __spin_unlock_no_resched(raw_spinlock_t *lock) + RELEASE_SPIN; +void __lockfunc __read_unlock(raw_rwlock_t *lock) RELEASE_RW; +void __lockfunc __write_unlock(raw_rwlock_t *lock) RELEASE_RW; +void __lockfunc __spin_unlock_bh(raw_spinlock_t *lock) RELEASE_SPIN; +void __lockfunc __read_unlock_bh(raw_rwlock_t *lock) RELEASE_RW; +void __lockfunc __write_unlock_bh(raw_rwlock_t *lock) RELEASE_RW; +void __lockfunc __spin_unlock_irq(raw_spinlock_t *lock) RELEASE_SPIN; +void __lockfunc __read_unlock_irq(raw_rwlock_t *lock) RELEASE_RW; +void __lockfunc __write_unlock_irq(raw_rwlock_t *lock) RELEASE_RW; +void __lockfunc +__spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags) + RELEASE_SPIN; +void __lockfunc +__read_unlock_irqrestore(raw_rwlock_t *lock, unsigned long flags) + RELEASE_RW; +void +__lockfunc __write_unlock_irqrestore(raw_rwlock_t *lock, unsigned long flags) + RELEASE_RW; #endif /* __LINUX_SPINLOCK_API_SMP_H */ Index: linux-2.6-tip/include/linux/spinlock_api_up.h =================================================================== --- linux-2.6-tip.orig/include/linux/spinlock_api_up.h +++ linux-2.6-tip/include/linux/spinlock_api_up.h @@ -33,12 +33,22 @@ #define __LOCK_IRQ(lock) \ do { local_irq_disable(); __LOCK(lock); } while (0) -#define __LOCK_IRQSAVE(lock, flags) \ - do { local_irq_save(flags); __LOCK(lock); } while (0) +#define __LOCK_IRQSAVE(lock) \ + ({ unsigned long __flags; local_irq_save(__flags); __LOCK(lock); __flags; }) + +#define __TRYLOCK_IRQSAVE(lock, flags) \ + ({ local_irq_save(*(flags)); __LOCK(lock); 1; }) + +#define __spin_trylock_irqsave(lock, flags) __TRYLOCK_IRQSAVE(lock, flags) + +#define __write_trylock_irqsave(lock, flags) __TRYLOCK_IRQSAVE(lock, flags) #define __UNLOCK(lock) \ do { preempt_enable(); __release(lock); (void)(lock); } while (0) +#define __UNLOCK_NO_RESCHED(lock) \ + do { __preempt_enable_no_resched(); __release(lock); (void)(lock); } while (0) + #define __UNLOCK_BH(lock) \ do { preempt_enable_no_resched(); local_bh_enable(); __release(lock); (void)(lock); } while (0) @@ -48,34 +58,36 @@ #define __UNLOCK_IRQRESTORE(lock, flags) \ do { local_irq_restore(flags); __UNLOCK(lock); } while (0) -#define _spin_lock(lock) __LOCK(lock) -#define _spin_lock_nested(lock, subclass) __LOCK(lock) -#define _read_lock(lock) __LOCK(lock) -#define _write_lock(lock) __LOCK(lock) -#define _spin_lock_bh(lock) __LOCK_BH(lock) -#define _read_lock_bh(lock) __LOCK_BH(lock) -#define _write_lock_bh(lock) __LOCK_BH(lock) -#define _spin_lock_irq(lock) __LOCK_IRQ(lock) -#define _read_lock_irq(lock) __LOCK_IRQ(lock) -#define _write_lock_irq(lock) __LOCK_IRQ(lock) -#define _spin_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) -#define _read_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) -#define _write_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) -#define _spin_trylock(lock) ({ __LOCK(lock); 1; }) -#define _read_trylock(lock) ({ __LOCK(lock); 1; }) -#define _write_trylock(lock) ({ __LOCK(lock); 1; }) -#define _spin_trylock_bh(lock) ({ __LOCK_BH(lock); 1; }) -#define _spin_unlock(lock) __UNLOCK(lock) -#define _read_unlock(lock) __UNLOCK(lock) -#define _write_unlock(lock) __UNLOCK(lock) -#define _spin_unlock_bh(lock) __UNLOCK_BH(lock) -#define _write_unlock_bh(lock) __UNLOCK_BH(lock) -#define _read_unlock_bh(lock) __UNLOCK_BH(lock) -#define _spin_unlock_irq(lock) __UNLOCK_IRQ(lock) -#define _read_unlock_irq(lock) __UNLOCK_IRQ(lock) -#define _write_unlock_irq(lock) __UNLOCK_IRQ(lock) -#define _spin_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) -#define _read_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) -#define _write_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) +#define __spin_lock(lock) __LOCK(lock) +#define __spin_lock_nested(lock, subclass) __LOCK(lock) +#define __read_lock(lock) __LOCK(lock) +#define __write_lock(lock) __LOCK(lock) +#define __spin_lock_bh(lock) __LOCK_BH(lock) +#define __read_lock_bh(lock) __LOCK_BH(lock) +#define __write_lock_bh(lock) __LOCK_BH(lock) +#define __spin_lock_irq(lock) __LOCK_IRQ(lock) +#define __read_lock_irq(lock) __LOCK_IRQ(lock) +#define __write_lock_irq(lock) __LOCK_IRQ(lock) +#define __spin_lock_irqsave(lock) __LOCK_IRQSAVE(lock) +#define __read_lock_irqsave(lock) __LOCK_IRQSAVE(lock) +#define __write_lock_irqsave(lock) __LOCK_IRQSAVE(lock) +#define __spin_trylock(lock) ({ __LOCK(lock); 1; }) +#define __read_trylock(lock) ({ __LOCK(lock); 1; }) +#define __write_trylock(lock) ({ __LOCK(lock); 1; }) +#define __spin_trylock_bh(lock) ({ __LOCK_BH(lock); 1; }) +#define __spin_trylock_irq(lock) ({ __LOCK_IRQ(lock); 1; }) +#define __spin_unlock(lock) __UNLOCK(lock) +#define __spin_unlock_no_resched(lock) __UNLOCK_NO_RESCHED(lock) +#define __read_unlock(lock) __UNLOCK(lock) +#define __write_unlock(lock) __UNLOCK(lock) +#define __spin_unlock_bh(lock) __UNLOCK_BH(lock) +#define __write_unlock_bh(lock) __UNLOCK_BH(lock) +#define __read_unlock_bh(lock) __UNLOCK_BH(lock) +#define __spin_unlock_irq(lock) __UNLOCK_IRQ(lock) +#define __read_unlock_irq(lock) __UNLOCK_IRQ(lock) +#define __write_unlock_irq(lock) __UNLOCK_IRQ(lock) +#define __spin_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) +#define __read_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) +#define __write_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) #endif /* __LINUX_SPINLOCK_API_UP_H */ Index: linux-2.6-tip/include/linux/spinlock_types.h =================================================================== --- linux-2.6-tip.orig/include/linux/spinlock_types.h +++ linux-2.6-tip/include/linux/spinlock_types.h @@ -15,10 +15,27 @@ # include #endif +/* + * Must define these before including other files, inline functions need them + */ +#define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME + +#define LOCK_SECTION_START(extra) \ + ".subsection 1\n\t" \ + extra \ + ".ifndef " LOCK_SECTION_NAME "\n\t" \ + LOCK_SECTION_NAME ":\n\t" \ + ".endif\n" + +#define LOCK_SECTION_END \ + ".previous\n\t" + +#define __lockfunc __attribute__((section(".spinlock.text"))) + #include typedef struct { - raw_spinlock_t raw_lock; + __raw_spinlock_t raw_lock; #ifdef CONFIG_GENERIC_LOCKBREAK unsigned int break_lock; #endif @@ -29,12 +46,12 @@ typedef struct { #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lockdep_map dep_map; #endif -} spinlock_t; +} raw_spinlock_t; #define SPINLOCK_MAGIC 0xdead4ead typedef struct { - raw_rwlock_t raw_lock; + __raw_rwlock_t raw_lock; #ifdef CONFIG_GENERIC_LOCKBREAK unsigned int break_lock; #endif @@ -45,7 +62,7 @@ typedef struct { #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lockdep_map dep_map; #endif -} rwlock_t; +} raw_rwlock_t; #define RWLOCK_MAGIC 0xdeaf1eed @@ -64,24 +81,24 @@ typedef struct { #endif #ifdef CONFIG_DEBUG_SPINLOCK -# define __SPIN_LOCK_UNLOCKED(lockname) \ - (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, \ +# define _RAW_SPIN_LOCK_UNLOCKED(lockname) \ + { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, \ .magic = SPINLOCK_MAGIC, \ .owner = SPINLOCK_OWNER_INIT, \ .owner_cpu = -1, \ SPIN_DEP_MAP_INIT(lockname) } -#define __RW_LOCK_UNLOCKED(lockname) \ - (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED, \ +#define _RAW_RW_LOCK_UNLOCKED(lockname) \ + { .raw_lock = __RAW_RW_LOCK_UNLOCKED, \ .magic = RWLOCK_MAGIC, \ .owner = SPINLOCK_OWNER_INIT, \ .owner_cpu = -1, \ RW_DEP_MAP_INIT(lockname) } #else -# define __SPIN_LOCK_UNLOCKED(lockname) \ - (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, \ +# define _RAW_SPIN_LOCK_UNLOCKED(lockname) \ + { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, \ SPIN_DEP_MAP_INIT(lockname) } -#define __RW_LOCK_UNLOCKED(lockname) \ - (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED, \ +# define _RAW_RW_LOCK_UNLOCKED(lockname) \ + { .raw_lock = __RAW_RW_LOCK_UNLOCKED, \ RW_DEP_MAP_INIT(lockname) } #endif @@ -91,10 +108,22 @@ typedef struct { * Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or * __SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate. */ -#define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init) -#define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init) -#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) -#define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x) +# define RAW_SPIN_LOCK_UNLOCKED(lockname) \ + (raw_spinlock_t) _RAW_SPIN_LOCK_UNLOCKED(lockname) + +# define RAW_RW_LOCK_UNLOCKED(lockname) \ + (raw_rwlock_t) _RAW_RW_LOCK_UNLOCKED(lockname) + +#define DEFINE_RAW_SPINLOCK(name) \ + raw_spinlock_t name __cacheline_aligned_in_smp = \ + RAW_SPIN_LOCK_UNLOCKED(name) + +#define __DEFINE_RAW_SPINLOCK(name) \ + raw_spinlock_t name = RAW_SPIN_LOCK_UNLOCKED(name) + +#define DEFINE_RAW_RWLOCK(name) \ + raw_rwlock_t name __cacheline_aligned_in_smp = \ + RAW_RW_LOCK_UNLOCKED(name) #endif /* __LINUX_SPINLOCK_TYPES_H */ Index: linux-2.6-tip/include/linux/spinlock_types_up.h =================================================================== --- linux-2.6-tip.orig/include/linux/spinlock_types_up.h +++ linux-2.6-tip/include/linux/spinlock_types_up.h @@ -16,13 +16,13 @@ typedef struct { volatile unsigned int slock; -} raw_spinlock_t; +} __raw_spinlock_t; #define __RAW_SPIN_LOCK_UNLOCKED { 1 } #else -typedef struct { } raw_spinlock_t; +typedef struct { } __raw_spinlock_t; #define __RAW_SPIN_LOCK_UNLOCKED { } @@ -30,7 +30,7 @@ typedef struct { } raw_spinlock_t; typedef struct { /* no debug version on UP */ -} raw_rwlock_t; +} __raw_rwlock_t; #define __RAW_RW_LOCK_UNLOCKED { } Index: linux-2.6-tip/include/linux/spinlock_up.h =================================================================== --- linux-2.6-tip.orig/include/linux/spinlock_up.h +++ linux-2.6-tip/include/linux/spinlock_up.h @@ -20,19 +20,19 @@ #ifdef CONFIG_DEBUG_SPINLOCK #define __raw_spin_is_locked(x) ((x)->slock == 0) -static inline void __raw_spin_lock(raw_spinlock_t *lock) +static inline void __raw_spin_lock(__raw_spinlock_t *lock) { lock->slock = 0; } static inline void -__raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags) +__raw_spin_lock_flags(__raw_spinlock_t *lock, unsigned long flags) { local_irq_save(flags); lock->slock = 0; } -static inline int __raw_spin_trylock(raw_spinlock_t *lock) +static inline int __raw_spin_trylock(__raw_spinlock_t *lock) { char oldval = lock->slock; @@ -41,7 +41,7 @@ static inline int __raw_spin_trylock(raw return oldval > 0; } -static inline void __raw_spin_unlock(raw_spinlock_t *lock) +static inline void __raw_spin_unlock(__raw_spinlock_t *lock) { lock->slock = 1; } Index: linux-2.6-tip/kernel/Makefile =================================================================== --- linux-2.6-tip.orig/kernel/Makefile +++ linux-2.6-tip/kernel/Makefile @@ -7,7 +7,7 @@ obj-y = sched.o fork.o exec_domain.o sysctl.o capability.o ptrace.o timer.o user.o \ signal.o sys.o kmod.o workqueue.o pid.o \ rcupdate.o extable.o params.o posix-timers.o \ - kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ + kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o \ hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \ notifier.o ksysfs.o pm_qos_params.o sched_clock.o cred.o \ async.o @@ -27,7 +27,10 @@ obj-$(CONFIG_PROFILING) += profile.o obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) += sysctl_check.o obj-$(CONFIG_STACKTRACE) += stacktrace.o obj-y += time/ +ifneq ($(CONFIG_PREEMPT_RT),y) +obj-y += mutex.o obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o +endif obj-$(CONFIG_LOCKDEP) += lockdep.o ifeq ($(CONFIG_PROC_FS),y) obj-$(CONFIG_LOCKDEP) += lockdep_proc.o @@ -39,6 +42,7 @@ endif obj-$(CONFIG_RT_MUTEXES) += rtmutex.o obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o +obj-$(CONFIG_PREEMPT_RT) += rt.o obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o ifneq ($(CONFIG_SMP),y) Index: linux-2.6-tip/kernel/fork.c =================================================================== --- linux-2.6-tip.orig/kernel/fork.c +++ linux-2.6-tip/kernel/fork.c @@ -80,7 +80,11 @@ int max_threads; /* tunable limit on nr DEFINE_PER_CPU(unsigned long, process_counts) = 0; +#ifdef CONFIG_PREEMPT_RT +DEFINE_RWLOCK(tasklist_lock); /* outer */ +#else __cacheline_aligned DEFINE_RWLOCK(tasklist_lock); /* outer */ +#endif DEFINE_TRACE(sched_process_fork); @@ -921,6 +925,9 @@ static void rt_mutex_init_task(struct ta #ifdef CONFIG_RT_MUTEXES plist_head_init(&p->pi_waiters, &p->pi_lock); p->pi_blocked_on = NULL; +# ifdef CONFIG_DEBUG_RT_MUTEXES + p->last_kernel_lock = NULL; +# endif #endif } @@ -1127,6 +1134,9 @@ static struct task_struct *copy_process( retval = copy_thread(0, clone_flags, stack_start, stack_size, p, regs); if (retval) goto bad_fork_cleanup_io; +#ifdef CONFIG_DEBUG_PREEMPT + p->lock_count = 0; +#endif if (pid != &init_struct_pid) { retval = -ENOMEM; Index: linux-2.6-tip/kernel/futex.c =================================================================== --- linux-2.6-tip.orig/kernel/futex.c +++ linux-2.6-tip/kernel/futex.c @@ -1983,7 +1983,11 @@ static int __init futex_init(void) futex_cmpxchg_enabled = 1; for (i = 0; i < ARRAY_SIZE(futex_queues); i++) { +#ifdef CONFIG_PREEMPT_RT + plist_head_init(&futex_queues[i].chain, NULL); +#else plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock); +#endif spin_lock_init(&futex_queues[i].lock); } Index: linux-2.6-tip/kernel/lockdep.c =================================================================== --- linux-2.6-tip.orig/kernel/lockdep.c +++ linux-2.6-tip/kernel/lockdep.c @@ -70,7 +70,7 @@ module_param(lock_stat, int, 0644); * to use a raw spinlock - we really dont want the spinlock * code to recurse back into the lockdep code... */ -static raw_spinlock_t lockdep_lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; +static __raw_spinlock_t lockdep_lock = (__raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; static int graph_lock(void) { Index: linux-2.6-tip/kernel/rt.c =================================================================== --- /dev/null +++ linux-2.6-tip/kernel/rt.c @@ -0,0 +1,634 @@ +/* + * kernel/rt.c + * + * Real-Time Preemption Support + * + * started by Ingo Molnar: + * + * Copyright (C) 2004-2006 Red Hat, Inc., Ingo Molnar + * Copyright (C) 2006, Timesys Corp., Thomas Gleixner + * + * historic credit for proving that Linux spinlocks can be implemented via + * RT-aware mutexes goes to many people: The Pmutex project (Dirk Grambow + * and others) who prototyped it on 2.4 and did lots of comparative + * research and analysis; TimeSys, for proving that you can implement a + * fully preemptible kernel via the use of IRQ threading and mutexes; + * Bill Huey for persuasively arguing on lkml that the mutex model is the + * right one; and to MontaVista, who ported pmutexes to 2.6. + * + * This code is a from-scratch implementation and is not based on pmutexes, + * but the idea of converting spinlocks to mutexes is used here too. + * + * lock debugging, locking tree, deadlock detection: + * + * Copyright (C) 2004, LynuxWorks, Inc., Igor Manyilov, Bill Huey + * Released under the General Public License (GPL). + * + * Includes portions of the generic R/W semaphore implementation from: + * + * Copyright (c) 2001 David Howells (dhowells@redhat.com). + * - Derived partially from idea by Andrea Arcangeli + * - Derived also from comments by Linus + * + * Pending ownership of locks and ownership stealing: + * + * Copyright (C) 2005, Kihon Technologies Inc., Steven Rostedt + * + * (also by Steven Rostedt) + * - Converted single pi_lock to individual task locks. + * + * By Esben Nielsen: + * Doing priority inheritance with help of the scheduler. + * + * Copyright (C) 2006, Timesys Corp., Thomas Gleixner + * - major rework based on Esben Nielsens initial patch + * - replaced thread_info references by task_struct refs + * - removed task->pending_owner dependency + * - BKL drop/reacquire for semaphore style locks to avoid deadlocks + * in the scheduler return path as discussed with Steven Rostedt + * + * Copyright (C) 2006, Kihon Technologies Inc. + * Steven Rostedt + * - debugged and patched Thomas Gleixner's rework. + * - added back the cmpxchg to the rework. + * - turned atomic require back on for SMP. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "rtmutex_common.h" + +#ifdef CONFIG_PREEMPT_RT +/* + * Unlock these on crash: + */ +void zap_rt_locks(void) +{ + //trace_lock_init(); +} +#endif + +/* + * struct mutex functions + */ +void _mutex_init(struct mutex *lock, char *name, struct lock_class_key *key) +{ +#ifdef CONFIG_DEBUG_LOCK_ALLOC + /* + * Make sure we are not reinitializing a held lock: + */ + debug_check_no_locks_freed((void *)lock, sizeof(*lock)); + lockdep_init_map(&lock->dep_map, name, key, 0); +#endif + __rt_mutex_init(&lock->lock, name); +} +EXPORT_SYMBOL(_mutex_init); + +void __lockfunc _mutex_lock(struct mutex *lock) +{ + mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); + rt_mutex_lock(&lock->lock); +} +EXPORT_SYMBOL(_mutex_lock); + +int __lockfunc _mutex_lock_interruptible(struct mutex *lock) +{ + int ret; + + mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); + ret = rt_mutex_lock_interruptible(&lock->lock, 0); + if (ret) + mutex_release(&lock->dep_map, 1, _RET_IP_); + return ret; +} +EXPORT_SYMBOL(_mutex_lock_interruptible); + +int __lockfunc _mutex_lock_killable(struct mutex *lock) +{ + int ret; + + mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); + ret = rt_mutex_lock_killable(&lock->lock, 0); + if (ret) + mutex_release(&lock->dep_map, 1, _RET_IP_); + return ret; +} +EXPORT_SYMBOL(_mutex_lock_killable); + +#ifdef CONFIG_DEBUG_LOCK_ALLOC +void __lockfunc _mutex_lock_nested(struct mutex *lock, int subclass) +{ + mutex_acquire(&lock->dep_map, subclass, 0, _RET_IP_); + rt_mutex_lock(&lock->lock); +} +EXPORT_SYMBOL(_mutex_lock_nested); + +int __lockfunc _mutex_lock_interruptible_nested(struct mutex *lock, int subclass) +{ + int ret; + + mutex_acquire(&lock->dep_map, subclass, 0, _RET_IP_); + ret = rt_mutex_lock_interruptible(&lock->lock, 0); + if (ret) + mutex_release(&lock->dep_map, 1, _RET_IP_); + return ret; +} +EXPORT_SYMBOL(_mutex_lock_interruptible_nested); + +int __lockfunc _mutex_lock_killable_nested(struct mutex *lock, int subclass) +{ + int ret; + + mutex_acquire(&lock->dep_map, subclass, 0, _RET_IP_); + ret = rt_mutex_lock_killable(&lock->lock, 0); + if (ret) + mutex_release(&lock->dep_map, 1, _RET_IP_); + return ret; +} +EXPORT_SYMBOL(_mutex_lock_killable_nested); +#endif + +int __lockfunc _mutex_trylock(struct mutex *lock) +{ + int ret = rt_mutex_trylock(&lock->lock); + + if (ret) + mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_); + + return ret; +} +EXPORT_SYMBOL(_mutex_trylock); + +void __lockfunc _mutex_unlock(struct mutex *lock) +{ + mutex_release(&lock->dep_map, 1, _RET_IP_); + rt_mutex_unlock(&lock->lock); +} +EXPORT_SYMBOL(_mutex_unlock); + +/* + * rwlock_t functions + */ +int __lockfunc rt_write_trylock(rwlock_t *rwlock) +{ + int ret = rt_mutex_trylock(&rwlock->lock); + + if (ret) + rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_); + + return ret; +} +EXPORT_SYMBOL(rt_write_trylock); + +int __lockfunc rt_write_trylock_irqsave(rwlock_t *rwlock, unsigned long *flags) +{ + *flags = 0; + return rt_write_trylock(rwlock); +} +EXPORT_SYMBOL(rt_write_trylock_irqsave); + +int __lockfunc rt_read_trylock(rwlock_t *rwlock) +{ + struct rt_mutex *lock = &rwlock->lock; + unsigned long flags; + int ret; + + /* + * Read locks within the self-held write lock succeed. + */ + spin_lock_irqsave(&lock->wait_lock, flags); + if (rt_mutex_real_owner(lock) == current) { + spin_unlock_irqrestore(&lock->wait_lock, flags); + rwlock->read_depth++; + rwlock_acquire_read(&rwlock->dep_map, 0, 1, _RET_IP_); + return 1; + } + spin_unlock_irqrestore(&lock->wait_lock, flags); + + ret = rt_mutex_trylock(lock); + if (ret) + rwlock_acquire_read(&rwlock->dep_map, 0, 1, _RET_IP_); + + return ret; +} +EXPORT_SYMBOL(rt_read_trylock); + +void __lockfunc rt_write_lock(rwlock_t *rwlock) +{ + rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); + __rt_spin_lock(&rwlock->lock); +} +EXPORT_SYMBOL(rt_write_lock); + +void __lockfunc rt_read_lock(rwlock_t *rwlock) +{ + unsigned long flags; + struct rt_mutex *lock = &rwlock->lock; + + rwlock_acquire_read(&rwlock->dep_map, 0, 0, _RET_IP_); + /* + * Read locks within the write lock succeed. + */ + spin_lock_irqsave(&lock->wait_lock, flags); + if (rt_mutex_real_owner(lock) == current) { + spin_unlock_irqrestore(&lock->wait_lock, flags); + rwlock->read_depth++; + return; + } + spin_unlock_irqrestore(&lock->wait_lock, flags); + __rt_spin_lock(lock); +} + +EXPORT_SYMBOL(rt_read_lock); + +void __lockfunc rt_write_unlock(rwlock_t *rwlock) +{ + /* NOTE: we always pass in '1' for nested, for simplicity */ + rwlock_release(&rwlock->dep_map, 1, _RET_IP_); + __rt_spin_unlock(&rwlock->lock); +} +EXPORT_SYMBOL(rt_write_unlock); + +void __lockfunc rt_read_unlock(rwlock_t *rwlock) +{ + struct rt_mutex *lock = &rwlock->lock; + unsigned long flags; + + rwlock_release(&rwlock->dep_map, 1, _RET_IP_); + // TRACE_WARN_ON(lock->save_state != 1); + /* + * Read locks within the self-held write lock succeed. + */ + spin_lock_irqsave(&lock->wait_lock, flags); + if (rt_mutex_real_owner(lock) == current && rwlock->read_depth) { + spin_unlock_irqrestore(&lock->wait_lock, flags); + rwlock->read_depth--; + return; + } + spin_unlock_irqrestore(&lock->wait_lock, flags); + __rt_spin_unlock(&rwlock->lock); +} +EXPORT_SYMBOL(rt_read_unlock); + +unsigned long __lockfunc rt_write_lock_irqsave(rwlock_t *rwlock) +{ + rt_write_lock(rwlock); + + return 0; +} +EXPORT_SYMBOL(rt_write_lock_irqsave); + +unsigned long __lockfunc rt_read_lock_irqsave(rwlock_t *rwlock) +{ + rt_read_lock(rwlock); + + return 0; +} +EXPORT_SYMBOL(rt_read_lock_irqsave); + +void __rt_rwlock_init(rwlock_t *rwlock, char *name, struct lock_class_key *key) +{ +#ifdef CONFIG_DEBUG_LOCK_ALLOC + /* + * Make sure we are not reinitializing a held lock: + */ + debug_check_no_locks_freed((void *)rwlock, sizeof(*rwlock)); + lockdep_init_map(&rwlock->dep_map, name, key, 0); +#endif + __rt_mutex_init(&rwlock->lock, name); + rwlock->read_depth = 0; +} +EXPORT_SYMBOL(__rt_rwlock_init); + +/* + * rw_semaphores + */ + +void rt_up_write(struct rw_semaphore *rwsem) +{ + rwsem_release(&rwsem->dep_map, 1, _RET_IP_); + rt_mutex_unlock(&rwsem->lock); +} +EXPORT_SYMBOL(rt_up_write); + +void rt_up_read(struct rw_semaphore *rwsem) +{ + unsigned long flags; + + rwsem_release(&rwsem->dep_map, 1, _RET_IP_); + /* + * Read locks within the self-held write lock succeed. + */ + spin_lock_irqsave(&rwsem->lock.wait_lock, flags); + if (rt_mutex_real_owner(&rwsem->lock) == current && rwsem->read_depth) { + spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); + rwsem->read_depth--; + return; + } + spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); + rt_mutex_unlock(&rwsem->lock); +} +EXPORT_SYMBOL(rt_up_read); + +#ifdef CONFIG_DEBUG_LOCK_ALLOC +void rt_up_read_non_owner(struct rw_semaphore *rwsem) +{ + unsigned long flags; + /* + * Read locks within the self-held write lock succeed. + */ + spin_lock_irqsave(&rwsem->lock.wait_lock, flags); + if (rt_mutex_real_owner(&rwsem->lock) == current && rwsem->read_depth) { + spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); + rwsem->read_depth--; + return; + } + spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); + rt_mutex_unlock(&rwsem->lock); +} +EXPORT_SYMBOL(rt_up_read_non_owner); +#endif + +/* + * downgrade a write lock into a read lock + * - just wake up any readers at the front of the queue + */ +void rt_downgrade_write(struct rw_semaphore *rwsem) +{ + BUG(); +} +EXPORT_SYMBOL(rt_downgrade_write); + +int rt_down_write_trylock(struct rw_semaphore *rwsem) +{ + int ret = rt_mutex_trylock(&rwsem->lock); + + if (ret) + rwsem_acquire(&rwsem->dep_map, 0, 1, _RET_IP_); + return ret; +} +EXPORT_SYMBOL(rt_down_write_trylock); + +void rt_down_write(struct rw_semaphore *rwsem) +{ + rwsem_acquire(&rwsem->dep_map, 0, 0, _RET_IP_); + rt_mutex_lock(&rwsem->lock); +} +EXPORT_SYMBOL(rt_down_write); + +void rt_down_write_nested(struct rw_semaphore *rwsem, int subclass) +{ + rwsem_acquire(&rwsem->dep_map, subclass, 0, _RET_IP_); + rt_mutex_lock(&rwsem->lock); +} +EXPORT_SYMBOL(rt_down_write_nested); + +int rt_down_read_trylock(struct rw_semaphore *rwsem) +{ + unsigned long flags; + int ret; + + /* + * Read locks within the self-held write lock succeed. + */ + spin_lock_irqsave(&rwsem->lock.wait_lock, flags); + if (rt_mutex_real_owner(&rwsem->lock) == current) { + spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); + rwsem_acquire_read(&rwsem->dep_map, 0, 1, _RET_IP_); + rwsem->read_depth++; + return 1; + } + spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); + + ret = rt_mutex_trylock(&rwsem->lock); + if (ret) + rwsem_acquire(&rwsem->dep_map, 0, 1, _RET_IP_); + return ret; +} +EXPORT_SYMBOL(rt_down_read_trylock); + +static void __rt_down_read(struct rw_semaphore *rwsem, int subclass) +{ + unsigned long flags; + + rwsem_acquire_read(&rwsem->dep_map, subclass, 0, _RET_IP_); + + /* + * Read locks within the write lock succeed. + */ + spin_lock_irqsave(&rwsem->lock.wait_lock, flags); + + if (rt_mutex_real_owner(&rwsem->lock) == current) { + spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); + rwsem->read_depth++; + return; + } + spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); + rt_mutex_lock(&rwsem->lock); +} + +void rt_down_read(struct rw_semaphore *rwsem) +{ + __rt_down_read(rwsem, 0); +} +EXPORT_SYMBOL(rt_down_read); + +void rt_down_read_nested(struct rw_semaphore *rwsem, int subclass) +{ + __rt_down_read(rwsem, subclass); +} +EXPORT_SYMBOL(rt_down_read_nested); + + +#ifdef CONFIG_DEBUG_LOCK_ALLOC + +/* + * Same as rt_down_read() but no lockdep calls: + */ +void rt_down_read_non_owner(struct rw_semaphore *rwsem) +{ + unsigned long flags; + /* + * Read locks within the write lock succeed. + */ + spin_lock_irqsave(&rwsem->lock.wait_lock, flags); + + if (rt_mutex_real_owner(&rwsem->lock) == current) { + spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); + rwsem->read_depth++; + return; + } + spin_unlock_irqrestore(&rwsem->lock.wait_lock, flags); + rt_mutex_lock(&rwsem->lock); +} +EXPORT_SYMBOL(rt_down_read_non_owner); + +#endif + +void __rt_rwsem_init(struct rw_semaphore *rwsem, char *name, + struct lock_class_key *key) +{ +#ifdef CONFIG_DEBUG_LOCK_ALLOC + /* + * Make sure we are not reinitializing a held lock: + */ + debug_check_no_locks_freed((void *)rwsem, sizeof(*rwsem)); + lockdep_init_map(&rwsem->dep_map, name, key, 0); +#endif + __rt_mutex_init(&rwsem->lock, name); + rwsem->read_depth = 0; +} +EXPORT_SYMBOL(__rt_rwsem_init); + +/* + * Semaphores + */ +/* + * Linux Semaphores implemented via RT-mutexes. + * + * In the down() variants we use the mutex as the semaphore blocking + * object: we always acquire it, decrease the counter and keep the lock + * locked if we did the 1->0 transition. The next down() will then block. + * + * In the up() path we atomically increase the counter and do the + * unlock if we were the one doing the 0->1 transition. + */ + +static inline void __down_complete(struct semaphore *sem) +{ + int count = atomic_dec_return(&sem->count); + + if (unlikely(count > 0)) + rt_mutex_unlock(&sem->lock); +} + +void rt_down(struct semaphore *sem) +{ + rt_mutex_lock(&sem->lock); + __down_complete(sem); +} +EXPORT_SYMBOL(rt_down); + +int rt_down_interruptible(struct semaphore *sem) +{ + int ret; + + ret = rt_mutex_lock_interruptible(&sem->lock, 0); + if (ret) + return ret; + __down_complete(sem); + return 0; +} +EXPORT_SYMBOL(rt_down_interruptible); + +int rt_down_timeout(struct semaphore *sem, long jiff) +{ + struct hrtimer_sleeper t; + struct timespec ts; + unsigned long expires = jiffies + jiff + 1; + int ret; + + /* + * rt_mutex_slowlock can use an interruptible, but this needs to + * be TASK_INTERRUPTIBLE. The down_timeout uses TASK_UNINTERRUPTIBLE. + * To handle this we loop if a signal caused the timeout and the + * we recalculate the new timeout. + * Yes Thomas, this is a hack! But we can fix it right later. + */ + do { + jiffies_to_timespec(jiff, &ts); + hrtimer_init_on_stack(&t.timer, HRTIMER_MODE_REL, CLOCK_MONOTONIC); + t.timer.expires = timespec_to_ktime(ts); + + ret = rt_mutex_timed_lock(&sem->lock, &t, 0); + if (ret != -EINTR) + break; + + /* signal occured, but the down_timeout doesn't handle them */ + jiff = expires - jiffies; + + } while (jiff > 0); + + if (!ret) + __down_complete(sem); + else + ret = -ETIME; + + return ret; +} +EXPORT_SYMBOL(rt_down_timeout); + +/* + * try to down the semaphore, 0 on success and 1 on failure. (inverted) + */ +int rt_down_trylock(struct semaphore *sem) +{ + /* + * Here we are a tiny bit different from ordinary Linux semaphores, + * because we can get 'transient' locking-failures when say a + * process decreases the count from 9 to 8 and locks/releases the + * embedded mutex internally. It would be quite complex to remove + * these transient failures so lets try it the simple way first: + */ + if (rt_mutex_trylock(&sem->lock)) { + __down_complete(sem); + return 0; + } + return 1; +} +EXPORT_SYMBOL(rt_down_trylock); + +void rt_up(struct semaphore *sem) +{ + int count; + + /* + * Disable preemption to make sure a highprio trylock-er cannot + * preempt us here and get into an infinite loop: + */ + preempt_disable(); + count = atomic_inc_return(&sem->count); + /* + * If we did the 0 -> 1 transition then we are the ones to unlock it: + */ + if (likely(count == 1)) + rt_mutex_unlock(&sem->lock); + preempt_enable(); +} +EXPORT_SYMBOL(rt_up); + +void __sema_init(struct semaphore *sem, int val, + char *name, char *file, int line) +{ + atomic_set(&sem->count, val); + switch (val) { + case 0: + __rt_mutex_init(&sem->lock, name); + rt_mutex_lock(&sem->lock); + break; + default: + __rt_mutex_init(&sem->lock, name); + break; + } +} +EXPORT_SYMBOL(__sema_init); + +void __init_MUTEX(struct semaphore *sem, char *name, char *file, + int line) +{ + __sema_init(sem, 1, name, file, line); +} +EXPORT_SYMBOL(__init_MUTEX); + Index: linux-2.6-tip/kernel/rtmutex-debug.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex-debug.c +++ linux-2.6-tip/kernel/rtmutex-debug.c @@ -16,6 +16,7 @@ * * See rt.c in preempt-rt for proper credits and further information */ +#include #include #include #include @@ -29,61 +30,6 @@ #include "rtmutex_common.h" -# define TRACE_WARN_ON(x) WARN_ON(x) -# define TRACE_BUG_ON(x) BUG_ON(x) - -# define TRACE_OFF() \ -do { \ - if (rt_trace_on) { \ - rt_trace_on = 0; \ - console_verbose(); \ - if (spin_is_locked(¤t->pi_lock)) \ - spin_unlock(¤t->pi_lock); \ - } \ -} while (0) - -# define TRACE_OFF_NOLOCK() \ -do { \ - if (rt_trace_on) { \ - rt_trace_on = 0; \ - console_verbose(); \ - } \ -} while (0) - -# define TRACE_BUG_LOCKED() \ -do { \ - TRACE_OFF(); \ - BUG(); \ -} while (0) - -# define TRACE_WARN_ON_LOCKED(c) \ -do { \ - if (unlikely(c)) { \ - TRACE_OFF(); \ - WARN_ON(1); \ - } \ -} while (0) - -# define TRACE_BUG_ON_LOCKED(c) \ -do { \ - if (unlikely(c)) \ - TRACE_BUG_LOCKED(); \ -} while (0) - -#ifdef CONFIG_SMP -# define SMP_TRACE_BUG_ON_LOCKED(c) TRACE_BUG_ON_LOCKED(c) -#else -# define SMP_TRACE_BUG_ON_LOCKED(c) do { } while (0) -#endif - -/* - * deadlock detection flag. We turn it off when we detect - * the first problem because we dont want to recurse back - * into the tracing code when doing error printk or - * executing a BUG(): - */ -static int rt_trace_on = 1; - static void printk_task(struct task_struct *p) { if (p) @@ -111,8 +57,8 @@ static void printk_lock(struct rt_mutex void rt_mutex_debug_task_free(struct task_struct *task) { - WARN_ON(!plist_head_empty(&task->pi_waiters)); - WARN_ON(task->pi_blocked_on); + DEBUG_LOCKS_WARN_ON(!plist_head_empty(&task->pi_waiters)); + DEBUG_LOCKS_WARN_ON(task->pi_blocked_on); } /* @@ -125,7 +71,7 @@ void debug_rt_mutex_deadlock(int detect, { struct task_struct *task; - if (!rt_trace_on || detect || !act_waiter) + if (!debug_locks || detect || !act_waiter) return; task = rt_mutex_owner(act_waiter->lock); @@ -139,7 +85,7 @@ void debug_rt_mutex_print_deadlock(struc { struct task_struct *task; - if (!waiter->deadlock_lock || !rt_trace_on) + if (!waiter->deadlock_lock || !debug_locks) return; rcu_read_lock(); @@ -149,7 +95,8 @@ void debug_rt_mutex_print_deadlock(struc return; } - TRACE_OFF_NOLOCK(); + if (!debug_locks_off()) + return; printk("\n============================================\n"); printk( "[ BUG: circular locking deadlock detected! ]\n"); @@ -180,7 +127,6 @@ void debug_rt_mutex_print_deadlock(struc printk("[ turning off deadlock detection." "Please report this trace. ]\n\n"); - local_irq_disable(); } void debug_rt_mutex_lock(struct rt_mutex *lock) @@ -189,7 +135,8 @@ void debug_rt_mutex_lock(struct rt_mutex void debug_rt_mutex_unlock(struct rt_mutex *lock) { - TRACE_WARN_ON_LOCKED(rt_mutex_owner(lock) != current); + if (debug_locks) + DEBUG_LOCKS_WARN_ON(rt_mutex_owner(lock) != current); } void @@ -199,7 +146,7 @@ debug_rt_mutex_proxy_lock(struct rt_mute void debug_rt_mutex_proxy_unlock(struct rt_mutex *lock) { - TRACE_WARN_ON_LOCKED(!rt_mutex_owner(lock)); + DEBUG_LOCKS_WARN_ON(!rt_mutex_owner(lock)); } void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter) @@ -213,9 +160,9 @@ void debug_rt_mutex_init_waiter(struct r void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter) { put_pid(waiter->deadlock_task_pid); - TRACE_WARN_ON(!plist_node_empty(&waiter->list_entry)); - TRACE_WARN_ON(!plist_node_empty(&waiter->pi_list_entry)); - TRACE_WARN_ON(waiter->task); + DEBUG_LOCKS_WARN_ON(!plist_node_empty(&waiter->list_entry)); + DEBUG_LOCKS_WARN_ON(!plist_node_empty(&waiter->pi_list_entry)); + DEBUG_LOCKS_WARN_ON(waiter->task); memset(waiter, 0x22, sizeof(*waiter)); } @@ -231,9 +178,36 @@ void debug_rt_mutex_init(struct rt_mutex void rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task) { +#ifdef CONFIG_DEBUG_PREEMPT + if (task->lock_count >= MAX_LOCK_STACK) { + if (!debug_locks_off()) + return; + printk("BUG: %s/%d: lock count overflow!\n", + task->comm, task->pid); + dump_stack(); + return; + } +#ifdef CONFIG_PREEMPT_RT + task->owned_lock[task->lock_count] = lock; +#endif + task->lock_count++; +#endif } void rt_mutex_deadlock_account_unlock(struct task_struct *task) { +#ifdef CONFIG_DEBUG_PREEMPT + if (!task->lock_count) { + if (!debug_locks_off()) + return; + printk("BUG: %s/%d: lock count underflow!\n", + task->comm, task->pid); + dump_stack(); + return; + } + task->lock_count--; +#ifdef CONFIG_PREEMPT_RT + task->owned_lock[task->lock_count] = NULL; +#endif +#endif } - Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "rtmutex_common.h" @@ -97,6 +98,22 @@ static inline void mark_rt_mutex_waiters } #endif +int pi_initialized; + +/* + * we initialize the wait_list runtime. (Could be done build-time and/or + * boot-time.) + */ +static inline void init_lists(struct rt_mutex *lock) +{ + if (unlikely(!lock->wait_list.prio_list.prev)) { + plist_head_init(&lock->wait_list, &lock->wait_lock); +#ifdef CONFIG_DEBUG_RT_MUTEXES + pi_initialized++; +#endif + } +} + /* * Calculate task priority from the waiter list priority * @@ -253,13 +270,13 @@ static int rt_mutex_adjust_prio_chain(st plist_add(&waiter->list_entry, &lock->wait_list); /* Release the task */ - spin_unlock_irqrestore(&task->pi_lock, flags); + spin_unlock(&task->pi_lock); put_task_struct(task); /* Grab the next task */ task = rt_mutex_owner(lock); get_task_struct(task); - spin_lock_irqsave(&task->pi_lock, flags); + spin_lock(&task->pi_lock); if (waiter == rt_mutex_top_waiter(lock)) { /* Boost the owner */ @@ -277,10 +294,10 @@ static int rt_mutex_adjust_prio_chain(st __rt_mutex_adjust_prio(task); } - spin_unlock_irqrestore(&task->pi_lock, flags); + spin_unlock(&task->pi_lock); top_waiter = rt_mutex_top_waiter(lock); - spin_unlock(&lock->wait_lock); + spin_unlock_irqrestore(&lock->wait_lock, flags); if (!detect_deadlock && waiter != top_waiter) goto out_put_task; @@ -304,7 +321,6 @@ static inline int try_to_steal_lock(stru { struct task_struct *pendowner = rt_mutex_owner(lock); struct rt_mutex_waiter *next; - unsigned long flags; if (!rt_mutex_owner_pending(lock)) return 0; @@ -312,9 +328,9 @@ static inline int try_to_steal_lock(stru if (pendowner == current) return 1; - spin_lock_irqsave(&pendowner->pi_lock, flags); + spin_lock(&pendowner->pi_lock); if (current->prio >= pendowner->prio) { - spin_unlock_irqrestore(&pendowner->pi_lock, flags); + spin_unlock(&pendowner->pi_lock); return 0; } @@ -324,7 +340,7 @@ static inline int try_to_steal_lock(stru * priority. */ if (likely(!rt_mutex_has_waiters(lock))) { - spin_unlock_irqrestore(&pendowner->pi_lock, flags); + spin_unlock(&pendowner->pi_lock); return 1; } @@ -332,7 +348,7 @@ static inline int try_to_steal_lock(stru next = rt_mutex_top_waiter(lock); plist_del(&next->pi_list_entry, &pendowner->pi_waiters); __rt_mutex_adjust_prio(pendowner); - spin_unlock_irqrestore(&pendowner->pi_lock, flags); + spin_unlock(&pendowner->pi_lock); /* * We are going to steal the lock and a waiter was @@ -349,10 +365,10 @@ static inline int try_to_steal_lock(stru * might be current: */ if (likely(next->task != current)) { - spin_lock_irqsave(¤t->pi_lock, flags); + spin_lock(¤t->pi_lock); plist_add(&next->pi_list_entry, ¤t->pi_waiters); __rt_mutex_adjust_prio(current); - spin_unlock_irqrestore(¤t->pi_lock, flags); + spin_unlock(¤t->pi_lock); } return 1; } @@ -411,14 +427,13 @@ static int try_to_take_rt_mutex(struct r */ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, struct rt_mutex_waiter *waiter, - int detect_deadlock) + int detect_deadlock, unsigned long flags) { struct task_struct *owner = rt_mutex_owner(lock); struct rt_mutex_waiter *top_waiter = waiter; - unsigned long flags; int chain_walk = 0, res; - spin_lock_irqsave(¤t->pi_lock, flags); + spin_lock(¤t->pi_lock); __rt_mutex_adjust_prio(current); waiter->task = current; waiter->lock = lock; @@ -432,17 +447,17 @@ static int task_blocks_on_rt_mutex(struc current->pi_blocked_on = waiter; - spin_unlock_irqrestore(¤t->pi_lock, flags); + spin_unlock(¤t->pi_lock); if (waiter == rt_mutex_top_waiter(lock)) { - spin_lock_irqsave(&owner->pi_lock, flags); + spin_lock(&owner->pi_lock); plist_del(&top_waiter->pi_list_entry, &owner->pi_waiters); plist_add(&waiter->pi_list_entry, &owner->pi_waiters); __rt_mutex_adjust_prio(owner); if (owner->pi_blocked_on) chain_walk = 1; - spin_unlock_irqrestore(&owner->pi_lock, flags); + spin_unlock(&owner->pi_lock); } else if (debug_rt_mutex_detect_deadlock(waiter, detect_deadlock)) chain_walk = 1; @@ -457,12 +472,12 @@ static int task_blocks_on_rt_mutex(struc */ get_task_struct(owner); - spin_unlock(&lock->wait_lock); + spin_unlock_irqrestore(&lock->wait_lock, flags); res = rt_mutex_adjust_prio_chain(owner, detect_deadlock, lock, waiter, current); - spin_lock(&lock->wait_lock); + spin_lock_irq(&lock->wait_lock); return res; } @@ -475,13 +490,12 @@ static int task_blocks_on_rt_mutex(struc * * Called with lock->wait_lock held. */ -static void wakeup_next_waiter(struct rt_mutex *lock) +static void wakeup_next_waiter(struct rt_mutex *lock, int savestate) { struct rt_mutex_waiter *waiter; struct task_struct *pendowner; - unsigned long flags; - spin_lock_irqsave(¤t->pi_lock, flags); + spin_lock(¤t->pi_lock); waiter = rt_mutex_top_waiter(lock); plist_del(&waiter->list_entry, &lock->wait_list); @@ -498,7 +512,7 @@ static void wakeup_next_waiter(struct rt rt_mutex_set_owner(lock, pendowner, RT_MUTEX_OWNER_PENDING); - spin_unlock_irqrestore(¤t->pi_lock, flags); + spin_unlock(¤t->pi_lock); /* * Clear the pi_blocked_on variable and enqueue a possible @@ -507,7 +521,7 @@ static void wakeup_next_waiter(struct rt * waiter with higher priority than pending-owner->normal_prio * is blocked on the unboosted (pending) owner. */ - spin_lock_irqsave(&pendowner->pi_lock, flags); + spin_lock(&pendowner->pi_lock); WARN_ON(!pendowner->pi_blocked_on); WARN_ON(pendowner->pi_blocked_on != waiter); @@ -521,9 +535,12 @@ static void wakeup_next_waiter(struct rt next = rt_mutex_top_waiter(lock); plist_add(&next->pi_list_entry, &pendowner->pi_waiters); } - spin_unlock_irqrestore(&pendowner->pi_lock, flags); + spin_unlock(&pendowner->pi_lock); - wake_up_process(pendowner); + if (savestate) + wake_up_process_mutex(pendowner); + else + wake_up_process(pendowner); } /* @@ -532,22 +549,22 @@ static void wakeup_next_waiter(struct rt * Must be called with lock->wait_lock held */ static void remove_waiter(struct rt_mutex *lock, - struct rt_mutex_waiter *waiter) + struct rt_mutex_waiter *waiter, + unsigned long flags) { int first = (waiter == rt_mutex_top_waiter(lock)); struct task_struct *owner = rt_mutex_owner(lock); - unsigned long flags; int chain_walk = 0; - spin_lock_irqsave(¤t->pi_lock, flags); + spin_lock(¤t->pi_lock); plist_del(&waiter->list_entry, &lock->wait_list); waiter->task = NULL; current->pi_blocked_on = NULL; - spin_unlock_irqrestore(¤t->pi_lock, flags); + spin_unlock(¤t->pi_lock); if (first && owner != current) { - spin_lock_irqsave(&owner->pi_lock, flags); + spin_lock(&owner->pi_lock); plist_del(&waiter->pi_list_entry, &owner->pi_waiters); @@ -562,7 +579,7 @@ static void remove_waiter(struct rt_mute if (owner->pi_blocked_on) chain_walk = 1; - spin_unlock_irqrestore(&owner->pi_lock, flags); + spin_unlock(&owner->pi_lock); } WARN_ON(!plist_node_empty(&waiter->pi_list_entry)); @@ -573,11 +590,11 @@ static void remove_waiter(struct rt_mute /* gets dropped in rt_mutex_adjust_prio_chain()! */ get_task_struct(owner); - spin_unlock(&lock->wait_lock); + spin_unlock_irqrestore(&lock->wait_lock, flags); rt_mutex_adjust_prio_chain(owner, 0, lock, NULL, current); - spin_lock(&lock->wait_lock); + spin_lock_irq(&lock->wait_lock); } /* @@ -598,14 +615,302 @@ void rt_mutex_adjust_pi(struct task_stru return; } - spin_unlock_irqrestore(&task->pi_lock, flags); - /* gets dropped in rt_mutex_adjust_prio_chain()! */ get_task_struct(task); + spin_unlock_irqrestore(&task->pi_lock, flags); + rt_mutex_adjust_prio_chain(task, 0, NULL, NULL, task); } /* + * preemptible spin_lock functions: + */ + +#ifdef CONFIG_PREEMPT_RT + +static inline void +rt_spin_lock_fastlock(struct rt_mutex *lock, + void (*slowfn)(struct rt_mutex *lock)) +{ + might_sleep(); + + if (likely(rt_mutex_cmpxchg(lock, NULL, current))) + rt_mutex_deadlock_account_lock(lock, current); + else + slowfn(lock); +} + +static inline void +rt_spin_lock_fastunlock(struct rt_mutex *lock, + void (*slowfn)(struct rt_mutex *lock)) +{ + if (likely(rt_mutex_cmpxchg(lock, current, NULL))) + rt_mutex_deadlock_account_unlock(current); + else + slowfn(lock); +} + +/* + * Slow path lock function spin_lock style: this variant is very + * careful not to miss any non-lock wakeups. + * + * The wakeup side uses wake_up_process_mutex, which, combined with + * the xchg code of this function is a transparent sleep/wakeup + * mechanism nested within any existing sleep/wakeup mechanism. This + * enables the seemless use of arbitrary (blocking) spinlocks within + * sleep/wakeup event loops. + */ +static void noinline __sched +rt_spin_lock_slowlock(struct rt_mutex *lock) +{ + struct rt_mutex_waiter waiter; + unsigned long saved_state, state, flags; + + debug_rt_mutex_init_waiter(&waiter); + waiter.task = NULL; + + spin_lock_irqsave(&lock->wait_lock, flags); + init_lists(lock); + + /* Try to acquire the lock again: */ + if (try_to_take_rt_mutex(lock)) { + spin_unlock_irqrestore(&lock->wait_lock, flags); + return; + } + + BUG_ON(rt_mutex_owner(lock) == current); + + /* + * Here we save whatever state the task was in originally, + * we'll restore it at the end of the function and we'll take + * any intermediate wakeup into account as well, independently + * of the lock sleep/wakeup mechanism. When we get a real + * wakeup the task->state is TASK_RUNNING and we change + * saved_state accordingly. If we did not get a real wakeup + * then we return with the saved state. + */ + saved_state = xchg(¤t->state, TASK_UNINTERRUPTIBLE); + + for (;;) { + unsigned long saved_flags; + int saved_lock_depth = current->lock_depth; + + /* Try to acquire the lock */ + if (try_to_take_rt_mutex(lock)) + break; + /* + * waiter.task is NULL the first time we come here and + * when we have been woken up by the previous owner + * but the lock got stolen by an higher prio task. + */ + if (!waiter.task) { + task_blocks_on_rt_mutex(lock, &waiter, 0, flags); + /* Wakeup during boost ? */ + if (unlikely(!waiter.task)) + continue; + } + + /* + * Prevent schedule() to drop BKL, while waiting for + * the lock ! We restore lock_depth when we come back. + */ + saved_flags = current->flags & PF_NOSCHED; + current->lock_depth = -1; + current->flags &= ~PF_NOSCHED; + spin_unlock_irqrestore(&lock->wait_lock, flags); + + debug_rt_mutex_print_deadlock(&waiter); + + schedule_rt_mutex(lock); + + spin_lock_irqsave(&lock->wait_lock, flags); + current->flags |= saved_flags; + current->lock_depth = saved_lock_depth; + state = xchg(¤t->state, TASK_UNINTERRUPTIBLE); + if (unlikely(state == TASK_RUNNING)) + saved_state = TASK_RUNNING; + } + + state = xchg(¤t->state, saved_state); + if (unlikely(state == TASK_RUNNING)) + current->state = TASK_RUNNING; + + /* + * Extremely rare case, if we got woken up by a non-mutex wakeup, + * and we managed to steal the lock despite us not being the + * highest-prio waiter (due to SCHED_OTHER changing prio), then we + * can end up with a non-NULL waiter.task: + */ + if (unlikely(waiter.task)) + remove_waiter(lock, &waiter, flags); + /* + * try_to_take_rt_mutex() sets the waiter bit + * unconditionally. We might have to fix that up: + */ + fixup_rt_mutex_waiters(lock); + + spin_unlock_irqrestore(&lock->wait_lock, flags); + + debug_rt_mutex_free_waiter(&waiter); +} + +/* + * Slow path to release a rt_mutex spin_lock style + */ +static void noinline __sched +rt_spin_lock_slowunlock(struct rt_mutex *lock) +{ + unsigned long flags; + + spin_lock_irqsave(&lock->wait_lock, flags); + + debug_rt_mutex_unlock(lock); + + rt_mutex_deadlock_account_unlock(current); + + if (!rt_mutex_has_waiters(lock)) { + lock->owner = NULL; + spin_unlock_irqrestore(&lock->wait_lock, flags); + return; + } + + wakeup_next_waiter(lock, 1); + + spin_unlock_irqrestore(&lock->wait_lock, flags); + + /* Undo pi boosting.when necessary */ + rt_mutex_adjust_prio(current); +} + +void __lockfunc rt_spin_lock(spinlock_t *lock) +{ + rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); + spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); +} +EXPORT_SYMBOL(rt_spin_lock); + +void __lockfunc __rt_spin_lock(struct rt_mutex *lock) +{ + rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock); +} +EXPORT_SYMBOL(__rt_spin_lock); + +#ifdef CONFIG_DEBUG_LOCK_ALLOC + +void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass) +{ + rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); + spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); +} +EXPORT_SYMBOL(rt_spin_lock_nested); + +#endif + +void __lockfunc rt_spin_unlock(spinlock_t *lock) +{ + /* NOTE: we always pass in '1' for nested, for simplicity */ + spin_release(&lock->dep_map, 1, _RET_IP_); + rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock); +} +EXPORT_SYMBOL(rt_spin_unlock); + +void __lockfunc __rt_spin_unlock(struct rt_mutex *lock) +{ + rt_spin_lock_fastunlock(lock, rt_spin_lock_slowunlock); +} +EXPORT_SYMBOL(__rt_spin_unlock); + +/* + * Wait for the lock to get unlocked: instead of polling for an unlock + * (like raw spinlocks do), we lock and unlock, to force the kernel to + * schedule if there's contention: + */ +void __lockfunc rt_spin_unlock_wait(spinlock_t *lock) +{ + spin_lock(lock); + spin_unlock(lock); +} +EXPORT_SYMBOL(rt_spin_unlock_wait); + +int __lockfunc rt_spin_trylock(spinlock_t *lock) +{ + int ret = rt_mutex_trylock(&lock->lock); + + if (ret) + spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); + + return ret; +} +EXPORT_SYMBOL(rt_spin_trylock); + +int __lockfunc rt_spin_trylock_irqsave(spinlock_t *lock, unsigned long *flags) +{ + int ret; + + *flags = 0; + ret = rt_mutex_trylock(&lock->lock); + if (ret) + spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); + + return ret; +} +EXPORT_SYMBOL(rt_spin_trylock_irqsave); + +int _atomic_dec_and_spin_lock(spinlock_t *lock, atomic_t *atomic) +{ + /* Subtract 1 from counter unless that drops it to 0 (ie. it was 1) */ + if (atomic_add_unless(atomic, -1, 1)) + return 0; + rt_spin_lock(lock); + if (atomic_dec_and_test(atomic)) + return 1; + rt_spin_unlock(lock); + return 0; +} +EXPORT_SYMBOL(_atomic_dec_and_spin_lock); + +void +__rt_spin_lock_init(spinlock_t *lock, char *name, struct lock_class_key *key) +{ +#ifdef CONFIG_DEBUG_LOCK_ALLOC + /* + * Make sure we are not reinitializing a held lock: + */ + debug_check_no_locks_freed((void *)lock, sizeof(*lock)); + lockdep_init_map(&lock->dep_map, name, key, 0); +#endif + __rt_mutex_init(&lock->lock, name); +} +EXPORT_SYMBOL(__rt_spin_lock_init); + +#endif + +static inline int rt_release_bkl(struct rt_mutex *lock, unsigned long flags) +{ + int saved_lock_depth = current->lock_depth; + + current->lock_depth = -1; + /* + * try_to_take_lock set the waiters, make sure it's + * still correct. + */ + fixup_rt_mutex_waiters(lock); + spin_unlock_irqrestore(&lock->wait_lock, flags); + + up(&kernel_sem); + + spin_lock_irq(&lock->wait_lock); + + return saved_lock_depth; +} + +static inline void rt_reacquire_bkl(int saved_lock_depth) +{ + down(&kernel_sem); + current->lock_depth = saved_lock_depth; +} + +/* * Slow path lock function: */ static int __sched @@ -613,20 +918,29 @@ rt_mutex_slowlock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout, int detect_deadlock) { + int ret = 0, saved_lock_depth = -1; struct rt_mutex_waiter waiter; - int ret = 0; + unsigned long flags; debug_rt_mutex_init_waiter(&waiter); waiter.task = NULL; - spin_lock(&lock->wait_lock); + spin_lock_irqsave(&lock->wait_lock, flags); + init_lists(lock); /* Try to acquire the lock again: */ if (try_to_take_rt_mutex(lock)) { - spin_unlock(&lock->wait_lock); + spin_unlock_irqrestore(&lock->wait_lock, flags); return 0; } + /* + * We drop the BKL here before we go into the wait loop to avoid a + * possible deadlock in the scheduler. + */ + if (unlikely(current->lock_depth >= 0)) + saved_lock_depth = rt_release_bkl(lock, flags); + set_current_state(state); /* Setup the timer, when timeout != NULL */ @@ -637,6 +951,8 @@ rt_mutex_slowlock(struct rt_mutex *lock, } for (;;) { + unsigned long saved_flags; + /* Try to acquire the lock: */ if (try_to_take_rt_mutex(lock)) break; @@ -662,7 +978,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, */ if (!waiter.task) { ret = task_blocks_on_rt_mutex(lock, &waiter, - detect_deadlock); + detect_deadlock, flags); /* * If we got woken up by the owner then start loop * all over without going into schedule to try @@ -681,22 +997,26 @@ rt_mutex_slowlock(struct rt_mutex *lock, if (unlikely(ret)) break; } + saved_flags = current->flags & PF_NOSCHED; + current->flags &= ~PF_NOSCHED; - spin_unlock(&lock->wait_lock); + spin_unlock_irq(&lock->wait_lock); debug_rt_mutex_print_deadlock(&waiter); if (waiter.task) schedule_rt_mutex(lock); - spin_lock(&lock->wait_lock); + spin_lock_irq(&lock->wait_lock); + + current->flags |= saved_flags; set_current_state(state); } set_current_state(TASK_RUNNING); if (unlikely(waiter.task)) - remove_waiter(lock, &waiter); + remove_waiter(lock, &waiter, flags); /* * try_to_take_rt_mutex() sets the waiter bit @@ -704,7 +1024,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, */ fixup_rt_mutex_waiters(lock); - spin_unlock(&lock->wait_lock); + spin_unlock_irqrestore(&lock->wait_lock, flags); /* Remove pending timer: */ if (unlikely(timeout)) @@ -718,6 +1038,10 @@ rt_mutex_slowlock(struct rt_mutex *lock, if (unlikely(ret)) rt_mutex_adjust_prio(current); + /* Must we reaquire the BKL? */ + if (unlikely(saved_lock_depth >= 0)) + rt_reacquire_bkl(saved_lock_depth); + debug_rt_mutex_free_waiter(&waiter); return ret; @@ -729,12 +1053,15 @@ rt_mutex_slowlock(struct rt_mutex *lock, static inline int rt_mutex_slowtrylock(struct rt_mutex *lock) { + unsigned long flags; int ret = 0; - spin_lock(&lock->wait_lock); + spin_lock_irqsave(&lock->wait_lock, flags); if (likely(rt_mutex_owner(lock) != current)) { + init_lists(lock); + ret = try_to_take_rt_mutex(lock); /* * try_to_take_rt_mutex() sets the lock waiters @@ -743,7 +1070,7 @@ rt_mutex_slowtrylock(struct rt_mutex *lo fixup_rt_mutex_waiters(lock); } - spin_unlock(&lock->wait_lock); + spin_unlock_irqrestore(&lock->wait_lock, flags); return ret; } @@ -754,7 +1081,9 @@ rt_mutex_slowtrylock(struct rt_mutex *lo static void __sched rt_mutex_slowunlock(struct rt_mutex *lock) { - spin_lock(&lock->wait_lock); + unsigned long flags; + + spin_lock_irqsave(&lock->wait_lock, flags); debug_rt_mutex_unlock(lock); @@ -762,13 +1091,13 @@ rt_mutex_slowunlock(struct rt_mutex *loc if (!rt_mutex_has_waiters(lock)) { lock->owner = NULL; - spin_unlock(&lock->wait_lock); + spin_unlock_irqrestore(&lock->wait_lock, flags); return; } - wakeup_next_waiter(lock); + wakeup_next_waiter(lock, 0); - spin_unlock(&lock->wait_lock); + spin_unlock_irqrestore(&lock->wait_lock, flags); /* Undo pi boosting if necessary: */ rt_mutex_adjust_prio(current); @@ -830,6 +1159,27 @@ rt_mutex_fastunlock(struct rt_mutex *loc } /** + * rt_mutex_lock_killable - lock a rt_mutex killable + * + * @lock: the rt_mutex to be locked + * @detect_deadlock: deadlock detection on/off + * + * Returns: + * 0 on success + * -EINTR when interrupted by a signal + * -EDEADLK when the lock would deadlock (when deadlock detection is on) + */ +int __sched rt_mutex_lock_killable(struct rt_mutex *lock, + int detect_deadlock) +{ + might_sleep(); + + return rt_mutex_fastlock(lock, TASK_KILLABLE, + detect_deadlock, rt_mutex_slowlock); +} +EXPORT_SYMBOL_GPL(rt_mutex_lock_killable); + +/** * rt_mutex_lock - lock a rt_mutex * * @lock: the rt_mutex to be locked Index: linux-2.6-tip/kernel/rwsem.c =================================================================== --- linux-2.6-tip.orig/kernel/rwsem.c +++ linux-2.6-tip/kernel/rwsem.c @@ -16,7 +16,7 @@ /* * lock for reading */ -void __sched down_read(struct rw_semaphore *sem) +void __sched compat_down_read(struct compat_rw_semaphore *sem) { might_sleep(); rwsem_acquire_read(&sem->dep_map, 0, 0, _RET_IP_); @@ -24,12 +24,12 @@ void __sched down_read(struct rw_semapho LOCK_CONTENDED(sem, __down_read_trylock, __down_read); } -EXPORT_SYMBOL(down_read); +EXPORT_SYMBOL(compat_down_read); /* * trylock for reading -- returns 1 if successful, 0 if contention */ -int down_read_trylock(struct rw_semaphore *sem) +int compat_down_read_trylock(struct compat_rw_semaphore *sem) { int ret = __down_read_trylock(sem); @@ -38,12 +38,12 @@ int down_read_trylock(struct rw_semaphor return ret; } -EXPORT_SYMBOL(down_read_trylock); +EXPORT_SYMBOL(compat_down_read_trylock); /* * lock for writing */ -void __sched down_write(struct rw_semaphore *sem) +void __sched compat_down_write(struct compat_rw_semaphore *sem) { might_sleep(); rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_); @@ -51,12 +51,12 @@ void __sched down_write(struct rw_semaph LOCK_CONTENDED(sem, __down_write_trylock, __down_write); } -EXPORT_SYMBOL(down_write); +EXPORT_SYMBOL(compat_down_write); /* * trylock for writing -- returns 1 if successful, 0 if contention */ -int down_write_trylock(struct rw_semaphore *sem) +int compat_down_write_trylock(struct compat_rw_semaphore *sem) { int ret = __down_write_trylock(sem); @@ -65,36 +65,36 @@ int down_write_trylock(struct rw_semapho return ret; } -EXPORT_SYMBOL(down_write_trylock); +EXPORT_SYMBOL(compat_down_write_trylock); /* * release a read lock */ -void up_read(struct rw_semaphore *sem) +void compat_up_read(struct compat_rw_semaphore *sem) { rwsem_release(&sem->dep_map, 1, _RET_IP_); __up_read(sem); } -EXPORT_SYMBOL(up_read); +EXPORT_SYMBOL(compat_up_read); /* * release a write lock */ -void up_write(struct rw_semaphore *sem) +void compat_up_write(struct compat_rw_semaphore *sem) { rwsem_release(&sem->dep_map, 1, _RET_IP_); __up_write(sem); } -EXPORT_SYMBOL(up_write); +EXPORT_SYMBOL(compat_up_write); /* * downgrade write lock to read lock */ -void downgrade_write(struct rw_semaphore *sem) +void compat_downgrade_write(struct compat_rw_semaphore *sem) { /* * lockdep: a downgraded write will live on as a write @@ -103,11 +103,11 @@ void downgrade_write(struct rw_semaphore __downgrade_write(sem); } -EXPORT_SYMBOL(downgrade_write); +EXPORT_SYMBOL(compat_downgrade_write); #ifdef CONFIG_DEBUG_LOCK_ALLOC -void down_read_nested(struct rw_semaphore *sem, int subclass) +void compat_down_read_nested(struct compat_rw_semaphore *sem, int subclass) { might_sleep(); rwsem_acquire_read(&sem->dep_map, subclass, 0, _RET_IP_); @@ -115,18 +115,18 @@ void down_read_nested(struct rw_semaphor LOCK_CONTENDED(sem, __down_read_trylock, __down_read); } -EXPORT_SYMBOL(down_read_nested); +EXPORT_SYMBOL(compat_down_read_nested); -void down_read_non_owner(struct rw_semaphore *sem) +void compat_down_read_non_owner(struct compat_rw_semaphore *sem) { might_sleep(); __down_read(sem); } -EXPORT_SYMBOL(down_read_non_owner); +EXPORT_SYMBOL(compat_down_read_non_owner); -void down_write_nested(struct rw_semaphore *sem, int subclass) +void compat_down_write_nested(struct compat_rw_semaphore *sem, int subclass) { might_sleep(); rwsem_acquire(&sem->dep_map, subclass, 0, _RET_IP_); @@ -134,14 +134,14 @@ void down_write_nested(struct rw_semapho LOCK_CONTENDED(sem, __down_write_trylock, __down_write); } -EXPORT_SYMBOL(down_write_nested); +EXPORT_SYMBOL(compat_down_write_nested); -void up_read_non_owner(struct rw_semaphore *sem) +void compat_up_read_non_owner(struct compat_rw_semaphore *sem) { __up_read(sem); } -EXPORT_SYMBOL(up_read_non_owner); +EXPORT_SYMBOL(compat_up_read_non_owner); #endif Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -2394,7 +2394,8 @@ void task_oncpu_function_call(struct tas * * returns failure only if the task is already active. */ -static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync) +static int +try_to_wake_up(struct task_struct *p, unsigned int state, int sync, int mutex) { int cpu, orig_cpu, this_cpu, success = 0; unsigned long flags; @@ -2516,13 +2517,31 @@ out: int wake_up_process(struct task_struct *p) { - return try_to_wake_up(p, TASK_ALL, 0); + return try_to_wake_up(p, TASK_ALL, 0, 0); } EXPORT_SYMBOL(wake_up_process); +int wake_up_process_sync(struct task_struct * p) +{ + return try_to_wake_up(p, TASK_ALL, 1, 0); +} +EXPORT_SYMBOL(wake_up_process_sync); + +int wake_up_process_mutex(struct task_struct * p) +{ + return try_to_wake_up(p, TASK_ALL, 0, 1); +} +EXPORT_SYMBOL(wake_up_process_mutex); + +int wake_up_process_mutex_sync(struct task_struct * p) +{ + return try_to_wake_up(p, TASK_ALL, 1, 1); +} +EXPORT_SYMBOL(wake_up_process_mutex_sync); + int wake_up_state(struct task_struct *p, unsigned int state) { - return try_to_wake_up(p, state, 0); + return try_to_wake_up(p, state | TASK_RUNNING_MUTEX, 0, 0); } /* @@ -5003,7 +5022,8 @@ asmlinkage void __sched preempt_schedule int default_wake_function(wait_queue_t *curr, unsigned mode, int sync, void *key) { - return try_to_wake_up(curr->private, mode, sync); + return try_to_wake_up(curr->private, mode | TASK_RUNNING_MUTEX, + sync, 0); } EXPORT_SYMBOL(default_wake_function); @@ -5043,7 +5063,7 @@ void __wake_up(wait_queue_head_t *q, uns unsigned long flags; spin_lock_irqsave(&q->lock, flags); - __wake_up_common(q, mode, nr_exclusive, 0, key); + __wake_up_common(q, mode, nr_exclusive, 1, key); spin_unlock_irqrestore(&q->lock, flags); } EXPORT_SYMBOL(__wake_up); @@ -5102,7 +5122,7 @@ void complete(struct completion *x) spin_lock_irqsave(&x->wait.lock, flags); x->done++; - __wake_up_common(&x->wait, TASK_NORMAL, 1, 0, NULL); + __wake_up_common(&x->wait, TASK_NORMAL, 1, 1, NULL); spin_unlock_irqrestore(&x->wait.lock, flags); } EXPORT_SYMBOL(complete); @@ -5119,11 +5139,17 @@ void complete_all(struct completion *x) spin_lock_irqsave(&x->wait.lock, flags); x->done += UINT_MAX/2; - __wake_up_common(&x->wait, TASK_NORMAL, 0, 0, NULL); + __wake_up_common(&x->wait, TASK_NORMAL, 0, 1, NULL); spin_unlock_irqrestore(&x->wait.lock, flags); } EXPORT_SYMBOL(complete_all); +unsigned int completion_done(struct completion *x) +{ + return x->done; +} +EXPORT_SYMBOL(completion_done); + static inline long __sched do_wait_for_common(struct completion *x, long timeout, int state) { @@ -6016,10 +6042,7 @@ SYSCALL_DEFINE0(sched_yield) * Since we are going to call schedule() anyway, there's * no need to preempt or enable interrupts: */ - __release(rq->lock); - spin_release(&rq->lock.dep_map, 1, _THIS_IP_); - _raw_spin_unlock(&rq->lock); - preempt_enable_no_resched(); + spin_unlock_no_resched(&rq->lock); schedule(); @@ -6062,13 +6085,13 @@ EXPORT_SYMBOL(_cond_resched); * operations here to prevent schedule() from being called twice (once via * spin_unlock(), once by hand). */ -int cond_resched_lock(spinlock_t *lock) +int __cond_resched_raw_spinlock(raw_spinlock_t *lock) { int resched = need_resched() && system_state == SYSTEM_RUNNING; int ret = 0; if (spin_needbreak(lock) || resched) { - spin_unlock(lock); + spin_unlock_no_resched(lock); if (resched && need_resched()) __cond_resched(); else @@ -6078,15 +6101,16 @@ int cond_resched_lock(spinlock_t *lock) } return ret; } -EXPORT_SYMBOL(cond_resched_lock); +EXPORT_SYMBOL(__cond_resched_raw_spinlock); /* * Voluntarily preempt a process context that has softirqs disabled: */ int __sched cond_resched_softirq(void) { +#ifndef CONFIG_PREEMPT_RT WARN_ON_ONCE(!in_softirq()); - +#endif if (need_resched() && system_state == SYSTEM_RUNNING) { local_bh_enable(); __cond_resched(); @@ -6295,19 +6319,23 @@ void sched_show_task(struct task_struct unsigned state; state = p->state ? __ffs(p->state) + 1 : 0; - printk(KERN_INFO "%-13.13s %c", p->comm, - state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?'); + printk("%-13.13s %c [%p]", p->comm, + state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?', p); #if BITS_PER_LONG == 32 - if (state == TASK_RUNNING) + if (0 && (state == TASK_RUNNING)) printk(KERN_CONT " running "); else printk(KERN_CONT " %08lx ", thread_saved_pc(p)); #else - if (state == TASK_RUNNING) + if (0 && (state == TASK_RUNNING)) printk(KERN_CONT " running task "); else printk(KERN_CONT " %016lx ", thread_saved_pc(p)); #endif + if (task_curr(p)) + printk("[curr] "); + else if (p->se.on_rq) + printk("[on rq #%d] ", task_cpu(p)); #ifdef CONFIG_DEBUG_STACK_USAGE free = stack_not_used(p); #endif Index: linux-2.6-tip/kernel/sched_clock.c =================================================================== --- linux-2.6-tip.orig/kernel/sched_clock.c +++ linux-2.6-tip/kernel/sched_clock.c @@ -52,7 +52,7 @@ struct sched_clock_data { * from within instrumentation code so we dont want to do any * instrumentation ourselves. */ - raw_spinlock_t lock; + __raw_spinlock_t lock; u64 tick_raw; u64 tick_gtod; @@ -79,7 +79,7 @@ void sched_clock_init(void) for_each_possible_cpu(cpu) { struct sched_clock_data *scd = cpu_sdc(cpu); - scd->lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; + scd->lock = (__raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; scd->tick_raw = 0; scd->tick_gtod = ktime_now; scd->clock = ktime_now; Index: linux-2.6-tip/kernel/semaphore.c =================================================================== --- linux-2.6-tip.orig/kernel/semaphore.c +++ linux-2.6-tip/kernel/semaphore.c @@ -33,11 +33,11 @@ #include #include -static noinline void __down(struct semaphore *sem); -static noinline int __down_interruptible(struct semaphore *sem); -static noinline int __down_killable(struct semaphore *sem); -static noinline int __down_timeout(struct semaphore *sem, long jiffies); -static noinline void __up(struct semaphore *sem); +static noinline void __down(struct compat_semaphore *sem); +static noinline int __down_interruptible(struct compat_semaphore *sem); +static noinline int __down_killable(struct compat_semaphore *sem); +static noinline int __down_timeout(struct compat_semaphore *sem, long jiffies); +static noinline void __up(struct compat_semaphore *sem); /** * down - acquire the semaphore @@ -50,7 +50,7 @@ static noinline void __up(struct semapho * Use of this function is deprecated, please use down_interruptible() or * down_killable() instead. */ -void down(struct semaphore *sem) +void compat_down(struct compat_semaphore *sem) { unsigned long flags; @@ -61,7 +61,7 @@ void down(struct semaphore *sem) __down(sem); spin_unlock_irqrestore(&sem->lock, flags); } -EXPORT_SYMBOL(down); +EXPORT_SYMBOL(compat_down); /** * down_interruptible - acquire the semaphore unless interrupted @@ -72,7 +72,7 @@ EXPORT_SYMBOL(down); * If the sleep is interrupted by a signal, this function will return -EINTR. * If the semaphore is successfully acquired, this function returns 0. */ -int down_interruptible(struct semaphore *sem) +int compat_down_interruptible(struct compat_semaphore *sem) { unsigned long flags; int result = 0; @@ -86,7 +86,7 @@ int down_interruptible(struct semaphore return result; } -EXPORT_SYMBOL(down_interruptible); +EXPORT_SYMBOL(compat_down_interruptible); /** * down_killable - acquire the semaphore unless killed @@ -98,7 +98,7 @@ EXPORT_SYMBOL(down_interruptible); * -EINTR. If the semaphore is successfully acquired, this function returns * 0. */ -int down_killable(struct semaphore *sem) +int compat_down_killable(struct compat_semaphore *sem) { unsigned long flags; int result = 0; @@ -112,7 +112,7 @@ int down_killable(struct semaphore *sem) return result; } -EXPORT_SYMBOL(down_killable); +EXPORT_SYMBOL(compat_down_killable); /** * down_trylock - try to acquire the semaphore, without waiting @@ -127,7 +127,7 @@ EXPORT_SYMBOL(down_killable); * Unlike mutex_trylock, this function can be used from interrupt context, * and the semaphore can be released by any task or interrupt. */ -int down_trylock(struct semaphore *sem) +int compat_down_trylock(struct compat_semaphore *sem) { unsigned long flags; int count; @@ -140,7 +140,7 @@ int down_trylock(struct semaphore *sem) return (count < 0); } -EXPORT_SYMBOL(down_trylock); +EXPORT_SYMBOL(compat_down_trylock); /** * down_timeout - acquire the semaphore within a specified time @@ -152,7 +152,7 @@ EXPORT_SYMBOL(down_trylock); * If the semaphore is not released within the specified number of jiffies, * this function returns -ETIME. It returns 0 if the semaphore was acquired. */ -int down_timeout(struct semaphore *sem, long jiffies) +int compat_down_timeout(struct compat_semaphore *sem, long jiffies) { unsigned long flags; int result = 0; @@ -166,7 +166,7 @@ int down_timeout(struct semaphore *sem, return result; } -EXPORT_SYMBOL(down_timeout); +EXPORT_SYMBOL(compat_down_timeout); /** * up - release the semaphore @@ -175,7 +175,7 @@ EXPORT_SYMBOL(down_timeout); * Release the semaphore. Unlike mutexes, up() may be called from any * context and even by tasks which have never called down(). */ -void up(struct semaphore *sem) +void compat_up(struct compat_semaphore *sem) { unsigned long flags; @@ -186,7 +186,7 @@ void up(struct semaphore *sem) __up(sem); spin_unlock_irqrestore(&sem->lock, flags); } -EXPORT_SYMBOL(up); +EXPORT_SYMBOL(compat_up); /* Functions for the contended case */ @@ -201,7 +201,7 @@ struct semaphore_waiter { * constant, and thus optimised away by the compiler. Likewise the * 'timeout' parameter for the cases without timeouts. */ -static inline int __sched __down_common(struct semaphore *sem, long state, +static inline int __sched __down_common(struct compat_semaphore *sem, long state, long timeout) { struct task_struct *task = current; @@ -233,27 +233,27 @@ static inline int __sched __down_common( return -EINTR; } -static noinline void __sched __down(struct semaphore *sem) +static noinline void __sched __down(struct compat_semaphore *sem) { __down_common(sem, TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT); } -static noinline int __sched __down_interruptible(struct semaphore *sem) +static noinline int __sched __down_interruptible(struct compat_semaphore *sem) { return __down_common(sem, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT); } -static noinline int __sched __down_killable(struct semaphore *sem) +static noinline int __sched __down_killable(struct compat_semaphore *sem) { return __down_common(sem, TASK_KILLABLE, MAX_SCHEDULE_TIMEOUT); } -static noinline int __sched __down_timeout(struct semaphore *sem, long jiffies) +static noinline int __sched __down_timeout(struct compat_semaphore *sem, long jiffies) { return __down_common(sem, TASK_UNINTERRUPTIBLE, jiffies); } -static noinline void __sched __up(struct semaphore *sem) +static noinline void __sched __up(struct compat_semaphore *sem) { struct semaphore_waiter *waiter = list_first_entry(&sem->wait_list, struct semaphore_waiter, list); Index: linux-2.6-tip/kernel/spinlock.c =================================================================== --- linux-2.6-tip.orig/kernel/spinlock.c +++ linux-2.6-tip/kernel/spinlock.c @@ -21,7 +21,7 @@ #include #include -int __lockfunc _spin_trylock(spinlock_t *lock) +int __lockfunc __spin_trylock(raw_spinlock_t *lock) { preempt_disable(); if (_raw_spin_trylock(lock)) { @@ -32,9 +32,46 @@ int __lockfunc _spin_trylock(spinlock_t preempt_enable(); return 0; } -EXPORT_SYMBOL(_spin_trylock); +EXPORT_SYMBOL(__spin_trylock); -int __lockfunc _read_trylock(rwlock_t *lock) +int __lockfunc __spin_trylock_irq(raw_spinlock_t *lock) +{ + local_irq_disable(); + preempt_disable(); + + if (_raw_spin_trylock(lock)) { + spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); + return 1; + } + + __preempt_enable_no_resched(); + local_irq_enable(); + preempt_check_resched(); + + return 0; +} +EXPORT_SYMBOL(__spin_trylock_irq); + +int __lockfunc __spin_trylock_irqsave(raw_spinlock_t *lock, + unsigned long *flags) +{ + local_irq_save(*flags); + preempt_disable(); + + if (_raw_spin_trylock(lock)) { + spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); + return 1; + } + + __preempt_enable_no_resched(); + local_irq_restore(*flags); + preempt_check_resched(); + + return 0; +} +EXPORT_SYMBOL(__spin_trylock_irqsave); + +int __lockfunc __read_trylock(raw_rwlock_t *lock) { preempt_disable(); if (_raw_read_trylock(lock)) { @@ -45,9 +82,9 @@ int __lockfunc _read_trylock(rwlock_t *l preempt_enable(); return 0; } -EXPORT_SYMBOL(_read_trylock); +EXPORT_SYMBOL(__read_trylock); -int __lockfunc _write_trylock(rwlock_t *lock) +int __lockfunc __write_trylock(raw_rwlock_t *lock) { preempt_disable(); if (_raw_write_trylock(lock)) { @@ -58,7 +95,21 @@ int __lockfunc _write_trylock(rwlock_t * preempt_enable(); return 0; } -EXPORT_SYMBOL(_write_trylock); +EXPORT_SYMBOL(__write_trylock); + +int __lockfunc __write_trylock_irqsave(raw_rwlock_t *lock, unsigned long *flags) +{ + int ret; + + local_irq_save(*flags); + ret = __write_trylock(lock); + if (ret) + return ret; + + local_irq_restore(*flags); + return 0; +} +EXPORT_SYMBOL(__write_trylock_irqsave); /* * If lockdep is enabled then we use the non-preemption spin-ops @@ -67,15 +118,15 @@ EXPORT_SYMBOL(_write_trylock); */ #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) -void __lockfunc _read_lock(rwlock_t *lock) +void __lockfunc __read_lock(raw_rwlock_t *lock) { preempt_disable(); rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); } -EXPORT_SYMBOL(_read_lock); +EXPORT_SYMBOL(__read_lock); -unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) +unsigned long __lockfunc __spin_lock_irqsave(raw_spinlock_t *lock) { unsigned long flags; @@ -94,27 +145,27 @@ unsigned long __lockfunc _spin_lock_irqs #endif return flags; } -EXPORT_SYMBOL(_spin_lock_irqsave); +EXPORT_SYMBOL(__spin_lock_irqsave); -void __lockfunc _spin_lock_irq(spinlock_t *lock) +void __lockfunc __spin_lock_irq(raw_spinlock_t *lock) { local_irq_disable(); preempt_disable(); spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); } -EXPORT_SYMBOL(_spin_lock_irq); +EXPORT_SYMBOL(__spin_lock_irq); -void __lockfunc _spin_lock_bh(spinlock_t *lock) +void __lockfunc __spin_lock_bh(raw_spinlock_t *lock) { local_bh_disable(); preempt_disable(); spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); } -EXPORT_SYMBOL(_spin_lock_bh); +EXPORT_SYMBOL(__spin_lock_bh); -unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) +unsigned long __lockfunc __read_lock_irqsave(raw_rwlock_t *lock) { unsigned long flags; @@ -124,27 +175,27 @@ unsigned long __lockfunc _read_lock_irqs LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); return flags; } -EXPORT_SYMBOL(_read_lock_irqsave); +EXPORT_SYMBOL(__read_lock_irqsave); -void __lockfunc _read_lock_irq(rwlock_t *lock) +void __lockfunc __read_lock_irq(raw_rwlock_t *lock) { local_irq_disable(); preempt_disable(); rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); } -EXPORT_SYMBOL(_read_lock_irq); +EXPORT_SYMBOL(__read_lock_irq); -void __lockfunc _read_lock_bh(rwlock_t *lock) +void __lockfunc __read_lock_bh(raw_rwlock_t *lock) { local_bh_disable(); preempt_disable(); rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); } -EXPORT_SYMBOL(_read_lock_bh); +EXPORT_SYMBOL(__read_lock_bh); -unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) +unsigned long __lockfunc __write_lock_irqsave(raw_rwlock_t *lock) { unsigned long flags; @@ -154,43 +205,43 @@ unsigned long __lockfunc _write_lock_irq LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); return flags; } -EXPORT_SYMBOL(_write_lock_irqsave); +EXPORT_SYMBOL(__write_lock_irqsave); -void __lockfunc _write_lock_irq(rwlock_t *lock) +void __lockfunc __write_lock_irq(raw_rwlock_t *lock) { local_irq_disable(); preempt_disable(); rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); } -EXPORT_SYMBOL(_write_lock_irq); +EXPORT_SYMBOL(__write_lock_irq); -void __lockfunc _write_lock_bh(rwlock_t *lock) +void __lockfunc __write_lock_bh(raw_rwlock_t *lock) { local_bh_disable(); preempt_disable(); rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); } -EXPORT_SYMBOL(_write_lock_bh); +EXPORT_SYMBOL(__write_lock_bh); -void __lockfunc _spin_lock(spinlock_t *lock) +void __lockfunc __spin_lock(raw_spinlock_t *lock) { preempt_disable(); spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); } -EXPORT_SYMBOL(_spin_lock); +EXPORT_SYMBOL(__spin_lock); -void __lockfunc _write_lock(rwlock_t *lock) +void __lockfunc __write_lock(raw_rwlock_t *lock) { preempt_disable(); rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); } -EXPORT_SYMBOL(_write_lock); +EXPORT_SYMBOL(__write_lock); #else /* CONFIG_PREEMPT: */ @@ -203,7 +254,7 @@ EXPORT_SYMBOL(_write_lock); */ #define BUILD_LOCK_OPS(op, locktype) \ -void __lockfunc _##op##_lock(locktype##_t *lock) \ +void __lockfunc __##op##_lock(locktype##_t *lock) \ { \ for (;;) { \ preempt_disable(); \ @@ -213,15 +264,16 @@ void __lockfunc _##op##_lock(locktype##_ \ if (!(lock)->break_lock) \ (lock)->break_lock = 1; \ - while (!op##_can_lock(lock) && (lock)->break_lock) \ - _raw_##op##_relax(&lock->raw_lock); \ + while (!__raw_##op##_can_lock(&(lock)->raw_lock) && \ + (lock)->break_lock) \ + __raw_##op##_relax(&lock->raw_lock); \ } \ (lock)->break_lock = 0; \ } \ \ -EXPORT_SYMBOL(_##op##_lock); \ +EXPORT_SYMBOL(__##op##_lock); \ \ -unsigned long __lockfunc _##op##_lock_irqsave(locktype##_t *lock) \ +unsigned long __lockfunc __##op##_lock_irqsave(locktype##_t *lock) \ { \ unsigned long flags; \ \ @@ -235,23 +287,24 @@ unsigned long __lockfunc _##op##_lock_ir \ if (!(lock)->break_lock) \ (lock)->break_lock = 1; \ - while (!op##_can_lock(lock) && (lock)->break_lock) \ - _raw_##op##_relax(&lock->raw_lock); \ + while (!__raw_##op##_can_lock(&(lock)->raw_lock) && \ + (lock)->break_lock) \ + __raw_##op##_relax(&lock->raw_lock); \ } \ (lock)->break_lock = 0; \ return flags; \ } \ \ -EXPORT_SYMBOL(_##op##_lock_irqsave); \ +EXPORT_SYMBOL(__##op##_lock_irqsave); \ \ -void __lockfunc _##op##_lock_irq(locktype##_t *lock) \ +void __lockfunc __##op##_lock_irq(locktype##_t *lock) \ { \ - _##op##_lock_irqsave(lock); \ + __##op##_lock_irqsave(lock); \ } \ \ -EXPORT_SYMBOL(_##op##_lock_irq); \ +EXPORT_SYMBOL(__##op##_lock_irq); \ \ -void __lockfunc _##op##_lock_bh(locktype##_t *lock) \ +void __lockfunc __##op##_lock_bh(locktype##_t *lock) \ { \ unsigned long flags; \ \ @@ -260,37 +313,46 @@ void __lockfunc _##op##_lock_bh(locktype /* irq-disabling. We use the generic preemption-aware */ \ /* function: */ \ /**/ \ - flags = _##op##_lock_irqsave(lock); \ + flags = __##op##_lock_irqsave(lock); \ local_bh_disable(); \ local_irq_restore(flags); \ } \ \ -EXPORT_SYMBOL(_##op##_lock_bh) +EXPORT_SYMBOL(__##op##_lock_bh) /* * Build preemption-friendly versions of the following * lock-spinning functions: * - * _[spin|read|write]_lock() - * _[spin|read|write]_lock_irq() - * _[spin|read|write]_lock_irqsave() - * _[spin|read|write]_lock_bh() + * __[spin|read|write]_lock() + * __[spin|read|write]_lock_irq() + * __[spin|read|write]_lock_irqsave() + * __[spin|read|write]_lock_bh() */ -BUILD_LOCK_OPS(spin, spinlock); -BUILD_LOCK_OPS(read, rwlock); -BUILD_LOCK_OPS(write, rwlock); +BUILD_LOCK_OPS(spin, raw_spinlock); +BUILD_LOCK_OPS(read, raw_rwlock); +BUILD_LOCK_OPS(write, raw_rwlock); #endif /* CONFIG_PREEMPT */ #ifdef CONFIG_DEBUG_LOCK_ALLOC -void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) +void __lockfunc __spin_lock_nested(raw_spinlock_t *lock, int subclass) { preempt_disable(); spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); } -EXPORT_SYMBOL(_spin_lock_nested); +EXPORT_SYMBOL(__spin_lock_nested); + +void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, + struct lockdep_map *nest_lock) +{ + preempt_disable(); + spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_); + LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); +} +EXPORT_SYMBOL(_spin_lock_nest_lock); unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass) { @@ -311,125 +373,130 @@ unsigned long __lockfunc _spin_lock_irqs #endif return flags; } -EXPORT_SYMBOL(_spin_lock_irqsave_nested); - -void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, - struct lockdep_map *nest_lock) -{ - preempt_disable(); - spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_); - LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); -} -EXPORT_SYMBOL(_spin_lock_nest_lock); +EXPORT_SYMBOL(__spin_lock_irqsave_nested); #endif -void __lockfunc _spin_unlock(spinlock_t *lock) +void __lockfunc __spin_unlock(raw_spinlock_t *lock) { spin_release(&lock->dep_map, 1, _RET_IP_); _raw_spin_unlock(lock); preempt_enable(); } -EXPORT_SYMBOL(_spin_unlock); +EXPORT_SYMBOL(__spin_unlock); -void __lockfunc _write_unlock(rwlock_t *lock) +void __lockfunc __spin_unlock_no_resched(raw_spinlock_t *lock) +{ + spin_release(&lock->dep_map, 1, _RET_IP_); + _raw_spin_unlock(lock); + __preempt_enable_no_resched(); +} +/* not exported */ + +void __lockfunc __write_unlock(raw_rwlock_t *lock) { rwlock_release(&lock->dep_map, 1, _RET_IP_); _raw_write_unlock(lock); preempt_enable(); } -EXPORT_SYMBOL(_write_unlock); +EXPORT_SYMBOL(__write_unlock); -void __lockfunc _read_unlock(rwlock_t *lock) +void __lockfunc __read_unlock(raw_rwlock_t *lock) { rwlock_release(&lock->dep_map, 1, _RET_IP_); _raw_read_unlock(lock); preempt_enable(); } -EXPORT_SYMBOL(_read_unlock); +EXPORT_SYMBOL(__read_unlock); -void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) +void __lockfunc __spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags) { spin_release(&lock->dep_map, 1, _RET_IP_); _raw_spin_unlock(lock); + __preempt_enable_no_resched(); local_irq_restore(flags); - preempt_enable(); + preempt_check_resched(); } -EXPORT_SYMBOL(_spin_unlock_irqrestore); +EXPORT_SYMBOL(__spin_unlock_irqrestore); -void __lockfunc _spin_unlock_irq(spinlock_t *lock) +void __lockfunc __spin_unlock_irq(raw_spinlock_t *lock) { spin_release(&lock->dep_map, 1, _RET_IP_); _raw_spin_unlock(lock); + __preempt_enable_no_resched(); local_irq_enable(); - preempt_enable(); + preempt_check_resched(); } -EXPORT_SYMBOL(_spin_unlock_irq); +EXPORT_SYMBOL(__spin_unlock_irq); -void __lockfunc _spin_unlock_bh(spinlock_t *lock) +void __lockfunc __spin_unlock_bh(raw_spinlock_t *lock) { spin_release(&lock->dep_map, 1, _RET_IP_); _raw_spin_unlock(lock); - preempt_enable_no_resched(); + __preempt_enable_no_resched(); local_bh_enable_ip((unsigned long)__builtin_return_address(0)); } -EXPORT_SYMBOL(_spin_unlock_bh); +EXPORT_SYMBOL(__spin_unlock_bh); -void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) +void __lockfunc __read_unlock_irqrestore(raw_rwlock_t *lock, unsigned long flags) { rwlock_release(&lock->dep_map, 1, _RET_IP_); _raw_read_unlock(lock); + __preempt_enable_no_resched(); local_irq_restore(flags); - preempt_enable(); + preempt_check_resched(); } -EXPORT_SYMBOL(_read_unlock_irqrestore); +EXPORT_SYMBOL(__read_unlock_irqrestore); -void __lockfunc _read_unlock_irq(rwlock_t *lock) +void __lockfunc __read_unlock_irq(raw_rwlock_t *lock) { rwlock_release(&lock->dep_map, 1, _RET_IP_); _raw_read_unlock(lock); + __preempt_enable_no_resched(); local_irq_enable(); - preempt_enable(); + preempt_check_resched(); } -EXPORT_SYMBOL(_read_unlock_irq); +EXPORT_SYMBOL(__read_unlock_irq); -void __lockfunc _read_unlock_bh(rwlock_t *lock) +void __lockfunc __read_unlock_bh(raw_rwlock_t *lock) { rwlock_release(&lock->dep_map, 1, _RET_IP_); _raw_read_unlock(lock); - preempt_enable_no_resched(); + __preempt_enable_no_resched(); local_bh_enable_ip((unsigned long)__builtin_return_address(0)); } -EXPORT_SYMBOL(_read_unlock_bh); +EXPORT_SYMBOL(__read_unlock_bh); -void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) +void __lockfunc __write_unlock_irqrestore(raw_rwlock_t *lock, unsigned long flags) { rwlock_release(&lock->dep_map, 1, _RET_IP_); _raw_write_unlock(lock); + __preempt_enable_no_resched(); local_irq_restore(flags); - preempt_enable(); + preempt_check_resched(); } -EXPORT_SYMBOL(_write_unlock_irqrestore); +EXPORT_SYMBOL(__write_unlock_irqrestore); -void __lockfunc _write_unlock_irq(rwlock_t *lock) +void __lockfunc __write_unlock_irq(raw_rwlock_t *lock) { rwlock_release(&lock->dep_map, 1, _RET_IP_); _raw_write_unlock(lock); + __preempt_enable_no_resched(); local_irq_enable(); - preempt_enable(); + preempt_check_resched(); } -EXPORT_SYMBOL(_write_unlock_irq); +EXPORT_SYMBOL(__write_unlock_irq); -void __lockfunc _write_unlock_bh(rwlock_t *lock) +void __lockfunc __write_unlock_bh(raw_rwlock_t *lock) { rwlock_release(&lock->dep_map, 1, _RET_IP_); _raw_write_unlock(lock); - preempt_enable_no_resched(); + __preempt_enable_no_resched(); local_bh_enable_ip((unsigned long)__builtin_return_address(0)); } -EXPORT_SYMBOL(_write_unlock_bh); +EXPORT_SYMBOL(__write_unlock_bh); -int __lockfunc _spin_trylock_bh(spinlock_t *lock) +int __lockfunc __spin_trylock_bh(raw_spinlock_t *lock) { local_bh_disable(); preempt_disable(); @@ -438,11 +505,11 @@ int __lockfunc _spin_trylock_bh(spinlock return 1; } - preempt_enable_no_resched(); + __preempt_enable_no_resched(); local_bh_enable_ip((unsigned long)__builtin_return_address(0)); return 0; } -EXPORT_SYMBOL(_spin_trylock_bh); +EXPORT_SYMBOL(__spin_trylock_bh); notrace int in_lock_functions(unsigned long addr) { @@ -450,6 +517,17 @@ notrace int in_lock_functions(unsigned l extern char __lock_text_start[], __lock_text_end[]; return addr >= (unsigned long)__lock_text_start - && addr < (unsigned long)__lock_text_end; + && addr < (unsigned long)__lock_text_end; } EXPORT_SYMBOL(in_lock_functions); + +void notrace __debug_atomic_dec_and_test(atomic_t *v) +{ + static int warn_once = 1; + + if (!atomic_read(v) && warn_once) { + warn_once = 0; + printk("BUG: atomic counter underflow!\n"); + WARN_ON(1); + } +} Index: linux-2.6-tip/lib/dec_and_lock.c =================================================================== --- linux-2.6-tip.orig/lib/dec_and_lock.c +++ linux-2.6-tip/lib/dec_and_lock.c @@ -17,7 +17,7 @@ * because the spin-lock and the decrement must be * "atomic". */ -int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) +int __atomic_dec_and_spin_lock(raw_spinlock_t *lock, atomic_t *atomic) { #ifdef CONFIG_SMP /* Subtract 1 from counter unless that drops it to 0 (ie. it was 1) */ @@ -32,4 +32,4 @@ int _atomic_dec_and_lock(atomic_t *atomi return 0; } -EXPORT_SYMBOL(_atomic_dec_and_lock); +EXPORT_SYMBOL(__atomic_dec_and_spin_lock); Index: linux-2.6-tip/lib/kernel_lock.c =================================================================== --- linux-2.6-tip.orig/lib/kernel_lock.c +++ linux-2.6-tip/lib/kernel_lock.c @@ -24,7 +24,7 @@ * * Don't use in new code. */ -static DECLARE_MUTEX(kernel_sem); +DECLARE_MUTEX(kernel_sem); /* * Re-acquire the kernel semaphore. @@ -44,7 +44,7 @@ int __lockfunc __reacquire_kernel_lock(v BUG_ON(saved_lock_depth < 0); task->lock_depth = -1; - preempt_enable_no_resched(); + __preempt_enable_no_resched(); down(&kernel_sem); Index: linux-2.6-tip/lib/locking-selftest.c =================================================================== --- linux-2.6-tip.orig/lib/locking-selftest.c +++ linux-2.6-tip/lib/locking-selftest.c @@ -940,6 +940,9 @@ static void dotest(void (*testcase_fn)(v { unsigned long saved_preempt_count = preempt_count(); int expected_failure = 0; +#if defined(CONFIG_DEBUG_PREEMPT) && defined(CONFIG_DEBUG_RT_MUTEXES) + int saved_lock_count = current->lock_count; +#endif WARN_ON(irqs_disabled()); @@ -989,6 +992,9 @@ static void dotest(void (*testcase_fn)(v #endif reset_locks(); +#if defined(CONFIG_DEBUG_PREEMPT) && defined(CONFIG_DEBUG_RT_MUTEXES) + current->lock_count = saved_lock_count; +#endif } static inline void print_testname(const char *testname) Index: linux-2.6-tip/lib/plist.c =================================================================== --- linux-2.6-tip.orig/lib/plist.c +++ linux-2.6-tip/lib/plist.c @@ -54,7 +54,9 @@ static void plist_check_list(struct list static void plist_check_head(struct plist_head *head) { +#ifndef CONFIG_PREEMPT_RT WARN_ON(!head->lock); +#endif if (head->lock) WARN_ON_SMP(!spin_is_locked(head->lock)); plist_check_list(&head->prio_list); Index: linux-2.6-tip/lib/rwsem-spinlock.c =================================================================== --- linux-2.6-tip.orig/lib/rwsem-spinlock.c +++ linux-2.6-tip/lib/rwsem-spinlock.c @@ -20,7 +20,7 @@ struct rwsem_waiter { /* * initialise the semaphore */ -void __init_rwsem(struct rw_semaphore *sem, const char *name, +void __compat_init_rwsem(struct compat_rw_semaphore *sem, const char *name, struct lock_class_key *key) { #ifdef CONFIG_DEBUG_LOCK_ALLOC @@ -44,8 +44,8 @@ void __init_rwsem(struct rw_semaphore *s * - woken process blocks are discarded from the list after having task zeroed * - writers are only woken if wakewrite is non-zero */ -static inline struct rw_semaphore * -__rwsem_do_wake(struct rw_semaphore *sem, int wakewrite) +static inline struct compat_rw_semaphore * +__rwsem_do_wake(struct compat_rw_semaphore *sem, int wakewrite) { struct rwsem_waiter *waiter; struct task_struct *tsk; @@ -103,8 +103,8 @@ __rwsem_do_wake(struct rw_semaphore *sem /* * wake a single writer */ -static inline struct rw_semaphore * -__rwsem_wake_one_writer(struct rw_semaphore *sem) +static inline struct compat_rw_semaphore * +__rwsem_wake_one_writer(struct compat_rw_semaphore *sem) { struct rwsem_waiter *waiter; struct task_struct *tsk; @@ -125,7 +125,7 @@ __rwsem_wake_one_writer(struct rw_semaph /* * get a read lock on the semaphore */ -void __sched __down_read(struct rw_semaphore *sem) +void __sched __down_read(struct compat_rw_semaphore *sem) { struct rwsem_waiter waiter; struct task_struct *tsk; @@ -168,7 +168,7 @@ void __sched __down_read(struct rw_semap /* * trylock for reading -- returns 1 if successful, 0 if contention */ -int __down_read_trylock(struct rw_semaphore *sem) +int __down_read_trylock(struct compat_rw_semaphore *sem) { unsigned long flags; int ret = 0; @@ -191,7 +191,8 @@ int __down_read_trylock(struct rw_semaph * get a write lock on the semaphore * - we increment the waiting count anyway to indicate an exclusive lock */ -void __sched __down_write_nested(struct rw_semaphore *sem, int subclass) +void __sched +__down_write_nested(struct compat_rw_semaphore *sem, int subclass) { struct rwsem_waiter waiter; struct task_struct *tsk; @@ -231,7 +232,7 @@ void __sched __down_write_nested(struct ; } -void __sched __down_write(struct rw_semaphore *sem) +void __sched __down_write(struct compat_rw_semaphore *sem) { __down_write_nested(sem, 0); } @@ -239,7 +240,7 @@ void __sched __down_write(struct rw_sema /* * trylock for writing -- returns 1 if successful, 0 if contention */ -int __down_write_trylock(struct rw_semaphore *sem) +int __down_write_trylock(struct compat_rw_semaphore *sem) { unsigned long flags; int ret = 0; @@ -260,7 +261,7 @@ int __down_write_trylock(struct rw_semap /* * release a read lock on the semaphore */ -void __up_read(struct rw_semaphore *sem) +void __up_read(struct compat_rw_semaphore *sem) { unsigned long flags; @@ -275,7 +276,7 @@ void __up_read(struct rw_semaphore *sem) /* * release a write lock on the semaphore */ -void __up_write(struct rw_semaphore *sem) +void __up_write(struct compat_rw_semaphore *sem) { unsigned long flags; @@ -292,7 +293,7 @@ void __up_write(struct rw_semaphore *sem * downgrade a write lock into a read lock * - just wake up any readers at the front of the queue */ -void __downgrade_write(struct rw_semaphore *sem) +void __downgrade_write(struct compat_rw_semaphore *sem) { unsigned long flags; @@ -305,7 +306,7 @@ void __downgrade_write(struct rw_semapho spin_unlock_irqrestore(&sem->wait_lock, flags); } -EXPORT_SYMBOL(__init_rwsem); +EXPORT_SYMBOL(__compat_init_rwsem); EXPORT_SYMBOL(__down_read); EXPORT_SYMBOL(__down_read_trylock); EXPORT_SYMBOL(__down_write_nested); Index: linux-2.6-tip/lib/rwsem.c =================================================================== --- linux-2.6-tip.orig/lib/rwsem.c +++ linux-2.6-tip/lib/rwsem.c @@ -11,8 +11,8 @@ /* * Initialize an rwsem: */ -void __init_rwsem(struct rw_semaphore *sem, const char *name, - struct lock_class_key *key) +void __compat_init_rwsem(struct rw_semaphore *sem, const char *name, + struct lock_class_key *key) { #ifdef CONFIG_DEBUG_LOCK_ALLOC /* @@ -26,7 +26,7 @@ void __init_rwsem(struct rw_semaphore *s INIT_LIST_HEAD(&sem->wait_list); } -EXPORT_SYMBOL(__init_rwsem); +EXPORT_SYMBOL(__compat_init_rwsem); struct rwsem_waiter { struct list_head list; Index: linux-2.6-tip/lib/spinlock_debug.c =================================================================== --- linux-2.6-tip.orig/lib/spinlock_debug.c +++ linux-2.6-tip/lib/spinlock_debug.c @@ -13,8 +13,8 @@ #include #include -void __spin_lock_init(spinlock_t *lock, const char *name, - struct lock_class_key *key) +void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, + struct lock_class_key *key) { #ifdef CONFIG_DEBUG_LOCK_ALLOC /* @@ -23,16 +23,16 @@ void __spin_lock_init(spinlock_t *lock, debug_check_no_locks_freed((void *)lock, sizeof(*lock)); lockdep_init_map(&lock->dep_map, name, key, 0); #endif - lock->raw_lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; + lock->raw_lock = (__raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; lock->magic = SPINLOCK_MAGIC; lock->owner = SPINLOCK_OWNER_INIT; lock->owner_cpu = -1; } -EXPORT_SYMBOL(__spin_lock_init); +EXPORT_SYMBOL(__raw_spin_lock_init); -void __rwlock_init(rwlock_t *lock, const char *name, - struct lock_class_key *key) +void __raw_rwlock_init(raw_rwlock_t *lock, const char *name, + struct lock_class_key *key) { #ifdef CONFIG_DEBUG_LOCK_ALLOC /* @@ -41,15 +41,15 @@ void __rwlock_init(rwlock_t *lock, const debug_check_no_locks_freed((void *)lock, sizeof(*lock)); lockdep_init_map(&lock->dep_map, name, key, 0); #endif - lock->raw_lock = (raw_rwlock_t) __RAW_RW_LOCK_UNLOCKED; + lock->raw_lock = (__raw_rwlock_t) __RAW_RW_LOCK_UNLOCKED; lock->magic = RWLOCK_MAGIC; lock->owner = SPINLOCK_OWNER_INIT; lock->owner_cpu = -1; } -EXPORT_SYMBOL(__rwlock_init); +EXPORT_SYMBOL(__raw_rwlock_init); -static void spin_bug(spinlock_t *lock, const char *msg) +static void spin_bug(raw_spinlock_t *lock, const char *msg) { struct task_struct *owner = NULL; @@ -73,7 +73,7 @@ static void spin_bug(spinlock_t *lock, c #define SPIN_BUG_ON(cond, lock, msg) if (unlikely(cond)) spin_bug(lock, msg) static inline void -debug_spin_lock_before(spinlock_t *lock) +debug_spin_lock_before(raw_spinlock_t *lock) { SPIN_BUG_ON(lock->magic != SPINLOCK_MAGIC, lock, "bad magic"); SPIN_BUG_ON(lock->owner == current, lock, "recursion"); @@ -81,13 +81,13 @@ debug_spin_lock_before(spinlock_t *lock) lock, "cpu recursion"); } -static inline void debug_spin_lock_after(spinlock_t *lock) +static inline void debug_spin_lock_after(raw_spinlock_t *lock) { lock->owner_cpu = raw_smp_processor_id(); lock->owner = current; } -static inline void debug_spin_unlock(spinlock_t *lock) +static inline void debug_spin_unlock(raw_spinlock_t *lock) { SPIN_BUG_ON(lock->magic != SPINLOCK_MAGIC, lock, "bad magic"); SPIN_BUG_ON(!spin_is_locked(lock), lock, "already unlocked"); @@ -98,7 +98,7 @@ static inline void debug_spin_unlock(spi lock->owner_cpu = -1; } -static void __spin_lock_debug(spinlock_t *lock) +static void __spin_lock_debug(raw_spinlock_t *lock) { u64 i; u64 loops = loops_per_jiffy * HZ; @@ -125,7 +125,7 @@ static void __spin_lock_debug(spinlock_t } } -void _raw_spin_lock(spinlock_t *lock) +void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) { debug_spin_lock_before(lock); if (unlikely(!__raw_spin_trylock(&lock->raw_lock))) @@ -133,7 +133,7 @@ void _raw_spin_lock(spinlock_t *lock) debug_spin_lock_after(lock); } -int _raw_spin_trylock(spinlock_t *lock) +int __lockfunc _raw_spin_trylock(raw_spinlock_t *lock) { int ret = __raw_spin_trylock(&lock->raw_lock); @@ -148,13 +148,13 @@ int _raw_spin_trylock(spinlock_t *lock) return ret; } -void _raw_spin_unlock(spinlock_t *lock) +void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock) { debug_spin_unlock(lock); __raw_spin_unlock(&lock->raw_lock); } -static void rwlock_bug(rwlock_t *lock, const char *msg) +static void rwlock_bug(raw_rwlock_t *lock, const char *msg) { if (!debug_locks_off()) return; @@ -167,8 +167,8 @@ static void rwlock_bug(rwlock_t *lock, c #define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg) -#if 0 /* __write_lock_debug() can lock up - maybe this can too? */ -static void __read_lock_debug(rwlock_t *lock) +#if 1 /* __write_lock_debug() can lock up - maybe this can too? */ +static void __raw_read_lock_debug(raw_rwlock_t *lock) { u64 i; u64 loops = loops_per_jiffy * HZ; @@ -193,13 +193,13 @@ static void __read_lock_debug(rwlock_t * } #endif -void _raw_read_lock(rwlock_t *lock) +void __lockfunc _raw_read_lock(raw_rwlock_t *lock) { RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic"); - __raw_read_lock(&lock->raw_lock); + __raw_read_lock_debug(lock); } -int _raw_read_trylock(rwlock_t *lock) +int __lockfunc _raw_read_trylock(raw_rwlock_t *lock) { int ret = __raw_read_trylock(&lock->raw_lock); @@ -212,13 +212,13 @@ int _raw_read_trylock(rwlock_t *lock) return ret; } -void _raw_read_unlock(rwlock_t *lock) +void __lockfunc _raw_read_unlock(raw_rwlock_t *lock) { RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic"); __raw_read_unlock(&lock->raw_lock); } -static inline void debug_write_lock_before(rwlock_t *lock) +static inline void debug_write_lock_before(raw_rwlock_t *lock) { RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic"); RWLOCK_BUG_ON(lock->owner == current, lock, "recursion"); @@ -226,13 +226,13 @@ static inline void debug_write_lock_befo lock, "cpu recursion"); } -static inline void debug_write_lock_after(rwlock_t *lock) +static inline void debug_write_lock_after(raw_rwlock_t *lock) { lock->owner_cpu = raw_smp_processor_id(); lock->owner = current; } -static inline void debug_write_unlock(rwlock_t *lock) +static inline void debug_write_unlock(raw_rwlock_t *lock) { RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic"); RWLOCK_BUG_ON(lock->owner != current, lock, "wrong owner"); @@ -242,8 +242,8 @@ static inline void debug_write_unlock(rw lock->owner_cpu = -1; } -#if 0 /* This can cause lockups */ -static void __write_lock_debug(rwlock_t *lock) +#if 1 /* This can cause lockups */ +static void __raw_write_lock_debug(raw_rwlock_t *lock) { u64 i; u64 loops = loops_per_jiffy * HZ; @@ -268,14 +268,14 @@ static void __write_lock_debug(rwlock_t } #endif -void _raw_write_lock(rwlock_t *lock) +void __lockfunc _raw_write_lock(raw_rwlock_t *lock) { debug_write_lock_before(lock); - __raw_write_lock(&lock->raw_lock); + __raw_write_lock_debug(lock); debug_write_lock_after(lock); } -int _raw_write_trylock(rwlock_t *lock) +int __lockfunc _raw_write_trylock(raw_rwlock_t *lock) { int ret = __raw_write_trylock(&lock->raw_lock); @@ -290,7 +290,7 @@ int _raw_write_trylock(rwlock_t *lock) return ret; } -void _raw_write_unlock(rwlock_t *lock) +void __lockfunc _raw_write_unlock(raw_rwlock_t *lock) { debug_write_unlock(lock); __raw_write_unlock(&lock->raw_lock); patches/preempt-realtime-sched-i386.patch0000664000076400007640000000400111160752235017302 0ustar tglxtglxSubject: preempt: realtime sched i386 From: Ingo Molnar Date: Wed Feb 04 00:02:55 CET 2009 Signed-off-by: Ingo Molnar --- arch/x86/kernel/entry_32.S | 11 +++++++---- arch/x86/kernel/process_32.c | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) Index: linux-2.6-tip/arch/x86/kernel/entry_32.S =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/entry_32.S +++ linux-2.6-tip/arch/x86/kernel/entry_32.S @@ -371,14 +371,18 @@ END(ret_from_exception) #ifdef CONFIG_PREEMPT ENTRY(resume_kernel) DISABLE_INTERRUPTS(CLBR_ANY) + cmpl $0, kernel_preemption + jz restore_nocheck cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ? jnz restore_nocheck need_resched: movl TI_flags(%ebp), %ecx # need_resched set ? testb $_TIF_NEED_RESCHED, %cl - jz restore_all + jz restore_nocheck testl $X86_EFLAGS_IF,PT_EFLAGS(%esp) # interrupts off (exception path) ? - jz restore_all + jz restore_nocheck + DISABLE_INTERRUPTS(CLBR_ANY) + call preempt_schedule_irq jmp need_resched END(resume_kernel) @@ -616,12 +620,11 @@ work_pending: testl $(_TIF_NEED_RESCHED), %ecx jz work_notifysig work_resched: - call schedule + call __schedule LOCKDEP_SYS_EXIT DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt # setting need_resched or sigpending # between sampling and the iret - TRACE_IRQS_OFF movl TI_flags(%ebp), %ecx andl $_TIF_WORK_MASK, %ecx # is there any work to be done other # than syscall tracing? Index: linux-2.6-tip/arch/x86/kernel/process_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/process_32.c +++ linux-2.6-tip/arch/x86/kernel/process_32.c @@ -119,10 +119,12 @@ void cpu_idle(void) pm_idle(); start_critical_timings(); } + local_irq_disable(); tick_nohz_restart_sched_tick(); __preempt_enable_no_resched(); - schedule(); + __schedule(); preempt_disable(); + local_irq_enable(); } } patches/printk-tick-move-to-softirq-on-rt.patch0000664000076400007640000000155711160752235020635 0ustar tglxtglxSubject: printk-tick-move-to-softirq-on-rt.patch From: Thomas Gleixner Date: Thu, 05 Feb 2009 09:42:22 +0100 Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- kernel/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/kernel/timer.c =================================================================== --- linux-2.6-tip.orig/kernel/timer.c +++ linux-2.6-tip/kernel/timer.c @@ -1180,7 +1180,6 @@ void update_process_times(int user_tick) run_local_timers(); if (rcu_pending(cpu)) rcu_check_callbacks(cpu, user_tick); - printk_tick(); run_posix_cpu_timers(p); } @@ -1348,6 +1347,7 @@ static void run_timer_softirq(struct sof { struct tvec_base *base = per_cpu(tvec_bases, raw_smp_processor_id()); + printk_tick(); update_times(); hrtimer_run_pending(); patches/x86-64-tscless-vgettimeofday.patch0000664000076400007640000000246511160752235017466 0ustar tglxtglxSubject: x86_64 GTOD: offer scalable vgettimeofday From: Ingo Molnar offer scalable vgettimeofday independently of whether the TSC is synchronous or not. Off by default. this patch also fixes an SMP bug in sys_vtime(): we should read __vsyscall_gtod_data.wall_time_tv.tv_sec only once. Signed-off-by: Ingo Molnar --- arch/x86/kernel/vsyscall_64.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) Index: linux-2.6-tip/arch/x86/kernel/vsyscall_64.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/vsyscall_64.c +++ linux-2.6-tip/arch/x86/kernel/vsyscall_64.c @@ -123,6 +123,25 @@ static __always_inline void do_vgettimeo unsigned seq; unsigned long mult, shift, nsec; cycle_t (*vread)(void); + + if (likely(__vsyscall_gtod_data.sysctl_enabled == 2)) { + struct timeval tmp; + + do { + barrier(); + tv->tv_sec = __vsyscall_gtod_data.wall_time_sec; + tv->tv_usec = __vsyscall_gtod_data.wall_time_nsec; + barrier(); + tmp.tv_sec = __vsyscall_gtod_data.wall_time_sec; + tmp.tv_usec = __vsyscall_gtod_data.wall_time_nsec; + + } while (tmp.tv_usec != tv->tv_usec || + tmp.tv_sec != tv->tv_sec); + + tv->tv_usec /= NSEC_PER_USEC; + return; + } + do { seq = read_seqbegin(&__vsyscall_gtod_data.lock); patches/lockdep-atomic-fixup.patch0000664000076400007640000000143111160752235016303 0ustar tglxtglxSubject: lockdep: atomic fixup From: Ingo Molnar Date: Wed Feb 04 00:01:59 CET 2009 Signed-off-by: Ingo Molnar --- lib/locking-selftest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/lib/locking-selftest.c =================================================================== --- linux-2.6-tip.orig/lib/locking-selftest.c +++ linux-2.6-tip/lib/locking-selftest.c @@ -948,7 +948,7 @@ static void dotest(void (*testcase_fn)(v unsigned long saved_preempt_count = preempt_count(); int expected_failure = 0; #if defined(CONFIG_DEBUG_PREEMPT) && defined(CONFIG_DEBUG_RT_MUTEXES) - int saved_lock_count = current->lock_count; + atomic_t saved_lock_count = current->lock_count; #endif WARN_ON(irqs_disabled()); patches/trace-disable-hw-branch-tracer.patch0000664000076400007640000000115311160752235020104 0ustar tglxtglxSubject: trace-disable-hw-branch-tracer.patch From: Thomas Gleixner Date: Tue, 17 Mar 2009 17:33:05 +0100 Signed-off-by: Thomas Gleixner --- kernel/trace/Kconfig | 1 + 1 file changed, 1 insertion(+) Index: linux-2.6-tip/kernel/trace/Kconfig =================================================================== --- linux-2.6-tip.orig/kernel/trace/Kconfig +++ linux-2.6-tip/kernel/trace/Kconfig @@ -291,6 +291,7 @@ config STACK_TRACER config HW_BRANCH_TRACER depends on HAVE_HW_BRANCH_TRACER + depends on !PREEMPT_RT bool "Trace hw branches" select TRACING help patches/rt-mutex-core-fixes.patch0000664000076400007640000000434311161723467016121 0ustar tglxtglxSubject: rt: mutex core fixes From: Ingo Molnar Date: Wed Feb 04 02:20:51 CET 2009 Signed-off-by: Ingo Molnar --- arch/x86/include/asm/rwsem.h | 2 +- include/linux/irqflags.h | 3 +++ include/linux/spinlock.h | 3 +++ kernel/sched.c | 6 ------ 4 files changed, 7 insertions(+), 7 deletions(-) Index: linux-2.6-tip/arch/x86/include/asm/rwsem.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/rwsem.h +++ linux-2.6-tip/arch/x86/include/asm/rwsem.h @@ -257,7 +257,7 @@ static inline int rwsem_atomic_update(in return tmp + delta; } -static inline int rwsem_is_locked(struct compat_rw_semaphore *sem) +static inline int compat_rwsem_is_locked(struct compat_rw_semaphore *sem) { return (sem->count != 0); } Index: linux-2.6-tip/include/linux/irqflags.h =================================================================== --- linux-2.6-tip.orig/include/linux/irqflags.h +++ linux-2.6-tip/include/linux/irqflags.h @@ -13,6 +13,9 @@ #include +/* dummy wrapper for now: */ +#define BUILD_CHECK_IRQ_FLAGS(flags) + #ifdef CONFIG_TRACE_IRQFLAGS extern void trace_softirqs_on(unsigned long ip); extern void trace_softirqs_off(unsigned long ip); Index: linux-2.6-tip/include/linux/spinlock.h =================================================================== --- linux-2.6-tip.orig/include/linux/spinlock.h +++ linux-2.6-tip/include/linux/spinlock.h @@ -613,4 +613,7 @@ static inline int bit_spin_is_locked(int __cond_lock(lock, PICK_SPIN_OP_RET(__spin_can_lock, _spin_can_lock,\ lock)) +/* FIXME: porting hack! */ +#define spin_lock_nest_lock(lock, nest_lock) spin_lock_nested(lock, 0) + #endif /* __LINUX_SPINLOCK_H */ Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -5144,12 +5144,6 @@ void complete_all(struct completion *x) } EXPORT_SYMBOL(complete_all); -unsigned int completion_done(struct completion *x) -{ - return x->done; -} -EXPORT_SYMBOL(completion_done); - static inline long __sched do_wait_for_common(struct completion *x, long timeout, int state) { patches/rt-mutex-fix-non-lock-kernel-config.patch0000664000076400007640000000167011160752235021074 0ustar tglxtglxSubject: rt: mingo kernel_sem fix From: Ingo Molnar Date: Sun Feb 08 19:33:10 CET 2009 Signed-off-by: Ingo Molnar --- kernel/rtmutex.c | 4 ++++ 1 file changed, 4 insertions(+) Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -889,6 +889,7 @@ static inline int rt_release_bkl(struct { int saved_lock_depth = current->lock_depth; +#ifdef CONFIG_LOCK_KERNEL current->lock_depth = -1; /* * try_to_take_lock set the waiters, make sure it's @@ -900,14 +901,17 @@ static inline int rt_release_bkl(struct up(&kernel_sem); spin_lock_irq(&lock->wait_lock); +#endif return saved_lock_depth; } static inline void rt_reacquire_bkl(int saved_lock_depth) { +#ifdef CONFIG_LOCK_KERNEL down(&kernel_sem); current->lock_depth = saved_lock_depth; +#endif } /* patches/adaptive-optimize-rt-lock-wakeup.patch0000664000076400007640000000571711160752235020570 0ustar tglxtglxSubject: optimize rt lock wakeup From: Gregory Haskins Date: Tue, 20 May 2008 10:49:15 -0400 [ The following text is in the "utf-8" character set. ] [ Your display is set for the "iso-8859-1" character set. ] [ Some characters may be displayed incorrectly. ] It is redundant to wake the grantee task if it is already running, and the call to wake_up_process is relatively expensive. If we can safely skip it we can measurably improve the performance of the adaptive-locks. Credit goes to Peter Morreale for the general idea. Signed-off-by: Gregory Haskins Signed-off-by: Peter Morreale Signed-off-by: Ingo Molnar --- kernel/rtmutex.c | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -522,6 +522,41 @@ static void wakeup_next_waiter(struct rt pendowner = waiter->task; waiter->task = NULL; + /* + * Do the wakeup before the ownership change to give any spinning + * waiter grantees a headstart over the other threads that will + * trigger once owner changes. + */ + if (!savestate) + wake_up_process(pendowner); + else { + /* + * We can skip the actual (expensive) wakeup if the + * waiter is already running, but we have to be careful + * of race conditions because they may be about to sleep. + * + * The waiter-side protocol has the following pattern: + * 1: Set state != RUNNING + * 2: Conditionally sleep if waiter->task != NULL; + * + * And the owner-side has the following: + * A: Set waiter->task = NULL + * B: Conditionally wake if the state != RUNNING + * + * As long as we ensure 1->2 order, and A->B order, we + * will never miss a wakeup. + * + * Therefore, this barrier ensures that waiter->task = NULL + * is visible before we test the pendowner->state. The + * corresponding barrier is in the sleep logic. + */ + smp_mb(); + + /* If !RUNNING && !RUNNING_MUTEX */ + if (pendowner->state & ~TASK_RUNNING_MUTEX) + wake_up_process_mutex(pendowner); + } + rt_mutex_set_owner(lock, pendowner, RT_MUTEX_OWNER_PENDING); spin_unlock(¤t->pi_lock); @@ -548,11 +583,6 @@ static void wakeup_next_waiter(struct rt plist_add(&next->pi_list_entry, &pendowner->pi_waiters); } spin_unlock(&pendowner->pi_lock); - - if (savestate) - wake_up_process_mutex(pendowner); - else - wake_up_process(pendowner); } /* @@ -803,6 +833,11 @@ rt_spin_lock_slowlock(struct rt_mutex *l if (adaptive_wait(&waiter, orig_owner)) { update_current(TASK_UNINTERRUPTIBLE, &saved_state); + /* + * The xchg() in update_current() is an implicit + * barrier which we rely upon to ensure current->state + * is visible before we test waiter.task. + */ if (waiter.task) schedule_rt_mutex(lock); } patches/netpoll-8139too-fix.patch0000664000076400007640000000141111160752235015642 0ustar tglxtglxSubject: netpoll: 8139too fix From: Ingo Molnar Date: Wed Feb 04 00:03:14 CET 2009 Signed-off-by: Ingo Molnar --- drivers/net/8139too.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Index: linux-2.6-tip/drivers/net/8139too.c =================================================================== --- linux-2.6-tip.orig/drivers/net/8139too.c +++ linux-2.6-tip/drivers/net/8139too.c @@ -2209,7 +2209,11 @@ static irqreturn_t rtl8139_interrupt (in */ static void rtl8139_poll_controller(struct net_device *dev) { - disable_irq(dev->irq); + /* + * use _nosync() variant - might be used by netconsole + * from atomic contexts: + */ + disable_irq_nosync(dev->irq); rtl8139_interrupt(dev->irq, dev); enable_irq(dev->irq); } patches/seqlock-serialize-against-writers.patch0000664000076400007640000001466011160752235021036 0ustar tglxtglxSubject: seqlock: serialize against writers From: Gregory Haskins Date: Tue, 02 Sep 2008 09:29:18 -0400 [ The following text is in the "utf-8" character set. ] [ Your display is set for the "ANSI_X3.4-1968" character set. ] [ Some characters may be displayed incorrectly. ] [ here is the updated prologue rebased against the proper tree (26.3-rt3) ] -------------------------- seqlock: serialize against writers There are currently several problems in -rt w.r.t. seqlock objects. RT moves mainline seqlock_t to "raw_seqlock_t", and creates a new seqlock_t object that is fully preemptible. Being preemptible is a great step towards deterministic behavior, but there are a few areas that need additional measures to protect new vulnerabilities created by the preemptible code. For the purposes of demonstration, consider three tasks of different priority: A, B, and C. A is the logically highest, and C is the lowest. A is trying to acquire a seqlock read critical section, while C is involved in write locks. Problem 1) If A spins in seqbegin due to writer contention retries, it may prevent C from running even if C currently holds the write lock. This is a deadlock. Problem 2) B may preempt C, preventing it from releasing the write critical section. In this case, A becomes inverted behind B. Problem 3) Lower priority tasks such as C may continually acquire the write section which subsequently causes A to continually retry and thus fail to make forward progress. Since C is lower priority it ideally should not cause delays in A. E.g. C should block if A is in a read-lock and C is <= A. This patch addresses Problems 1 & 2, and leaves 3 for a later time. This patch changes the internal seqlock_t implementation to substitute a rwlock for the basic spinlock previously used, and forces the readers to serialize with the writers under contention. Blocking on the read_lock simultaneously sleeps A (preventing problem 1), while boosting C to A's priority (preventing problem 2). Non reader-to-writer contended acquisitions, which are the predominant mode, remain free of atomic operations. Therefore the fast path should not be perturbed by this change. This fixes a real-world deadlock discovered under testing where all high priority readers were hogging the cpus and preventing a writer from releasing the lock (i.e. problem 1). Signed-off-by: Gregory Haskins Signed-off-by: Ingo Molnar --- include/linux/seqlock.h | 51 +++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) Index: linux-2.6-tip/include/linux/seqlock.h =================================================================== --- linux-2.6-tip.orig/include/linux/seqlock.h +++ linux-2.6-tip/include/linux/seqlock.h @@ -3,9 +3,11 @@ /* * Reader/writer consistent mechanism without starving writers. This type of * lock for data where the reader wants a consistent set of information - * and is willing to retry if the information changes. Readers never - * block but they may have to retry if a writer is in - * progress. Writers do not wait for readers. + * and is willing to retry if the information changes. Readers block + * on write contention (and where applicable, pi-boost the writer). + * Readers without contention on entry acquire the critical section + * without any atomic operations, but they may have to retry if a writer + * enters before the critical section ends. Writers do not wait for readers. * * This is not as cache friendly as brlock. Also, this will not work * for data that contains pointers, because any writer could @@ -24,6 +26,8 @@ * * Based on x86_64 vsyscall gettimeofday * by Keith Owens and Andrea Arcangeli + * + * Priority inheritance and live-lock avoidance by Gregory Haskins */ #include @@ -31,7 +35,7 @@ typedef struct { unsigned sequence; - spinlock_t lock; + rwlock_t lock; } __seqlock_t; typedef struct { @@ -57,7 +61,7 @@ typedef __raw_seqlock_t raw_seqlock_t; { 0, RAW_SPIN_LOCK_UNLOCKED(lockname) } #ifdef CONFIG_PREEMPT_RT -# define __SEQLOCK_UNLOCKED(lockname) { 0, __SPIN_LOCK_UNLOCKED(lockname) } +# define __SEQLOCK_UNLOCKED(lockname) { 0, __RW_LOCK_UNLOCKED(lockname) } #else # define __SEQLOCK_UNLOCKED(lockname) __RAW_SEQLOCK_UNLOCKED(lockname) #endif @@ -69,7 +73,7 @@ typedef __raw_seqlock_t raw_seqlock_t; do { *(x) = (raw_seqlock_t) __RAW_SEQLOCK_UNLOCKED(x); spin_lock_init(&(x)->lock); } while (0) #define seqlock_init(x) \ - do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); spin_lock_init(&(x)->lock); } while (0) + do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); rwlock_init(&(x)->lock); } while (0) #define DEFINE_SEQLOCK(x) \ seqlock_t x = __SEQLOCK_UNLOCKED(x) @@ -85,7 +89,7 @@ typedef __raw_seqlock_t raw_seqlock_t; */ static inline void __write_seqlock(seqlock_t *sl) { - spin_lock(&sl->lock); + write_lock(&sl->lock); ++sl->sequence; smp_wmb(); } @@ -103,14 +107,14 @@ static inline void __write_sequnlock(seq { smp_wmb(); sl->sequence++; - spin_unlock(&sl->lock); + write_unlock(&sl->lock); } #define __write_sequnlock_irqrestore(sl, flags) __write_sequnlock(sl) static inline int __write_tryseqlock(seqlock_t *sl) { - int ret = spin_trylock(&sl->lock); + int ret = write_trylock(&sl->lock); if (ret) { ++sl->sequence; @@ -120,18 +124,25 @@ static inline int __write_tryseqlock(seq } /* Start of read calculation -- fetch last complete writer token */ -static __always_inline unsigned __read_seqbegin(const seqlock_t *sl) +static __always_inline unsigned __read_seqbegin(seqlock_t *sl) { unsigned ret; -repeat: ret = sl->sequence; smp_rmb(); if (unlikely(ret & 1)) { - cpu_relax(); - goto repeat; + /* + * Serialze with the writer which will ensure they are + * pi-boosted if necessary and prevent us from starving + * them. + */ + read_lock(&sl->lock); + ret = sl->sequence; + read_unlock(&sl->lock); } + BUG_ON(ret & 1); + return ret; } @@ -142,20 +153,8 @@ repeat: */ static inline int __read_seqretry(seqlock_t *sl, unsigned iv) { - int ret; - smp_rmb(); - ret = (sl->sequence != iv); - /* - * If invalid then serialize with the writer, to make sure we - * are not livelocking it: - */ - if (unlikely(ret)) { - unsigned long flags; - spin_lock_irqsave(&sl->lock, flags); - spin_unlock_irqrestore(&sl->lock, flags); - } - return ret; + return (sl->sequence != iv); } static __always_inline void __write_seqlock_raw(raw_seqlock_t *sl) patches/proportions-raw-locks.patch0000664000076400007640000000214711160752235016562 0ustar tglxtglxSubject: proportions: raw locks From: Ingo Molnar Date: Wed Feb 04 00:02:18 CET 2009 Signed-off-by: Ingo Molnar --- include/linux/proportions.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: linux-2.6-tip/include/linux/proportions.h =================================================================== --- linux-2.6-tip.orig/include/linux/proportions.h +++ linux-2.6-tip/include/linux/proportions.h @@ -58,7 +58,7 @@ struct prop_local_percpu { */ int shift; unsigned long period; - spinlock_t lock; /* protect the snapshot state */ + raw_spinlock_t lock; /* protect the snapshot state */ }; int prop_local_init_percpu(struct prop_local_percpu *pl); @@ -106,11 +106,11 @@ struct prop_local_single { */ unsigned long period; int shift; - spinlock_t lock; /* protect the snapshot state */ + raw_spinlock_t lock; /* protect the snapshot state */ }; #define INIT_PROP_LOCAL_SINGLE(name) \ -{ .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ +{ .lock = RAW_SPIN_LOCK_UNLOCKED(name.lock), \ } int prop_local_init_single(struct prop_local_single *pl); patches/fix-config-debug-rt-mutex-lock-underflow-warnings.patch0000664000076400007640000001033011161723437023737 0ustar tglxtglxSubject: Fix CONFIG_DEBUG_RT_MUTEX lock underflow warnings From: john stultz Date: Wed, 02 Jul 2008 17:57:32 -0700 So if I enable CONFIG_DEBUG_RT_MUTEXES with 2.6.24.7-rt14, I tend to quickly see a number of BUG warnings when running Java tests: BUG: jxeinajar/3383: lock count underflow! Pid: 3383, comm: jxeinajar Not tainted 2.6.24-ibmrt2.5john #3 Call Trace: [] rt_mutex_deadlock_account_unlock+0x5d/0x70 [] rt_read_slowunlock+0x35/0x550 [] rt_mutex_up_read+0x3d/0xc0 [] rt_up_read+0x29/0x30 [] do_futex+0x32e/0xd40 [] ? rt_mutex_up_read+0x3d/0xc0 [] ? rt_up_read+0x29/0x30 [] compat_sys_futex+0xa0/0x110 [] ? syscall_trace_enter+0x86/0xb0 [] cstar_do_call+0x1b/0x65 INFO: lockdep is turned off. --------------------------- | preempt count: 00000001 ] | 1-level deep critical section nesting: ---------------------------------------- ... [] .... __spin_lock_irqsave+0x22/0x60 ......[] .. ( <= rt_read_slowunlock+0x23/0x550) After some debugging and with Steven's help, we realized that with rwlocks, rt_mutex_deadlock_account_lock can be called multiple times in parallel (where as in most cases the mutex must be held by the caller to to call the function). This can cause integer lock_count value being used to be non-atomically incremented. The following patch converts lock_count to a atomic_t and resolves the warnings. Let me know if you have any feedback or comments! thanks -john Signed-off-by: John Stultz Cc: Steven Rostedt Cc: Clark Williams Cc: dvhltc Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- include/linux/sched.h | 2 +- kernel/fork.c | 2 +- kernel/rtmutex-debug.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -1408,7 +1408,7 @@ struct task_struct { #define MAX_PREEMPT_TRACE 25 #define MAX_LOCK_STACK MAX_PREEMPT_TRACE #ifdef CONFIG_DEBUG_PREEMPT - int lock_count; + atomic_t lock_count; # ifdef CONFIG_PREEMPT_RT struct rt_mutex *owned_lock[MAX_LOCK_STACK]; # endif Index: linux-2.6-tip/kernel/fork.c =================================================================== --- linux-2.6-tip.orig/kernel/fork.c +++ linux-2.6-tip/kernel/fork.c @@ -1164,7 +1164,7 @@ static struct task_struct *copy_process( if (retval) goto bad_fork_cleanup_io; #ifdef CONFIG_DEBUG_PREEMPT - p->lock_count = 0; + atomic_set(&p->lock_count, 0); #endif if (pid != &init_struct_pid) { Index: linux-2.6-tip/kernel/rtmutex-debug.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex-debug.c +++ linux-2.6-tip/kernel/rtmutex-debug.c @@ -179,7 +179,7 @@ void rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task) { #ifdef CONFIG_DEBUG_PREEMPT - if (task->lock_count >= MAX_LOCK_STACK) { + if (atomic_read(&task->lock_count) >= MAX_LOCK_STACK) { if (!debug_locks_off()) return; printk("BUG: %s/%d: lock count overflow!\n", @@ -188,16 +188,16 @@ rt_mutex_deadlock_account_lock(struct rt return; } #ifdef CONFIG_PREEMPT_RT - task->owned_lock[task->lock_count] = lock; + task->owned_lock[atomic_read(&task->lock_count)] = lock; #endif - task->lock_count++; + atomic_inc(&task->lock_count); #endif } void rt_mutex_deadlock_account_unlock(struct task_struct *task) { #ifdef CONFIG_DEBUG_PREEMPT - if (!task->lock_count) { + if (!atomic_read(&task->lock_count)) { if (!debug_locks_off()) return; printk("BUG: %s/%d: lock count underflow!\n", @@ -205,9 +205,9 @@ void rt_mutex_deadlock_account_unlock(st dump_stack(); return; } - task->lock_count--; + atomic_dec(&task->lock_count); #ifdef CONFIG_PREEMPT_RT - task->owned_lock[task->lock_count] = NULL; + task->owned_lock[atomic_read(&task->lock_count)] = NULL; #endif #endif } patches/seqlock-01-make-sure-that-raw_seqlock-retries.patch0000664000076400007640000000764511160752235022763 0ustar tglxtglxSubject: seqlock: make sure that raw_seqlock_t retries readers while writes are pending] From: Steven Rostedt Date: Wed, 20 Aug 2008 17:22:47 -0400 [ The following text is in the "utf-8" character set. ] [ Your display is set for the "ANSI_X3.4-1968" character set. ] [ Some characters may be displayed incorrectly. ] -------- Original Message -------- readers while writes are pending Date: Wed, 20 Aug 2008 14:28:20 -0400 From: Gregory Haskins To: srostedt@redhat.com The seqlock protocol is broken in -rt for raw_seqlock_t objects. This manifested in my 2.6.26-rt1 kernel as a 500ms (yes, millisecond) spike which was traced out with ftrace/preemptirqsoff to be originating in the HRT (hrtimer_interrupt, to be precise). It would occasionally spin processing the same CLOCK_MONOTONIC timer (the scheduler-tick) in a tight loop with interrupts disabled. Investigating, it turned out that the time-basis recorded for "now" early in the interrupt was momentarily moved 500ms in the future. This caused all timers with correct expiration times to appear to have expired a long time ago. Even rescheduling the timer via hrtimer_forward ultimately placed the timer in an "expired" state since the "now" basis was in the future. So I began investigating how this time-basis (derived from ktime_get()) could have done this. I observed that ktime_get() readers were able to successfully read a time value even while another core held a write-lock on the xtime_lock. Therefore the fundamental issue was that ktime_get was able to return transitional states of the xtime/clocksource infrastructure, which is clearly not intended. I root caused the issue to the raw_seqlock_t implementation. It was missing support for retrying a reader if it finds a write-pending flag. Investigating further, I think I can speculate why. Back in April, Ingo and Thomas checked in a fix to mainline for seqlocks, referenced here: commit 88a411c07b6fedcfc97b8dc51ae18540bd2beda0 Author: Ingo Molnar Date: Thu Apr 3 09:06:13 2008 +0200 seqlock: livelock fix Thomas Gleixner debugged a particularly ugly seqlock related livelock: do not process the seq-read section if we know it beforehand that the test at the end of the section will fail ... Signed-off-by: Ingo Molnar Of course, mainline only has seqlock_t. In -rt, we have both seqlock_t and raw_seqlock_t. It would appear that the merge-resolution for commit 88a411c07b6 to the -rt branch inadvertently applied one hunk of the fix to seqlock_t, and the other to raw_seqlock_t. The normal seqlocks now have two checks for retry, while the raw_seqlocks have none. This lack of a check is what causes the protocol failure, which ultimately caused the bad clock info and a latency spike. This patch corrects the above condition by applying the conceptual change from 88a411c07b6 to both seqlock_t and raw_seqlock_t equally. The observed problems with the HRT spike are confirmed to no longer be reproducible as as result. Signed-off-by: Gregory Haskins --- include/linux/seqlock.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) Index: linux-2.6-tip/include/linux/seqlock.h =================================================================== --- linux-2.6-tip.orig/include/linux/seqlock.h +++ linux-2.6-tip/include/linux/seqlock.h @@ -145,7 +145,7 @@ static inline int __read_seqretry(seqloc int ret; smp_rmb(); - ret = (iv & 1) | (sl->sequence ^ iv); + ret = (sl->sequence != iv); /* * If invalid then serialize with the writer, to make sure we * are not livelocking it: @@ -228,8 +228,16 @@ static __always_inline int __write_tryse static __always_inline unsigned __read_seqbegin_raw(const raw_seqlock_t *sl) { - unsigned ret = sl->sequence; + unsigned ret; + +repeat: + ret = sl->sequence; smp_rmb(); + if (unlikely(ret & 1)) { + cpu_relax(); + goto repeat; + } + return ret; } patches/vortex-fix.patch0000664000076400007640000000530211160752235014373 0ustar tglxtglxSubject: patches/vortex-fix.patch Argh, cut and paste wasn't enough... Use this patch instead. It needs an irq disable. But, believe it or not, on SMP this is actually better. If the irq is shared (as it is in Mark's case), we don't stop the irq of other devices from being handled on another CPU (unfortunately for Mark, he pinned all interrupts to one CPU). Andrew, should this be changed in mainline too? -- Steve Signed-off-by: Steven Rostedt drivers/net/3c59x.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) Signed-off-by: Ingo Molnar Index: linux-2.6-tip/drivers/net/3c59x.c =================================================================== --- linux-2.6-tip.orig/drivers/net/3c59x.c +++ linux-2.6-tip/drivers/net/3c59x.c @@ -791,9 +791,9 @@ static void poll_vortex(struct net_devic { struct vortex_private *vp = netdev_priv(dev); unsigned long flags; - local_irq_save(flags); + local_irq_save_nort(flags); (vp->full_bus_master_rx ? boomerang_interrupt:vortex_interrupt)(dev->irq,dev); - local_irq_restore(flags); + local_irq_restore_nort(flags); } #endif @@ -1739,6 +1739,7 @@ vortex_timer(unsigned long data) int next_tick = 60*HZ; int ok = 0; int media_status, old_window; + unsigned long flags; if (vortex_debug > 2) { printk(KERN_DEBUG "%s: Media selection timer tick happened, %s.\n", @@ -1746,7 +1747,7 @@ vortex_timer(unsigned long data) printk(KERN_DEBUG "dev->watchdog_timeo=%d\n", dev->watchdog_timeo); } - disable_irq_lockdep(dev->irq); + spin_lock_irqsave(&vp->lock, flags); old_window = ioread16(ioaddr + EL3_CMD) >> 13; EL3WINDOW(4); media_status = ioread16(ioaddr + Wn4_Media); @@ -1769,10 +1770,7 @@ vortex_timer(unsigned long data) case XCVR_MII: case XCVR_NWAY: { ok = 1; - /* Interrupts are already disabled */ - spin_lock(&vp->lock); vortex_check_media(dev, 0); - spin_unlock(&vp->lock); } break; default: /* Other media types handled by Tx timeouts. */ @@ -1828,7 +1826,7 @@ leave_media_alone: dev->name, media_tbl[dev->if_port].name); EL3WINDOW(old_window); - enable_irq_lockdep(dev->irq); + spin_unlock_irqrestore(&vp->lock, flags); mod_timer(&vp->timer, RUN_AT(next_tick)); if (vp->deferred) iowrite16(FakeIntr, ioaddr + EL3_CMD); @@ -1862,12 +1860,12 @@ static void vortex_tx_timeout(struct net * Block interrupts because vortex_interrupt does a bare spin_lock() */ unsigned long flags; - local_irq_save(flags); + local_irq_save_nort(flags); if (vp->full_bus_master_tx) boomerang_interrupt(dev->irq, dev); else vortex_interrupt(dev->irq, dev); - local_irq_restore(flags); + local_irq_restore_nort(flags); } } patches/x86_64-tsc-sync-irqflags-fix.patch0000664000076400007640000000163411160752235017355 0ustar tglxtglxSubject: x86_64: tsc sync irqflags fix From: Ingo Molnar Date: Wed Feb 04 00:03:15 CET 2009 Signed-off-by: Ingo Molnar --- arch/x86/kernel/tsc_sync.c | 4 ++++ 1 file changed, 4 insertions(+) Index: linux-2.6-tip/arch/x86/kernel/tsc_sync.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/tsc_sync.c +++ linux-2.6-tip/arch/x86/kernel/tsc_sync.c @@ -103,6 +103,7 @@ static __cpuinit void check_tsc_warp(voi */ void __cpuinit check_tsc_sync_source(int cpu) { + unsigned long flags; int cpus = 2; /* @@ -129,8 +130,11 @@ void __cpuinit check_tsc_sync_source(int /* * Wait for the target to arrive: */ + local_save_flags(flags); + local_irq_enable(); while (atomic_read(&start_count) != cpus-1) cpu_relax(); + local_irq_restore(flags); /* * Trigger the target to continue into the measurement too: */ patches/preempt-realtime-acpi.patch0000664000076400007640000001260511160752235016452 0ustar tglxtglxSubject: preempt: realtime acpi From: Ingo Molnar Date: Wed Feb 04 00:02:52 CET 2009 Signed-off-by: Ingo Molnar --- drivers/acpi/acpica/acglobal.h | 7 ++++++- drivers/acpi/acpica/hwregs.c | 4 ++-- drivers/acpi/acpica/hwxface.c | 8 ++++---- drivers/acpi/acpica/utmutex.c | 2 +- drivers/acpi/ec.c | 15 ++++++++++++++- drivers/acpi/processor_idle.c | 2 +- include/acpi/acpiosxf.h | 2 +- 7 files changed, 29 insertions(+), 11 deletions(-) Index: linux-2.6-tip/drivers/acpi/acpica/acglobal.h =================================================================== --- linux-2.6-tip.orig/drivers/acpi/acpica/acglobal.h +++ linux-2.6-tip/drivers/acpi/acpica/acglobal.h @@ -190,7 +190,12 @@ ACPI_EXTERN u8 acpi_gbl_global_lock_pres * interrupt level */ ACPI_EXTERN spinlock_t _acpi_gbl_gpe_lock; /* For GPE data structs and registers */ -ACPI_EXTERN spinlock_t _acpi_gbl_hardware_lock; /* For ACPI H/W except GPE registers */ + +/* + * Need to be raw because it might be used in acpi_processor_idle(): + */ +ACPI_EXTERN raw_spinlock_t _acpi_gbl_hardware_lock; /* For ACPI H/W except GPE registers */ + #define acpi_gbl_gpe_lock &_acpi_gbl_gpe_lock #define acpi_gbl_hardware_lock &_acpi_gbl_hardware_lock Index: linux-2.6-tip/drivers/acpi/acpica/hwregs.c =================================================================== --- linux-2.6-tip.orig/drivers/acpi/acpica/hwregs.c +++ linux-2.6-tip/drivers/acpi/acpica/hwregs.c @@ -74,7 +74,7 @@ acpi_status acpi_hw_clear_acpi_status(vo ACPI_BITMASK_ALL_FIXED_STATUS, (u16) acpi_gbl_FADT.xpm1a_event_block.address)); - lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); + spin_lock_irqsave(acpi_gbl_hardware_lock, lock_flags); status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS, ACPI_BITMASK_ALL_FIXED_STATUS); @@ -97,7 +97,7 @@ acpi_status acpi_hw_clear_acpi_status(vo status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block, NULL); unlock_and_exit: - acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); + spin_unlock_irqrestore(acpi_gbl_hardware_lock, lock_flags); return_ACPI_STATUS(status); } Index: linux-2.6-tip/drivers/acpi/acpica/hwxface.c =================================================================== --- linux-2.6-tip.orig/drivers/acpi/acpica/hwxface.c +++ linux-2.6-tip/drivers/acpi/acpica/hwxface.c @@ -313,9 +313,9 @@ acpi_status acpi_get_register(u32 regist acpi_status status; acpi_cpu_flags flags; - flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); + spin_lock_irqsave(acpi_gbl_hardware_lock, flags); status = acpi_get_register_unlocked(register_id, return_value); - acpi_os_release_lock(acpi_gbl_hardware_lock, flags); + spin_unlock_irqrestore(acpi_gbl_hardware_lock, flags); return (status); } @@ -353,7 +353,7 @@ acpi_status acpi_set_register(u32 regist return_ACPI_STATUS(AE_BAD_PARAMETER); } - lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); + spin_lock_irqsave(acpi_gbl_hardware_lock, lock_flags); /* Always do a register read first so we can insert the new bits */ @@ -458,7 +458,7 @@ acpi_status acpi_set_register(u32 regist unlock_and_exit: - acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); + spin_unlock_irqrestore(acpi_gbl_hardware_lock, lock_flags); /* Normalize the value that was read */ Index: linux-2.6-tip/drivers/acpi/acpica/utmutex.c =================================================================== --- linux-2.6-tip.orig/drivers/acpi/acpica/utmutex.c +++ linux-2.6-tip/drivers/acpi/acpica/utmutex.c @@ -117,7 +117,7 @@ void acpi_ut_mutex_terminate(void) /* Delete the spinlocks */ acpi_os_delete_lock(acpi_gbl_gpe_lock); - acpi_os_delete_lock(acpi_gbl_hardware_lock); +// acpi_os_delete_lock(acpi_gbl_hardware_lock); return_VOID; } Index: linux-2.6-tip/drivers/acpi/ec.c =================================================================== --- linux-2.6-tip.orig/drivers/acpi/ec.c +++ linux-2.6-tip/drivers/acpi/ec.c @@ -563,8 +563,21 @@ static u32 acpi_ec_gpe_handler(void *dat if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags)) { gpe_transaction(ec, status); if (ec_transaction_done(ec) && - (status & ACPI_EC_FLAG_IBF) == 0) + (status & ACPI_EC_FLAG_IBF) == 0) { +#if 0 wake_up(&ec->wait); +#else + // hack ... + if (waitqueue_active(&ec->wait)) { + struct task_struct *task; + + task = list_entry(ec->wait.task_list.next, + wait_queue_t, task_list)->private; + if (task) + wake_up_process(task); + } +#endif + } } ec_check_sci(ec, status); Index: linux-2.6-tip/drivers/acpi/processor_idle.c =================================================================== --- linux-2.6-tip.orig/drivers/acpi/processor_idle.c +++ linux-2.6-tip/drivers/acpi/processor_idle.c @@ -956,7 +956,7 @@ static int acpi_idle_enter_simple(struct } static int c3_cpu_count; -static DEFINE_SPINLOCK(c3_lock); +static DEFINE_RAW_SPINLOCK(c3_lock); /** * acpi_idle_enter_bm - enters C3 with proper BM handling Index: linux-2.6-tip/include/acpi/acpiosxf.h =================================================================== --- linux-2.6-tip.orig/include/acpi/acpiosxf.h +++ linux-2.6-tip/include/acpi/acpiosxf.h @@ -61,7 +61,7 @@ typedef enum { OSL_EC_BURST_HANDLER } acpi_execute_type; -#define ACPI_NO_UNIT_LIMIT ((u32) -1) +#define ACPI_NO_UNIT_LIMIT (INT_MAX/2) #define ACPI_MUTEX_SEM 1 /* Functions for acpi_os_signal */ patches/kstat-add-rt-stats.patch0000664000076400007640000001204311161723464015716 0ustar tglxtglxSubject: add rt stats to /proc/stat From: Thomas Gleixner add RT stats to /proc/stat Signed-off-by: Ingo Molnar fs/proc/stat.c | 24 ++++++++++++++++++------ include/linux/kernel_stat.h | 2 ++ kernel/sched.c | 6 +++++- 3 files changed, 25 insertions(+), 7 deletions(-) Index: linux-2.6-tip/fs/proc/stat.c =================================================================== --- linux-2.6-tip.orig/fs/proc/stat.c +++ linux-2.6-tip/fs/proc/stat.c @@ -23,13 +23,14 @@ static int show_stat(struct seq_file *p, { int i, j; unsigned long jif; - cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; + cputime64_t user_rt, user, nice, system_rt, system, idle, + iowait, irq, softirq, steal; cputime64_t guest; u64 sum = 0; struct timespec boottime; unsigned int per_irq_sum; - user = nice = system = idle = iowait = + user_rt = user = nice = system_rt = system = idle = iowait = irq = softirq = steal = cputime64_zero; guest = cputime64_zero; getboottime(&boottime); @@ -44,6 +45,8 @@ static int show_stat(struct seq_file *p, irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq); softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); + user_rt = cputime64_add(user_rt, kstat_cpu(i).cpustat.user_rt); + system_rt = cputime64_add(system_rt, kstat_cpu(i).cpustat.system_rt); guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); for_each_irq_nr(j) { sum += kstat_irqs_cpu(j, i); @@ -52,7 +55,10 @@ static int show_stat(struct seq_file *p, } sum += arch_irq_stat(); - seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", + user = cputime64_add(user_rt, user); + system = cputime64_add(system_rt, system); + + seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", (unsigned long long)cputime64_to_clock_t(user), (unsigned long long)cputime64_to_clock_t(nice), (unsigned long long)cputime64_to_clock_t(system), @@ -61,13 +67,17 @@ static int show_stat(struct seq_file *p, (unsigned long long)cputime64_to_clock_t(irq), (unsigned long long)cputime64_to_clock_t(softirq), (unsigned long long)cputime64_to_clock_t(steal), + (unsigned long long)cputime64_to_clock_t(user_rt), + (unsigned long long)cputime64_to_clock_t(system_rt), (unsigned long long)cputime64_to_clock_t(guest)); for_each_online_cpu(i) { /* Copy values here to work around gcc-2.95.3, gcc-2.96 */ - user = kstat_cpu(i).cpustat.user; + user_rt = kstat_cpu(i).cpustat.user_rt; + system_rt = kstat_cpu(i).cpustat.system_rt; + user = cputime64_add(user_rt, kstat_cpu(i).cpustat.user); nice = kstat_cpu(i).cpustat.nice; - system = kstat_cpu(i).cpustat.system; + system = cputime64_add(system_rt, kstat_cpu(i).cpustat.system); idle = kstat_cpu(i).cpustat.idle; iowait = kstat_cpu(i).cpustat.iowait; irq = kstat_cpu(i).cpustat.irq; @@ -75,7 +85,7 @@ static int show_stat(struct seq_file *p, steal = kstat_cpu(i).cpustat.steal; guest = kstat_cpu(i).cpustat.guest; seq_printf(p, - "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", + "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", i, (unsigned long long)cputime64_to_clock_t(user), (unsigned long long)cputime64_to_clock_t(nice), @@ -85,6 +95,8 @@ static int show_stat(struct seq_file *p, (unsigned long long)cputime64_to_clock_t(irq), (unsigned long long)cputime64_to_clock_t(softirq), (unsigned long long)cputime64_to_clock_t(steal), + (unsigned long long)cputime64_to_clock_t(user_rt), + (unsigned long long)cputime64_to_clock_t(system_rt), (unsigned long long)cputime64_to_clock_t(guest)); } seq_printf(p, "intr %llu", (unsigned long long)sum); Index: linux-2.6-tip/include/linux/kernel_stat.h =================================================================== --- linux-2.6-tip.orig/include/linux/kernel_stat.h +++ linux-2.6-tip/include/linux/kernel_stat.h @@ -23,6 +23,8 @@ struct cpu_usage_stat { cputime64_t idle; cputime64_t iowait; cputime64_t steal; + cputime64_t user_rt; + cputime64_t system_rt; cputime64_t guest; }; Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -4410,7 +4410,9 @@ void account_user_time(struct task_struc /* Add user time to cpustat. */ tmp = cputime_to_cputime64(cputime); - if (TASK_NICE(p) > 0) + if (rt_task(p)) + cpustat->user_rt = cputime64_add(cpustat->user_rt, tmp); + else if (TASK_NICE(p) > 0) cpustat->nice = cputime64_add(cpustat->nice, tmp); else cpustat->user = cputime64_add(cpustat->user, tmp); @@ -4472,6 +4474,8 @@ void account_system_time(struct task_str cpustat->irq = cputime64_add(cpustat->irq, tmp); else if (softirq_count() || (p->flags & PF_SOFTIRQ)) cpustat->softirq = cputime64_add(cpustat->softirq, tmp); + else if (rt_task(p)) + cpustat->system_rt = cputime64_add(cpustat->system_rt, tmp); else cpustat->system = cputime64_add(cpustat->system, tmp); patches/floppy-resume-fix.patch0000664000076400007640000000410511160752235015653 0ustar tglxtglxSubject: floppy: suspend/resume fix From: Ingo Molnar introduce a floppy platform-driver and suspend/resume ops to stop/start the floppy driver. Bug reported by Mikael Pettersson. Signed-off-by: Ingo Molnar --- drivers/block/floppy.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) Index: linux-2.6-tip/drivers/block/floppy.c =================================================================== --- linux-2.6-tip.orig/drivers/block/floppy.c +++ linux-2.6-tip/drivers/block/floppy.c @@ -4148,6 +4148,28 @@ static void floppy_device_release(struct { } +static int floppy_suspend(struct platform_device *dev, pm_message_t state) +{ + floppy_release_irq_and_dma(); + + return 0; +} + +static int floppy_resume(struct platform_device *dev) +{ + floppy_grab_irq_and_dma(); + + return 0; +} + +static struct platform_driver floppy_driver = { + .suspend = floppy_suspend, + .resume = floppy_resume, + .driver = { + .name = "floppy", + }, +}; + static struct platform_device floppy_device[N_DRIVE]; static struct kobject *floppy_find(dev_t dev, int *part, void *data) @@ -4196,10 +4218,14 @@ static int __init floppy_init(void) if (err) goto out_put_disk; + err = platform_driver_register(&floppy_driver); + if (err) + goto out_unreg_blkdev; + floppy_queue = blk_init_queue(do_fd_request, &floppy_lock); if (!floppy_queue) { err = -ENOMEM; - goto out_unreg_blkdev; + goto out_unreg_driver; } blk_queue_max_sectors(floppy_queue, 64); @@ -4346,6 +4372,8 @@ out_flush_work: out_unreg_region: blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256); blk_cleanup_queue(floppy_queue); +out_unreg_driver: + platform_driver_unregister(&floppy_driver); out_unreg_blkdev: unregister_blkdev(FLOPPY_MAJOR, "fd"); out_put_disk: @@ -4567,6 +4595,7 @@ static void __exit floppy_module_exit(vo blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256); unregister_blkdev(FLOPPY_MAJOR, "fd"); + platform_driver_unregister(&floppy_driver); for (drive = 0; drive < N_DRIVE; drive++) { del_timer_sync(&motor_off_timer[drive]); patches/apic-level-smp-affinity.patch0000664000076400007640000000164511160752235016713 0ustar tglxtglxSubject: apic: level smp affinity From: Ingo Molnar Date: Wed Feb 04 00:02:16 CET 2009 Signed-off-by: Ingo Molnar --- arch/x86/kernel/apic/io_apic.c | 9 +++++++++ 1 file changed, 9 insertions(+) Index: linux-2.6-tip/arch/x86/kernel/apic/io_apic.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/apic/io_apic.c +++ linux-2.6-tip/arch/x86/kernel/apic/io_apic.c @@ -2641,6 +2641,15 @@ static void ack_apic_level(unsigned int move_masked_irq(irq); unmask_IO_APIC_irq_desc(desc); } +#if (defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)) && \ + defined(CONFIG_PREEMPT_HARDIRQS) + /* + * With threaded interrupts, we always have IRQ_INPROGRESS + * when acking. + */ + else if (unlikely(desc->status & IRQ_MOVE_PENDING)) + move_masked_irq(irq); +#endif #ifdef CONFIG_X86_32 if (!(v & (1 << (i & 0x1f)))) { patches/arm-tracing-updates.patch0000664000076400007640000000761211160752235016135 0ustar tglxtglxSubject: arm-tracing-updates.patch From: Uwe Kleine-König Date: Fri, 20 Mar 2009 16:23:17 +0100 Signed-off-by: Uwe Kleine-König Signed-off-by: Thomas Gleixner --- --- arch/arm/include/asm/bitops.h | 1 arch/arm/include/asm/ftrace.h | 14 +++++++++++++ arch/arm/kernel/Makefile | 2 + arch/arm/kernel/return_address.c | 42 +++++++++++++++++++++++++++++++++++++++ arch/arm/kernel/stacktrace.c | 2 - 5 files changed, 60 insertions(+), 1 deletion(-) Index: linux-2.6-tip/arch/arm/include/asm/bitops.h =================================================================== --- linux-2.6-tip.orig/arch/arm/include/asm/bitops.h +++ linux-2.6-tip/arch/arm/include/asm/bitops.h @@ -25,6 +25,7 @@ #include #include +#include #define smp_mb__before_clear_bit() mb() #define smp_mb__after_clear_bit() mb() Index: linux-2.6-tip/arch/arm/include/asm/ftrace.h =================================================================== --- linux-2.6-tip.orig/arch/arm/include/asm/ftrace.h +++ linux-2.6-tip/arch/arm/include/asm/ftrace.h @@ -11,4 +11,18 @@ extern void mcount(void); #endif +#ifndef __ASSEMBLY__ +void *return_address(unsigned int); + +#define HAVE_ARCH_CALLER_ADDR +#define CALLER_ADDR0 ((unsigned long)return_address(0)) +#define CALLER_ADDR1 ((unsigned long)return_address(1)) +#define CALLER_ADDR2 ((unsigned long)return_address(2)) +#define CALLER_ADDR3 ((unsigned long)return_address(3)) +#define CALLER_ADDR4 ((unsigned long)return_address(4)) +#define CALLER_ADDR5 ((unsigned long)return_address(5)) +#define CALLER_ADDR6 ((unsigned long)return_address(6)) + +#endif + #endif /* _ASM_ARM_FTRACE */ Index: linux-2.6-tip/arch/arm/kernel/Makefile =================================================================== --- linux-2.6-tip.orig/arch/arm/kernel/Makefile +++ linux-2.6-tip/arch/arm/kernel/Makefile @@ -7,6 +7,7 @@ AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OF ifdef CONFIG_DYNAMIC_FTRACE CFLAGS_REMOVE_ftrace.o = -pg endif +CFLAGS_REMOVE_return_address.o = -pg # Object file lists. @@ -29,6 +30,7 @@ obj-$(CONFIG_ATAGS_PROC) += atags.o obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o obj-$(CONFIG_ARM_THUMBEE) += thumbee.o obj-$(CONFIG_KGDB) += kgdb.o +obj-y += return_address.o obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 Index: linux-2.6-tip/arch/arm/kernel/return_address.c =================================================================== --- /dev/null +++ linux-2.6-tip/arch/arm/kernel/return_address.c @@ -0,0 +1,42 @@ +#include +#include + +#include "stacktrace.h" + +struct return_address_data { + unsigned int level; + void *addr; +}; + +static int save_return_addr(struct stackframe *frame, void *d) +{ + struct return_address_data *data = d; + + if (!data->level) { + data->addr = (void *)frame->lr; + + return 1; + } else { + --data->level; + return 0; + } +} + +void *return_address(unsigned int level) +{ + unsigned long fp, base; + struct return_address_data data; + + data.level = level + 1; + + base = (unsigned long)task_stack_page(current); + asm("mov %0, fp" : "=r" (fp)); + + walk_stackframe(fp, base, base + THREAD_SIZE, save_return_addr, &data); + + if (!data.level) + return data.addr; + else + return NULL; +} +EXPORT_SYMBOL_GPL(return_address); Index: linux-2.6-tip/arch/arm/kernel/stacktrace.c =================================================================== --- linux-2.6-tip.orig/arch/arm/kernel/stacktrace.c +++ linux-2.6-tip/arch/arm/kernel/stacktrace.c @@ -4,7 +4,7 @@ #include "stacktrace.h" -int walk_stackframe(unsigned long fp, unsigned long low, unsigned long high, +int notrace walk_stackframe(unsigned long fp, unsigned long low, unsigned long high, int (*fn)(struct stackframe *, void *), void *data) { struct stackframe *frame; patches/preempt-softirqs-core.patch0000664000076400007640000004156611161723473016551 0ustar tglxtglxSubject: preempt: softirqs core From: Ingo Molnar Date: Wed Feb 04 00:03:10 CET 2009 Signed-off-by: Ingo Molnar --- include/linux/interrupt.h | 13 ++ include/linux/sched.h | 15 ++ kernel/Kconfig.preempt | 16 ++ kernel/sched.c | 28 ++++- kernel/softirq.c | 257 +++++++++++++++++++++++++++++++++++++--------- 5 files changed, 276 insertions(+), 53 deletions(-) Index: linux-2.6-tip/include/linux/interrupt.h =================================================================== --- linux-2.6-tip.orig/include/linux/interrupt.h +++ linux-2.6-tip/include/linux/interrupt.h @@ -265,6 +265,8 @@ enum SCHED_SOFTIRQ, HRTIMER_SOFTIRQ, RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ + /* Entries after this are ignored in split softirq mode */ + MAX_SOFTIRQ, NR_SOFTIRQS }; @@ -283,13 +285,16 @@ struct softirq_action void (*action)(struct softirq_action *); }; +#define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0) +#define __do_raise_softirq_irqoff(nr) __raise_softirq_irqoff(nr) + asmlinkage void do_softirq(void); asmlinkage void __do_softirq(void); extern void open_softirq(int nr, void (*action)(struct softirq_action *)); extern void softirq_init(void); -#define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0) extern void raise_softirq_irqoff(unsigned int nr); extern void raise_softirq(unsigned int nr); +extern void wakeup_irqd(void); /* This is the worklist that queues up per-cpu softirq work. * @@ -299,6 +304,11 @@ extern void raise_softirq(unsigned int n * only be accessed by the local cpu that they are for. */ DECLARE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list); +#ifdef CONFIG_PREEMPT_SOFTIRQS +extern void wait_for_softirq(int softirq); +#else +# define wait_for_softirq(x) do {} while(0) +#endif /* Try to send a softirq to a remote cpu. If this cannot be done, the * work will be queued to the local cpu. @@ -435,6 +445,7 @@ extern void tasklet_kill(struct tasklet_ extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu); extern void tasklet_init(struct tasklet_struct *t, void (*func)(unsigned long), unsigned long data); +void takeover_tasklets(unsigned int cpu); /* * Autoprobing for irqs: Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -92,6 +92,12 @@ struct sched_param { #include +#ifdef CONFIG_PREEMPT_SOFTIRQS +extern int softirq_preemption; +#else +# define softirq_preemption 0 +#endif + struct mem_cgroup; struct exec_domain; struct futex_pi_state; @@ -1641,6 +1647,7 @@ extern cputime_t task_gtime(struct task_ #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ #define PF_THREAD_BOUND 0x04000000 /* Thread bound to specific cpu */ +#define PF_SOFTIRQ 0x08000000 /* softirq context */ #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */ @@ -2228,6 +2235,7 @@ static inline int cond_resched_bkl(void) { return _cond_resched(); } +extern int cond_resched_softirq_context(void); /* * Does a critical section need to be broken due to another @@ -2260,6 +2268,13 @@ static inline void thread_group_cputime_ { } +static inline int softirq_need_resched(void) +{ + if (softirq_preemption && (current->flags & PF_SOFTIRQ)) + return need_resched(); + return 0; +} + /* * Reevaluate whether the task has signals pending delivery. * Wake the task if so. Index: linux-2.6-tip/kernel/Kconfig.preempt =================================================================== --- linux-2.6-tip.orig/kernel/Kconfig.preempt +++ linux-2.6-tip/kernel/Kconfig.preempt @@ -52,3 +52,19 @@ config PREEMPT endchoice +config PREEMPT_SOFTIRQS + bool "Thread Softirqs" + default n +# depends on PREEMPT + help + This option reduces the latency of the kernel by 'threading' + soft interrupts. This means that all softirqs will execute + in softirqd's context. While this helps latency, it can also + reduce performance. + + The threading of softirqs can also be controlled via + /proc/sys/kernel/softirq_preemption runtime flag and the + sofirq-preempt=0/1 boot-time option. + + Say N if you are unsure. + Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -4431,7 +4431,7 @@ void account_system_time(struct task_str tmp = cputime_to_cputime64(cputime); if (hardirq_count() - hardirq_offset) cpustat->irq = cputime64_add(cpustat->irq, tmp); - else if (softirq_count()) + else if (softirq_count() || (p->flags & PF_SOFTIRQ)) cpustat->softirq = cputime64_add(cpustat->softirq, tmp); else cpustat->system = cputime64_add(cpustat->system, tmp); @@ -4952,7 +4952,7 @@ asmlinkage void __sched preempt_schedule int saved_lock_depth; /* Catch callers which need to be fixed */ - BUG_ON(ti->preempt_count || !irqs_disabled()); + WARN_ON_ONCE(ti->preempt_count || !irqs_disabled()); do { add_preempt_count(PREEMPT_ACTIVE); @@ -6060,9 +6060,12 @@ int cond_resched_lock(spinlock_t *lock) } EXPORT_SYMBOL(cond_resched_lock); +/* + * Voluntarily preempt a process context that has softirqs disabled: + */ int __sched cond_resched_softirq(void) { - BUG_ON(!in_softirq()); + WARN_ON_ONCE(!in_softirq()); if (need_resched() && system_state == SYSTEM_RUNNING) { local_bh_enable(); @@ -6074,6 +6077,25 @@ int __sched cond_resched_softirq(void) } EXPORT_SYMBOL(cond_resched_softirq); +/* + * Voluntarily preempt a softirq context (possible with softirq threading): + */ +int __sched cond_resched_softirq_context(void) +{ + WARN_ON_ONCE(!in_softirq()); + + if (softirq_need_resched() && system_state == SYSTEM_RUNNING) { + raw_local_irq_disable(); + _local_bh_enable(); + raw_local_irq_enable(); + __cond_resched(); + local_bh_disable(); + return 1; + } + return 0; +} +EXPORT_SYMBOL(cond_resched_softirq_context); + /** * yield - yield the current processor to other threads. * Index: linux-2.6-tip/kernel/softirq.c =================================================================== --- linux-2.6-tip.orig/kernel/softirq.c +++ linux-2.6-tip/kernel/softirq.c @@ -8,9 +8,15 @@ * Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903) * * Remote softirq infrastructure is by Jens Axboe. + * + * Softirq-split implemetation by + * Copyright (C) 2005 Thomas Gleixner, Ingo Molnar */ #include +#include +#include +#include #include #include #include @@ -52,7 +58,43 @@ EXPORT_SYMBOL(irq_stat); static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp; -static DEFINE_PER_CPU(struct task_struct *, ksoftirqd); +struct softirqdata { + int nr; + unsigned long cpu; + struct task_struct *tsk; +#ifdef CONFIG_PREEMPT_SOFTIRQS + wait_queue_head_t wait; + int running; +#endif +}; + +static DEFINE_PER_CPU(struct softirqdata [MAX_SOFTIRQ], ksoftirqd); + +#ifdef CONFIG_PREEMPT_SOFTIRQS +/* + * Preempting the softirq causes cases that would not be a + * problem when the softirq is not preempted. That is a + * process may have code to spin while waiting for a softirq + * to finish on another CPU. But if it happens that the + * process has preempted the softirq, this could cause a + * deadlock. + */ +void wait_for_softirq(int softirq) +{ + struct softirqdata *data = &__get_cpu_var(ksoftirqd)[softirq]; + + if (data->running) { + DECLARE_WAITQUEUE(wait, current); + + set_current_state(TASK_UNINTERRUPTIBLE); + add_wait_queue(&data->wait, &wait); + if (data->running) + schedule(); + remove_wait_queue(&data->wait, &wait); + __set_current_state(TASK_RUNNING); + } +} +#endif char *softirq_to_name[NR_SOFTIRQS] = { "HI", "TIMER", "NET_TX", "NET_RX", "BLOCK", @@ -65,16 +107,32 @@ char *softirq_to_name[NR_SOFTIRQS] = { * to the pending events, so lets the scheduler to balance * the softirq load for us. */ -static inline void wakeup_softirqd(void) +static void wakeup_softirqd(int softirq) { /* Interrupts are disabled: no need to stop preemption */ - struct task_struct *tsk = __get_cpu_var(ksoftirqd); + struct task_struct *tsk = __get_cpu_var(ksoftirqd)[softirq].tsk; if (tsk && tsk->state != TASK_RUNNING) wake_up_process(tsk); } /* + * Wake up the softirq threads which have work + */ +static void trigger_softirqs(void) +{ + u32 pending = local_softirq_pending(); + int curr = 0; + + while (pending) { + if (pending & 1) + wakeup_softirqd(curr); + pending >>= 1; + curr++; + } +} + +/* * This one is for softirq.c-internal use, * where hardirqs are disabled legitimately: */ @@ -189,7 +247,7 @@ EXPORT_SYMBOL(local_bh_enable_ip); DEFINE_TRACE(softirq_entry); DEFINE_TRACE(softirq_exit); -asmlinkage void __do_softirq(void) +asmlinkage void ___do_softirq(void) { struct softirq_action *h; __u32 pending; @@ -199,9 +257,6 @@ asmlinkage void __do_softirq(void) pending = local_softirq_pending(); account_system_vtime(current); - __local_bh_disable((unsigned long)__builtin_return_address(0)); - lockdep_softirq_enter(); - cpu = smp_processor_id(); restart: /* Reset the pending bitmask before enabling irqs */ @@ -228,6 +283,7 @@ restart: } rcu_bh_qsctr_inc(cpu); + cond_resched_softirq_context(); } h++; pending >>= 1; @@ -240,12 +296,34 @@ restart: goto restart; if (pending) - wakeup_softirqd(); + trigger_softirqs(); +} + +asmlinkage void __do_softirq(void) +{ +#ifdef CONFIG_PREEMPT_SOFTIRQS + /* + * 'preempt harder'. Push all softirq processing off to ksoftirqd. + */ + if (softirq_preemption) { + if (local_softirq_pending()) + trigger_softirqs(); + return; + } +#endif + /* + * 'immediate' softirq execution: + */ + __local_bh_disable((unsigned long)__builtin_return_address(0)); + lockdep_softirq_enter(); + + ___do_softirq(); lockdep_softirq_exit(); account_system_vtime(current); _local_bh_enable(); + } #ifndef __ARCH_HAS_DO_SOFTIRQ @@ -316,19 +394,11 @@ void irq_exit(void) */ inline void raise_softirq_irqoff(unsigned int nr) { - __raise_softirq_irqoff(nr); + __do_raise_softirq_irqoff(nr); - /* - * If we're in an interrupt or softirq, we're done - * (this also catches softirq-disabled code). We will - * actually run the softirq once we return from - * the irq or softirq. - * - * Otherwise we wake up ksoftirqd to make sure we - * schedule the softirq soon. - */ - if (!in_interrupt()) - wakeup_softirqd(); +#ifdef CONFIG_PREEMPT_SOFTIRQS + wakeup_softirqd(nr); +#endif } void raise_softirq(unsigned int nr) @@ -424,7 +494,7 @@ static void tasklet_action(struct softir t->next = NULL; *__get_cpu_var(tasklet_vec).tail = t; __get_cpu_var(tasklet_vec).tail = &(t->next); - __raise_softirq_irqoff(TASKLET_SOFTIRQ); + __do_raise_softirq_irqoff(TASKLET_SOFTIRQ); local_irq_enable(); } } @@ -459,7 +529,7 @@ static void tasklet_hi_action(struct sof t->next = NULL; *__get_cpu_var(tasklet_hi_vec).tail = t; __get_cpu_var(tasklet_hi_vec).tail = &(t->next); - __raise_softirq_irqoff(HI_SOFTIRQ); + __do_raise_softirq_irqoff(HI_SOFTIRQ); local_irq_enable(); } } @@ -635,13 +705,24 @@ void __init softirq_init(void) open_softirq(HI_SOFTIRQ, tasklet_hi_action); } -static int ksoftirqd(void * __bind_cpu) +static int ksoftirqd(void * __data) { + struct sched_param param = { .sched_priority = MAX_USER_RT_PRIO/2 }; + struct softirqdata *data = __data; + u32 mask = (1 << data->nr); + struct softirq_action *h; + +#ifdef CONFIG_PREEMPT_SOFTIRQS + init_waitqueue_head(&data->wait); +#endif + + sys_sched_setscheduler(current->pid, SCHED_FIFO, ¶m); + current->flags |= PF_SOFTIRQ; set_current_state(TASK_INTERRUPTIBLE); while (!kthread_should_stop()) { preempt_disable(); - if (!local_softirq_pending()) { + if (!(local_softirq_pending() & mask)) { preempt_enable_no_resched(); schedule(); preempt_disable(); @@ -649,20 +730,42 @@ static int ksoftirqd(void * __bind_cpu) __set_current_state(TASK_RUNNING); - while (local_softirq_pending()) { +#ifdef CONFIG_PREEMPT_SOFTIRQS + data->running = 1; +#endif + + while (local_softirq_pending() & mask) { /* Preempt disable stops cpu going offline. If already offline, we'll be on wrong CPU: don't process */ - if (cpu_is_offline((long)__bind_cpu)) + if (cpu_is_offline(data->cpu)) goto wait_to_die; - do_softirq(); + + local_irq_disable(); preempt_enable_no_resched(); + set_softirq_pending(local_softirq_pending() & ~mask); + local_bh_disable(); + local_irq_enable(); + + h = &softirq_vec[data->nr]; + if (h) + h->action(h); + rcu_bh_qsctr_inc(data->cpu); + + local_irq_disable(); + _local_bh_enable(); + local_irq_enable(); + cond_resched(); preempt_disable(); - rcu_qsctr_inc((long)__bind_cpu); + rcu_qsctr_inc(data->cpu); } preempt_enable(); set_current_state(TASK_INTERRUPTIBLE); +#ifdef CONFIG_PREEMPT_SOFTIRQS + data->running = 0; + wake_up(&data->wait); +#endif } __set_current_state(TASK_RUNNING); return 0; @@ -712,7 +815,7 @@ void tasklet_kill_immediate(struct taskl BUG(); } -static void takeover_tasklets(unsigned int cpu) +void takeover_tasklets(unsigned int cpu) { /* CPU is dead, so no lock needed. */ local_irq_disable(); @@ -738,49 +841,82 @@ static void takeover_tasklets(unsigned i } #endif /* CONFIG_HOTPLUG_CPU */ +static const char *softirq_names [] = +{ + [HI_SOFTIRQ] = "high", + [SCHED_SOFTIRQ] = "sched", + [TIMER_SOFTIRQ] = "timer", + [NET_TX_SOFTIRQ] = "net-tx", + [NET_RX_SOFTIRQ] = "net-rx", + [BLOCK_SOFTIRQ] = "block", + [TASKLET_SOFTIRQ] = "tasklet", +#ifdef CONFIG_HIGH_RES_TIMERS + [HRTIMER_SOFTIRQ] = "hrtimer", +#endif + [RCU_SOFTIRQ] = "rcu", +}; + static int __cpuinit cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { - int hotcpu = (unsigned long)hcpu; + int hotcpu = (unsigned long)hcpu, i; struct task_struct *p; switch (action) { case CPU_UP_PREPARE: case CPU_UP_PREPARE_FROZEN: - p = kthread_create(ksoftirqd, hcpu, "ksoftirqd/%d", hotcpu); - if (IS_ERR(p)) { - printk("ksoftirqd for %i failed\n", hotcpu); - return NOTIFY_BAD; - } - kthread_bind(p, hotcpu); - per_cpu(ksoftirqd, hotcpu) = p; - break; + for (i = 0; i < MAX_SOFTIRQ; i++) { + per_cpu(ksoftirqd, hotcpu)[i].nr = i; + per_cpu(ksoftirqd, hotcpu)[i].cpu = hotcpu; + per_cpu(ksoftirqd, hotcpu)[i].tsk = NULL; + } + for (i = 0; i < MAX_SOFTIRQ; i++) { + p = kthread_create(ksoftirqd, + &per_cpu(ksoftirqd, hotcpu)[i], + "softirq-%s/%d", softirq_names[i], + hotcpu); + if (IS_ERR(p)) { + printk("ksoftirqd %d for %i failed\n", i, + hotcpu); + return NOTIFY_BAD; + } + kthread_bind(p, hotcpu); + per_cpu(ksoftirqd, hotcpu)[i].tsk = p; + } + break; + break; case CPU_ONLINE: case CPU_ONLINE_FROZEN: - wake_up_process(per_cpu(ksoftirqd, hotcpu)); + for (i = 0; i < MAX_SOFTIRQ; i++) + wake_up_process(per_cpu(ksoftirqd, hotcpu)[i].tsk); break; #ifdef CONFIG_HOTPLUG_CPU case CPU_UP_CANCELED: case CPU_UP_CANCELED_FROZEN: - if (!per_cpu(ksoftirqd, hotcpu)) - break; - /* Unbind so it can run. Fall thru. */ - kthread_bind(per_cpu(ksoftirqd, hotcpu), - cpumask_any(cpu_online_mask)); +#if 0 + for (i = 0; i < MAX_SOFTIRQ; i++) { + if (!per_cpu(ksoftirqd, hotcpu)[i].tsk) + continue; + kthread_bind(per_cpu(ksoftirqd, hotcpu)[i].tsk, + cpumask_any(cpu_online_mask)); + } +#endif case CPU_DEAD: case CPU_DEAD_FROZEN: { struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; - p = per_cpu(ksoftirqd, hotcpu); - per_cpu(ksoftirqd, hotcpu) = NULL; - sched_setscheduler_nocheck(p, SCHED_FIFO, ¶m); - kthread_stop(p); + for (i = 0; i < MAX_SOFTIRQ; i++) { + p = per_cpu(ksoftirqd, hotcpu)[i].tsk; + per_cpu(ksoftirqd, hotcpu)[i].tsk = NULL; + sched_setscheduler_nocheck(p, SCHED_FIFO, ¶m); + kthread_stop(p); + } takeover_tasklets(hotcpu); break; } #endif /* CONFIG_HOTPLUG_CPU */ - } + } return NOTIFY_OK; } @@ -800,6 +936,29 @@ static __init int spawn_ksoftirqd(void) } early_initcall(spawn_ksoftirqd); + +#ifdef CONFIG_PREEMPT_SOFTIRQS + +int softirq_preemption = 1; + +EXPORT_SYMBOL(softirq_preemption); + +static int __init softirq_preempt_setup (char *str) +{ + if (!strncmp(str, "off", 3)) + softirq_preemption = 0; + else + get_option(&str, &softirq_preemption); + if (!softirq_preemption) + printk("turning off softirq preemption!\n"); + + return 1; +} + +__setup("softirq-preempt=", softirq_preempt_setup); + +#endif + #ifdef CONFIG_SMP /* * Call a function on all processors patches/fix_vdso_gtod_vsyscall64_2.patch0000664000076400007640000000554111160752235017436 0ustar tglxtglxSubject: patches/fix_vdso_gtod_vsyscall64_2.patch This patch offers this resolution for the clocksources that have a vread() function, such as tsc and hpet. Otherwise it keeps uses the read() function offered by the clocksource, that may be costly. Also, a few other tweaks are performed. Signed-off-by: Luis Claudio R. Goncalves Signed-off-by: Ingo Molnar --- arch/x86/kernel/vsyscall_64.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) Index: linux-2.6-tip/arch/x86/kernel/vsyscall_64.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/vsyscall_64.c +++ linux-2.6-tip/arch/x86/kernel/vsyscall_64.c @@ -78,14 +78,40 @@ void update_vsyscall(struct timespec *wa unsigned long flags; write_seqlock_irqsave(&vsyscall_gtod_data.lock, flags); + + if (likely(vsyscall_gtod_data.sysctl_enabled == 2)) { + struct timespec tmp = *(wall_time); + cycle_t (*vread)(void); + cycle_t now; + + vread = vsyscall_gtod_data.clock.vread; + if (likely(vread)) + now = vread(); + else + now = clock->read(); + + /* calculate interval: */ + now = (now - clock->cycle_last) & clock->mask; + /* convert to nsecs: */ + tmp.tv_nsec += ( now * clock->mult) >> clock->shift; + + while (tmp.tv_nsec >= NSEC_PER_SEC) { + tmp.tv_sec += 1; + tmp.tv_nsec -= NSEC_PER_SEC; + } + + vsyscall_gtod_data.wall_time_sec = tmp.tv_sec; + vsyscall_gtod_data.wall_time_nsec = tmp.tv_nsec; + } else { + vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec; + vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec; + } /* copy vsyscall data */ vsyscall_gtod_data.clock.vread = clock->vread; vsyscall_gtod_data.clock.cycle_last = clock->cycle_last; vsyscall_gtod_data.clock.mask = clock->mask; vsyscall_gtod_data.clock.mult = clock->mult; vsyscall_gtod_data.clock.shift = clock->shift; - vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec; - vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec; vsyscall_gtod_data.wall_to_monotonic = wall_to_monotonic; write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags); } @@ -138,7 +164,8 @@ static __always_inline void do_vgettimeo } while (tmp.tv_usec != tv->tv_usec || tmp.tv_sec != tv->tv_sec); - tv->tv_usec /= NSEC_PER_USEC; + tv->tv_usec /= NSEC_PER_MSEC; + tv->tv_usec *= USEC_PER_MSEC; return; } @@ -157,7 +184,6 @@ static __always_inline void do_vgettimeo * does not cause time warps: */ rdtsc_barrier(); - now = vread(); rdtsc_barrier(); base = __vsyscall_gtod_data.clock.cycle_last; @@ -169,6 +195,7 @@ static __always_inline void do_vgettimeo nsec = __vsyscall_gtod_data.wall_time_nsec; } while (read_seqretry(&__vsyscall_gtod_data.lock, seq)); + now = vread(); /* calculate interval: */ cycle_delta = (now - base) & mask; /* convert to nsecs: */ patches/preempt-realtime-arm-footbridge.patch0000664000076400007640000000343011160752235020433 0ustar tglxtglx--- arch/arm/mach-footbridge/include/mach/hardware.h | 2 +- arch/arm/mach-footbridge/netwinder-hw.c | 2 +- arch/arm/mach-footbridge/netwinder-leds.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Index: linux-2.6-tip/arch/arm/mach-footbridge/include/mach/hardware.h =================================================================== --- linux-2.6-tip.orig/arch/arm/mach-footbridge/include/mach/hardware.h +++ linux-2.6-tip/arch/arm/mach-footbridge/include/mach/hardware.h @@ -86,7 +86,7 @@ #define CPLD_FLASH_WR_ENABLE 1 #ifndef __ASSEMBLY__ -extern spinlock_t nw_gpio_lock; +extern raw_spinlock_t nw_gpio_lock; extern void nw_gpio_modify_op(unsigned int mask, unsigned int set); extern void nw_gpio_modify_io(unsigned int mask, unsigned int in); extern unsigned int nw_gpio_read(void); Index: linux-2.6-tip/arch/arm/mach-footbridge/netwinder-hw.c =================================================================== --- linux-2.6-tip.orig/arch/arm/mach-footbridge/netwinder-hw.c +++ linux-2.6-tip/arch/arm/mach-footbridge/netwinder-hw.c @@ -68,7 +68,7 @@ static inline void wb977_ww(int reg, int /* * This is a lock for accessing ports GP1_IO_BASE and GP2_IO_BASE */ -DEFINE_SPINLOCK(nw_gpio_lock); +DEFINE_RAW_SPINLOCK(nw_gpio_lock); EXPORT_SYMBOL(nw_gpio_lock); static unsigned int current_gpio_op; Index: linux-2.6-tip/arch/arm/mach-footbridge/netwinder-leds.c =================================================================== --- linux-2.6-tip.orig/arch/arm/mach-footbridge/netwinder-leds.c +++ linux-2.6-tip/arch/arm/mach-footbridge/netwinder-leds.c @@ -31,7 +31,7 @@ static char led_state; static char hw_led_state; -static DEFINE_SPINLOCK(leds_lock); +static DEFINE_RAW_SPINLOCK(leds_lock); static void netwinder_leds_event(led_event_t evt) { patches/gtod-optimize.patch0000664000076400007640000000136111160752235015054 0ustar tglxtglxSubject: gtod: optimize From: Ingo Molnar Date: Wed Feb 04 00:02:44 CET 2009 Signed-off-by: Ingo Molnar --- kernel/timer.c | 7 +++++++ 1 file changed, 7 insertions(+) Index: linux-2.6-tip/kernel/timer.c =================================================================== --- linux-2.6-tip.orig/kernel/timer.c +++ linux-2.6-tip/kernel/timer.c @@ -1277,6 +1277,13 @@ static inline void update_times(void) static unsigned long last_tick = INITIAL_JIFFIES; unsigned long ticks, flags; + /* + * Dont take the xtime_lock from every CPU in + * every tick - only when needed: + */ + if (jiffies == last_tick) + return; + write_seqlock_irqsave(&xtime_lock, flags); ticks = jiffies - last_tick; if (ticks) { patches/cpuhotplug-idle.patch0000664000076400007640000000356511161723432015374 0ustar tglxtglxSubject: cpu-hotplug: cpu_down vs preempt-rt From: Peter Zijlstra Date: Wed Mar 18 15:38:32 CET 2009 idle_task_exit() calls mmdrop() from the idle thread, but in PREEMPT_RT all the allocator locks are sleeping locks - for obvious reasons scheduling away the idle thread gives some curious problems. Solve this by using mmdrop_delayed() and extending it to work for hotplug. Signed-off-by: Peter Zijlstra --- kernel/fork.c | 14 ++++++++++++++ kernel/sched.c | 4 ++++ 2 files changed, 18 insertions(+) Index: linux-2.6-tip/kernel/fork.c =================================================================== --- linux-2.6-tip.orig/kernel/fork.c +++ linux-2.6-tip/kernel/fork.c @@ -1816,6 +1816,19 @@ void __mmdrop_delayed(struct mm_struct put_cpu_var(delayed_drop_list); } +static void takeover_delayed_drop(int hotcpu) +{ + struct list_head *head = &per_cpu(delayed_drop_list, hotcpu); + + while (!list_empty(head)) { + struct mm_struct *mm = list_entry(head->next, + struct mm_struct, delayed_drop); + + list_del(&mm->delayed_drop); + __mmdrop_delayed(mm); + } +} + static int desched_thread(void * __bind_cpu) { set_user_nice(current, -10); @@ -1876,6 +1889,7 @@ static int __devinit cpu_callback(struct p = per_cpu(desched_task, hotcpu); per_cpu(desched_task, hotcpu) = NULL; kthread_stop(p); + takeover_delayed_drop(hotcpu); takeover_tasklets(hotcpu); break; #endif /* CONFIG_HOTPLUG_CPU */ Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -7098,7 +7098,11 @@ void idle_task_exit(void) if (mm != &init_mm) switch_mm(mm, &init_mm, current); +#ifdef CONFIG_PREEMPT_RT + mmdrop_delayed(mm); +#else mmdrop(mm); +#endif } /* called under rq->lock with disabled interrupts */ patches/adaptive-adjust-pi-wakeup.patch0000664000076400007640000000360311160752235017247 0ustar tglxtglxSubject: adjust pi_lock usage in wakeup From: Gregory Haskins Date: Tue, 20 May 2008 10:49:31 -0400 [ The following text is in the "utf-8" character set. ] [ Your display is set for the "iso-8859-1" character set. ] [ Some characters may be displayed incorrectly. ] From: Peter W.Morreale In wakeup_next_waiter(), we take the pi_lock, and then find out whether we have another waiter to add to the pending owner. We can reduce contention on the pi_lock for the pending owner if we first obtain the pointer to the next waiter outside of the pi_lock. Signed-off-by: Peter W. Morreale Signed-off-by: Gregory Haskins Signed-off-by: Ingo Molnar --- kernel/rtmutex.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -506,6 +506,7 @@ static void wakeup_next_waiter(struct rt { struct rt_mutex_waiter *waiter; struct task_struct *pendowner; + struct rt_mutex_waiter *next; spin_lock(¤t->pi_lock); @@ -568,6 +569,12 @@ static void wakeup_next_waiter(struct rt * waiter with higher priority than pending-owner->normal_prio * is blocked on the unboosted (pending) owner. */ + + if (rt_mutex_has_waiters(lock)) + next = rt_mutex_top_waiter(lock); + else + next = NULL; + spin_lock(&pendowner->pi_lock); WARN_ON(!pendowner->pi_blocked_on); @@ -576,12 +583,9 @@ static void wakeup_next_waiter(struct rt pendowner->pi_blocked_on = NULL; - if (rt_mutex_has_waiters(lock)) { - struct rt_mutex_waiter *next; - - next = rt_mutex_top_waiter(lock); + if (next) plist_add(&next->pi_list_entry, &pendowner->pi_waiters); - } + spin_unlock(&pendowner->pi_lock); } patches/preempt-realtime-perfcounters.patch0000664000076400007640000000265511161661124020256 0ustar tglxtglxSubject: rt: fix perfcounters From: Ingo Molnar Date: Mon Feb 09 23:04:04 CET 2009 perfcounter spinlocks get called from within the scheduler, so they need to be atomic spinlocks too. Signed-off-by: Ingo Molnar --- include/linux/init_task.h | 2 +- include/linux/perf_counter.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6-tip/include/linux/init_task.h =================================================================== --- linux-2.6-tip.orig/include/linux/init_task.h +++ linux-2.6-tip/include/linux/init_task.h @@ -128,7 +128,7 @@ extern struct cred init_cred; .perf_counter_ctx.event_list = \ LIST_HEAD_INIT(tsk.perf_counter_ctx.event_list), \ .perf_counter_ctx.lock = \ - __SPIN_LOCK_UNLOCKED(tsk.perf_counter_ctx.lock), + RAW_SPIN_LOCK_UNLOCKED(tsk.perf_counter_ctx.lock), #else # define INIT_PERF_COUNTERS(tsk) #endif Index: linux-2.6-tip/include/linux/perf_counter.h =================================================================== --- linux-2.6-tip.orig/include/linux/perf_counter.h +++ linux-2.6-tip/include/linux/perf_counter.h @@ -276,7 +276,7 @@ struct perf_counter_context { * Protect the states of the counters in the list, * nr_active, and the list: */ - spinlock_t lock; + raw_spinlock_t lock; /* * Protect the list of counters. Locking either mutex or lock * is sufficient to ensure the list doesn't change; to change patches/swap-spinlock-fix.patch0000664000076400007640000002161611160752235015644 0ustar tglxtglxSubject: Re: deadlock on 2.6.24.3-rt3 From: Hiroshi Shimamoto Date: Mon, 17 Mar 2008 17:14:51 -0700 Hiroshi Shimamoto wrote: > Hi, > > I got a soft lockup message on 2.6.24.3-rt3. > I attached the .config. > > I think there is a deadlock scenario, I explain later. > > Here is the console log; > BUG: soft lockup - CPU#2 stuck for 11s! [bash:2175] > CPU 2: > Modules linked in: > Pid: 2175, comm: bash Not tainted 2.6.24.3-rt3 #1 > RIP: 0010:[] [] __spin_lock+0x57/0x67 > RSP: 0000:ffff8100c52a1d48 EFLAGS: 00000202 > RAX: 0000000000000000 RBX: 0000000000004bc5 RCX: 0000000000004bc5 > RDX: 0000000000000002 RSI: 00000000006c3208 RDI: 0000000000000001 > RBP: 000000000000000d R08: ffff8100cbc28018 R09: ffff810007c95458 > R10: 00000000006c3208 R11: 0000000000000246 R12: ffffffff808246e8 > R13: 000284d000000002 R14: ffffffff80387277 R15: 00000000ffffffff > FS: 00002b28926a2ef0(0000) GS:ffff8100cf8a3940(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b > CR2: 00000000006c3208 CR3: 00000000c3cac000 CR4: 00000000000006e0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 > Call Trace: > [] __spin_lock+0x29/0x67 > [] swap_info_get+0x65/0xdd > [] can_share_swap_page+0x39/0x84 > [] do_wp_page+0x2f9/0x519 > [] handle_mm_fault+0x615/0x7cf > [] proc_flush_task+0x171/0x29c > [] recalc_sigpending+0xe/0x3c > [] do_page_fault+0x162/0x754 > [] audit_syscall_exit+0x31c/0x37a > [] error_exit+0x0/0x51 > --------------------------- > | preempt count: 00010002 ] > | 2-level deep critical section nesting: > ---------------------------------------- > .. [] .... __spin_lock+0xe/0x67 > .....[<00000000>] .. ( <= 0x0) > .. [] .... __spin_lock+0xe/0x67 > .....[<00000000>] .. ( <= 0x0) > BUG: soft lockup - CPU#3 stuck for 11s! [stress:9460] > CPU 3: > Modules linked in: > Pid: 9460, comm: stress Not tainted 2.6.24.3-rt3 #1 > RIP: 0010:[] [] find_get_page+0xad/0xbe > RSP: 0018:ffff8100cbf25b88 EFLAGS: 00000202 > 0000000000002009 RBX: ffffffff80824bc8 RCX: 0000000000000002 > RDX: 0000000000000002 RSI: ffff8100cbfcf298 RDI: ffff810005ad8910 > RBP: ffffffff80383a57 R08: ffff810005ad8918 R09: 0000000000000003 > R10: ffff810005ad88d8 R11: 0000000000000001 R12: ffffffff80822880 > R13: ffff81000799ce48 R14: ffffffff8028921c R15: ffffffff80822880 > FS: 00002acaa373bb00(0000) GS:ffff8100cf8a32c0(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b > CR2: 00002b9b2827c530 CR3: 000000006cc90000 CR4: 00000000000006e0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 > Call Trace: > [] find_get_page+0x23/0xbe > [] free_swap_and_cache+0x46/0xdd > [] unmap_vmas+0x626/0x8ce > [] exit_mmap+0xac/0x147 > [] mmput+0x32/0xae > [] do_exit+0x199/0x914 > [] __dequeue_signal+0x19/0x1b7 > [] do_group_exit+0x2c/0x7e > [] get_signal_to_deliver+0x2ef/0x4aa > [] do_notify_resume+0xa8/0x7cd > [] add_preempt_count+0x14/0x111 > [] __up_read+0x13/0x8d > [] do_page_fault+0x187/0x754 > [] __dequeue_entity+0x2d/0x34 > [] __switch_to+0x27/0x2c9 > [] do_page_fault+0x1f4/0x754 > [] retint_signal+0x3d/0x7f > --------------------------- > | preempt count: 00010005 ] > | 5-level deep critical section nesting: > ---------------------------------------- > .. [] .... __spin_lock+0xe/0x67 > .....[<00000000>] .. ( <= 0x0) > .. [] .... __spin_lock+0xe/0x67 > .....[<00000000>] .. ( <= 0x0) > .. [] .... __spin_lock+0xe/0x67 > .....[<00000000>] .. ( <= 0x0) > .. [] .... find_get_page+0x14/0xbe > .....[<00000000>] .. ( <= 0x0) > .. [] .... __spin_lock+0xe/0x67 > .....[<00000000>] .. ( <= 0x0) > > > I also got a kernel core. > (gdb) info thr > 4 process 9460 0xffffffff8027c974 in find_get_page (mapping=, > offset=18446744071570598016) at include/asm/processor_64.h:385 > 3 process 2175 __spin_lock (lock=0xffffffff80893f80) at kernel/spinlock.c:333 > 2 process 9132 __spin_lock (lock=0xffffffff80893f80) at include/asm/spinlock_64.h:22 > * 1 process 9478 __spin_lock (lock=0xffffffff80893f80) at kernel/spinlock.c:333 > > CPU3(thread 4) is in find_get_page(), and the others in __spin_lock(). > The thread 4 is waiting to turn PG_nonewrefs bit off in wait_on_page_ref() which is > called from page_cache_get_speculative(), and the thread 4 holds the swap_lock. > The other threads waiting the swap_lock. > On the other hand, the thread 1 turned PG_nonewrefs bit on by calling > lock_page_ref_irq() in remove_mapping(), and then waiting the swap_lock. > So if the target page of remove_mapping() is in the exiting process memory, > the kernel is deadlock. > > (gdb) bt > #0 __spin_lock (lock=0xffffffff80893f80) at kernel/spinlock.c:333 > #1 0xffffffff80296597 in swap_info_get (entry=) > at mm/swapfile.c:253 > #2 0xffffffff80296618 in swap_free (entry={val = 1}) at mm/swapfile.c:300 > #3 0xffffffff80286acd in remove_mapping (mapping=, > page=0xffff810005ad8910) at mm/vmscan.c:423 > ... > > (gdb) thr 2 > (gdb) bt > #0 __spin_lock (lock=0xffffffff80893f80) at include/asm/spinlock_64.h:22 > #1 0xffffffff80296374 in valid_swaphandles (entry=, > offset=0xffff81001e22bc78) at mm/swapfile.c:1783 > #2 0xffffffff8028b0af in swapin_readahead (entry={val = 1}, addr=0, vma=0x1) > at mm/memory.c:2054 > #3 0xffffffff8029a6af in shmem_getpage (inode=0xffff8100cdf4fd48, idx=0, > pagep=0xffff81001e22bd80, sgp=SGP_FAULT, type=0xffff81001e22bd34) at mm/shmem.c:1089 > ... > > (gdb) thr 3 > (gdb) bt > #0 __spin_lock (lock=0xffffffff80893f80) at kernel/spinlock.c:333 > #1 0xffffffff80296597 in swap_info_get (entry=) > at mm/swapfile.c:253 > #2 0xffffffff80296c0c in can_share_swap_page (page=) > at mm/swapfile.c:317 > #3 0xffffffff8028ae6e in do_wp_page (mm=0xffff8100ce772f40, vma=0xffff8100cd212f00, > address=7090696, page_table=0xffff8100cbcef618, pmd=0xffff8100cbc28018, > ptl=0xffff810007c95458, orig_pte=) at mm/memory.c:1606 > ... > > (gdb) thr 4 > (gdb) bt > #0 0xffffffff8027c974 in find_get_page (mapping=, > offset=18446744071570598016) at include/asm/processor_64.h:385 > #1 0xffffffff80296f83 in free_swap_and_cache (entry={val = 4032}) at mm/swapfile.c:403 > #2 0xffffffff8028b9b7 in unmap_vmas (tlbp=0xffff8100cbf25cd8, vma=0xffff8100cde5c678, > start_addr=0, end_addr=18446744073709551615, nr_accounted=0xffff8100cbf25cd0, > details=0x0) at mm/memory.c:728 > #3 0xffffffff8028fa4c in exit_mmap (mm=0xffff8100cd093600) at mm/mmap.c:2048 > #4 0xffffffff8023ced7 in mmput (mm=0xffff8100cd093600) at kernel/fork.c:443 > #5 0xffffffff80242f00 in do_exit (code=14) at kernel/exit.c:997 > ... > > > I think it came from the lockless speculative get page patch. > I found the newer version of this patch in linux-mm. > http://marc.info/?l=linux-mm&m=119477111927364&w=2 > > I haven't tested it because it looks big change and hard to apply. > But it seems to fix this deadlock issue. > Any other patch to fix this issue is welcome. > Is this patch good? Signed-off-by: Ingo Molnar --- From: Hiroshi Shimamoto There is a deadlock scenario; remove_mapping() vs free_swap_and_cache(). remove_mapping() turns PG_nonewrefs bit on, then locks swap_lock. free_swap_and_cache() locks swap_lock, then wait to turn PG_nonewrefs bit off in find_get_page(). swap_lock can be unlocked before calling find_get_page(). Signed-off-by: Hiroshi Shimamoto --- mm/swapfile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Index: linux-2.6-tip/mm/swapfile.c =================================================================== --- linux-2.6-tip.orig/mm/swapfile.c +++ linux-2.6-tip/mm/swapfile.c @@ -585,13 +585,14 @@ int free_swap_and_cache(swp_entry_t entr p = swap_info_get(entry); if (p) { if (swap_entry_free(p, entry) == 1) { + spin_unlock(&swap_lock); page = find_get_page(&swapper_space, entry.val); if (page && !trylock_page(page)) { page_cache_release(page); page = NULL; } - } - spin_unlock(&swap_lock); + } else + spin_unlock(&swap_lock); } if (page) { /* patches/kmap-atomic-i386-fix.patch0000664000076400007640000000317611160752235015744 0ustar tglxtglxSubject: kmap: atomic i386 fix From: Ingo Molnar Date: Wed Feb 04 00:02:36 CET 2009 Signed-off-by: Ingo Molnar --- arch/x86/include/asm/highmem.h | 6 +++--- arch/x86/mm/highmem_32.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) Index: linux-2.6-tip/arch/x86/include/asm/highmem.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/highmem.h +++ linux-2.6-tip/arch/x86/include/asm/highmem.h @@ -89,10 +89,10 @@ extern void add_highpages_with_active_re * on PREEMPT_RT kmap_atomic() is a wrapper that uses kmap(): */ #ifdef CONFIG_PREEMPT_RT -# define kmap_atomic_prot(page, type, prot) kmap(page) -# define kmap_atomic(page, type) kmap(page) +# define kmap_atomic_prot(page, type, prot) ({ pagefault_disable(); kmap(page); }) +# define kmap_atomic(page, type) ({ pagefault_disable(); kmap(page); }) # define kmap_atomic_pfn(pfn, type) kmap(pfn_to_page(pfn)) -# define kunmap_atomic(kvaddr, type) kunmap_virt(kvaddr) +# define kunmap_atomic(kvaddr, type) do { pagefault_enable(); kunmap_virt(kvaddr); } while(0) # define kmap_atomic_to_page(kvaddr) kmap_to_page(kvaddr) #else # define kmap_atomic_prot(page, type, prot) __kmap_atomic_prot(page, type, prot) Index: linux-2.6-tip/arch/x86/mm/highmem_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/highmem_32.c +++ linux-2.6-tip/arch/x86/mm/highmem_32.c @@ -4,9 +4,9 @@ void *kmap(struct page *page) { - might_sleep(); if (!PageHighMem(page)) return page_address(page); + might_sleep(); return kmap_high(page); } patches/mm-lock-break-on-bulk.patch0000664000076400007640000000123611160752235016250 0ustar tglxtglxSubject: mm-lock-break-on-bulk.patch From: Thomas Gleixner Date: Mon, 16 Mar 2009 17:06:15 +0100 Signed-off-by: Thomas Gleixner --- mm/page_alloc.c | 1 + 1 file changed, 1 insertion(+) Index: linux-2.6-tip/mm/page_alloc.c =================================================================== --- linux-2.6-tip.orig/mm/page_alloc.c +++ linux-2.6-tip/mm/page_alloc.c @@ -578,6 +578,7 @@ static void free_pages_bulk(struct zone /* have to delete it as __free_one_page list manipulates */ list_del(&page->lru); __free_one_page(page, zone, order); + cond_resched_lock(&zone->lock); } spin_unlock(&zone->lock); } patches/preempt-realtimer-timer-more-non-rt-warning-fixes.patch0000664000076400007640000000124311160752235023766 0ustar tglxtglxSubject: rt: fix timer.c warning From: Ingo Molnar Date: Sun Feb 08 07:46:38 CET 2009 Signed-off-by: Ingo Molnar --- kernel/timer.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6-tip/kernel/timer.c =================================================================== --- linux-2.6-tip.orig/kernel/timer.c +++ linux-2.6-tip/kernel/timer.c @@ -1233,7 +1233,9 @@ unsigned long avenrun_rt[3]; static inline void calc_load(unsigned long ticks) { unsigned long active_tasks; /* fixed-point */ +#ifdef CONFIG_PREEMPT_RT unsigned long active_rt_tasks; /* fixed-point */ +#endif static int count = LOAD_FREQ; count -= ticks; patches/rt-mutex-compat-semaphores.patch0000664000076400007640000001514711160752235017502 0ustar tglxtglxSubject: patches/rt-mutex-compat-semaphores.patch Signed-off-by: Ingo Molnar --- drivers/acpi/osl.c | 12 ++++++------ drivers/media/dvb/dvb-core/dvb_frontend.c | 2 +- drivers/net/3c527.c | 2 +- drivers/net/hamradio/6pack.c | 2 +- drivers/net/hamradio/mkiss.c | 2 +- drivers/net/ppp_async.c | 2 +- drivers/pci/hotplug/ibmphp_hpc.c | 2 +- drivers/scsi/aacraid/aacraid.h | 2 +- include/linux/parport.h | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) Index: linux-2.6-tip/drivers/acpi/osl.c =================================================================== --- linux-2.6-tip.orig/drivers/acpi/osl.c +++ linux-2.6-tip/drivers/acpi/osl.c @@ -799,12 +799,12 @@ void acpi_os_delete_lock(acpi_spinlock h acpi_status acpi_os_create_semaphore(u32 max_units, u32 initial_units, acpi_handle * handle) { - struct semaphore *sem = NULL; + struct compat_semaphore *sem = NULL; - sem = acpi_os_allocate(sizeof(struct semaphore)); + sem = acpi_os_allocate(sizeof(struct compat_semaphore)); if (!sem) return AE_NO_MEMORY; - memset(sem, 0, sizeof(struct semaphore)); + memset(sem, 0, sizeof(struct compat_semaphore)); sema_init(sem, initial_units); @@ -825,7 +825,7 @@ acpi_os_create_semaphore(u32 max_units, acpi_status acpi_os_delete_semaphore(acpi_handle handle) { - struct semaphore *sem = (struct semaphore *)handle; + struct compat_semaphore *sem = (struct compat_semaphore *)handle; if (!sem) return AE_BAD_PARAMETER; @@ -845,7 +845,7 @@ acpi_status acpi_os_delete_semaphore(acp acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout) { acpi_status status = AE_OK; - struct semaphore *sem = (struct semaphore *)handle; + struct compat_semaphore *sem = (struct compat_semaphore *)handle; long jiffies; int ret = 0; @@ -886,7 +886,7 @@ acpi_status acpi_os_wait_semaphore(acpi_ */ acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units) { - struct semaphore *sem = (struct semaphore *)handle; + struct compat_semaphore *sem = (struct compat_semaphore *)handle; if (!sem || (units < 1)) return AE_BAD_PARAMETER; Index: linux-2.6-tip/drivers/media/dvb/dvb-core/dvb_frontend.c =================================================================== --- linux-2.6-tip.orig/drivers/media/dvb/dvb-core/dvb_frontend.c +++ linux-2.6-tip/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -101,7 +101,7 @@ struct dvb_frontend_private { struct dvb_device *dvbdev; struct dvb_frontend_parameters parameters; struct dvb_fe_events events; - struct semaphore sem; + struct compat_semaphore sem; struct list_head list_head; wait_queue_head_t wait_queue; struct task_struct *thread; Index: linux-2.6-tip/drivers/net/3c527.c =================================================================== --- linux-2.6-tip.orig/drivers/net/3c527.c +++ linux-2.6-tip/drivers/net/3c527.c @@ -181,7 +181,7 @@ struct mc32_local u16 rx_ring_tail; /* index to rx de-queue end */ - struct semaphore cmd_mutex; /* Serialises issuing of execute commands */ + struct compat_semaphore cmd_mutex; /* Serialises issuing of execute commands */ struct completion execution_cmd; /* Card has completed an execute command */ struct completion xceiver_cmd; /* Card has completed a tx or rx command */ }; Index: linux-2.6-tip/drivers/net/hamradio/6pack.c =================================================================== --- linux-2.6-tip.orig/drivers/net/hamradio/6pack.c +++ linux-2.6-tip/drivers/net/hamradio/6pack.c @@ -120,7 +120,7 @@ struct sixpack { struct timer_list tx_t; struct timer_list resync_t; atomic_t refcnt; - struct semaphore dead_sem; + struct compat_semaphore dead_sem; spinlock_t lock; }; Index: linux-2.6-tip/drivers/net/hamradio/mkiss.c =================================================================== --- linux-2.6-tip.orig/drivers/net/hamradio/mkiss.c +++ linux-2.6-tip/drivers/net/hamradio/mkiss.c @@ -84,7 +84,7 @@ struct mkiss { #define CRC_MODE_SMACK_TEST 4 atomic_t refcnt; - struct semaphore dead_sem; + struct compat_semaphore dead_sem; }; /*---------------------------------------------------------------------------*/ Index: linux-2.6-tip/drivers/net/ppp_async.c =================================================================== --- linux-2.6-tip.orig/drivers/net/ppp_async.c +++ linux-2.6-tip/drivers/net/ppp_async.c @@ -67,7 +67,7 @@ struct asyncppp { struct tasklet_struct tsk; atomic_t refcnt; - struct semaphore dead_sem; + struct compat_semaphore dead_sem; struct ppp_channel chan; /* interface to generic ppp layer */ unsigned char obuf[OBUFSIZE]; }; Index: linux-2.6-tip/drivers/pci/hotplug/ibmphp_hpc.c =================================================================== --- linux-2.6-tip.orig/drivers/pci/hotplug/ibmphp_hpc.c +++ linux-2.6-tip/drivers/pci/hotplug/ibmphp_hpc.c @@ -104,7 +104,7 @@ static int to_debug = 0; static struct mutex sem_hpcaccess; // lock access to HPC static struct semaphore semOperations; // lock all operations and // access to data structures -static struct semaphore sem_exit; // make sure polling thread goes away +static struct compat_semaphore sem_exit; // make sure polling thread goes away static struct task_struct *ibmphp_poll_thread; //---------------------------------------------------------------------------- // local function prototypes Index: linux-2.6-tip/drivers/scsi/aacraid/aacraid.h =================================================================== --- linux-2.6-tip.orig/drivers/scsi/aacraid/aacraid.h +++ linux-2.6-tip/drivers/scsi/aacraid/aacraid.h @@ -719,7 +719,7 @@ struct aac_fib_context { u32 unique; // unique value representing this context ulong jiffies; // used for cleanup - dmb changed to ulong struct list_head next; // used to link context's into a linked list - struct semaphore wait_sem; // this is used to wait for the next fib to arrive. + struct compat_semaphore wait_sem; // this is used to wait for the next fib to arrive. int wait; // Set to true when thread is in WaitForSingleObject unsigned long count; // total number of FIBs on FibList struct list_head fib_list; // this holds fibs and their attachd hw_fibs Index: linux-2.6-tip/include/linux/parport.h =================================================================== --- linux-2.6-tip.orig/include/linux/parport.h +++ linux-2.6-tip/include/linux/parport.h @@ -264,7 +264,7 @@ enum ieee1284_phase { struct ieee1284_info { int mode; volatile enum ieee1284_phase phase; - struct semaphore irq; + struct compat_semaphore irq; }; /* A parallel port */ patches/preempt-realtime-mellanox-driver-fix.patch0000664000076400007640000000320011160752235021421 0ustar tglxtglxSubject: - Mellanox IB driver patch From: Sven-Thorsten Dietrich Date: Fri, 24 Aug 2007 02:25:26 -0700 Hi Ingo, RT driver patch to eliminate in_atomic stack dump. The problem code was identified by Michael S. Tsirkin, and he suggested the fix. I adapted to use RT's _nort primitives- should work correctly in all configs. Thanks, Sven Fixes in_atomic stack-dump, when Mellanox module is loaded into the RT Kernel. From: Michael S. Tsirkin "Basically, if you just make spin_lock_irqsave (and spin_lock_irq) not disable interrupts for non-raw spinlocks, I think all of infiniband will be fine without changes." signed-off-by: Sven-Thorsten Dietrich Signed-off-by: Ingo Molnar --- drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6-tip/drivers/infiniband/ulp/ipoib/ipoib_multicast.c =================================================================== --- linux-2.6-tip.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ linux-2.6-tip/drivers/infiniband/ulp/ipoib/ipoib_multicast.c @@ -773,7 +773,7 @@ void ipoib_mcast_restart_task(struct wor ipoib_mcast_stop_thread(dev, 0); - local_irq_save(flags); + local_irq_save_nort(flags); netif_addr_lock(dev); spin_lock(&priv->lock); @@ -852,7 +852,7 @@ void ipoib_mcast_restart_task(struct wor spin_unlock(&priv->lock); netif_addr_unlock(dev); - local_irq_restore(flags); + local_irq_restore_nort(flags); /* We have to cancel outside of the spinlock */ list_for_each_entry_safe(mcast, tmcast, &remove_list, list) { patches/x86-vector-sparse-irq-fix.patch0000664000076400007640000000233611160752235017061 0ustar tglxtglxSubject: rt.fix From: Ingo Molnar Date: Thu Mar 19 11:09:17 CET 2009 Signed-off-by: Ingo Molnar --- arch/x86/kernel/apic/io_apic.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) Index: linux-2.6-tip/arch/x86/kernel/apic/io_apic.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/apic/io_apic.c +++ linux-2.6-tip/arch/x86/kernel/apic/io_apic.c @@ -3192,7 +3192,6 @@ unsigned int create_irq_nr(unsigned int if (irq_want < nr_irqs_gsi) irq_want = nr_irqs_gsi; - spin_lock_irqsave(&vector_lock, flags); for (new = irq_want; new < nr_irqs; new++) { desc_new = irq_to_desc_alloc_cpu(new, cpu); if (!desc_new) { @@ -3201,13 +3200,16 @@ unsigned int create_irq_nr(unsigned int } cfg_new = desc_new->chip_data; - if (cfg_new->vector != 0) + spin_lock_irqsave(&vector_lock, flags); + if (cfg_new->vector != 0) { + spin_unlock_irqrestore(&vector_lock, flags); continue; + } if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0) irq = new; + spin_unlock_irqrestore(&vector_lock, flags); break; } - spin_unlock_irqrestore(&vector_lock, flags); if (irq > 0) { dynamic_irq_init(irq); patches/preempt-irqs-i386.patch0000664000076400007640000000474011160752235015404 0ustar tglxtglxSubject: preempt: irqs i386 From: Ingo Molnar Date: Wed Feb 04 00:03:08 CET 2009 Signed-off-by: Ingo Molnar --- arch/x86/kernel/i8259.c | 10 ++++++---- arch/x86/kernel/irqinit_32.c | 2 ++ arch/x86/kernel/visws_quirks.c | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) Index: linux-2.6-tip/arch/x86/kernel/i8259.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/i8259.c +++ linux-2.6-tip/arch/x86/kernel/i8259.c @@ -168,6 +168,8 @@ static void mask_and_ack_8259A(unsigned */ if (cached_irq_mask & irqmask) goto spurious_8259A_irq; + if (irq & 8) + outb(0x60+(irq&7), PIC_SLAVE_CMD); /* 'Specific EOI' to slave */ cached_irq_mask |= irqmask; handle_real_irq: @@ -328,10 +330,10 @@ void init_8259A(int auto_eoi) /* 8259A-1 (the master) has a slave on IR2 */ outb_pic(1U << PIC_CASCADE_IR, PIC_MASTER_IMR); - if (auto_eoi) /* master does Auto EOI */ - outb_pic(MASTER_ICW4_DEFAULT | PIC_ICW4_AEOI, PIC_MASTER_IMR); - else /* master expects normal EOI */ - outb_pic(MASTER_ICW4_DEFAULT, PIC_MASTER_IMR); + if (!auto_eoi) /* master expects normal EOI */ + outb_p(MASTER_ICW4_DEFAULT, PIC_MASTER_IMR); + else /* master does Auto EOI */ + outb_p(MASTER_ICW4_DEFAULT | PIC_ICW4_AEOI, PIC_MASTER_IMR); outb_pic(0x11, PIC_SLAVE_CMD); /* ICW1: select 8259A-2 init */ Index: linux-2.6-tip/arch/x86/kernel/irqinit_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/irqinit_32.c +++ linux-2.6-tip/arch/x86/kernel/irqinit_32.c @@ -50,6 +50,7 @@ static irqreturn_t math_error_irq(int cp */ static struct irqaction fpu_irq = { .handler = math_error_irq, + .flags = IRQF_NODELAY, .mask = CPU_MASK_NONE, .name = "fpu", }; @@ -83,6 +84,7 @@ void __init init_ISA_irqs(void) */ static struct irqaction irq2 = { .handler = no_action, + .flags = IRQF_NODELAY, .mask = CPU_MASK_NONE, .name = "cascade", }; Index: linux-2.6-tip/arch/x86/kernel/visws_quirks.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/visws_quirks.c +++ linux-2.6-tip/arch/x86/kernel/visws_quirks.c @@ -643,11 +643,13 @@ out_unlock: static struct irqaction master_action = { .handler = piix4_master_intr, .name = "PIIX4-8259", + .flags = IRQF_NODELAY, }; static struct irqaction cascade_action = { .handler = no_action, .name = "cascade", + .flags = IRQF_NODELAY, }; patches/x86-microcode-fix-sysfs-wreckage.patch0000664000076400007640000000215611160752235020372 0ustar tglxtglxSubject: x86-microcode-fix-sysfs-wreckage.patch From: Thomas Gleixner Date: Sat, 14 Mar 2009 17:44:26 +0100 commit 6807b3625c5709e0a70a8ede3f9c890103e2a458 (x86: cpumask: use work_on_cpu in arch/x86/kernel/microcode_core.c) introduced a sysfs WARNING. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/microcode_core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) Index: linux-2.6-tip/arch/x86/kernel/microcode_core.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/microcode_core.c +++ linux-2.6-tip/arch/x86/kernel/microcode_core.c @@ -391,9 +391,16 @@ static int mc_sysdev_add(struct sys_devi return err; err = microcode_init_cpu(cpu); +#if 0 + /* + * While it looks correct, it's broken as we remove the sysfs + * entry in sysdev_remove below again. The error handling in + * this file is completely wreckaged and we have multiple + * hotplug handling via notifier and sysdev as well. Sigh. + */ if (err) sysfs_remove_group(&sys_dev->kobj, &mc_attr_group); - +#endif return err; } patches/preempt-realtime-arm-ixp4xx.patch0000664000076400007640000000115111160752235017551 0ustar tglxtglx--- arch/arm/mach-ixp4xx/common-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/arch/arm/mach-ixp4xx/common-pci.c =================================================================== --- linux-2.6-tip.orig/arch/arm/mach-ixp4xx/common-pci.c +++ linux-2.6-tip/arch/arm/mach-ixp4xx/common-pci.c @@ -54,7 +54,7 @@ unsigned long ixp4xx_pci_reg_base = 0; * these transactions are atomic or we will end up * with corrupt data on the bus or in a driver. */ -static DEFINE_SPINLOCK(ixp4xx_pci_lock); +static DEFINE_RAW_SPINLOCK(ixp4xx_pci_lock); /* * Read from PCI config space patches/arm-fix-compile-1.patch0000664000076400007640000000122211160752235015404 0ustar tglxtglxSubject: arm-fix-compile-1.patch From: Thomas Gleixner Date: Wed, 25 Feb 2009 20:16:18 +0100 Signed-off-by: Thomas Gleixner --- arch/arm/include/asm/system.h | 2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6-tip/arch/arm/include/asm/system.h =================================================================== --- linux-2.6-tip.orig/arch/arm/include/asm/system.h +++ linux-2.6-tip/arch/arm/include/asm/system.h @@ -60,6 +60,8 @@ #include #include +#include + #define __exception __attribute__((section(".exception.text"))) struct thread_info; patches/rtmutex-remove-xchg.patch0000664000076400007640000000146211160752235016215 0ustar tglxtglxSubject: rtmutex - remove double xchg From: Steven Rostedt No reason to update current if we are running. We'll do that when we exit the loop. Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- kernel/rtmutex.c | 2 -- 1 file changed, 2 deletions(-) Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -748,8 +748,6 @@ rt_spin_lock_slowlock(struct rt_mutex *l update_current(TASK_UNINTERRUPTIBLE, &saved_state); if (waiter.task) schedule_rt_mutex(lock); - else - update_current(TASK_RUNNING_MUTEX, &saved_state); spin_lock_irqsave(&lock->wait_lock, flags); current->flags |= saved_flags; patches/signal-do-not-wakeup-self.patch0000664000076400007640000000131511160752235017154 0ustar tglxtglxSubject: signal-do-not-wakeup-self.patch From: Thomas Gleixner Date: Thu, 19 Mar 2009 12:09:57 +0100 Signed-off-by: Thomas Gleixner --- kernel/signal.c | 3 +++ 1 file changed, 3 insertions(+) Index: linux-2.6-tip/kernel/signal.c =================================================================== --- linux-2.6-tip.orig/kernel/signal.c +++ linux-2.6-tip/kernel/signal.c @@ -566,6 +566,9 @@ void signal_wake_up(struct task_struct * set_tsk_thread_flag(t, TIF_SIGPENDING); + if (unlikely(t == current)) + return; + /* * For SIGKILL, we want to wake it up in the stopped/traced/killable * case. We don't check t->state here because there is a race with it patches/preempt-irqs-core-fix.patch0000664000076400007640000000141711160752235016425 0ustar tglxtglxSubject: remove one extra (incorrect) test in mask_ack_irq() Date: Wed, 18 Mar 2009 19:16:46 -0700 From: Frank Rowand preempt-irqs-core.patch added an incorrect check for the existence of desc->chip->ack to mask_ack_irq() Signed-off-by: Frank Rowand --- kernel/irq/chip.c | 1 - 1 file changed, 1 deletion(-) Index: linux-2.6-tip/kernel/irq/chip.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/chip.c +++ linux-2.6-tip/kernel/irq/chip.c @@ -293,7 +293,6 @@ static inline void mask_ack_irq(struct i if (desc->chip->mask_ack) desc->chip->mask_ack(irq); else { - if (desc->chip->ack) if (desc->chip->mask) desc->chip->mask(irq); if (desc->chip->ack) patches/kstat-fix-spurious-system-load-spikes-in-proc-loadavgrt.patch0000664000076400007640000000734111160752235025147 0ustar tglxtglxSubject: Fixes spurious system load spikes in /proc/loadavgrt From: "Luis Claudio R. Goncalves" Date: Fri, 17 Aug 2007 16:37:06 -0300 Hi! The patch I sent to the list had a minor glitch in the path for the second half of the diff. This is the fixed version. Sorry for any disturbance! Best regards, Luis Hello, The values in /proc/loadavgrt are sometimes the real load and sometimes garbage. As you can see in th tests below, it occurs from in 2.6.21.5-rt20 to 2.6.23-rc2-rt2. The code for calc_load(), in kernel/timer.c has not changed much in -rt patches. [lclaudio@lab sandbox]$ ls /proc/loadavg* /proc/loadavg /proc/loadavgrt [lclaudio@lab sandbox]$ uname -a Linux lab.casa 2.6.21-34.el5rt #1 SMP PREEMPT RT Thu Jul 12 15:26:48 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux [lclaudio@lab sandbox]$ cat /proc/loadavg* 4.57 4.90 4.16 3/146 23499 0.44 0.98 1.78 0/146 23499 ... [lclaudio@lab sandbox]$ cat /proc/loadavg* 4.65 4.80 4.75 5/144 20720 23896.04 -898421.23 383170.94 2/144 20720 [root@neverland ~]# uname -a Linux neverland.casa 2.6.21.5-rt20 #2 SMP PREEMPT RT Fri Jul 1318:31:38 BRT 2007 i686 athlon i386 GNU/Linux [root@neverland ~]# cat /proc/loadavg* 0.16 0.16 0.15 1/184 11240 344.65 0.38 311.71 0/184 11240 [williams@torg ~]$ uname -a Linux torg 2.6.23-rc2-rt2 #14 SMP PREEMPT RT Tue Aug 7 20:07:31 CDT 2007 x86_64 x86_64 x86_64 GNU/Linux [williams@torg ~]$ cat /proc/loadavg* 0.88 0.76 0.57 1/257 7267 122947.70 103790.53 -564712.87 0/257 7267 ----------> Fixes spurious system load spikes observed in /proc/loadavgrt, as described in: Bug 253103: /proc/loadavgrt issues weird results https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=253103 Signed-off-by: Luis Claudio R. Goncalves Signed-off-by: Ingo Molnar --- --- kernel/sched_rt.c | 7 +++++++ kernel/timer.c | 14 ++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) Index: linux-2.6-tip/kernel/sched_rt.c =================================================================== --- linux-2.6-tip.orig/kernel/sched_rt.c +++ linux-2.6-tip/kernel/sched_rt.c @@ -878,6 +878,13 @@ unsigned long rt_nr_uninterruptible(void for_each_online_cpu(i) sum += cpu_rq(i)->rt.rt_nr_uninterruptible; + /* + * Since we read the counters lockless, it might be slightly + * inaccurate. Do not allow it to go below zero though: + */ + if (unlikely((long)sum < 0)) + sum = 0; + return sum; } Index: linux-2.6-tip/kernel/timer.c =================================================================== --- linux-2.6-tip.orig/kernel/timer.c +++ linux-2.6-tip/kernel/timer.c @@ -1235,23 +1235,25 @@ unsigned long avenrun_rt[3]; static inline void calc_load(unsigned long ticks) { unsigned long active_tasks; /* fixed-point */ + unsigned long active_rt_tasks; /* fixed-point */ static int count = LOAD_FREQ; count -= ticks; if (unlikely(count < 0)) { active_tasks = count_active_tasks(); + active_rt_tasks = count_active_rt_tasks(); do { CALC_LOAD(avenrun[0], EXP_1, active_tasks); CALC_LOAD(avenrun[1], EXP_5, active_tasks); CALC_LOAD(avenrun[2], EXP_15, active_tasks); - count += LOAD_FREQ; - } while (count < 0); #ifdef CONFIG_PREEMPT_RT - active_tasks = count_active_rt_tasks(); - CALC_LOAD(avenrun_rt[0], EXP_1, active_tasks); - CALC_LOAD(avenrun_rt[1], EXP_5, active_tasks); - CALC_LOAD(avenrun_rt[2], EXP_15, active_tasks); + CALC_LOAD(avenrun_rt[0], EXP_1, active_tasks); + CALC_LOAD(avenrun_rt[1], EXP_5, active_tasks); + CALC_LOAD(avenrun_rt[2], EXP_15, active_tasks); #endif + count += LOAD_FREQ; + + } while (count < 0); } } patches/powerpc-rtmutex.patch0000664000076400007640000002742111160752235015453 0ustar tglxtglxSubject: powerpc-rtmutex.patch From: Thomas Gleixner Date: Fri, 20 Mar 2009 17:31:24 +0100 Signed-off-by: Thomas Gleixner --- arch/powerpc/include/asm/rwsem.h | 40 ++++++++++++------------ arch/powerpc/include/asm/spinlock.h | 50 ++++++++++++++++-------------- arch/powerpc/include/asm/spinlock_types.h | 4 +- arch/powerpc/lib/locks.c | 6 +-- 4 files changed, 52 insertions(+), 48 deletions(-) Index: linux-2.6-tip/arch/powerpc/include/asm/rwsem.h =================================================================== --- linux-2.6-tip.orig/arch/powerpc/include/asm/rwsem.h +++ linux-2.6-tip/arch/powerpc/include/asm/rwsem.h @@ -21,7 +21,7 @@ /* * the semaphore definition */ -struct rw_semaphore { +struct compat_rw_semaphore { /* XXX this should be able to be an atomic_t -- paulus */ signed int count; #define RWSEM_UNLOCKED_VALUE 0x00000000 @@ -30,7 +30,7 @@ struct rw_semaphore { #define RWSEM_WAITING_BIAS (-0x00010000) #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) - spinlock_t wait_lock; + raw_spinlock_t wait_lock; struct list_head wait_list; #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lockdep_map dep_map; @@ -48,17 +48,17 @@ struct rw_semaphore { LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) } #define DECLARE_RWSEM(name) \ - struct rw_semaphore name = __RWSEM_INITIALIZER(name) + struct compat_rw_semaphore name = __RWSEM_INITIALIZER(name) -extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem); -extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem); -extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem); -extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem); +extern struct compat_rw_semaphore *rwsem_down_read_failed(struct compat_rw_semaphore *sem); +extern struct compat_rw_semaphore *rwsem_down_write_failed(struct compat_rw_semaphore *sem); +extern struct compat_rw_semaphore *rwsem_wake(struct compat_rw_semaphore *sem); +extern struct compat_rw_semaphore *rwsem_downgrade_wake(struct compat_rw_semaphore *sem); -extern void __init_rwsem(struct rw_semaphore *sem, const char *name, +extern void __init_rwsem(struct compat_rw_semaphore *sem, const char *name, struct lock_class_key *key); -#define init_rwsem(sem) \ +#define compat_init_rwsem(sem) \ do { \ static struct lock_class_key __key; \ \ @@ -68,13 +68,13 @@ extern void __init_rwsem(struct rw_semap /* * lock for reading */ -static inline void __down_read(struct rw_semaphore *sem) +static inline void __down_read(struct compat_rw_semaphore *sem) { if (unlikely(atomic_inc_return((atomic_t *)(&sem->count)) <= 0)) rwsem_down_read_failed(sem); } -static inline int __down_read_trylock(struct rw_semaphore *sem) +static inline int __down_read_trylock(struct compat_rw_semaphore *sem) { int tmp; @@ -90,7 +90,7 @@ static inline int __down_read_trylock(st /* * lock for writing */ -static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) +static inline void __down_write_nested(struct compat_rw_semaphore *sem, int subclass) { int tmp; @@ -100,12 +100,12 @@ static inline void __down_write_nested(s rwsem_down_write_failed(sem); } -static inline void __down_write(struct rw_semaphore *sem) +static inline void __down_write(struct compat_rw_semaphore *sem) { __down_write_nested(sem, 0); } -static inline int __down_write_trylock(struct rw_semaphore *sem) +static inline int __down_write_trylock(struct compat_rw_semaphore *sem) { int tmp; @@ -117,7 +117,7 @@ static inline int __down_write_trylock(s /* * unlock after reading */ -static inline void __up_read(struct rw_semaphore *sem) +static inline void __up_read(struct compat_rw_semaphore *sem) { int tmp; @@ -129,7 +129,7 @@ static inline void __up_read(struct rw_s /* * unlock after writing */ -static inline void __up_write(struct rw_semaphore *sem) +static inline void __up_write(struct compat_rw_semaphore *sem) { if (unlikely(atomic_sub_return(RWSEM_ACTIVE_WRITE_BIAS, (atomic_t *)(&sem->count)) < 0)) @@ -139,7 +139,7 @@ static inline void __up_write(struct rw_ /* * implement atomic add functionality */ -static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) +static inline void rwsem_atomic_add(int delta, struct compat_rw_semaphore *sem) { atomic_add(delta, (atomic_t *)(&sem->count)); } @@ -147,7 +147,7 @@ static inline void rwsem_atomic_add(int /* * downgrade write lock to read lock */ -static inline void __downgrade_write(struct rw_semaphore *sem) +static inline void __downgrade_write(struct compat_rw_semaphore *sem) { int tmp; @@ -159,12 +159,12 @@ static inline void __downgrade_write(str /* * implement exchange and add functionality */ -static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) +static inline int rwsem_atomic_update(int delta, struct compat_rw_semaphore *sem) { return atomic_add_return(delta, (atomic_t *)(&sem->count)); } -static inline int rwsem_is_locked(struct rw_semaphore *sem) +static inline int compat_rwsem_is_locked(struct compat_rw_semaphore *sem) { return (sem->count != 0); } Index: linux-2.6-tip/arch/powerpc/include/asm/spinlock.h =================================================================== --- linux-2.6-tip.orig/arch/powerpc/include/asm/spinlock.h +++ linux-2.6-tip/arch/powerpc/include/asm/spinlock.h @@ -54,7 +54,7 @@ * This returns the old value in the lock, so we succeeded * in getting the lock if the return value is 0. */ -static inline unsigned long __spin_trylock(raw_spinlock_t *lock) +static inline unsigned long ___raw_spin_trylock(__raw_spinlock_t *lock) { unsigned long tmp, token; @@ -73,10 +73,10 @@ static inline unsigned long __spin_trylo return tmp; } -static inline int __raw_spin_trylock(raw_spinlock_t *lock) +static inline int __raw_spin_trylock(__raw_spinlock_t *lock) { CLEAR_IO_SYNC; - return __spin_trylock(lock) == 0; + return ___raw_spin_trylock(lock) == 0; } /* @@ -96,19 +96,19 @@ static inline int __raw_spin_trylock(raw #if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES) /* We only yield to the hypervisor if we are in shared processor mode */ #define SHARED_PROCESSOR (get_lppaca()->shared_proc) -extern void __spin_yield(raw_spinlock_t *lock); -extern void __rw_yield(raw_rwlock_t *lock); +extern void __spin_yield(__raw_spinlock_t *lock); +extern void __rw_yield(__raw_rwlock_t *lock); #else /* SPLPAR || ISERIES */ #define __spin_yield(x) barrier() #define __rw_yield(x) barrier() #define SHARED_PROCESSOR 0 #endif -static inline void __raw_spin_lock(raw_spinlock_t *lock) +static inline void __raw_spin_lock(__raw_spinlock_t *lock) { CLEAR_IO_SYNC; while (1) { - if (likely(__spin_trylock(lock) == 0)) + if (likely(___raw_spin_trylock(lock) == 0)) break; do { HMT_low(); @@ -120,13 +120,13 @@ static inline void __raw_spin_lock(raw_s } static inline -void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags) +void __raw_spin_lock_flags(__raw_spinlock_t *lock, unsigned long flags) { unsigned long flags_dis; CLEAR_IO_SYNC; while (1) { - if (likely(__spin_trylock(lock) == 0)) + if (likely(___raw_spin_trylock(lock) == 0)) break; local_save_flags(flags_dis); local_irq_restore(flags); @@ -140,7 +140,7 @@ void __raw_spin_lock_flags(raw_spinlock_ } } -static inline void __raw_spin_unlock(raw_spinlock_t *lock) +static inline void __raw_spin_unlock(__raw_spinlock_t *lock) { SYNC_IO; __asm__ __volatile__("# __raw_spin_unlock\n\t" @@ -149,7 +149,7 @@ static inline void __raw_spin_unlock(raw } #ifdef CONFIG_PPC64 -extern void __raw_spin_unlock_wait(raw_spinlock_t *lock); +extern void __raw_spin_unlock_wait(__raw_spinlock_t *lock); #else #define __raw_spin_unlock_wait(lock) \ do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) @@ -181,7 +181,7 @@ extern void __raw_spin_unlock_wait(raw_s * This returns the old value in the lock + 1, * so we got a read lock if the return value is > 0. */ -static inline long __read_trylock(raw_rwlock_t *rw) +static inline long ___raw_read_trylock(__raw_rwlock_t *rw) { long tmp; @@ -205,7 +205,7 @@ static inline long __read_trylock(raw_rw * This returns the old value in the lock, * so we got the write lock if the return value is 0. */ -static inline long __write_trylock(raw_rwlock_t *rw) +static inline long ___raw_write_trylock(__raw_rwlock_t *rw) { long tmp, token; @@ -225,10 +225,10 @@ static inline long __write_trylock(raw_r return tmp; } -static inline void __raw_read_lock(raw_rwlock_t *rw) +static inline void __raw_read_lock(__raw_rwlock_t *rw) { while (1) { - if (likely(__read_trylock(rw) > 0)) + if (likely(___raw_read_trylock(rw) > 0)) break; do { HMT_low(); @@ -239,10 +239,10 @@ static inline void __raw_read_lock(raw_r } } -static inline void __raw_write_lock(raw_rwlock_t *rw) +static inline void __raw_write_lock(__raw_rwlock_t *rw) { while (1) { - if (likely(__write_trylock(rw) == 0)) + if (likely(___raw_write_trylock(rw) == 0)) break; do { HMT_low(); @@ -253,17 +253,17 @@ static inline void __raw_write_lock(raw_ } } -static inline int __raw_read_trylock(raw_rwlock_t *rw) +static inline int __raw_read_trylock(__raw_rwlock_t *rw) { - return __read_trylock(rw) > 0; + return ___raw_read_trylock(rw) > 0; } -static inline int __raw_write_trylock(raw_rwlock_t *rw) +static inline int __raw_write_trylock(__raw_rwlock_t *rw) { - return __write_trylock(rw) == 0; + return ___raw_write_trylock(rw) == 0; } -static inline void __raw_read_unlock(raw_rwlock_t *rw) +static inline void __raw_read_unlock(__raw_rwlock_t *rw) { long tmp; @@ -280,7 +280,7 @@ static inline void __raw_read_unlock(raw : "cr0", "xer", "memory"); } -static inline void __raw_write_unlock(raw_rwlock_t *rw) +static inline void __raw_write_unlock(__raw_rwlock_t *rw) { __asm__ __volatile__("# write_unlock\n\t" LWSYNC_ON_SMP: : :"memory"); @@ -291,5 +291,9 @@ static inline void __raw_write_unlock(ra #define _raw_read_relax(lock) __rw_yield(lock) #define _raw_write_relax(lock) __rw_yield(lock) +#define __raw_spin_relax(lock) cpu_relax() +#define __raw_read_relax(lock) cpu_relax() +#define __raw_write_relax(lock) cpu_relax() + #endif /* __KERNEL__ */ #endif /* __ASM_SPINLOCK_H */ Index: linux-2.6-tip/arch/powerpc/include/asm/spinlock_types.h =================================================================== --- linux-2.6-tip.orig/arch/powerpc/include/asm/spinlock_types.h +++ linux-2.6-tip/arch/powerpc/include/asm/spinlock_types.h @@ -7,13 +7,13 @@ typedef struct { volatile unsigned int slock; -} raw_spinlock_t; +} __raw_spinlock_t; #define __RAW_SPIN_LOCK_UNLOCKED { 0 } typedef struct { volatile signed int lock; -} raw_rwlock_t; +} __raw_rwlock_t; #define __RAW_RW_LOCK_UNLOCKED { 0 } Index: linux-2.6-tip/arch/powerpc/lib/locks.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/lib/locks.c +++ linux-2.6-tip/arch/powerpc/lib/locks.c @@ -25,7 +25,7 @@ #include #include -void __spin_yield(raw_spinlock_t *lock) +void __spin_yield(__raw_spinlock_t *lock) { unsigned int lock_value, holder_cpu, yield_count; @@ -55,7 +55,7 @@ void __spin_yield(raw_spinlock_t *lock) * This turns out to be the same for read and write locks, since * we only know the holder if it is write-locked. */ -void __rw_yield(raw_rwlock_t *rw) +void __rw_yield(__raw_rwlock_t *rw) { int lock_value; unsigned int holder_cpu, yield_count; @@ -82,7 +82,7 @@ void __rw_yield(raw_rwlock_t *rw) } #endif -void __raw_spin_unlock_wait(raw_spinlock_t *lock) +void __raw_spin_unlock_wait(__raw_spinlock_t *lock) { while (lock->slock) { HMT_low(); patches/powerpc-realtime-preempt.patch0000664000076400007640000001150511160752235017213 0ustar tglxtglxSubject: powerpc-realtime-preempt.patch From: Thomas Gleixner Date: Fri, 20 Mar 2009 17:35:01 +0100 Signed-off-by: Thomas Gleixner --- arch/powerpc/Kconfig | 15 +++++------ arch/powerpc/kernel/entry_64.S | 50 +++++++++++++++++++++---------------- arch/powerpc/kernel/idle.c | 6 ++-- arch/powerpc/platforms/chrp/time.c | 5 +++ arch/powerpc/xmon/xmon.c | 2 + 5 files changed, 48 insertions(+), 30 deletions(-) Index: linux-2.6-tip/arch/powerpc/Kconfig =================================================================== --- linux-2.6-tip.orig/arch/powerpc/Kconfig +++ linux-2.6-tip/arch/powerpc/Kconfig @@ -65,13 +65,6 @@ config LOCKDEP_SUPPORT bool default y -config RWSEM_GENERIC_SPINLOCK - bool - -config RWSEM_XCHGADD_ALGORITHM - bool - default y - config GENERIC_LOCKBREAK bool default y @@ -243,6 +236,14 @@ config HIGHMEM source kernel/time/Kconfig source kernel/Kconfig.hz source kernel/Kconfig.preempt + +config RWSEM_GENERIC_SPINLOCK + bool + default y + +config RWSEM_XCHGADD_ALGORITHM + bool + source "fs/Kconfig.binfmt" config HUGETLB_PAGE_SIZE_VARIABLE Index: linux-2.6-tip/arch/powerpc/kernel/entry_64.S =================================================================== --- linux-2.6-tip.orig/arch/powerpc/kernel/entry_64.S +++ linux-2.6-tip/arch/powerpc/kernel/entry_64.S @@ -625,44 +625,52 @@ do_work: bne restore /* here we are preempting the current task */ 1: + /* + * preempt_schedule_irq() expects interrupts disabled and returns + * with interrupts disabled. No need to check preemption again, + * preempt_schedule_irq just did that for us. + */ + bl .preempt_schedule_irq #ifdef CONFIG_TRACE_IRQFLAGS bl .trace_hardirqs_on +#endif /* CONFIG_TRACE_IRQFLAGS */ + /* Note: we just clobbered r10 which used to contain the previous * MSR before the hard-disabling done by the caller of do_work. * We don't have that value anymore, but it doesn't matter as * we will hard-enable unconditionally, we can just reload the * current MSR into r10 */ + bl .preempt_schedule_irq mfmsr r10 -#endif /* CONFIG_TRACE_IRQFLAGS */ - li r0,1 - stb r0,PACASOFTIRQEN(r13) - stb r0,PACAHARDIRQEN(r13) - ori r10,r10,MSR_EE - mtmsrd r10,1 /* reenable interrupts */ - bl .preempt_schedule - mfmsr r10 - clrrdi r9,r1,THREAD_SHIFT - rldicl r10,r10,48,1 /* disable interrupts again */ - rotldi r10,r10,16 - mtmsrd r10,1 - ld r4,TI_FLAGS(r9) - andi. r0,r4,_TIF_NEED_RESCHED - bne 1b + clrrdi r9,r1,THREAD_SHIFT + rldicl r10,r10,48,1 /* disable interrupts again */ + rotldi r10,r10,16 + mtmsrd r10,1 + ld r4,TI_FLAGS(r9) + andi. r0,r4,(_TIF_NEED_RESCHED) + bne 1b b restore user_work: #endif - /* Enable interrupts */ - ori r10,r10,MSR_EE - mtmsrd r10,1 - andi. r0,r4,_TIF_NEED_RESCHED beq 1f - bl .schedule + + /* preempt_schedule_irq() expects interrupts disabled. */ + bl .preempt_schedule_irq b .ret_from_except_lite -1: bl .save_nvgprs + /* here we are preempting the current task */ +1: li r0,1 + stb r0,PACASOFTIRQEN(r13) + stb r0,PACAHARDIRQEN(r13) + + /* Enable interrupts */ + ori r10,r10,MSR_EE + mtmsrd r10,1 + + bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD bl .do_signal b .ret_from_except Index: linux-2.6-tip/arch/powerpc/kernel/idle.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/kernel/idle.c +++ linux-2.6-tip/arch/powerpc/kernel/idle.c @@ -96,9 +96,11 @@ void cpu_idle(void) tick_nohz_restart_sched_tick(); if (cpu_should_die()) cpu_die(); - preempt_enable_no_resched(); - schedule(); + local_irq_disable(); + __preempt_enable_no_resched(); + __schedule(); preempt_disable(); + local_irq_enable(); } } Index: linux-2.6-tip/arch/powerpc/platforms/chrp/time.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/platforms/chrp/time.c +++ linux-2.6-tip/arch/powerpc/platforms/chrp/time.c @@ -83,7 +83,12 @@ int chrp_set_rtc_time(struct rtc_time *t unsigned char save_control, save_freq_select; struct rtc_time tm = *tmarg; +#if CONFIG_PREEMPT_RT + if (!spin_trylock(&rtc_lock)) + return -1; +#else spin_lock(&rtc_lock); +#endif save_control = chrp_cmos_clock_read(RTC_CONTROL); /* tell the clock it's being set */ Index: linux-2.6-tip/arch/powerpc/xmon/xmon.c =================================================================== --- linux-2.6-tip.orig/arch/powerpc/xmon/xmon.c +++ linux-2.6-tip/arch/powerpc/xmon/xmon.c @@ -346,6 +346,7 @@ static int xmon_core(struct pt_regs *reg unsigned long timeout; #endif + preempt_disable(); local_irq_save(flags); bp = in_breakpoint_table(regs->nip, &offset); @@ -522,6 +523,7 @@ static int xmon_core(struct pt_regs *reg insert_cpu_bpts(); local_irq_restore(flags); + preempt_enable(); return cmd != 'X' && cmd != EOF; } patches/page-alloc-bulk-moar.patch0000664000076400007640000000760011160752235016156 0ustar tglxtglxSubject: pagealloc: reduce lock sections further From: Peter Zijlstra Date: Wed Mar 18 00:46:47 CET 2009 Signed-off-by: Peter Zijlstra --- include/linux/list.h | 3 +++ mm/page_alloc.c | 42 ++++++++++++++++++++++++++++++------------ 2 files changed, 33 insertions(+), 12 deletions(-) Index: linux-2.6-tip/include/linux/list.h =================================================================== --- linux-2.6-tip.orig/include/linux/list.h +++ linux-2.6-tip/include/linux/list.h @@ -345,6 +345,9 @@ static inline void list_splice_tail_init #define list_first_entry(ptr, type, member) \ list_entry((ptr)->next, type, member) +#define list_last_entry(ptr, type, member) \ + list_entry((ptr)->prev, type, member) + /** * list_for_each - iterate over a list * @pos: the &struct list_head to use as a loop cursor. Index: linux-2.6-tip/mm/page_alloc.c =================================================================== --- linux-2.6-tip.orig/mm/page_alloc.c +++ linux-2.6-tip/mm/page_alloc.c @@ -564,18 +564,16 @@ static inline int free_pages_check(struc * And clear the zone's pages_scanned counter, to hold off the "all pages are * pinned" detection logic. */ -static void free_pages_bulk(struct zone *zone, int count, - struct list_head *list, int order) +static void +free_pages_bulk(struct zone *zone, struct list_head *list, int order) { spin_lock(&zone->lock); zone_clear_flag(zone, ZONE_ALL_UNRECLAIMABLE); zone->pages_scanned = 0; - while (count--) { - struct page *page; - VM_BUG_ON(list_empty(list)); - page = list_entry(list->prev, struct page, lru); - /* have to delete it as __free_one_page list manipulates */ + while (!list_empty(list)) { + struct page *page = list_first_entry(list, struct page, lru); + list_del(&page->lru); __free_one_page(page, zone, order); cond_resched_lock(&zone->lock); @@ -935,6 +933,16 @@ static int rmqueue_bulk(struct zone *zon return i; } +static void +isolate_pcp_pages(int count, struct list_head *src, struct list_head *dst) +{ + while (count--) { + struct page *page = list_last_entry(src, struct page, lru); + list_move(&page->lru, dst); + } +} + + #ifdef CONFIG_NUMA /* * Called from the vmstat counter updater to drain pagesets of this @@ -946,6 +954,7 @@ static int rmqueue_bulk(struct zone *zon */ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) { + LIST_HEAD(free_list); unsigned long flags; int to_drain; int this_cpu; @@ -955,9 +964,11 @@ void drain_zone_pages(struct zone *zone, to_drain = pcp->batch; else to_drain = pcp->count; - free_pages_bulk(zone, to_drain, &pcp->list, 0); + isolate_pcp_pages(to_drain, &pcp->list, &free_list); pcp->count -= to_drain; unlock_cpu_pcp(flags, this_cpu); + + free_pages_bulk(zone, &free_list, 0); } #endif @@ -976,6 +987,7 @@ static void drain_pages(unsigned int cpu for_each_zone(zone) { struct per_cpu_pageset *pset; struct per_cpu_pages *pcp; + LIST_HEAD(free_list); if (!populated_zone(zone)) continue; @@ -987,9 +999,10 @@ static void drain_pages(unsigned int cpu } pcp = &pset->pcp; lock_cpu_pcp(&flags, &cpu); - free_pages_bulk(zone, pcp->count, &pcp->list, 0); + isolate_pcp_pages(pcp->count, &pcp->list, &free_list); pcp->count = 0; unlock_cpu_pcp(flags, cpu); + free_pages_bulk(zone, &free_list, 0); } } @@ -1122,10 +1135,15 @@ static void free_hot_cold_page(struct pa set_page_private(page, get_pageblock_migratetype(page)); pcp->count++; if (pcp->count >= pcp->high) { - free_pages_bulk(zone, pcp->batch, &pcp->list, 0); + LIST_HEAD(free_list); + + isolate_pcp_pages(pcp->batch, &pcp->list, &free_list); pcp->count -= pcp->batch; - } - put_zone_pcp(zone, flags, this_cpu); + put_zone_pcp(zone, flags, this_cpu); + + free_pages_bulk(zone, &free_list, 0); + } else + put_zone_pcp(zone, flags, this_cpu); } void free_hot_page(struct page *page) patches/rt-mutex-arm.patch0000664000076400007640000000206311160752235014623 0ustar tglxtglx--- arch/arm/kernel/entry-common.S | 3 ++- arch/arm/kernel/process.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) Index: linux-2.6-tip/arch/arm/kernel/entry-common.S =================================================================== --- linux-2.6-tip.orig/arch/arm/kernel/entry-common.S +++ linux-2.6-tip/arch/arm/kernel/entry-common.S @@ -55,7 +55,8 @@ work_pending: b ret_slow_syscall @ Check work again work_resched: - bl schedule + bl __schedule + /* * "slow" syscall return path. "why" tells us if this was a real syscall. */ Index: linux-2.6-tip/arch/arm/kernel/process.c =================================================================== --- linux-2.6-tip.orig/arch/arm/kernel/process.c +++ linux-2.6-tip/arch/arm/kernel/process.c @@ -167,9 +167,11 @@ void cpu_idle(void) idle(); leds_event(led_idle_end); tick_nohz_restart_sched_tick(); - preempt_enable_no_resched(); - schedule(); + local_irq_disable(); + __preempt_enable_no_resched(); + __schedule(); preempt_disable(); + local_irq_enable(); } } patches/preempt-irqs-hrtimer.patch0000664000076400007640000001025211160752235016360 0ustar tglxtglxSubject: patches/preempt-irqs-hrtimer.patch Signed-off-by: Ingo Molnar --- include/linux/hrtimer.h | 10 ++++++++++ kernel/hrtimer.c | 33 ++++++++++++++++++++++++++++++++- kernel/itimer.c | 1 + kernel/posix-timers.c | 3 +++ 4 files changed, 46 insertions(+), 1 deletion(-) Index: linux-2.6-tip/include/linux/hrtimer.h =================================================================== --- linux-2.6-tip.orig/include/linux/hrtimer.h +++ linux-2.6-tip/include/linux/hrtimer.h @@ -173,6 +173,9 @@ struct hrtimer_cpu_base { int hres_active; unsigned long nr_events; #endif +#ifdef CONFIG_PREEMPT_SOFTIRQS + wait_queue_head_t wait; +#endif }; static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) @@ -360,6 +363,13 @@ static inline int hrtimer_restart(struct return hrtimer_start_expires(timer, HRTIMER_MODE_ABS); } +/* Softirq preemption could deadlock timer removal */ +#ifdef CONFIG_PREEMPT_SOFTIRQS + extern void hrtimer_wait_for_timer(const struct hrtimer *timer); +#else +# define hrtimer_wait_for_timer(timer) do { cpu_relax(); } while (0) +#endif + /* Query timers: */ extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer); extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp); Index: linux-2.6-tip/kernel/hrtimer.c =================================================================== --- linux-2.6-tip.orig/kernel/hrtimer.c +++ linux-2.6-tip/kernel/hrtimer.c @@ -836,6 +836,32 @@ static int enqueue_hrtimer(struct hrtime return leftmost; } +#ifdef CONFIG_PREEMPT_SOFTIRQS +# define wake_up_timer_waiters(b) wake_up(&(b)->wait) + +/** + * hrtimer_wait_for_timer - Wait for a running timer + * + * @timer: timer to wait for + * + * The function waits in case the timers callback function is + * currently executed on the waitqueue of the timer base. The + * waitqueue is woken up after the timer callback function has + * finished execution. + */ +void hrtimer_wait_for_timer(const struct hrtimer *timer) +{ + struct hrtimer_clock_base *base = timer->base; + + if (base && base->cpu_base) + wait_event(base->cpu_base->wait, + !(timer->state & HRTIMER_STATE_CALLBACK)); +} + +#else +# define wake_up_timer_waiters(b) do { } while (0) +#endif + /* * __remove_hrtimer - internal function to remove a timer * @@ -864,6 +890,8 @@ static void __remove_hrtimer(struct hrti rb_erase(&timer->node, &base->active); } timer->state = newstate; + + wake_up_timer_waiters(base->cpu_base); } /* @@ -1022,7 +1050,7 @@ int hrtimer_cancel(struct hrtimer *timer if (ret >= 0) return ret; - cpu_relax(); + hrtimer_wait_for_timer(timer); } } EXPORT_SYMBOL_GPL(hrtimer_cancel); @@ -1545,6 +1573,9 @@ static void __cpuinit init_hrtimers_cpu( cpu_base->clock_base[i].cpu_base = cpu_base; hrtimer_init_hres(cpu_base); +#ifdef CONFIG_PREEMPT_SOFTIRQS + init_waitqueue_head(&cpu_base->wait); +#endif } #ifdef CONFIG_HOTPLUG_CPU Index: linux-2.6-tip/kernel/itimer.c =================================================================== --- linux-2.6-tip.orig/kernel/itimer.c +++ linux-2.6-tip/kernel/itimer.c @@ -161,6 +161,7 @@ again: /* We are sharing ->siglock with it_real_fn() */ if (hrtimer_try_to_cancel(timer) < 0) { spin_unlock_irq(&tsk->sighand->siglock); + hrtimer_wait_for_timer(&tsk->signal->real_timer); goto again; } expires = timeval_to_ktime(value->it_value); Index: linux-2.6-tip/kernel/posix-timers.c =================================================================== --- linux-2.6-tip.orig/kernel/posix-timers.c +++ linux-2.6-tip/kernel/posix-timers.c @@ -789,6 +789,7 @@ retry: unlock_timer(timr, flag); if (error == TIMER_RETRY) { + hrtimer_wait_for_timer(&timr->it.real.timer); rtn = NULL; // We already got the old time... goto retry; } @@ -827,6 +828,7 @@ retry_delete: if (timer_delete_hook(timer) == TIMER_RETRY) { unlock_timer(timer, flags); + hrtimer_wait_for_timer(&timer->it.real.timer); goto retry_delete; } @@ -856,6 +858,7 @@ retry_delete: if (timer_delete_hook(timer) == TIMER_RETRY) { unlock_timer(timer, flags); + hrtimer_wait_for_timer(&timer->it.real.timer); goto retry_delete; } list_del(&timer->list); patches/highmem-atomic-fix.patch0000664000076400007640000000125611160752235015740 0ustar tglxtglxSubject: highmem: atomic fix From: Ingo Molnar Date: Wed Feb 04 08:10:53 CET 2009 CHECKME: really bogus? triggers on !PREEMPT_RT + highmem, 32-bit. Signed-off-by: Ingo Molnar --- mm/filemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/mm/filemap.c =================================================================== --- linux-2.6-tip.orig/mm/filemap.c +++ linux-2.6-tip/mm/filemap.c @@ -1846,7 +1846,7 @@ size_t iov_iter_copy_from_user_atomic(st char *kaddr; size_t copied; - BUG_ON(!in_atomic()); +// BUG_ON(!in_atomic()); kaddr = kmap_atomic(page, KM_USER0); if (likely(i->nr_segs == 1)) { int left; patches/rt-spin-needbreak-fixup.patch0000664000076400007640000000301211161723433016716 0ustar tglxtglxSubject: rt-spin-needbreak-fixup.patch From: Thomas Gleixner Date: Wed, 18 Mar 2009 12:10:53 +0100 Signed-off-by: Thomas Gleixner --- include/linux/sched.h | 5 ++++- kernel/sched.c | 7 +++---- 2 files changed, 7 insertions(+), 5 deletions(-) Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -2389,7 +2389,10 @@ static inline void thread_group_cputime_ #ifdef CONFIG_PREEMPT_RT static inline int __spin_needbreak(spinlock_t *lock) { - return lock->break_lock; + struct task_struct *tsk = current; + + /* break if we are priority boosted */ + return tsk->prio < tsk->normal_prio; } #else static inline int __spin_needbreak(spinlock_t *lock) Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -6349,15 +6349,14 @@ EXPORT_SYMBOL(__cond_resched_raw_spinloc int __cond_resched_spinlock(spinlock_t *lock) { -#if (defined(CONFIG_SMP) && defined(CONFIG_PREEMPT)) || defined(CONFIG_PREEMPT_RT) - if (lock->break_lock) { - lock->break_lock = 0; + int resched = need_resched() && system_state == SYSTEM_RUNNING; + + if (spin_needbreak(lock) || resched) { spin_unlock_no_resched(lock); __cond_resched(); spin_lock(lock); return 1; } -#endif return 0; } EXPORT_SYMBOL(__cond_resched_spinlock); patches/preempt-rt-x86-pageattr-flush-unused.patch0000664000076400007640000000121311161723434021224 0ustar tglxtglxSubject: preempt-rt-x86-pageattr-flush-unused.patch From: Thomas Gleixner Date: Mon, 16 Feb 2009 23:15:49 +0100 Signed-off-by: Thomas Gleixner --- arch/x86/mm/pageattr.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6-tip/arch/x86/mm/pageattr.c =================================================================== --- linux-2.6-tip.orig/arch/x86/mm/pageattr.c +++ linux-2.6-tip/arch/x86/mm/pageattr.c @@ -839,8 +839,10 @@ static int change_page_attr_set_clr(unsi } } +#if 0 /* Must avoid aliasing mappings in the highmem code */ kmap_flush_unused(); +#endif vm_unmap_aliases(); patches/preempt-realtime-sched-remove-debug.patch0000664000076400007640000000210311161723462021174 0ustar tglxtglxSubject: preempt: realtime sched remove debug From: Ingo Molnar Date: Wed Feb 04 06:17:45 CET 2009 Signed-off-by: Ingo Molnar --- kernel/sched.c | 5 ----- 1 file changed, 5 deletions(-) Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -2891,7 +2891,6 @@ asmlinkage void schedule_tail(struct tas __releases(rq->lock) { preempt_disable(); - BUG_ON((preempt_count() & 0xffff) != 2); finish_task_switch(this_rq(), prev); __preempt_enable_no_resched(); local_irq_enable(); @@ -4970,19 +4969,15 @@ asmlinkage void __sched __schedule(void) } reacquire_kernel_lock(current); - BUG_ON(preempt_count() & 0xffff); } asmlinkage void __sched schedule(void) { - BUG_ON((preempt_count() & 0xffff) && !current->exit_state); need_resched: local_irq_disable(); __schedule(); local_irq_enable(); - BUG_ON(preempt_count() & 0xffff); - if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) goto need_resched; } patches/relay-fix.patch0000664000076400007640000000300511160752235014156 0ustar tglxtglxSubject: relay: fix timer madness From: Ingo Molnar remove timer calls (!!!) from deep within the tracing infrastructure. This was totally bogus code that can cause lockups and worse. Poll the buffer every 2 jiffies for now. Signed-off-by: Ingo Molnar --- kernel/relay.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) Index: linux-2.6-tip/kernel/relay.c =================================================================== --- linux-2.6-tip.orig/kernel/relay.c +++ linux-2.6-tip/kernel/relay.c @@ -343,6 +343,10 @@ static void wakeup_readers(unsigned long { struct rchan_buf *buf = (struct rchan_buf *)data; wake_up_interruptible(&buf->read_wait); + /* + * Stupid polling for now: + */ + mod_timer(&buf->timer, jiffies + 1); } /** @@ -360,6 +364,7 @@ static void __relay_reset(struct rchan_b init_waitqueue_head(&buf->read_wait); kref_init(&buf->kref); setup_timer(&buf->timer, wakeup_readers, (unsigned long)buf); + mod_timer(&buf->timer, jiffies + 1); } else del_timer_sync(&buf->timer); @@ -740,15 +745,6 @@ size_t relay_switch_subbuf(struct rchan_ else buf->early_bytes += buf->chan->subbuf_size - buf->padding[old_subbuf]; - smp_mb(); - if (waitqueue_active(&buf->read_wait)) - /* - * Calling wake_up_interruptible() from here - * will deadlock if we happen to be logging - * from the scheduler (trying to re-grab - * rq->lock), so defer it. - */ - mod_timer(&buf->timer, jiffies + 1); } old = buf->data; patches/preempt-realtime-serial-console-fix.patch0000664000076400007640000000336111160752235021240 0ustar tglxtglxSubject: rt: serial console fix From: Ingo Molnar Date: Tue Feb 10 00:10:12 CET 2009 The serial console printk path grew a new spinlock - which is rather heavy - so instead of converting it to raw, use the sysrq/oops path of only taking the lock if we can, on PREEMPT_RT. Signed-off-by: Ingo Molnar --- drivers/serial/8250.c | 3 ++- include/linux/rt_lock.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) Index: linux-2.6-tip/drivers/serial/8250.c =================================================================== --- linux-2.6-tip.orig/drivers/serial/8250.c +++ linux-2.6-tip/drivers/serial/8250.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -2716,7 +2717,7 @@ serial8250_console_write(struct console touch_nmi_watchdog(); - if (up->port.sysrq || oops_in_progress) + if (up->port.sysrq || oops_in_progress || preempt_rt) locked = spin_trylock_irqsave(&up->port.lock, flags); else spin_lock_irqsave(&up->port.lock, flags); Index: linux-2.6-tip/include/linux/rt_lock.h =================================================================== --- linux-2.6-tip.orig/include/linux/rt_lock.h +++ linux-2.6-tip/include/linux/rt_lock.h @@ -15,6 +15,7 @@ #include #ifdef CONFIG_PREEMPT_RT +# define preempt_rt 1 /* * spinlocks - an RT mutex plus lock-break field: */ @@ -280,6 +281,8 @@ extern void rt_downgrade_write(struct r #define rwsem_is_locked(rwsem) \ PICK_RWSEM_OP_RET(compat_rwsem_is_locked, rt_rwsem_is_locked, rwsem) +#else +# define preempt_rt 0 #endif /* CONFIG_PREEMPT_RT */ #endif patches/hrtimer-fixup-hrtimer-callback-changes.patch0000664000076400007640000002311011160752235021670 0ustar tglxtglxSubject: hrtimer: fixup hrtimer callback changes for preempt-rt From: Thomas Gleixner Date: Sat, 07 Feb 2009 15:52:43 +0100 In preempt-rt we can not call the callbacks which take sleeping locks from the timer interrupt context. Bring back the softirq split for now, until we fixed the signal delivery problem for real. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- include/linux/hrtimer.h | 2 kernel/hrtimer.c | 141 ++++++++++++++++++++++++++++++++++++++++++----- kernel/sched.c | 2 kernel/time/tick-sched.c | 1 4 files changed, 131 insertions(+), 15 deletions(-) Index: linux-2.6-tip/include/linux/hrtimer.h =================================================================== --- linux-2.6-tip.orig/include/linux/hrtimer.h +++ linux-2.6-tip/include/linux/hrtimer.h @@ -105,6 +105,7 @@ struct hrtimer { struct hrtimer_clock_base *base; unsigned long state; struct list_head cb_entry; + int irqsafe; #ifdef CONFIG_TIMER_STATS int start_pid; void *start_site; @@ -140,6 +141,7 @@ struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base; clockid_t index; struct rb_root active; + struct list_head expired; struct rb_node *first; ktime_t resolution; ktime_t (*get_time)(void); Index: linux-2.6-tip/kernel/hrtimer.c =================================================================== --- linux-2.6-tip.orig/kernel/hrtimer.c +++ linux-2.6-tip/kernel/hrtimer.c @@ -534,15 +534,24 @@ static int hrtimer_reprogram(struct hrti WARN_ON_ONCE(hrtimer_get_expires_tv64(timer) < 0); +#ifndef CONFIG_PREEMPT_RT /* * When the callback is running, we do not reprogram the clock event * device. The timer callback is either running on a different CPU or * the callback is executed in the hrtimer_interrupt context. The - * reprogramming is handled either by the softirq, which called the - * callback or at the end of the hrtimer_interrupt. + * reprogramming is handled at the end of the hrtimer_interrupt. */ if (hrtimer_callback_running(timer)) return 0; +#else + /* + * preempt-rt changes the rules here as long as we have not + * solved the callback problem. For softirq based timers we + * need to allow reprogramming. + */ + if (hrtimer_callback_running(timer) && timer->irqsafe) + return 0; +#endif /* * CLOCK_REALTIME timer might be requested with an absolute @@ -642,6 +651,8 @@ static inline void hrtimer_init_timer_hr { } +static void __run_hrtimer(struct hrtimer *timer); +static int hrtimer_rt_defer(struct hrtimer *timer); /* * When High resolution timers are active, try to reprogram. Note, that in case @@ -654,6 +665,17 @@ static inline int hrtimer_enqueue_reprog int wakeup) { if (base->cpu_base->hres_active && hrtimer_reprogram(timer, base)) { +#ifdef CONFIG_PREEMPT_RT + /* + * Move softirq based timers away from the rbtree in + * case it expired already. Otherwise we would have a + * stale base->first entry until the softirq runs. + */ + if (!hrtimer_rt_defer(timer)) { + __run_hrtimer(timer); + return 1; + } +#endif if (wakeup) { spin_unlock(&base->cpu_base->lock); raise_softirq_irqoff(HRTIMER_SOFTIRQ); @@ -878,6 +900,11 @@ static void __remove_hrtimer(struct hrti unsigned long newstate, int reprogram) { if (timer->state & HRTIMER_STATE_ENQUEUED) { + + if (unlikely(!list_empty(&timer->cb_entry))) { + list_del_init(&timer->cb_entry); + goto out; + } /* * Remove the timer from the rbtree and replace the * first entry pointer if necessary. @@ -890,6 +917,7 @@ static void __remove_hrtimer(struct hrti } rb_erase(&timer->node, &base->active); } +out: timer->state = newstate; } @@ -1203,6 +1231,77 @@ static void __run_hrtimer(struct hrtimer timer->state &= ~HRTIMER_STATE_CALLBACK; } +#ifdef CONFIG_PREEMPT_RT + +/* + * The changes in mainline which removed the callback modes from + * hrtimer are not yet working with -rt. The non wakeup_process() + * based callbacks which involve sleeping locks need to be treated + * seperately. + */ +static void hrtimer_rt_run_pending(void) +{ + enum hrtimer_restart (*fn)(struct hrtimer *); + struct hrtimer_cpu_base *cpu_base; + struct hrtimer_clock_base *base; + struct hrtimer *timer; + int index, restart; + + local_irq_disable(); + cpu_base = &per_cpu(hrtimer_bases, smp_processor_id()); + + spin_lock(&cpu_base->lock); + + for (index = 0; index < HRTIMER_MAX_CLOCK_BASES; index++) { + base = &cpu_base->clock_base[index]; + + while (!list_empty(&base->expired)) { + timer = list_first_entry(&base->expired, + struct hrtimer, cb_entry); + + /* + * Same as the above __run_hrtimer function + * just we run with interrupts enabled. + */ + debug_hrtimer_deactivate(timer); + __remove_hrtimer(timer, base, HRTIMER_STATE_CALLBACK, 0); + timer_stats_account_hrtimer(timer); + fn = timer->function; + + spin_unlock_irq(&cpu_base->lock); + restart = fn(timer); + spin_lock_irq(&cpu_base->lock); + + if (restart != HRTIMER_NORESTART) { + BUG_ON(timer->state != HRTIMER_STATE_CALLBACK); + enqueue_hrtimer(timer, base); + } + timer->state &= ~HRTIMER_STATE_CALLBACK; + } + } + + spin_unlock_irq(&cpu_base->lock); + + wake_up_timer_waiters(cpu_base); +} + +static int hrtimer_rt_defer(struct hrtimer *timer) +{ + if (timer->irqsafe) + return 0; + + __remove_hrtimer(timer, timer->base, timer->state, 0); + list_add_tail(&timer->cb_entry, &timer->base->expired); + return 1; +} + +#else + +static inline void hrtimer_rt_run_pending(void) { } +static inline int hrtimer_rt_defer(struct hrtimer *timer) { return 0; } + +#endif + #ifdef CONFIG_HIGH_RES_TIMERS static int force_clock_reprogram; @@ -1238,7 +1337,7 @@ void hrtimer_interrupt(struct clock_even struct hrtimer_clock_base *base; ktime_t expires_next, now; int nr_retries = 0; - int i; + int i, raise = 0; BUG_ON(!cpu_base->hres_active); cpu_base->nr_events++; @@ -1291,7 +1390,10 @@ void hrtimer_interrupt(struct clock_even break; } - __run_hrtimer(timer); + if (!hrtimer_rt_defer(timer)) + __run_hrtimer(timer); + else + raise = 1; } spin_unlock(&cpu_base->lock); base++; @@ -1304,6 +1406,9 @@ void hrtimer_interrupt(struct clock_even if (tick_program_event(expires_next, force_clock_reprogram)) goto retry; } + + if (raise) + raise_softirq_irqoff(HRTIMER_SOFTIRQ); } /* @@ -1342,17 +1447,18 @@ void hrtimer_peek_ahead_timers(void) local_irq_restore(flags); } -static void run_hrtimer_softirq(struct softirq_action *h) -{ - hrtimer_peek_ahead_timers(); -} - #else /* CONFIG_HIGH_RES_TIMERS */ static inline void __hrtimer_peek_ahead_timers(void) { } #endif /* !CONFIG_HIGH_RES_TIMERS */ +static void run_hrtimer_softirq(struct softirq_action *h) +{ + hrtimer_peek_ahead_timers(); + hrtimer_rt_run_pending(); +} + /* * Called from timer softirq every jiffy, expire hrtimers: * @@ -1387,7 +1493,7 @@ void hrtimer_run_queues(void) struct rb_node *node; struct hrtimer_cpu_base *cpu_base; struct hrtimer_clock_base *base; - int index, gettime = 1; + int index, gettime = 1, raise = 0; cpu_base = &per_cpu(hrtimer_bases, raw_smp_processor_id()); if (hrtimer_hres_active(cpu_base)) @@ -1414,12 +1520,16 @@ void hrtimer_run_queues(void) hrtimer_get_expires_tv64(timer)) break; - __run_hrtimer(timer); + if (!hrtimer_rt_defer(timer)) + __run_hrtimer(timer); + else + raise = 1; } spin_unlock(&cpu_base->lock); } - wake_up_timer_waiters(cpu_base); + if (raise) + raise_softirq_irqoff(HRTIMER_SOFTIRQ); } /* @@ -1441,6 +1551,7 @@ static enum hrtimer_restart hrtimer_wake void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, struct task_struct *task) { sl->timer.function = hrtimer_wakeup; + sl->timer.irqsafe = 1; sl->task = task; } @@ -1575,8 +1686,10 @@ static void __cpuinit init_hrtimers_cpu( spin_lock_init(&cpu_base->lock); - for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) + for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) { cpu_base->clock_base[i].cpu_base = cpu_base; + INIT_LIST_HEAD(&cpu_base->clock_base[i].expired); + } hrtimer_init_hres(cpu_base); #ifdef CONFIG_PREEMPT_SOFTIRQS @@ -1694,9 +1807,7 @@ void __init hrtimers_init(void) hrtimer_cpu_notify(&hrtimers_nb, (unsigned long)CPU_UP_PREPARE, (void *)(long)smp_processor_id()); register_cpu_notifier(&hrtimers_nb); -#ifdef CONFIG_HIGH_RES_TIMERS open_softirq(HRTIMER_SOFTIRQ, run_hrtimer_softirq); -#endif } /** Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -254,6 +254,7 @@ void init_rt_bandwidth(struct rt_bandwid hrtimer_init(&rt_b->rt_period_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); + rt_b->rt_period_timer.irqsafe = 1; rt_b->rt_period_timer.function = sched_rt_period_timer; } @@ -1283,6 +1284,7 @@ static void init_rq_hrtick(struct rq *rq hrtimer_init(&rq->hrtick_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); rq->hrtick_timer.function = hrtick; + rq->hrtick_timer.irqsafe = 1; } #else /* CONFIG_SCHED_HRTICK */ static inline void hrtick_clear(struct rq *rq) Index: linux-2.6-tip/kernel/time/tick-sched.c =================================================================== --- linux-2.6-tip.orig/kernel/time/tick-sched.c +++ linux-2.6-tip/kernel/time/tick-sched.c @@ -687,6 +687,7 @@ void tick_setup_sched_timer(void) * Emulate tick processing via per-CPU hrtimers: */ hrtimer_init(&ts->sched_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); + ts->sched_timer.irqsafe = 1; ts->sched_timer.function = tick_sched_timer; /* Get the next period (per cpu) */ patches/generic-cmpxchg-use-raw-local-irq-variant.patch0000664000076400007640000000233411160752235022231 0ustar tglxtglxSubject: generic: cmpxchg use raw local irq variant From: Ingo Molnar Date: Wed Feb 04 00:03:10 CET 2009 Signed-off-by: Ingo Molnar --- include/asm-generic/cmpxchg-local.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: linux-2.6-tip/include/asm-generic/cmpxchg-local.h =================================================================== --- linux-2.6-tip.orig/include/asm-generic/cmpxchg-local.h +++ linux-2.6-tip/include/asm-generic/cmpxchg-local.h @@ -20,7 +20,7 @@ static inline unsigned long __cmpxchg_lo if (size == 8 && sizeof(unsigned long) != 8) wrong_size_cmpxchg(ptr); - local_irq_save(flags); + raw_local_irq_save(flags); switch (size) { case 1: prev = *(u8 *)ptr; if (prev == old) @@ -41,7 +41,7 @@ static inline unsigned long __cmpxchg_lo default: wrong_size_cmpxchg(ptr); } - local_irq_restore(flags); + raw_local_irq_restore(flags); return prev; } @@ -54,11 +54,11 @@ static inline u64 __cmpxchg64_local_gene u64 prev; unsigned long flags; - local_irq_save(flags); + raw_local_irq_save(flags); prev = *(u64 *)ptr; if (prev == old) *(u64 *)ptr = new; - local_irq_restore(flags); + raw_local_irq_restore(flags); return prev; } patches/preempt-realtime-debugobjects-rt-safe.patch0000664000076400007640000000154211160752235021533 0ustar tglxtglxSubject: preempt-realtime-debugobjects-rt-safe.patch From: Thomas Gleixner Date: Mon, 09 Feb 2009 18:52:50 +0100 Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- lib/debugobjects.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6-tip/lib/debugobjects.c =================================================================== --- linux-2.6-tip.orig/lib/debugobjects.c +++ linux-2.6-tip/lib/debugobjects.c @@ -25,14 +25,14 @@ struct debug_bucket { struct hlist_head list; - spinlock_t lock; + raw_spinlock_t lock; }; static struct debug_bucket obj_hash[ODEBUG_HASH_SIZE]; static struct debug_obj obj_static_pool[ODEBUG_POOL_SIZE] __initdata; -static DEFINE_SPINLOCK(pool_lock); +static DEFINE_RAW_SPINLOCK(pool_lock); static HLIST_HEAD(obj_pool); patches/loopback-revert.patch0000664000076400007640000000240511160752235015360 0ustar tglxtglxSubject: patches/loopback-revert.patch revert this commit: commit 58f539740b1ccfc5ef4e509ec2efe82621b546e3 Author: Eric Dumazet Date: Fri Oct 20 00:32:41 2006 -0700 [NET]: Can use __get_cpu_var() instead of per_cpu() in loopback driver. As BHs are off in loopback_xmit(), preemption cannot occurs, so we can use __get_cpu_var() instead of per_cpu() (and avoid a preempt_enable()/preempt_disable() pair) Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Ingo Molnar --- drivers/net/loopback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6-tip/drivers/net/loopback.c =================================================================== --- linux-2.6-tip.orig/drivers/net/loopback.c +++ linux-2.6-tip/drivers/net/loopback.c @@ -76,11 +76,11 @@ static int loopback_xmit(struct sk_buff skb->protocol = eth_type_trans(skb,dev); - /* it's OK to use per_cpu_ptr() because BHs are off */ pcpu_lstats = dev->ml_priv; - lb_stats = per_cpu_ptr(pcpu_lstats, smp_processor_id()); + lb_stats = per_cpu_ptr(pcpu_lstats, get_cpu()); lb_stats->bytes += skb->len; lb_stats->packets++; + put_cpu(); netif_rx(skb); patches/rtmutex-rearrange.patch0000664000076400007640000000432211160752235015735 0ustar tglxtglxSubject: patches/rtmutex-rearrange.patch From: Gregory Haskins The current logic makes rather coarse adjustments to current->state since it is planning on sleeping anyway. We want to eventually move to an adaptive (e.g. optional sleep) algorithm, so we tighten the scope of the adjustments to bracket the schedule(). This should yield correct behavior with or without the adaptive features that are added later in the series. We add it here as a separate patch for greater review clarity on smaller changes. Signed-off-by: Gregory Haskins Signed-off-by: Ingo Molnar --- kernel/rtmutex.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) Index: linux-2.6-tip/kernel/rtmutex.c =================================================================== --- linux-2.6-tip.orig/kernel/rtmutex.c +++ linux-2.6-tip/kernel/rtmutex.c @@ -666,6 +666,14 @@ rt_spin_lock_fastunlock(struct rt_mutex slowfn(lock); } +static inline void +update_current(unsigned long new_state, unsigned long *saved_state) +{ + unsigned long state = xchg(¤t->state, new_state); + if (unlikely(state == TASK_RUNNING)) + *saved_state = TASK_RUNNING; +} + /* * Slow path lock function spin_lock style: this variant is very * careful not to miss any non-lock wakeups. @@ -705,7 +713,7 @@ rt_spin_lock_slowlock(struct rt_mutex *l * saved_state accordingly. If we did not get a real wakeup * then we return with the saved state. */ - saved_state = xchg(¤t->state, TASK_UNINTERRUPTIBLE); + saved_state = current->state; for (;;) { unsigned long saved_flags; @@ -737,14 +745,15 @@ rt_spin_lock_slowlock(struct rt_mutex *l debug_rt_mutex_print_deadlock(&waiter); - schedule_rt_mutex(lock); + update_current(TASK_UNINTERRUPTIBLE, &saved_state); + if (waiter.task) + schedule_rt_mutex(lock); + else + update_current(TASK_RUNNING_MUTEX, &saved_state); spin_lock_irqsave(&lock->wait_lock, flags); current->flags |= saved_flags; current->lock_depth = saved_lock_depth; - state = xchg(¤t->state, TASK_UNINTERRUPTIBLE); - if (unlikely(state == TASK_RUNNING)) - saved_state = TASK_RUNNING; } state = xchg(¤t->state, saved_state); patches/preempt-realtime-supress-rtc-printk.patch0000664000076400007640000000132211160752235021327 0ustar tglxtglxSubject: preempt: realtime supress rtc printk From: Ingo Molnar Date: Wed Feb 04 00:02:45 CET 2009 Signed-off-by: Ingo Molnar --- drivers/char/rtc.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6-tip/drivers/char/rtc.c =================================================================== --- linux-2.6-tip.orig/drivers/char/rtc.c +++ linux-2.6-tip/drivers/char/rtc.c @@ -1201,10 +1201,12 @@ static void rtc_dropped_irq(unsigned lon spin_unlock_irq(&rtc_lock); +#ifndef CONFIG_PREEMPT_RT if (printk_ratelimit()) { printk(KERN_WARNING "rtc: lost some interrupts at %ldHz.\n", freq); } +#endif /* Now we have new data */ wake_up_interruptible(&rtc_wait); patches/rt-page_alloc.patch0000664000076400007640000001261311160752235014774 0ustar tglxtglxSubject: rt-friendly per-cpu pages From: Ingo Molnar rt-friendly per-cpu pages: convert the irqs-off per-cpu locking method into a preemptible, explicit-per-cpu-locks method. Signed-off-by: Ingo Molnar --- mm/page_alloc.c | 100 ++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 75 insertions(+), 25 deletions(-) Index: linux-2.6-tip/mm/page_alloc.c =================================================================== --- linux-2.6-tip.orig/mm/page_alloc.c +++ linux-2.6-tip/mm/page_alloc.c @@ -163,6 +163,53 @@ static unsigned long __meminitdata dma_r EXPORT_SYMBOL(movable_zone); #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ +#ifdef CONFIG_PREEMPT_RT +static DEFINE_PER_CPU_LOCKED(int, pcp_locks); +#endif + +static inline void __lock_cpu_pcp(unsigned long *flags, int cpu) +{ +#ifdef CONFIG_PREEMPT_RT + spin_lock(&__get_cpu_lock(pcp_locks, cpu)); + flags = 0; +#else + local_irq_save(*flags); +#endif +} + +static inline void lock_cpu_pcp(unsigned long *flags, int *this_cpu) +{ +#ifdef CONFIG_PREEMPT_RT + (void)get_cpu_var_locked(pcp_locks, this_cpu); + flags = 0; +#else + local_irq_save(*flags); + *this_cpu = smp_processor_id(); +#endif +} + +static inline void unlock_cpu_pcp(unsigned long flags, int this_cpu) +{ +#ifdef CONFIG_PREEMPT_RT + put_cpu_var_locked(pcp_locks, this_cpu); +#else + local_irq_restore(flags); +#endif +} + +static struct per_cpu_pageset * +get_zone_pcp(struct zone *zone, unsigned long *flags, int *this_cpu) +{ + lock_cpu_pcp(flags, this_cpu); + return zone_pcp(zone, *this_cpu); +} + +static void +put_zone_pcp(struct zone *zone, unsigned long flags, int this_cpu) +{ + unlock_cpu_pcp(flags, this_cpu); +} + #if MAX_NUMNODES > 1 int nr_node_ids __read_mostly = MAX_NUMNODES; EXPORT_SYMBOL(nr_node_ids); @@ -547,8 +594,7 @@ static void free_one_page(struct zone *z static void __free_pages_ok(struct page *page, unsigned int order) { unsigned long flags; - int i; - int bad = 0; + int i, this_cpu, bad = 0; kmemcheck_free_shadow(page, order); @@ -565,10 +611,10 @@ static void __free_pages_ok(struct page arch_free_page(page, order); kernel_map_pages(page, 1 << order, 0); - local_irq_save(flags); - __count_vm_events(PGFREE, 1 << order); + lock_cpu_pcp(&flags, &this_cpu); + count_vm_events(PGFREE, 1 << order); free_one_page(page_zone(page), page, order); - local_irq_restore(flags); + unlock_cpu_pcp(flags, this_cpu); } /* @@ -901,15 +947,16 @@ void drain_zone_pages(struct zone *zone, { unsigned long flags; int to_drain; + int this_cpu; - local_irq_save(flags); + lock_cpu_pcp(&flags, &this_cpu); if (pcp->count >= pcp->batch) to_drain = pcp->batch; else to_drain = pcp->count; free_pages_bulk(zone, to_drain, &pcp->list, 0); pcp->count -= to_drain; - local_irq_restore(flags); + unlock_cpu_pcp(flags, this_cpu); } #endif @@ -933,12 +980,15 @@ static void drain_pages(unsigned int cpu continue; pset = zone_pcp(zone, cpu); - + if (!pset) { + WARN_ON(1); + continue; + } pcp = &pset->pcp; - local_irq_save(flags); + lock_cpu_pcp(&flags, &cpu); free_pages_bulk(zone, pcp->count, &pcp->list, 0); pcp->count = 0; - local_irq_restore(flags); + unlock_cpu_pcp(flags, cpu); } } @@ -1000,8 +1050,10 @@ void mark_free_pages(struct zone *zone) static void free_hot_cold_page(struct page *page, int cold) { struct zone *zone = page_zone(page); + struct per_cpu_pageset *pset; struct per_cpu_pages *pcp; unsigned long flags; + int this_cpu; kmemcheck_free_shadow(page, 0); @@ -1017,9 +1069,11 @@ static void free_hot_cold_page(struct pa arch_free_page(page, 0); kernel_map_pages(page, 1, 0); - pcp = &zone_pcp(zone, get_cpu())->pcp; - local_irq_save(flags); - __count_vm_event(PGFREE); + pset = get_zone_pcp(zone, &flags, &this_cpu); + pcp = &pset->pcp; + + count_vm_event(PGFREE); + if (cold) list_add_tail(&page->lru, &pcp->list); else @@ -1030,8 +1084,7 @@ static void free_hot_cold_page(struct pa free_pages_bulk(zone, pcp->batch, &pcp->list, 0); pcp->count -= pcp->batch; } - local_irq_restore(flags); - put_cpu(); + put_zone_pcp(zone, flags, this_cpu); } void free_hot_page(struct page *page) @@ -1083,16 +1136,15 @@ static struct page *buffered_rmqueue(str unsigned long flags; struct page *page; int cold = !!(gfp_flags & __GFP_COLD); - int cpu; + struct per_cpu_pageset *pset; int migratetype = allocflags_to_migratetype(gfp_flags); + int this_cpu; again: - cpu = get_cpu(); + pset = get_zone_pcp(zone, &flags, &this_cpu); if (likely(order == 0)) { - struct per_cpu_pages *pcp; + struct per_cpu_pages *pcp = &pset->pcp; - pcp = &zone_pcp(zone, cpu)->pcp; - local_irq_save(flags); if (!pcp->count) { pcp->count = rmqueue_bulk(zone, 0, pcp->batch, &pcp->list, migratetype); @@ -1121,7 +1173,7 @@ again: list_del(&page->lru); pcp->count--; } else { - spin_lock_irqsave(&zone->lock, flags); + spin_lock(&zone->lock); page = __rmqueue(zone, order, migratetype); spin_unlock(&zone->lock); if (!page) @@ -1130,8 +1182,7 @@ again: __count_zone_vm_events(PGALLOC, zone, 1 << order); zone_statistics(preferred_zone, zone); - local_irq_restore(flags); - put_cpu(); + put_zone_pcp(zone, flags, this_cpu); VM_BUG_ON(bad_range(zone, page)); if (prep_new_page(page, order, gfp_flags)) @@ -1139,8 +1190,7 @@ again: return page; failed: - local_irq_restore(flags); - put_cpu(); + put_zone_pcp(zone, flags, this_cpu); return NULL; } patches/arm-omap-05.patch0000664000076400007640000000213111160752235014210 0ustar tglxtglxFrom khilman@mvista.com Wed May 28 15:18:00 2008 Date: Tue, 20 May 2008 15:45:50 -0700 From: Kevin Hilman To: linux-rt-users@vger.kernel.org Cc: linux-omap@vger.kernel.org, Kevin Hilman Subject: [PATCH 5/5] ARM: OMAP: remove unnecessary locking in clk_get_rate() The locking in the get_rate() hook is unnecessary, and causes problems when used with the -rt patch, since it may be called recursively. Signed-off-by: Kevin Hilman --- arch/arm/plat-omap/clock.c | 3 --- 1 file changed, 3 deletions(-) Index: linux-2.6-tip/arch/arm/plat-omap/clock.c =================================================================== --- linux-2.6-tip.orig/arch/arm/plat-omap/clock.c +++ linux-2.6-tip/arch/arm/plat-omap/clock.c @@ -132,15 +132,12 @@ EXPORT_SYMBOL(clk_get_usecount); unsigned long clk_get_rate(struct clk *clk) { - unsigned long flags; unsigned long ret = 0; if (clk == NULL || IS_ERR(clk)) return 0; - spin_lock_irqsave(&clockfw_lock, flags); ret = clk->rate; - spin_unlock_irqrestore(&clockfw_lock, flags); return ret; } patches/disable-maxcpus-for-now.patch0000664000076400007640000000323711160752235016733 0ustar tglxtglxSubject: disable-maxcpus-for-now.patch From: Thomas Gleixner Date: Thu, 12 Mar 2009 15:13:56 +0100 Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig | 2 +- arch/x86/Kconfig.debug | 1 + lib/Kconfig | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) Index: linux-2.6-tip/arch/x86/Kconfig =================================================================== --- linux-2.6-tip.orig/arch/x86/Kconfig +++ linux-2.6-tip/arch/x86/Kconfig @@ -663,7 +663,7 @@ config IOMMU_API config MAXSMP bool "Configure Maximum number of SMP Processors and NUMA Nodes" - depends on X86_64 && SMP && DEBUG_KERNEL && EXPERIMENTAL + depends on 0 && X86_64 && SMP && DEBUG_KERNEL && EXPERIMENTAL select CPUMASK_OFFSTACK default n ---help--- Index: linux-2.6-tip/arch/x86/Kconfig.debug =================================================================== --- linux-2.6-tip.orig/arch/x86/Kconfig.debug +++ linux-2.6-tip/arch/x86/Kconfig.debug @@ -85,6 +85,7 @@ config DEBUG_PER_CPU_MAPS bool "Debug access to per_cpu maps" depends on DEBUG_KERNEL depends on SMP + depends on !PREEMPT_RT default n ---help--- Say Y to verify that the per_cpu map being accessed has Index: linux-2.6-tip/lib/Kconfig =================================================================== --- linux-2.6-tip.orig/lib/Kconfig +++ linux-2.6-tip/lib/Kconfig @@ -176,6 +176,7 @@ config HAVE_LMB config CPUMASK_OFFSTACK bool "Force CPU masks off stack" if DEBUG_PER_CPU_MAPS + depends on !PREEMPT_RT && BROKEN help Use dynamic allocation for cpumask_var_t, instead of putting them on the stack. This is a bit more expensive, but avoids patches/rt-res_counter-fix.patch0000664000076400007640000000665311160752235016031 0ustar tglxtglxSubject: rt: res_counter fix From: Ingo Molnar Date: Thu Feb 12 11:11:47 CET 2009 Frederic Weisbecker reported this warning: [ 45.228562] BUG: sleeping function called from invalid context at kernel/rtmutex.c:683 [ 45.228571] in_atomic(): 0, irqs_disabled(): 1, pid: 4290, name: ntpdate [ 45.228576] INFO: lockdep is turned off. [ 45.228580] irq event stamp: 0 [ 45.228583] hardirqs last enabled at (0): [<(null)>] (null) [ 45.228589] hardirqs last disabled at (0): [] copy_process+0x68d/0x1500 [ 45.228602] softirqs last enabled at (0): [] copy_process+0x68d/0x1500 [ 45.228609] softirqs last disabled at (0): [<(null)>] (null) [ 45.228617] Pid: 4290, comm: ntpdate Tainted: G W 2.6.29-rc4-rt1-tip #1 [ 45.228622] Call Trace: [ 45.228632] [] ? print_irqtrace_events+0xd0/0xe0 [ 45.228639] [] __might_sleep+0x113/0x130 [ 45.228646] [] rt_spin_lock+0xa1/0xb0 [ 45.228653] [] res_counter_charge+0x5d/0x130 [ 45.228660] [] __mem_cgroup_try_charge+0x7f/0x180 [ 45.228667] [] mem_cgroup_charge_common+0x57/0x90 [ 45.228674] [] ? ftrace_call+0x5/0x2b [ 45.228680] [] mem_cgroup_newpage_charge+0x5d/0x60 [ 45.228688] [] __do_fault+0x29e/0x4c0 [ 45.228694] [] ? rt_spin_unlock+0x23/0x80 [ 45.228700] [] handle_mm_fault+0x205/0x890 [ 45.228707] [] ? ftrace_call+0x5/0x2b [ 45.228714] [] do_page_fault+0x11e/0x2a0 [ 45.228720] [] page_fault+0x25/0x30 [ 45.228727] [] ? __clear_user+0x3d/0x70 [ 45.228733] [] ? __clear_user+0x21/0x70 The reason is the raw IRQ flag use of kernel/res_counter.c. The irq flags tricks there seem a bit pointless: it cannot protect the c->parent linkage because local_irq_save() is only per CPU. So replace it with _nort(). This code needs a second look. Reported-by: Frederic Weisbecker Signed-off-by: Ingo Molnar --- kernel/res_counter.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) Index: linux-2.6-tip/kernel/res_counter.c =================================================================== --- linux-2.6-tip.orig/kernel/res_counter.c +++ linux-2.6-tip/kernel/res_counter.c @@ -14,6 +14,7 @@ #include #include #include +#include void res_counter_init(struct res_counter *counter, struct res_counter *parent) { @@ -43,7 +44,7 @@ int res_counter_charge(struct res_counte struct res_counter *c, *u; *limit_fail_at = NULL; - local_irq_save(flags); + local_irq_save_nort(flags); for (c = counter; c != NULL; c = c->parent) { spin_lock(&c->lock); ret = res_counter_charge_locked(c, val); @@ -62,7 +63,7 @@ undo: spin_unlock(&u->lock); } done: - local_irq_restore(flags); + local_irq_restore_nort(flags); return ret; } @@ -79,13 +80,13 @@ void res_counter_uncharge(struct res_cou unsigned long flags; struct res_counter *c; - local_irq_save(flags); + local_irq_save_nort(flags); for (c = counter; c != NULL; c = c->parent) { spin_lock(&c->lock); res_counter_uncharge_locked(c, val); spin_unlock(&c->lock); } - local_irq_restore(flags); + local_irq_restore_nort(flags); } patches/series0000664000076400007640000003052711161723362012463 0ustar tglxtglx# # base tree: 2.6.29-rc8 # origin.patch # # Mainline + -tip fixes and updates # kbuild.patch # # Needs to be solved upstream by BKL removal # revert-sched-changes.patch revert-bkl-cleanup.patch revert-preempt-bkl-revert.patch # # Patches which should go mainline # rt_mutex_setprio.patch posix-timers-prevent-broadcast-signals.patch # # Lockless QRCU # qrcu.patch # KVM - RT fixes # NECESSARY: sched-enable-irqs-in-preempt-in-notifier-call.patch # # Check what's in mainline / mm or might be # upstream material. # spinlock-trylock-cleanup-sungem.patch x86_64-tsc-sync-irqflags-fix.patch neptune-no-at-keyboard.patch rtmutex-debug.h-cleanup.patch netpoll-8139too-fix.patch kprobes-preempt-fix.patch replace-bugon-by-warn-on.patch # Suspend / resume fixups i386-mark-atomic-irq-ops-raw.patch msi-suspend-resume-workaround.patch floppy-resume-fix.patch # # assorted fixlets from -mm: # ioapic-fix-too-fast-clocks.patch move-native-irq.patch dont-unmask-io_apic.patch # # misc build beautification patches: # gcc-warnings-shut-up.patch # # Various fixlets # nfs-stats-miss-preemption.patch random-driver-latency-fix.patch # # Debugging patches # #apic-dumpstack.patch # # Revert loopback bh assumption patch # loopback-revert.patch # # -rt queue: # #inet_hash_bits.patch #inet-hash-bits-ipv6-fix.patch # # IRQ threading # generic-cmpxchg-use-raw-local-irq-variant.patch preempt-softirqs-core.patch preempt-irqs-core.patch preempt-irqs-core-fix.patch preempt-irqs-direct-debug-keyboard.patch preempt-realtime-direct-keyboard-sparseirq-fix.patch preempt-irqs-timer.patch preempt-irqs-hrtimer.patch # i386 preempt-irqs-i386.patch #preempt-irqs-i386-ioapic-mask-quirk.patch # x8664 #preempt-irqs-x86-64-ioapic-mask-quirk.patch preempt-irqs-Kconfig.patch # # Real real time stuff :) # preempt-irqs-port-fixes.patch rt-apis.patch rt-slab-new.patch rt-page_alloc.patch # # rt-mutexes # rt-mutex-preempt-debugging.patch ## PORT-BARRIER: rt-mutex-irq-flags-checking.patch rt-mutex-trivial-tcp-preempt-fix.patch rt-mutex-trivial-route-cast-fix.patch rt-mutex-i386.patch rt-mutex-x86-64.patch rt-mutex-core.patch rt-mutex-core-fixes.patch rt-mutex-core-mutex-fixes.patch rt-mutex-core-fixes2.patch rt-mutex-fix-non-lock-kernel-config.patch slub-compile-fix.patch rt-mutex-compat-semaphores.patch # # Per-CPU locking assumption cleanups: # per-cpu-locked-infrastructure.patch percpu-locked-mm.patch drain-all-local-pages-via-sched.patch rt-page_alloc.c-cleanup.patch percpu-locked-netfilter.patch #percpu-locked-netfilter2.patch # # Various preempt fixups # net-core-preempt-fix.patch bh-uptodate-lock.patch bh-state-lock.patch jbd_assertions_smp_only.patch # # Tasklet redesign # tasklet-redesign.patch tasklet-busy-loop-hack.patch # # Diable irq poll on -rt # disable-irqpoll.patch # # Inaccurate -rt stats (should be replaced by CFS) # kstat-add-rt-stats.patch # Misc preempt-realtime-warn-and-bug-on.patch # # Posix-cpu-timers in a thread # cputimer-thread-rt_A0.patch cputimer-thread-rt-fix.patch shorten-posix-cpu-timers-name.patch # # Various broken drivers # vortex-fix.patch serial-locking-rt-cleanup.patch # # Serial optimizing # serial-slow-machines.patch # # Realtime patches # # X86_64: needs splitting preempt-realtime-x86_64.patch # i386 preempt-realtime-i386.patch remove-check-pgt-cache-calls.patch #preempt-irqs-i386-idle-poll-loop-fix.patch # # Core patch # # Note this is a convenience split up it is not supposed to compile # step by step. Needs some care, but it is way easier to handle than # the previous touch all in one patch # preempt-realtime-sched.patch preempt-realtime-sched-remove-debug.patch preempt-realtime-mmdrop-delayed.patch preempt-realtime-sched-i386.patch preempt-realtime-prevent-idle-boosting.patch # preempt-realtime-cfs-accounting-fix.patch # PORT VICTIM: schedule-tail-balance-disable-irqs.patch preempt-realtime-sched-cpupri.patch preempt-realtime-core.patch fix-net-bug-fixes.patch resurrect-softirq-code.patch preempt-realtime-net.patch preempt-realtime-net-softirq-fixups.patch dev-queue-xmit-preempt-fix.patch net-xmit-lock-owner-cleanup.patch preempt-realtime-cleanup-dev-queue-xmit.patch preempt-realtime-loopback.patch preempt-realtime-fs-block.patch preempt-realtime-acpi.patch preempt-realtime-ipc.patch #preempt-realtime-sound.patch # ftrace-compile-fixes.patch preempt-realtime-mm.patch preempt-realtime-init-show-enabled-debugs.patch preempt-realtime-compile-fixes.patch preempt-realtime-console.patch #preempt-realtime-debug-sysctl.patch preempt-realtime-ide.patch preempt-realtime-input.patch preempt-realtime-irqs.patch irq-desc-init.patch preempt-realtime-fix-irqdesc-lock-initializers.patch preempt-realtime-fix-sig-cputimer-lock.patch preempt-realtime-net-drivers.patch #preempt-realtime-netconsole.patch preempt-realtime-printk.patch # CHECKME: preempt-realtime-profiling.patch preempt-realtime-rawlocks.patch preempt-realtime-rcu.patch preempt-realtime-timer.patch fix-compilation-for-non-RT-in-timer.patch kstat-fix-spurious-system-load-spikes-in-proc-loadavgrt.patch preempt-realtimer-timer-non-rt-warning-fixes.patch preempt-realtimer-timer-more-non-rt-warning-fixes.patch gtod-optimize.patch rt-move-update-wall-time-back-to-do-timer.patch bz235099-idle-load-fix.patch preempt-realtime-usb.patch preempt-realtime-warn-and-bug-on-fix.patch preempt-realtime-debugobjects-rt-safe.patch preempt-realtime-xfs-compat-semaphore.patch rt-stop-cpus-fix.patch preempt-realtime-tracer.patch preempt-realtime-btrfs-locking-workaround.patch preempt-realtime-force-rcu-preempt.patch preempt-realtime-perfcounters.patch preempt-realtime-ipi-call-lock-raw.patch preempt-realtime-timer-cpu-hotplug-fix.patch preempt-realtime-serial-console-fix.patch preempt-realtime-disable-workqueue-tracer-on-preempt-rt.patch # CHECKME: irq-mask-fix.patch handle-pending-in-simple-irq.patch preempt-realtime-irqthreading-sparseirq-fixups.patch preempt-realtime-sparseirq-waitqueue-init-fix.patch # # Various -rt fixups # #preempt-realtime-supress-cpulock-warning.patch #preempt-realtime-supress-nohz-softirq-warning.patch #preempt-realtime-8139too-rt-irq-flags-fix.patch preempt-realtime-mellanox-driver-fix.patch # # Utility patches (not for upstream inclusion): # preempt-realtime-supress-rtc-printk.patch hrtimer-no-printk.patch # # soft watchdog queue: # #softlockup-fix.patch softlockup-add-irq-regs-h.patch #softlockup-better-printout.patch #softlockup-cleanups.patch #softlockup-use-cpu-clock.patch # # Not yet reviewed # # # START of Pete's ccur-pagecache queue # # # END of Pete's ccur-pagecache queue # # # kmap atomix fixes # kmap-atomic-prepare.patch pagefault-disable-cleanup.patch kmap-atomic-i386-fix.patch # # Highmem modifications # highmem-revert-mainline.patch highmem_rewrite.patch highmem-redo-mainline.patch rt-kmap-scale-fix.patch # # Not yet reviewed # highmem-atomic-fix.patch #select-error-leak-fix.patch fix-emergency-reboot.patch timer-freq-tweaks.patch # # Debug patches: # #pause-on-oops-head-tail.patch # # x86-64 vsyscall modifications # x86-64-tscless-vgettimeofday.patch #vsyscall-fixadder-pa.patch # # Timekeeping fixups # # x rt-time-starvation-fix.patch # x rt-time-starvation-fix-update.patch # # RT-Java testing stuff # #Add-dev-rmem-device-driver-for-real-time-JVM-testing.patch #Allocate-RTSJ-memory-for-TCK-conformance-test.patch # # Softirq modifications # #new-softirq-code.patch softirq-per-cpu-assumptions-fixes.patch #fix-migrating-softirq.patch #only-run-softirqs-from-irq-thread-when-irq-affinity-is-set.patch #fix-softirq-checks-for-non-rt-preempt-hardirq.patch smp-processor-id-fixups.patch # # Weird crap unearthed by -rt which needs to be investigated # irda-fix.patch #nf_conntrack-fix-smp-processor-id.patch # # Needs proper fix # print-might-sleep-hack.patch lockdep-rt-mutex.patch #lockstat-rt-hooks.patch #lockstat_bounce_rt.patch # # KVM: # #kvm-rt.patch # # Add RT to uname and apply the version # RT_utsname.patch # # not yet backmerged tail patches: # preempt-rt-no-slub.patch paravirt-function-pointer-fix.patch quicklist-release-before-free-page.patch quicklist-release-before-free-page-fix.patch sched-rt-stats.patch # CHECKME: mitigate-resched-flood.patch genirq-soft-resend.patch relay-fix.patch #schedule_on_each_cpu-enhance.patch #schedule_on_each_cpu-enhance-rt.patch lockdep-rt-recursion-limit-fix.patch cond_resched_softirq-WARN-fix.patch # stuff Ingo put into version.patch #export-schedule-on-each-cpu.patch # fix-alternate_node_alloc.patch hack-convert-i_alloc_sem-for-direct_io-craziness.patch dont-let-rt-rw_semaphores-do-non_owner-locks.patch # CHECKME: rt-s_files-kill-a-union.patch loadavg_fixes_weird_loads.patch # HPET patches #watchdog_use_timer_and_hpet_on_x86_64.patch # x stop-critical-timing-in-idle.patch # rt-wakeup-fix.patch disable-ist-x86_64.patch plist-debug.patch seq-irqsave.patch numa-slab-freeing.patch # Peter's patches # # workqueue PI # # CHECKME: rt-list-mods.patch # CHECKME: rt-plist-mods.patch # CHECKME: rt-workqeue-prio.patch # CHECKME: rt-workqueue-barrier.patch # CHECKME: rt-wq-barrier-fix.patch # CHECKME: rt-delayed-prio.patch # CHECKME: sched_prio.patch # x critical-timing-kconfig.patch lock-init-plist-fix.patch ntfs-local-irq-save-nort.patch dont-disable-preemption-without-IST.patch # CHECKME: filemap-dont-bug-non-atomic.patch # CHECKME: fix-bug-on-in-filemap.patch rt-sched-groups.patch printk-dont-bug-on-sched.patch user-no-irq-disable.patch proportions-raw-locks.patch # AT91 patches use-edge-triggered-irq-handler-instead-of-simple-irq.patch apic-level-smp-affinity.patch printk-in-atomic.patch printk-in-atomic-hack-fix.patch slab-irq-nopreempt-fix.patch swap-spinlock-fix.patch aacraid-compat-sem.patch # Luis's gtod updates fix_vdso_gtod_vsyscall64_2.patch git-ignore-script-lpp.patch sched-wake_up_idle_cpu-rt.patch # Adaptive Locks and lateral steal rtmutex-lateral-steal.patch rtmutex-rearrange.patch rtmutex-remove-xchg.patch adaptive-spinlock-lite-v2.patch adaptive-optimize-rt-lock-wakeup.patch adaptive-task-oncpu.patch adaptive-adjust-pi-wakeup.patch adapt-remove-extra-try-to-lock.patch adaptive-earlybreak-on-steal.patch fix-adaptive-hack.patch tglx-04-rtmutex-unify-state-manipulation.patch tglx-05-rtmutex-remove-uber-optimization.patch tglx-07-rtmutex-prevent-missed-wakeups.patch fix-config-debug-rt-mutex-lock-underflow-warnings.patch realtime-preempt-warn-about-tracing.patch sub-dont-disable-irqs.patch raw-spinlocks-for-nmi-print.patch sched-fix-dequeued-race.patch lockdep-atomic-fixup.patch seqlock-01-make-sure-that-raw_seqlock-retries.patch namespace-lock-fixes.patch sched-generic-hide-smp-warning.patch seqlock-serialize-against-writers.patch seqlocks-handle-rwlock-and-spin.patch ata-irq-save-nort.patch fix-erroneous-histogram-stop-warn-on-messages.patch # hrtimer bring back the hard/softirq seperation :( hrtimer-fix-wait-for-hrtimer.patch printk-tick-move-to-softirq-on-rt.patch hrtimer-fixup-hrtimer-callback-changes.patch blkcypher-fix.patch rt-res_counter-fix.patch preempt-realtime-paravirt-spinlocks-fix.patch # x86-32 highmem related fixups preempt-realtime-x86-32-gup-kmapatomic.patch preempt-rt-x86-pageattr-flush-unused.patch # general valid on -rt not only for x86-32 highmem preempt-rt-scatterlist-nort.patch netfilter-rcu-destroy.patch percpu-locked-netfilter-ecache.patch #debugobjects-rt-safe.patch disable-maxcpus-for-now.patch x86-microcode-fix-sysfs-wreckage.patch trace-disable-hw-branch-tracer.patch rt-spin-needbreak-fixup.patch mm-lock-break-on-bulk.patch page-alloc-bulk-moar.patch pagealloc-cond-resched-rt-only.patch trace-setprio.patch signal-keep-a-task-private-siginfo-for-rt-tasks.patch cpuhotplug-idle.patch cpuhotplug-page_alloc.patch cpuhotplug-per-cpu.patch cpuhotplug-vs-slab.patch slab-free-pages.patch lockdep-compat-sema-fix.patch x86-vector-sparse-irq-fix.patch posixtimer-avoid-wakeups.patch signal-do-not-wakeup-self.patch # ARM arm-preempt-config.patch preempt-irqs-arm.patch preempt-irqs-arm-fix-oprofile.patch rt-mutex-arm.patch preempt-realtime-arm.patch arm-fix-compile-1.patch preempt-realtime-arm-rawlock-in-mmu_context-h.patch preempt-realtime-arm-bagde4.patch preempt-realtime-arm-footbridge.patch preempt-realtime-arm-integrator.patch preempt-realtime-arm-ixp4xx.patch preempt-realtime-arm-shark.patch arm-omap-05.patch arm-tracing-updates.patch # POWERPC powerpc-rtmutex.patch powerpc-compat-semaphore.patch powerpc-rawlocks.patch powerpc-percpu-tlb.patch powerpc-realtime-preempt.patch genirq-warn-on-do-irq.patch x86-pae-preempt-realtime-fix.patch version.patch patches/preempt-realtime-input.patch0000664000076400007640000000270711160752235016677 0ustar tglxtglxSubject: preempt: realtime input From: Ingo Molnar Date: Wed Feb 04 00:02:50 CET 2009 Signed-off-by: Ingo Molnar --- drivers/input/gameport/gameport.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) Index: linux-2.6-tip/drivers/input/gameport/gameport.c =================================================================== --- linux-2.6-tip.orig/drivers/input/gameport/gameport.c +++ linux-2.6-tip/drivers/input/gameport/gameport.c @@ -20,6 +20,7 @@ #include #include #include +#include #include /* HZ */ #include #include @@ -98,12 +99,12 @@ static int gameport_measure_speed(struct tx = 1 << 30; for(i = 0; i < 50; i++) { - local_irq_save(flags); + local_irq_save_nort(flags); GET_TIME(t1); for (t = 0; t < 50; t++) gameport_read(gameport); GET_TIME(t2); GET_TIME(t3); - local_irq_restore(flags); + local_irq_restore_nort(flags); udelay(i * 10); if ((t = DELTA(t2,t1) - DELTA(t3,t2)) < tx) tx = t; } @@ -122,11 +123,11 @@ static int gameport_measure_speed(struct tx = 1 << 30; for(i = 0; i < 50; i++) { - local_irq_save(flags); + local_irq_save_nort(flags); rdtscl(t1); for (t = 0; t < 50; t++) gameport_read(gameport); rdtscl(t2); - local_irq_restore(flags); + local_irq_restore_nort(flags); udelay(i * 10); if (t2 - t1 < tx) tx = t2 - t1; } patches/preempt-realtime-ide.patch0000664000076400007640000001551511160752235016302 0ustar tglxtglxSubject: preempt: realtime ide From: Ingo Molnar Date: Wed Feb 04 00:02:50 CET 2009 Signed-off-by: Ingo Molnar --- drivers/ide/alim15x3.c | 12 ++++++------ drivers/ide/hpt366.c | 4 ++-- drivers/ide/ide-io.c | 2 +- drivers/ide/ide-iops.c | 20 ++++++++++---------- drivers/ide/ide-probe.c | 6 +++--- drivers/ide/ide-taskfile.c | 6 +++--- 6 files changed, 25 insertions(+), 25 deletions(-) Index: linux-2.6-tip/drivers/ide/alim15x3.c =================================================================== --- linux-2.6-tip.orig/drivers/ide/alim15x3.c +++ linux-2.6-tip/drivers/ide/alim15x3.c @@ -90,7 +90,7 @@ static void ali_set_pio_mode(ide_drive_t if (r_clc >= 16) r_clc = 0; } - local_irq_save(flags); + local_irq_save_nort(flags); /* * PIO mode => ATA FIFO on, ATAPI FIFO off @@ -112,7 +112,7 @@ static void ali_set_pio_mode(ide_drive_t pci_write_config_byte(dev, port, s_clc); pci_write_config_byte(dev, port + unit + 2, (a_clc << 4) | r_clc); - local_irq_restore(flags); + local_irq_restore_nort(flags); } /** @@ -222,7 +222,7 @@ static unsigned int init_chipset_ali15x3 isa_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); - local_irq_save(flags); + local_irq_save_nort(flags); if (m5229_revision < 0xC2) { /* @@ -313,7 +313,7 @@ out: } pci_dev_put(north); pci_dev_put(isa_dev); - local_irq_restore(flags); + local_irq_restore_nort(flags); return 0; } @@ -375,7 +375,7 @@ static u8 ali_cable_detect(ide_hwif_t *h unsigned long flags; u8 cbl = ATA_CBL_PATA40, tmpbyte; - local_irq_save(flags); + local_irq_save_nort(flags); if (m5229_revision >= 0xC2) { /* @@ -396,7 +396,7 @@ static u8 ali_cable_detect(ide_hwif_t *h } } - local_irq_restore(flags); + local_irq_restore_nort(flags); return cbl; } Index: linux-2.6-tip/drivers/ide/hpt366.c =================================================================== --- linux-2.6-tip.orig/drivers/ide/hpt366.c +++ linux-2.6-tip/drivers/ide/hpt366.c @@ -1328,7 +1328,7 @@ static int __devinit init_dma_hpt366(ide dma_old = inb(base + 2); - local_irq_save(flags); + local_irq_save_nort(flags); dma_new = dma_old; pci_read_config_byte(dev, hwif->channel ? 0x4b : 0x43, &masterdma); @@ -1339,7 +1339,7 @@ static int __devinit init_dma_hpt366(ide if (dma_new != dma_old) outb(dma_new, base + 2); - local_irq_restore(flags); + local_irq_restore_nort(flags); printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n", hwif->name, base, base + 7); Index: linux-2.6-tip/drivers/ide/ide-io.c =================================================================== --- linux-2.6-tip.orig/drivers/ide/ide-io.c +++ linux-2.6-tip/drivers/ide/ide-io.c @@ -949,7 +949,7 @@ void ide_timer_expiry (unsigned long dat /* disable_irq_nosync ?? */ disable_irq(hwif->irq); /* local CPU only, as if we were handling an interrupt */ - local_irq_disable(); + local_irq_disable_nort(); if (hwif->polling) { startstop = handler(drive); } else if (drive_is_ready(drive)) { Index: linux-2.6-tip/drivers/ide/ide-iops.c =================================================================== --- linux-2.6-tip.orig/drivers/ide/ide-iops.c +++ linux-2.6-tip/drivers/ide/ide-iops.c @@ -275,7 +275,7 @@ void ide_input_data(ide_drive_t *drive, unsigned long uninitialized_var(flags); if ((io_32bit & 2) && !mmio) { - local_irq_save(flags); + local_irq_save_nort(flags); ata_vlb_sync(io_ports->nsect_addr); } @@ -285,7 +285,7 @@ void ide_input_data(ide_drive_t *drive, insl(data_addr, buf, len / 4); if ((io_32bit & 2) && !mmio) - local_irq_restore(flags); + local_irq_restore_nort(flags); if ((len & 3) >= 2) { if (mmio) @@ -321,7 +321,7 @@ void ide_output_data(ide_drive_t *drive, unsigned long uninitialized_var(flags); if ((io_32bit & 2) && !mmio) { - local_irq_save(flags); + local_irq_save_nort(flags); ata_vlb_sync(io_ports->nsect_addr); } @@ -331,7 +331,7 @@ void ide_output_data(ide_drive_t *drive, outsl(data_addr, buf, len / 4); if ((io_32bit & 2) && !mmio) - local_irq_restore(flags); + local_irq_restore_nort(flags); if ((len & 3) >= 2) { if (mmio) @@ -509,12 +509,12 @@ static int __ide_wait_stat(ide_drive_t * if ((stat & ATA_BUSY) == 0) break; - local_irq_restore(flags); + local_irq_restore_nort(flags); *rstat = stat; return -EBUSY; } } - local_irq_restore(flags); + local_irq_restore_nort(flags); } /* * Allow status to settle, then read it again. @@ -681,17 +681,17 @@ int ide_driveid_update(ide_drive_t *driv printk("%s: CHECK for good STATUS\n", drive->name); return 0; } - local_irq_save(flags); + local_irq_save_nort(flags); SELECT_MASK(drive, 0); id = kmalloc(SECTOR_SIZE, GFP_ATOMIC); if (!id) { - local_irq_restore(flags); + local_irq_restore_nort(flags); return 0; } tp_ops->input_data(drive, NULL, id, SECTOR_SIZE); (void)tp_ops->read_status(hwif); /* clear drive IRQ */ - local_irq_enable(); - local_irq_restore(flags); + local_irq_enable_nort(); + local_irq_restore_nort(flags); ide_fix_driveid(id); drive->id[ATA_ID_UDMA_MODES] = id[ATA_ID_UDMA_MODES]; Index: linux-2.6-tip/drivers/ide/ide-probe.c =================================================================== --- linux-2.6-tip.orig/drivers/ide/ide-probe.c +++ linux-2.6-tip/drivers/ide/ide-probe.c @@ -196,10 +196,10 @@ static void do_identify(ide_drive_t *dri int bswap = 1; /* local CPU only; some systems need this */ - local_irq_save(flags); + local_irq_save_nort(flags); /* read 512 bytes of id info */ hwif->tp_ops->input_data(drive, NULL, id, SECTOR_SIZE); - local_irq_restore(flags); + local_irq_restore_nort(flags); drive->dev_flags |= IDE_DFLAG_ID_READ; #ifdef DEBUG @@ -813,7 +813,7 @@ static int ide_probe_port(ide_hwif_t *hw rc = 0; } - local_irq_restore(flags); + local_irq_restore_nort(flags); /* * Use cached IRQ number. It might be (and is...) changed by probe Index: linux-2.6-tip/drivers/ide/ide-taskfile.c =================================================================== --- linux-2.6-tip.orig/drivers/ide/ide-taskfile.c +++ linux-2.6-tip/drivers/ide/ide-taskfile.c @@ -219,7 +219,7 @@ static void ide_pio_sector(ide_drive_t * offset %= PAGE_SIZE; #ifdef CONFIG_HIGHMEM - local_irq_save(flags); + local_irq_save_nort(flags); #endif buf = kmap_atomic(page, KM_BIO_SRC_IRQ) + offset; @@ -239,7 +239,7 @@ static void ide_pio_sector(ide_drive_t * kunmap_atomic(buf, KM_BIO_SRC_IRQ); #ifdef CONFIG_HIGHMEM - local_irq_restore(flags); + local_irq_restore_nort(flags); #endif } @@ -430,7 +430,7 @@ static ide_startstop_t pre_task_out_intr } if ((drive->dev_flags & IDE_DFLAG_UNMASK) == 0) - local_irq_disable(); + local_irq_disable_nort(); ide_set_handler(drive, &task_out_intr, WAIT_WORSTCASE, NULL); ide_pio_datablock(drive, rq, 1); patches/numa-slab-freeing.patch0000664000076400007640000000351311160752235015556 0ustar tglxtglxSubject: Fix rt preempt slab NUMA freeing From: Andi Kleen Date: Tue, 23 Oct 2007 19:13:03 +0200 When this_cpu changes in the free path node needs to change too. Otherwise the slab can end up in the wrong node's list and this eventually leads to WARN_ONs and of course worse NUMA performace. This patch is likely not complete (the NUMA slab code is *very* hairy), but seems to make the make -j128 test survive for at least two hours. But at least it fixes one case that regularly triggered during testing, resulting in slabs in the wrong node lists and triggering WARN_ONs in slab_put/get_obj I tried a complete audit of keeping this_cpu/node/slabp in sync when needed, but it is very hairy code and I likely missed some cases. This so far fixes only the simple free path; but it seems to be good enough to not trigger easily anymore on a NUMA system with memory pressure. Longer term the only good fix is probably to migrate to slub. Or disable NUMA slab for PREEMPT_RT (its value has been disputed in some benchmarks anyways) Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar --- mm/slab.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-2.6-tip/mm/slab.c =================================================================== --- linux-2.6-tip.orig/mm/slab.c +++ linux-2.6-tip/mm/slab.c @@ -1120,7 +1120,7 @@ cache_free_alien(struct kmem_cache *cach struct array_cache *alien = NULL; int node; - node = numa_node_id(); + node = cpu_to_node(*this_cpu); /* * Make sure we are not freeing a object from another node to the array @@ -4150,6 +4150,8 @@ static void cache_reap(struct work_struc work_done += reap_alien(searchp, l3, &this_cpu); + node = cpu_to_node(this_cpu); + work_done += drain_array(searchp, l3, cpu_cache_get(searchp, this_cpu), 0, node); patches/blkcypher-fix.patch0000664000076400007640000000552111161723435015033 0ustar tglxtglxSubject: irq threading: fix PF_HARDIRQ definition From: Ingo Molnar Date: Thu Feb 12 09:29:14 CET 2009 Clark Williams reported the following warning: WARNING: at crypto/blkcipher.c:327 blkcipher_walk_first+0x72/0x1aa() [] blkcipher_walk_first+0x72/0x1aa [] blkcipher_walk_virt+0x1a/0x1c [] crypto_ecb_crypt+0x2b/0x9a [] crypto_ecb_decrypt+0x31/0x33 [] ieee80211_wep_decrypt_data+0x5e/0x95 [] ieee80211_wep_decrypt+0x118/0x16f [] ieee80211_crypto_wep_decrypt+0x4b/0x93 [] ieee80211_invoke_rx_handlers+0x26b/0x1395 [] __ieee80211_rx_handle_packet+0x55f/0x59c [] __ieee80211_rx+0x508/0x572 [] ieee80211_tasklet_handler+0x6d/0xff [] __tasklet_action+0xa1/0x112 [] tasklet_action+0x39/0x3b [] ksoftirqd+0x162/0x278 Which comes from: if (WARN_ON_ONCE(in_irq())) return -EDEADLK; This warning is surprising, as it clearly comes from a softirq context. The in_irq() definition looks like this on -rt: #define in_irq() (hardirq_count() || (current->flags & PF_HARDIRQ)) hardirq_count() is correct, but looking at PF_HARDIRQ's definition in sched.h: #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ #define PF_HARDIRQ 0x08000020 /* hardirq context */ #define PF_NOSCHED 0x00000020 /* Userspace does not expect scheduling */ #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ Reveals that due to a typo it not only overlaps the PF_NOSCHED bit, but also has a spurious 0x08000000 component. Move it to a free slot: 0x00000080. Reported-by: Clark Williams Signed-off-by: Ingo Molnar --- include/linux/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -1724,9 +1724,9 @@ extern cputime_t task_gtime(struct task_ #define PF_EXITING 0x00000004 /* getting shut down */ #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ -#define PF_HARDIRQ 0x08000020 /* hardirq context */ #define PF_NOSCHED 0x00000020 /* Userspace does not expect scheduling */ #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ +#define PF_HARDIRQ 0x00000080 /* hardirq context */ #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ #define PF_DUMPCORE 0x00000200 /* dumped core */ #define PF_SIGNALED 0x00000400 /* killed by a signal */ patches/preempt-realtime-tracer.patch0000664000076400007640000001513211161661054017013 0ustar tglxtglxSubject: preempt-realtime-tracer.patch From: Thomas Gleixner Date: Mon, 09 Feb 2009 19:30:01 +0100 Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- kernel/sched.c | 2 +- kernel/trace/ring_buffer.c | 6 +++--- kernel/trace/trace.c | 18 ++++++++++-------- kernel/trace/trace_clock.c | 4 ++-- kernel/trace/trace_irqsoff.c | 2 +- kernel/trace/trace_sched_wakeup.c | 3 +-- kernel/trace/trace_stack.c | 3 +-- 7 files changed, 19 insertions(+), 19 deletions(-) Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -4737,7 +4737,7 @@ void scheduler_tick(void) #endif } -unsigned long get_parent_ip(unsigned long addr) +unsigned long notrace get_parent_ip(unsigned long addr) { if (in_lock_functions(addr)) { addr = CALLER_ADDR2; Index: linux-2.6-tip/kernel/trace/ring_buffer.c =================================================================== --- linux-2.6-tip.orig/kernel/trace/ring_buffer.c +++ linux-2.6-tip/kernel/trace/ring_buffer.c @@ -368,8 +368,8 @@ static inline int test_time_stamp(u64 de struct ring_buffer_per_cpu { int cpu; struct ring_buffer *buffer; - spinlock_t reader_lock; /* serialize readers */ - raw_spinlock_t lock; + raw_spinlock_t reader_lock; /* serialize readers */ + __raw_spinlock_t lock; struct lock_class_key lock_key; struct list_head pages; struct buffer_page *head_page; /* read from head */ @@ -524,7 +524,7 @@ rb_allocate_cpu_buffer(struct ring_buffe cpu_buffer->cpu = cpu; cpu_buffer->buffer = buffer; spin_lock_init(&cpu_buffer->reader_lock); - cpu_buffer->lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; + cpu_buffer->lock = (__raw_spinlock_t) __RAW_SPIN_LOCK_UNLOCKED; INIT_LIST_HEAD(&cpu_buffer->pages); bpage = kzalloc_node(ALIGN(sizeof(*bpage), cache_line_size()), Index: linux-2.6-tip/kernel/trace/trace.c =================================================================== --- linux-2.6-tip.orig/kernel/trace/trace.c +++ linux-2.6-tip/kernel/trace/trace.c @@ -265,6 +265,10 @@ unsigned long trace_flags = TRACE_ITER_P */ void trace_wake_up(void) { +#ifdef CONFIG_PREEMPT_RT + if (in_atomic() || irqs_disabled()) + return; +#endif /* * The runqueue_is_locked() can fail, but this is the best we * have for now: @@ -328,8 +332,7 @@ static const char *trace_options[] = { * This is defined as a raw_spinlock_t in order to help * with performance when lockdep debugging is enabled. */ -static raw_spinlock_t ftrace_max_lock = - (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; +static __raw_spinlock_t ftrace_max_lock = __RAW_SPIN_LOCK_UNLOCKED; /* * Copy the new maximum trace into the separate maximum-trace @@ -646,7 +649,7 @@ static unsigned map_pid_to_cmdline[PID_M static unsigned map_cmdline_to_pid[SAVED_CMDLINES]; static char saved_cmdlines[SAVED_CMDLINES][TASK_COMM_LEN]; static int cmdline_idx; -static raw_spinlock_t trace_cmdline_lock = __RAW_SPIN_LOCK_UNLOCKED; +static __raw_spinlock_t trace_cmdline_lock = __RAW_SPIN_LOCK_UNLOCKED; /* temporary disable recording */ static atomic_t trace_record_cmdline_disabled __read_mostly; @@ -659,7 +662,7 @@ static void trace_init_cmdlines(void) } static int trace_stop_count; -static DEFINE_SPINLOCK(tracing_start_lock); +static DEFINE_RAW_SPINLOCK(tracing_start_lock); /** * ftrace_off_permanent - disable all ftrace code permanently @@ -1219,8 +1222,7 @@ void trace_graph_return(struct ftrace_gr */ int trace_vbprintk(unsigned long ip, const char *fmt, va_list args) { - static raw_spinlock_t trace_buf_lock = - (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; + static __raw_spinlock_t trace_buf_lock = __RAW_SPIN_LOCK_UNLOCKED; static u32 trace_buf[TRACE_BUF_SIZE]; struct ring_buffer_event *event; @@ -1278,7 +1280,7 @@ EXPORT_SYMBOL_GPL(trace_vbprintk); int trace_vprintk(unsigned long ip, const char *fmt, va_list args) { - static raw_spinlock_t trace_buf_lock = __RAW_SPIN_LOCK_UNLOCKED; + static __raw_spinlock_t trace_buf_lock = __RAW_SPIN_LOCK_UNLOCKED; static char trace_buf[TRACE_BUF_SIZE]; struct ring_buffer_event *event; @@ -4036,7 +4038,7 @@ trace_printk_seq(struct trace_seq *s) static void __ftrace_dump(bool disable_tracing) { - static DEFINE_SPINLOCK(ftrace_dump_lock); + static DEFINE_RAW_SPINLOCK(ftrace_dump_lock); /* use static because iter can be a bit big for the stack */ static struct trace_iterator iter; unsigned int old_userobj; Index: linux-2.6-tip/kernel/trace/trace_clock.c =================================================================== --- linux-2.6-tip.orig/kernel/trace/trace_clock.c +++ linux-2.6-tip/kernel/trace/trace_clock.c @@ -68,8 +68,8 @@ u64 notrace trace_clock(void) static u64 prev_trace_clock_time; -static raw_spinlock_t trace_clock_lock ____cacheline_aligned_in_smp = - (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; +static __raw_spinlock_t trace_clock_lock ____cacheline_aligned_in_smp = + __RAW_SPIN_LOCK_UNLOCKED; u64 notrace trace_clock_global(void) { Index: linux-2.6-tip/kernel/trace/trace_irqsoff.c =================================================================== --- linux-2.6-tip.orig/kernel/trace/trace_irqsoff.c +++ linux-2.6-tip/kernel/trace/trace_irqsoff.c @@ -23,7 +23,7 @@ static int tracer_enabled __read_most static DEFINE_PER_CPU(int, tracing_cpu); -static DEFINE_SPINLOCK(max_trace_lock); +static DEFINE_RAW_SPINLOCK(max_trace_lock); enum { TRACER_IRQS_OFF = (1 << 1), Index: linux-2.6-tip/kernel/trace/trace_sched_wakeup.c =================================================================== --- linux-2.6-tip.orig/kernel/trace/trace_sched_wakeup.c +++ linux-2.6-tip/kernel/trace/trace_sched_wakeup.c @@ -27,8 +27,7 @@ static int wakeup_cpu; static unsigned wakeup_prio = -1; static int wakeup_rt; -static raw_spinlock_t wakeup_lock = - (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; +static __raw_spinlock_t wakeup_lock = __RAW_SPIN_LOCK_UNLOCKED; static void __wakeup_reset(struct trace_array *tr); Index: linux-2.6-tip/kernel/trace/trace_stack.c =================================================================== --- linux-2.6-tip.orig/kernel/trace/trace_stack.c +++ linux-2.6-tip/kernel/trace/trace_stack.c @@ -27,8 +27,7 @@ static struct stack_trace max_stack_trac }; static unsigned long max_stack_size; -static raw_spinlock_t max_stack_lock = - (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED; +static __raw_spinlock_t max_stack_lock = __RAW_SPIN_LOCK_UNLOCKED; static int stack_trace_disabled __read_mostly; static DEFINE_PER_CPU(int, trace_active); patches/preempt-realtime-arm.patch0000664000076400007640000001612211160752235016313 0ustar tglxtglx--- arch/arm/include/asm/dma.h | 2 +- arch/arm/include/asm/tlb.h | 9 ++++++--- arch/arm/kernel/dma.c | 2 +- arch/arm/kernel/irq.c | 2 +- arch/arm/kernel/signal.c | 8 ++++++++ arch/arm/kernel/smp.c | 2 +- arch/arm/kernel/traps.c | 4 ++-- arch/arm/mm/cache-l2x0.c | 2 +- arch/arm/mm/copypage-v4mc.c | 2 +- arch/arm/mm/copypage-v6.c | 2 +- arch/arm/mm/copypage-xscale.c | 2 +- arch/arm/mm/dma-mapping.c | 2 +- arch/arm/mm/mmu.c | 2 +- 13 files changed, 26 insertions(+), 15 deletions(-) Index: linux-2.6-tip/arch/arm/include/asm/dma.h =================================================================== --- linux-2.6-tip.orig/arch/arm/include/asm/dma.h +++ linux-2.6-tip/arch/arm/include/asm/dma.h @@ -35,7 +35,7 @@ typedef unsigned int dmamode_t; #define DMA_MODE_CASCADE 2 #define DMA_AUTOINIT 4 -extern spinlock_t dma_spin_lock; +extern raw_spinlock_t dma_spin_lock; static inline unsigned long claim_dma_lock(void) { Index: linux-2.6-tip/arch/arm/include/asm/tlb.h =================================================================== --- linux-2.6-tip.orig/arch/arm/include/asm/tlb.h +++ linux-2.6-tip/arch/arm/include/asm/tlb.h @@ -36,15 +36,18 @@ struct mmu_gather { struct mm_struct *mm; unsigned int fullmm; + int cpu; }; -DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); +DECLARE_PER_CPU_LOCKED(struct mmu_gather, mmu_gathers); static inline struct mmu_gather * tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) { - struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); + int cpu; + struct mmu_gather *tlb = &get_cpu_var_locked(mmu_gathers, &cpu); + tlb->cpu = cpu; tlb->mm = mm; tlb->fullmm = full_mm_flush; @@ -60,7 +63,7 @@ tlb_finish_mmu(struct mmu_gather *tlb, u /* keep the page table cache within bounds */ check_pgt_cache(); - put_cpu_var(mmu_gathers); + put_cpu_var_locked(mmu_gathers, tlb->cpu); } #define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0) Index: linux-2.6-tip/arch/arm/kernel/dma.c =================================================================== --- linux-2.6-tip.orig/arch/arm/kernel/dma.c +++ linux-2.6-tip/arch/arm/kernel/dma.c @@ -20,7 +20,7 @@ #include -DEFINE_SPINLOCK(dma_spin_lock); +DEFINE_RAW_SPINLOCK(dma_spin_lock); EXPORT_SYMBOL(dma_spin_lock); static dma_t dma_chan[MAX_DMA_CHANNELS]; Index: linux-2.6-tip/arch/arm/kernel/irq.c =================================================================== --- linux-2.6-tip.orig/arch/arm/kernel/irq.c +++ linux-2.6-tip/arch/arm/kernel/irq.c @@ -101,7 +101,7 @@ unlock: /* Handle bad interrupts */ static struct irq_desc bad_irq_desc = { .handle_irq = handle_bad_irq, - .lock = __SPIN_LOCK_UNLOCKED(bad_irq_desc.lock), + .lock = RAW_SPIN_LOCK_UNLOCKED(bad_irq_desc.lock), }; #ifdef CONFIG_CPUMASK_OFFSTACK Index: linux-2.6-tip/arch/arm/kernel/signal.c =================================================================== --- linux-2.6-tip.orig/arch/arm/kernel/signal.c +++ linux-2.6-tip/arch/arm/kernel/signal.c @@ -623,6 +623,14 @@ static int do_signal(sigset_t *oldset, s siginfo_t info; int signr; +#ifdef CONFIG_PREEMPT_RT + /* + * Fully-preemptible kernel does not need interrupts disabled: + */ + local_irq_enable(); + preempt_check_resched(); +#endif + /* * We want the common case to go fast, which * is why we may in certain cases get here from Index: linux-2.6-tip/arch/arm/kernel/smp.c =================================================================== --- linux-2.6-tip.orig/arch/arm/kernel/smp.c +++ linux-2.6-tip/arch/arm/kernel/smp.c @@ -403,7 +403,7 @@ asmlinkage void __exception do_local_tim } #endif -static DEFINE_SPINLOCK(stop_lock); +static DEFINE_RAW_SPINLOCK(stop_lock); /* * ipi_cpu_stop - handle IPI from smp_send_stop() Index: linux-2.6-tip/arch/arm/kernel/traps.c =================================================================== --- linux-2.6-tip.orig/arch/arm/kernel/traps.c +++ linux-2.6-tip/arch/arm/kernel/traps.c @@ -225,7 +225,7 @@ static void __die(const char *str, int e } } -DEFINE_SPINLOCK(die_lock); +DEFINE_RAW_SPINLOCK(die_lock); /* * This function is protected against re-entrancy. @@ -268,7 +268,7 @@ void arm_notify_die(const char *str, str } static LIST_HEAD(undef_hook); -static DEFINE_SPINLOCK(undef_lock); +static DEFINE_RAW_SPINLOCK(undef_lock); void register_undef_hook(struct undef_hook *hook) { Index: linux-2.6-tip/arch/arm/mm/cache-l2x0.c =================================================================== --- linux-2.6-tip.orig/arch/arm/mm/cache-l2x0.c +++ linux-2.6-tip/arch/arm/mm/cache-l2x0.c @@ -26,7 +26,7 @@ #define CACHE_LINE_SIZE 32 static void __iomem *l2x0_base; -static DEFINE_SPINLOCK(l2x0_lock); +static DEFINE_RAW_SPINLOCK(l2x0_lock); static inline void sync_writel(unsigned long val, unsigned long reg, unsigned long complete_mask) Index: linux-2.6-tip/arch/arm/mm/copypage-v4mc.c =================================================================== --- linux-2.6-tip.orig/arch/arm/mm/copypage-v4mc.c +++ linux-2.6-tip/arch/arm/mm/copypage-v4mc.c @@ -30,7 +30,7 @@ #define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \ L_PTE_MT_MINICACHE) -static DEFINE_SPINLOCK(minicache_lock); +static DEFINE_RAW_SPINLOCK(minicache_lock); /* * ARMv4 mini-dcache optimised copy_user_highpage Index: linux-2.6-tip/arch/arm/mm/copypage-v6.c =================================================================== --- linux-2.6-tip.orig/arch/arm/mm/copypage-v6.c +++ linux-2.6-tip/arch/arm/mm/copypage-v6.c @@ -27,7 +27,7 @@ #define from_address (0xffff8000) #define to_address (0xffffc000) -static DEFINE_SPINLOCK(v6_lock); +static DEFINE_RAW_SPINLOCK(v6_lock); /* * Copy the user page. No aliasing to deal with so we can just Index: linux-2.6-tip/arch/arm/mm/copypage-xscale.c =================================================================== --- linux-2.6-tip.orig/arch/arm/mm/copypage-xscale.c +++ linux-2.6-tip/arch/arm/mm/copypage-xscale.c @@ -32,7 +32,7 @@ #define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \ L_PTE_MT_MINICACHE) -static DEFINE_SPINLOCK(minicache_lock); +static DEFINE_RAW_SPINLOCK(minicache_lock); /* * XScale mini-dcache optimised copy_user_highpage Index: linux-2.6-tip/arch/arm/mm/dma-mapping.c =================================================================== --- linux-2.6-tip.orig/arch/arm/mm/dma-mapping.c +++ linux-2.6-tip/arch/arm/mm/dma-mapping.c @@ -40,7 +40,7 @@ * These are the page tables (2MB each) covering uncached, DMA consistent allocations */ static pte_t *consistent_pte[NUM_CONSISTENT_PTES]; -static DEFINE_SPINLOCK(consistent_lock); +static DEFINE_RAW_SPINLOCK(consistent_lock); /* * VM region handling support. Index: linux-2.6-tip/arch/arm/mm/mmu.c =================================================================== --- linux-2.6-tip.orig/arch/arm/mm/mmu.c +++ linux-2.6-tip/arch/arm/mm/mmu.c @@ -27,7 +27,7 @@ #include "mm.h" -DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); +DEFINE_PER_CPU_LOCKED(struct mmu_gather, mmu_gathers); /* * empty_zero_page is a special page that is used for patches/plist-debug.patch0000664000076400007640000000331711160752235014503 0ustar tglxtglxSubject: [PATCH][DEBUG_PI_LIST]: Set plist.lock to NULL on PREEMPT_RT From: Arnaldo Carvalho de Melo Date: Mon, 22 Oct 2007 14:43:02 -0200 On RT struct plist_head->lock is a raw_spinlock_t, but struct futex_hash_bucket->lock, that is set to plist_head->lock is a spinlock, which becomes a mutex on RT. Later in plist_check_head spin_is_locked can't figure out what is the right type, triggering a WARN_ON_SMP. As we were already special casing PREEMPT_RT on plist_check_head.. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar --- kernel/futex.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) Index: linux-2.6-tip/kernel/futex.c =================================================================== --- linux-2.6-tip.orig/kernel/futex.c +++ linux-2.6-tip/kernel/futex.c @@ -867,9 +867,13 @@ retry_private: plist_del(&this->list, &hb1->chain); plist_add(&this->list, &hb2->chain); this->lock_ptr = &hb2->lock; -#if defined(CONFIG_DEBUG_PI_LIST) && !defined(CONFIG_PREEMPT_RT) +#ifdef CONFIG_DEBUG_PI_LIST +#ifdef CONFIG_PREEMPT_RT + this->list.plist.lock = NULL; +#else this->list.plist.lock = &hb2->lock; #endif +#endif } this->key = key2; get_futex_key_refs(&key2); @@ -925,9 +929,13 @@ static inline void queue_me(struct futex prio = min(current->normal_prio, MAX_RT_PRIO); plist_node_init(&q->list, prio); -#if defined(CONFIG_DEBUG_PI_LIST) && !defined(CONFIG_PREEMPT_RT) +#ifdef CONFIG_DEBUG_PI_LIST +#ifdef CONFIG_PREEMPT_RT + q->list.plist.lock = NULL; +#else q->list.plist.lock = &hb->lock; #endif +#endif plist_add(&q->list, &hb->chain); q->task = current; spin_unlock(&hb->lock); patches/preempt-realtime-loopback.patch0000664000076400007640000000111111160752235017316 0ustar tglxtglxSubject: preempt: realtime loopback From: Ingo Molnar Date: Wed Feb 04 00:02:45 CET 2009 Signed-off-by: Ingo Molnar --- drivers/net/loopback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/drivers/net/loopback.c =================================================================== --- linux-2.6-tip.orig/drivers/net/loopback.c +++ linux-2.6-tip/drivers/net/loopback.c @@ -82,7 +82,7 @@ static int loopback_xmit(struct sk_buff lb_stats->packets++; put_cpu(); - netif_rx(skb); + netif_rx_ni(skb); return 0; } patches/handle-pending-in-simple-irq.patch0000664000076400007640000000230011160752235017614 0ustar tglxtglxSubject: handle IRQ_PENDING for simple irq handler From: Steven Rostedt With the IO-APIC pcix hack (level=>edge masking), we can receive interrupts while masked. But these interrupts might be missed. Also, normal "simple" interrupts might be missed too on leaving of thread handler. Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- kernel/irq/manage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) Index: linux-2.6-tip/kernel/irq/manage.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/manage.c +++ linux-2.6-tip/kernel/irq/manage.c @@ -839,14 +839,17 @@ static void thread_simple_irq(irq_desc_t unsigned int irq = desc - irq_desc; irqreturn_t action_ret; - if (action && !desc->depth) { + do { + if (!action || desc->depth) + break; + desc->status &= ~IRQ_PENDING; spin_unlock(&desc->lock); action_ret = handle_IRQ_event(irq, action); cond_resched_hardirq_context(); spin_lock_irq(&desc->lock); if (!noirqdebug) note_interrupt(irq, desc, action_ret); - } + } while (desc->status & IRQ_PENDING); desc->status &= ~IRQ_INPROGRESS; } patches/rt-mutex-i386.patch0000664000076400007640000003364011160752235014542 0ustar tglxtglxSubject: rt: mutex i386 From: Ingo Molnar Date: Tue Feb 03 23:55:11 CET 2009 Signed-off-by: Ingo Molnar --- arch/x86/Kconfig | 12 ++++++-- arch/x86/include/asm/rwsem.h | 51 +++++++++++++++++----------------- arch/x86/include/asm/spinlock.h | 46 +++++++++++++++--------------- arch/x86/include/asm/spinlock_types.h | 4 +- arch/x86/kernel/entry_32.S | 4 +- arch/x86/kernel/process_32.c | 2 - 6 files changed, 64 insertions(+), 55 deletions(-) Index: linux-2.6-tip/arch/x86/Kconfig =================================================================== --- linux-2.6-tip.orig/arch/x86/Kconfig +++ linux-2.6-tip/arch/x86/Kconfig @@ -115,10 +115,18 @@ config ARCH_MAY_HAVE_PC_FDC def_bool y config RWSEM_GENERIC_SPINLOCK - def_bool !X86_XADD + bool + depends on !X86_XADD || PREEMPT_RT + default y + +config ASM_SEMAPHORES + bool + default y config RWSEM_XCHGADD_ALGORITHM - def_bool X86_XADD + bool + depends on X86_XADD && !RWSEM_GENERIC_SPINLOCK + default y config ARCH_HAS_CPU_IDLE_WAIT def_bool y Index: linux-2.6-tip/arch/x86/include/asm/rwsem.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/rwsem.h +++ linux-2.6-tip/arch/x86/include/asm/rwsem.h @@ -44,14 +44,14 @@ struct rwsem_waiter; -extern asmregparm struct rw_semaphore * - rwsem_down_read_failed(struct rw_semaphore *sem); -extern asmregparm struct rw_semaphore * - rwsem_down_write_failed(struct rw_semaphore *sem); -extern asmregparm struct rw_semaphore * - rwsem_wake(struct rw_semaphore *); -extern asmregparm struct rw_semaphore * - rwsem_downgrade_wake(struct rw_semaphore *sem); +extern asmregparm struct compat_rw_semaphore * + rwsem_down_read_failed(struct compat_rw_semaphore *sem); +extern asmregparm struct compat_rw_semaphore * + rwsem_down_write_failed(struct compat_rw_semaphore *sem); +extern asmregparm struct compat_rw_semaphore * + rwsem_wake(struct compat_rw_semaphore *); +extern asmregparm struct compat_rw_semaphore * + rwsem_downgrade_wake(struct compat_rw_semaphore *sem); /* * the semaphore definition @@ -64,7 +64,7 @@ extern asmregparm struct rw_semaphore * #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) -struct rw_semaphore { +struct compat_rw_semaphore { signed long count; spinlock_t wait_lock; struct list_head wait_list; @@ -86,23 +86,23 @@ struct rw_semaphore { LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) \ } -#define DECLARE_RWSEM(name) \ - struct rw_semaphore name = __RWSEM_INITIALIZER(name) +#define COMPAT_DECLARE_RWSEM(name) \ + struct compat_rw_semaphore name = __RWSEM_INITIALIZER(name) -extern void __init_rwsem(struct rw_semaphore *sem, const char *name, +extern void __compat_init_rwsem(struct compat_rw_semaphore *sem, const char *name, struct lock_class_key *key); -#define init_rwsem(sem) \ +#define compat_init_rwsem(sem) \ do { \ static struct lock_class_key __key; \ \ - __init_rwsem((sem), #sem, &__key); \ + __compat_init_rwsem((sem), #sem, &__key); \ } while (0) /* * lock for reading */ -static inline void __down_read(struct rw_semaphore *sem) +static inline void __down_read(struct compat_rw_semaphore *sem) { asm volatile("# beginning down_read\n\t" LOCK_PREFIX " incl (%%eax)\n\t" @@ -119,7 +119,7 @@ static inline void __down_read(struct rw /* * trylock for reading -- returns 1 if successful, 0 if contention */ -static inline int __down_read_trylock(struct rw_semaphore *sem) +static inline int __down_read_trylock(struct compat_rw_semaphore *sem) { __s32 result, tmp; asm volatile("# beginning __down_read_trylock\n\t" @@ -141,7 +141,8 @@ static inline int __down_read_trylock(st /* * lock for writing */ -static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) +static inline void +__down_write_nested(struct compat_rw_semaphore *sem, int subclass) { int tmp; @@ -160,7 +161,7 @@ static inline void __down_write_nested(s : "memory", "cc"); } -static inline void __down_write(struct rw_semaphore *sem) +static inline void __down_write(struct compat_rw_semaphore *sem) { __down_write_nested(sem, 0); } @@ -168,7 +169,7 @@ static inline void __down_write(struct r /* * trylock for writing -- returns 1 if successful, 0 if contention */ -static inline int __down_write_trylock(struct rw_semaphore *sem) +static inline int __down_write_trylock(struct compat_rw_semaphore *sem) { signed long ret = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE, @@ -181,7 +182,7 @@ static inline int __down_write_trylock(s /* * unlock after reading */ -static inline void __up_read(struct rw_semaphore *sem) +static inline void __up_read(struct compat_rw_semaphore *sem) { __s32 tmp = -RWSEM_ACTIVE_READ_BIAS; asm volatile("# beginning __up_read\n\t" @@ -199,7 +200,7 @@ static inline void __up_read(struct rw_s /* * unlock after writing */ -static inline void __up_write(struct rw_semaphore *sem) +static inline void __up_write(struct compat_rw_semaphore *sem) { asm volatile("# beginning __up_write\n\t" " movl %2,%%edx\n\t" @@ -218,7 +219,7 @@ static inline void __up_write(struct rw_ /* * downgrade write lock to read lock */ -static inline void __downgrade_write(struct rw_semaphore *sem) +static inline void __downgrade_write(struct compat_rw_semaphore *sem) { asm volatile("# beginning __downgrade_write\n\t" LOCK_PREFIX " addl %2,(%%eax)\n\t" @@ -235,7 +236,7 @@ static inline void __downgrade_write(str /* * implement atomic add functionality */ -static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) +static inline void rwsem_atomic_add(int delta, struct compat_rw_semaphore *sem) { asm volatile(LOCK_PREFIX "addl %1,%0" : "+m" (sem->count) @@ -245,7 +246,7 @@ static inline void rwsem_atomic_add(int /* * implement exchange and add functionality */ -static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) +static inline int rwsem_atomic_update(int delta, struct compat_rw_semaphore *sem) { int tmp = delta; @@ -256,7 +257,7 @@ static inline int rwsem_atomic_update(in return tmp + delta; } -static inline int rwsem_is_locked(struct rw_semaphore *sem) +static inline int rwsem_is_locked(struct compat_rw_semaphore *sem) { return (sem->count != 0); } Index: linux-2.6-tip/arch/x86/include/asm/spinlock.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/spinlock.h +++ linux-2.6-tip/arch/x86/include/asm/spinlock.h @@ -58,7 +58,7 @@ #if (NR_CPUS < 256) #define TICKET_SHIFT 8 -static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock) +static __always_inline void __ticket_spin_lock(__raw_spinlock_t *lock) { short inc = 0x0100; @@ -77,7 +77,7 @@ static __always_inline void __ticket_spi : "memory", "cc"); } -static __always_inline int __ticket_spin_trylock(raw_spinlock_t *lock) +static __always_inline int __ticket_spin_trylock(__raw_spinlock_t *lock) { int tmp, new; @@ -96,7 +96,7 @@ static __always_inline int __ticket_spin return tmp; } -static __always_inline void __ticket_spin_unlock(raw_spinlock_t *lock) +static __always_inline void __ticket_spin_unlock(__raw_spinlock_t *lock) { asm volatile(UNLOCK_LOCK_PREFIX "incb %0" : "+m" (lock->slock) @@ -106,7 +106,7 @@ static __always_inline void __ticket_spi #else #define TICKET_SHIFT 16 -static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock) +static __always_inline void __ticket_spin_lock(__raw_spinlock_t *lock) { int inc = 0x00010000; int tmp; @@ -127,7 +127,7 @@ static __always_inline void __ticket_spi : "memory", "cc"); } -static __always_inline int __ticket_spin_trylock(raw_spinlock_t *lock) +static __always_inline int __ticket_spin_trylock(__raw_spinlock_t *lock) { int tmp; int new; @@ -149,7 +149,7 @@ static __always_inline int __ticket_spin return tmp; } -static __always_inline void __ticket_spin_unlock(raw_spinlock_t *lock) +static __always_inline void __ticket_spin_unlock(__raw_spinlock_t *lock) { asm volatile(UNLOCK_LOCK_PREFIX "incw %0" : "+m" (lock->slock) @@ -158,14 +158,14 @@ static __always_inline void __ticket_spi } #endif -static inline int __ticket_spin_is_locked(raw_spinlock_t *lock) +static inline int __ticket_spin_is_locked(__raw_spinlock_t *lock) { int tmp = ACCESS_ONCE(lock->slock); return !!(((tmp >> TICKET_SHIFT) ^ tmp) & ((1 << TICKET_SHIFT) - 1)); } -static inline int __ticket_spin_is_contended(raw_spinlock_t *lock) +static inline int __ticket_spin_is_contended(__raw_spinlock_t *lock) { int tmp = ACCESS_ONCE(lock->slock); @@ -174,33 +174,33 @@ static inline int __ticket_spin_is_conte #ifndef CONFIG_PARAVIRT -static inline int __raw_spin_is_locked(raw_spinlock_t *lock) +static inline int __raw_spin_is_locked(__raw_spinlock_t *lock) { return __ticket_spin_is_locked(lock); } -static inline int __raw_spin_is_contended(raw_spinlock_t *lock) +static inline int __raw_spin_is_contended(__raw_spinlock_t *lock) { return __ticket_spin_is_contended(lock); } #define __raw_spin_is_contended __raw_spin_is_contended -static __always_inline void __raw_spin_lock(raw_spinlock_t *lock) +static __always_inline void __raw_spin_lock(__raw_spinlock_t *lock) { __ticket_spin_lock(lock); } -static __always_inline int __raw_spin_trylock(raw_spinlock_t *lock) +static __always_inline int __raw_spin_trylock(__raw_spinlock_t *lock) { return __ticket_spin_trylock(lock); } -static __always_inline void __raw_spin_unlock(raw_spinlock_t *lock) +static __always_inline void __raw_spin_unlock(__raw_spinlock_t *lock) { __ticket_spin_unlock(lock); } -static __always_inline void __raw_spin_lock_flags(raw_spinlock_t *lock, +static __always_inline void __raw_spin_lock_flags(__raw_spinlock_t *lock, unsigned long flags) { __raw_spin_lock(lock); @@ -208,7 +208,7 @@ static __always_inline void __raw_spin_l #endif -static inline void __raw_spin_unlock_wait(raw_spinlock_t *lock) +static inline void __raw_spin_unlock_wait(__raw_spinlock_t *lock) { while (__raw_spin_is_locked(lock)) cpu_relax(); @@ -232,7 +232,7 @@ static inline void __raw_spin_unlock_wai * read_can_lock - would read_trylock() succeed? * @lock: the rwlock in question. */ -static inline int __raw_read_can_lock(raw_rwlock_t *lock) +static inline int __raw_read_can_lock(__raw_rwlock_t *lock) { return (int)(lock)->lock > 0; } @@ -241,12 +241,12 @@ static inline int __raw_read_can_lock(ra * write_can_lock - would write_trylock() succeed? * @lock: the rwlock in question. */ -static inline int __raw_write_can_lock(raw_rwlock_t *lock) +static inline int __raw_write_can_lock(__raw_rwlock_t *lock) { return (lock)->lock == RW_LOCK_BIAS; } -static inline void __raw_read_lock(raw_rwlock_t *rw) +static inline void __raw_read_lock(__raw_rwlock_t *rw) { asm volatile(LOCK_PREFIX " subl $1,(%0)\n\t" "jns 1f\n" @@ -255,7 +255,7 @@ static inline void __raw_read_lock(raw_r ::LOCK_PTR_REG (rw) : "memory"); } -static inline void __raw_write_lock(raw_rwlock_t *rw) +static inline void __raw_write_lock(__raw_rwlock_t *rw) { asm volatile(LOCK_PREFIX " subl %1,(%0)\n\t" "jz 1f\n" @@ -264,7 +264,7 @@ static inline void __raw_write_lock(raw_ ::LOCK_PTR_REG (rw), "i" (RW_LOCK_BIAS) : "memory"); } -static inline int __raw_read_trylock(raw_rwlock_t *lock) +static inline int __raw_read_trylock(__raw_rwlock_t *lock) { atomic_t *count = (atomic_t *)lock; @@ -274,7 +274,7 @@ static inline int __raw_read_trylock(raw return 0; } -static inline int __raw_write_trylock(raw_rwlock_t *lock) +static inline int __raw_write_trylock(__raw_rwlock_t *lock) { atomic_t *count = (atomic_t *)lock; @@ -284,12 +284,12 @@ static inline int __raw_write_trylock(ra return 0; } -static inline void __raw_read_unlock(raw_rwlock_t *rw) +static inline void __raw_read_unlock(__raw_rwlock_t *rw) { asm volatile(LOCK_PREFIX "incl %0" :"+m" (rw->lock) : : "memory"); } -static inline void __raw_write_unlock(raw_rwlock_t *rw) +static inline void __raw_write_unlock(__raw_rwlock_t *rw) { asm volatile(LOCK_PREFIX "addl %1, %0" : "+m" (rw->lock) : "i" (RW_LOCK_BIAS) : "memory"); Index: linux-2.6-tip/arch/x86/include/asm/spinlock_types.h =================================================================== --- linux-2.6-tip.orig/arch/x86/include/asm/spinlock_types.h +++ linux-2.6-tip/arch/x86/include/asm/spinlock_types.h @@ -7,13 +7,13 @@ typedef struct raw_spinlock { unsigned int slock; -} raw_spinlock_t; +} __raw_spinlock_t; #define __RAW_SPIN_LOCK_UNLOCKED { 0 } typedef struct { unsigned int lock; -} raw_rwlock_t; +} __raw_rwlock_t; #define __RAW_RW_LOCK_UNLOCKED { RW_LOCK_BIAS } Index: linux-2.6-tip/arch/x86/kernel/entry_32.S =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/entry_32.S +++ linux-2.6-tip/arch/x86/kernel/entry_32.S @@ -613,7 +613,7 @@ ENDPROC(system_call) ALIGN RING0_PTREGS_FRAME # can't unwind into user space anyway work_pending: - testb $_TIF_NEED_RESCHED, %cl + testl $(_TIF_NEED_RESCHED), %ecx jz work_notifysig work_resched: call schedule @@ -626,7 +626,7 @@ work_resched: andl $_TIF_WORK_MASK, %ecx # is there any work to be done other # than syscall tracing? jz restore_all - testb $_TIF_NEED_RESCHED, %cl + testl $(_TIF_NEED_RESCHED), %ecx jnz work_resched work_notifysig: # deal with pending signals and Index: linux-2.6-tip/arch/x86/kernel/process_32.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/process_32.c +++ linux-2.6-tip/arch/x86/kernel/process_32.c @@ -121,7 +121,7 @@ void cpu_idle(void) start_critical_timings(); } tick_nohz_restart_sched_tick(); - preempt_enable_no_resched(); + __preempt_enable_no_resched(); schedule(); preempt_disable(); } patches/signal-keep-a-task-private-siginfo-for-rt-tasks.patch0000664000076400007640000001301211161723432023266 0ustar tglxtglxSubject: signals: allow rt tasks to cache one sigqueue struct From: Thomas Gleixner Date: Wed, 18 Mar 2009 21:28:08 +0100 Signed-off-by: Thomas Gleixner --- include/linux/sched.h | 1 include/linux/signal.h | 1 kernel/exit.c | 2 - kernel/signal.c | 74 +++++++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 71 insertions(+), 7 deletions(-) Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -1341,6 +1341,7 @@ struct task_struct { /* signal handlers */ struct signal_struct *signal; struct sighand_struct *sighand; + struct sigqueue *sigqueue_cache; sigset_t blocked, real_blocked; sigset_t saved_sigmask; /* restored if set_restore_sigmask() was used */ Index: linux-2.6-tip/include/linux/signal.h =================================================================== --- linux-2.6-tip.orig/include/linux/signal.h +++ linux-2.6-tip/include/linux/signal.h @@ -225,6 +225,7 @@ static inline void init_sigpending(struc } extern void flush_sigqueue(struct sigpending *queue); +extern void flush_task_sigqueue(struct task_struct *tsk); /* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */ static inline int valid_signal(unsigned long sig) Index: linux-2.6-tip/kernel/exit.c =================================================================== --- linux-2.6-tip.orig/kernel/exit.c +++ linux-2.6-tip/kernel/exit.c @@ -140,7 +140,7 @@ static void __exit_signal(struct task_st * Do this under ->siglock, we can race with another thread * doing sigqueue_free() if we have SIGQUEUE_PREALLOC signals. */ - flush_sigqueue(&tsk->pending); + flush_task_sigqueue(tsk); tsk->signal = NULL; tsk->sighand = NULL; Index: linux-2.6-tip/kernel/signal.c =================================================================== --- linux-2.6-tip.orig/kernel/signal.c +++ linux-2.6-tip/kernel/signal.c @@ -179,13 +179,28 @@ int next_signal(struct sigpending *pendi return sig; } +static struct sigqueue *sigqueue_alloc_from_task_cache(struct task_struct *t, + int fromslab) +{ + struct sigqueue *q = NULL; + + if (!fromslab) { +#ifdef __HAVE_ARCH_CMPXCHG + q = t->sigqueue_cache; + if (cmpxchg(&t->sigqueue_cache, q, NULL) != q) + q = NULL; +#endif + } + return q; +} + /* * allocate a new signal queue record * - this may be called without locks if and only if t == current, otherwise an * appopriate lock must be held to stop the target task from exiting */ -static struct sigqueue *__sigqueue_alloc(struct task_struct *t, gfp_t flags, - int override_rlimit) +static struct sigqueue *__sigqueue_do_alloc(struct task_struct *t, gfp_t flags, + int override_rlimit, int fromslab) { struct sigqueue *q = NULL; struct user_struct *user; @@ -200,8 +215,13 @@ static struct sigqueue *__sigqueue_alloc atomic_inc(&user->sigpending); if (override_rlimit || atomic_read(&user->sigpending) <= - t->signal->rlim[RLIMIT_SIGPENDING].rlim_cur) - q = kmem_cache_alloc(sigqueue_cachep, flags); + t->signal->rlim[RLIMIT_SIGPENDING].rlim_cur) { + + q = sigqueue_alloc_from_task_cache(t, fromslab); + if (!q) + q = kmem_cache_alloc(sigqueue_cachep, flags); + } + if (unlikely(q == NULL)) { atomic_dec(&user->sigpending); free_uid(user); @@ -214,6 +234,12 @@ static struct sigqueue *__sigqueue_alloc return q; } +static struct sigqueue *__sigqueue_alloc(struct task_struct *t, gfp_t flags, + int override_rlimit) +{ + return __sigqueue_do_alloc(t, flags, override_rlimit, 0); +} + static void __sigqueue_free(struct sigqueue *q) { if (q->flags & SIGQUEUE_PREALLOC) @@ -223,6 +249,22 @@ static void __sigqueue_free(struct sigqu kmem_cache_free(sigqueue_cachep, q); } +static void sigqueue_free_current(struct sigqueue *q) +{ + if (q->flags & SIGQUEUE_PREALLOC) + return; + +#ifdef __HAVE_ARCH_CMPXCHG + if (rt_prio(current->normal_prio) && + cmpxchg(¤t->sigqueue_cache, NULL, q) == NULL) { + atomic_dec(&q->user->sigpending); + free_uid(q->user); + return; + } +#endif + __sigqueue_free(q); +} + void flush_sigqueue(struct sigpending *queue) { struct sigqueue *q; @@ -236,6 +278,23 @@ void flush_sigqueue(struct sigpending *q } /* + * Called from __exit_signal. Flush tsk->pending and + * tsk->sigqueue_cache + */ +void flush_task_sigqueue(struct task_struct *tsk) +{ + struct sigqueue *q; + + flush_sigqueue(&tsk->pending); + + q = tsk->sigqueue_cache; + tsk->sigqueue_cache = NULL; + + if (q) + kmem_cache_free(sigqueue_cachep, q); +} + +/* * Flush all pending signals for a task. */ void flush_signals(struct task_struct *t) @@ -378,7 +437,7 @@ static void collect_signal(int sig, stru still_pending: list_del_init(&first->list); copy_siginfo(info, &first->info); - __sigqueue_free(first); + sigqueue_free_current(first); } else { /* Ok, it wasn't in the queue. This must be a fast-pathed signal or we must have been @@ -423,6 +482,8 @@ int dequeue_signal(struct task_struct *t { int signr; + WARN_ON_ONCE(tsk != current); + /* We only dequeue private signals from ourselves, we don't let * signalfd steal them */ @@ -1278,7 +1339,8 @@ struct sigqueue *sigqueue_alloc(void) { struct sigqueue *q; - if ((q = __sigqueue_alloc(current, GFP_KERNEL, 0))) + /* Preallocated sigqueue objects always from the slabcache ! */ + if ((q = __sigqueue_do_alloc(current, GFP_KERNEL, 0, 1))) q->flags |= SIGQUEUE_PREALLOC; return(q); } patches/slab-free-pages.patch0000664000076400007640000001075111160752235015221 0ustar tglxtglxSubject: From: Peter Zijlstra Date: Wed Mar 18 20:03:05 CET 2009 Signed-off-by: Peter Zijlstra --- mm/slab.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 12 deletions(-) Index: linux-2.6-tip/mm/slab.c =================================================================== --- linux-2.6-tip.orig/mm/slab.c +++ linux-2.6-tip/mm/slab.c @@ -179,28 +179,46 @@ static void slab_irq_disable_GFP_WAIT(gf * by a lock. This keeps the code preemptable - albeit at the cost of remote * memory access when the task does get migrated away. */ -DEFINE_PER_CPU_LOCKED(int, slab_irq_locks) = { 0, }; +DEFINE_PER_CPU_LOCKED(struct list_head, slab) = { 0, }; static void _slab_irq_disable(int *cpu) { - get_cpu_var_locked(slab_irq_locks, cpu); + (void)get_cpu_var_locked(slab, cpu); } #define slab_irq_disable(cpu) _slab_irq_disable(&(cpu)) static inline void slab_irq_enable(int cpu) { - put_cpu_var_locked(slab_irq_locks, cpu); + LIST_HEAD(list); + + list_splice_init(&__get_cpu_var_locked(slab, cpu), &list); + put_cpu_var_locked(slab, cpu); + + while (!list_empty(&list)) { + struct page *page = list_first_entry(&list, struct page, lru); + list_del(&page->lru); + __free_pages(page, page->index); + } } static inline void slab_irq_disable_this_rt(int cpu) { - spin_lock(&__get_cpu_lock(slab_irq_locks, cpu)); + spin_lock(&__get_cpu_lock(slab, cpu)); } static inline void slab_irq_enable_rt(int cpu) { - spin_unlock(&__get_cpu_lock(slab_irq_locks, cpu)); + LIST_HEAD(list); + + list_splice_init(&__get_cpu_var_locked(slab, cpu), &list); + spin_unlock(&__get_cpu_lock(slab, cpu)); + + while (!list_empty(&list)) { + struct page *page = list_first_entry(&list, struct page, lru); + list_del(&page->lru); + __free_pages(page, page->index); + } } # define slab_irq_save(flags, cpu) \ @@ -1497,6 +1515,12 @@ void __init kmem_cache_init(void) int order; int node; +#ifdef CONFIG_PREEMPT_RT + for_each_possible_cpu(i) { + INIT_LIST_HEAD(&__get_cpu_var_locked(slab, i)); + } +#endif + if (num_possible_nodes() == 1) { use_alien_caches = 0; numa_platform = 0; @@ -1770,12 +1794,14 @@ static void *kmem_getpages(struct kmem_c /* * Interface to system's page release. */ -static void kmem_freepages(struct kmem_cache *cachep, void *addr) +static void kmem_freepages(struct kmem_cache *cachep, void *addr, int cpu) { unsigned long i = (1 << cachep->gfporder); - struct page *page = virt_to_page(addr); + struct page *page, *basepage = virt_to_page(addr); const unsigned long nr_freed = i; + page = basepage; + kmemcheck_free_shadow(page, cachep->gfporder); if (cachep->flags & SLAB_RECLAIM_ACCOUNT) @@ -1784,6 +1810,7 @@ static void kmem_freepages(struct kmem_c else sub_zone_page_state(page_zone(page), NR_SLAB_UNRECLAIMABLE, nr_freed); + while (i--) { BUG_ON(!PageSlab(page)); __ClearPageSlab(page); @@ -1791,6 +1818,13 @@ static void kmem_freepages(struct kmem_c } if (current->reclaim_state) current->reclaim_state->reclaimed_slab += nr_freed; + +#ifdef CONFIG_PREEMPT_RT + if (cpu >= 0) { + basepage->index = cachep->gfporder; + list_add(&basepage->lru, &__get_cpu_var_locked(slab, cpu)); + } else +#endif free_pages((unsigned long)addr, cachep->gfporder); } @@ -1799,7 +1833,7 @@ static void kmem_rcu_free(struct rcu_hea struct slab_rcu *slab_rcu = (struct slab_rcu *)head; struct kmem_cache *cachep = slab_rcu->cachep; - kmem_freepages(cachep, slab_rcu->addr); + kmem_freepages(cachep, slab_rcu->addr, -1); if (OFF_SLAB(cachep)) kmem_cache_free(cachep->slabp_cache, slab_rcu); } @@ -2036,7 +2070,7 @@ slab_destroy(struct kmem_cache *cachep, slab_rcu->addr = addr; call_rcu(&slab_rcu->head, kmem_rcu_free); } else { - kmem_freepages(cachep, addr); + kmem_freepages(cachep, addr, *this_cpu); if (OFF_SLAB(cachep)) { if (this_cpu) __cache_free(cachep->slabp_cache, slabp, this_cpu); @@ -2553,9 +2587,9 @@ slab_on_each_cpu(void (*func)(void *arg, check_irq_on(); for_each_online_cpu(i) { - spin_lock(&__get_cpu_lock(slab_irq_locks, i)); + spin_lock(&__get_cpu_lock(slab, i)); func(arg, i); - spin_unlock(&__get_cpu_lock(slab_irq_locks, i)); + spin_unlock(&__get_cpu_lock(slab, i)); } } #else @@ -2938,7 +2972,7 @@ static int cache_grow(struct kmem_cache spin_unlock(&l3->list_lock); return 1; opps1: - kmem_freepages(cachep, objp); + kmem_freepages(cachep, objp, -1); failed: slab_irq_disable_GFP_WAIT(local_flags, this_cpu); return 0; patches/preempt-irqs-arm-fix-oprofile.patch0000664000076400007640000000154211161723431020065 0ustar tglxtglxConvert XScale performance monitor unit (PMU) interrupt used by oprofile to IRQF_NODELAY. PMU results not useful if ISR is run as thread. Signed-off-by: Kevin Hilman arch/arm/oprofile/op_model_xscale.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: linux-2.6-tip/arch/arm/oprofile/op_model_xscale.c =================================================================== --- linux-2.6-tip.orig/arch/arm/oprofile/op_model_xscale.c +++ linux-2.6-tip/arch/arm/oprofile/op_model_xscale.c @@ -381,8 +381,9 @@ static int xscale_pmu_start(void) { int ret; u32 pmnc = read_pmnc(); + int irq_flags = IRQF_DISABLED | IRQF_NODELAY; - ret = request_irq(XSCALE_PMU_IRQ, xscale_pmu_interrupt, IRQF_DISABLED, + ret = request_irq(XSCALE_PMU_IRQ, xscale_pmu_interrupt, irq_flags, "XScale PMU", (void *)results); if (ret < 0) { patches/resurrect-softirq-code.patch0000664000076400007640000002644611160752235016707 0ustar tglxtglxSubject: resurrect: softirq code From: Ingo Molnar Date: Wed Feb 04 06:41:19 CET 2009 Note: net/ipv4/proc.c is a fix for upstream too. Signed-off-by: Ingo Molnar --- include/linux/bottom_half.h | 2 kernel/softirq.c | 206 +++++++++++++++++++++++++++++++------------- net/ipv4/proc.c | 4 3 files changed, 152 insertions(+), 60 deletions(-) Index: linux-2.6-tip/include/linux/bottom_half.h =================================================================== --- linux-2.6-tip.orig/include/linux/bottom_half.h +++ linux-2.6-tip/include/linux/bottom_half.h @@ -1,7 +1,7 @@ #ifndef _LINUX_BH_H #define _LINUX_BH_H -#ifdef CONFIG_PREEMPT_RT +#ifdef CONFIG_PREEMPT_HARDIRQS # define local_bh_disable() do { } while (0) # define __local_bh_disable(ip) do { } while (0) # define _local_bh_enable() do { } while (0) Index: linux-2.6-tip/kernel/softirq.c =================================================================== --- linux-2.6-tip.orig/kernel/softirq.c +++ linux-2.6-tip/kernel/softirq.c @@ -134,7 +134,7 @@ static void trigger_softirqs(void) } } -#ifndef CONFIG_PREEMPT_RT +#ifndef CONFIG_PREEMPT_HARDIRQS /* * This one is for softirq.c-internal use, @@ -188,7 +188,6 @@ EXPORT_SYMBOL(local_bh_disable); */ void _local_bh_enable(void) { - WARN_ON_ONCE(in_irq()); WARN_ON_ONCE(!irqs_disabled()); if (softirq_count() == SOFTIRQ_OFFSET) @@ -198,17 +197,22 @@ void _local_bh_enable(void) EXPORT_SYMBOL(_local_bh_enable); -static inline void _local_bh_enable_ip(unsigned long ip) +void local_bh_enable(void) { - WARN_ON_ONCE(in_irq() || irqs_disabled()); #ifdef CONFIG_TRACE_IRQFLAGS - local_irq_disable(); + unsigned long flags; + + WARN_ON_ONCE(in_irq()); +#endif + +#ifdef CONFIG_TRACE_IRQFLAGS + local_irq_save(flags); #endif /* * Are softirqs going to be turned on now: */ if (softirq_count() == SOFTIRQ_OFFSET) - trace_softirqs_on(ip); + trace_softirqs_on((unsigned long)__builtin_return_address(0)); /* * Keep preemption disabled until we are done with * softirq processing: @@ -220,20 +224,40 @@ static inline void _local_bh_enable_ip(u dec_preempt_count(); #ifdef CONFIG_TRACE_IRQFLAGS - local_irq_enable(); + local_irq_restore(flags); #endif preempt_check_resched(); } - -void local_bh_enable(void) -{ - _local_bh_enable_ip((unsigned long)__builtin_return_address(0)); -} EXPORT_SYMBOL(local_bh_enable); void local_bh_enable_ip(unsigned long ip) { - _local_bh_enable_ip(ip); +#ifdef CONFIG_TRACE_IRQFLAGS + unsigned long flags; + + WARN_ON_ONCE(in_irq()); + + local_irq_save(flags); +#endif + /* + * Are softirqs going to be turned on now: + */ + if (softirq_count() == SOFTIRQ_OFFSET) + trace_softirqs_on(ip); + /* + * Keep preemption disabled until we are done with + * softirq processing: + */ + sub_preempt_count(SOFTIRQ_OFFSET - 1); + + if (unlikely(!in_interrupt() && local_softirq_pending())) + do_softirq(); + + dec_preempt_count(); +#ifdef CONFIG_TRACE_IRQFLAGS + local_irq_restore(flags); +#endif + preempt_check_resched(); } EXPORT_SYMBOL(local_bh_enable_ip); @@ -248,58 +272,116 @@ EXPORT_SYMBOL(local_bh_enable_ip); * we want to handle softirqs as soon as possible, but they * should not be able to lock up the box. */ -#define MAX_SOFTIRQ_RESTART 10 +#define MAX_SOFTIRQ_RESTART 20 DEFINE_TRACE(softirq_entry); DEFINE_TRACE(softirq_exit); -asmlinkage void ___do_softirq(void) +static DEFINE_PER_CPU(u32, softirq_running); + +/* + * Debug check for leaking preempt counts in h->action handlers: + */ + +static inline void debug_check_preempt_count_start(__u32 *preempt_count) { - struct softirq_action *h; - __u32 pending; +#ifdef CONFIG_DEBUG_PREEMPT + *preempt_count = preempt_count(); +#endif +} + +static inline void + debug_check_preempt_count_stop(__u32 *preempt_count, struct softirq_action *h) +{ +#ifdef CONFIG_DEBUG_PREEMPT + if (*preempt_count == preempt_count()) + return; + + print_symbol("BUG: %Ps exited with wrong preemption count!\n", + (unsigned long)h->action); + printk("=> enter: %08x, exit: %08x.\n", *preempt_count, preempt_count()); + preempt_count() = *preempt_count; +#endif +} + +/* + * Execute softirq handlers: + */ +static void ___do_softirq(const int same_prio_only) +{ + __u32 pending, available_mask, same_prio_skipped, preempt_count; int max_restart = MAX_SOFTIRQ_RESTART; - int cpu; + struct softirq_action *h; + int cpu, softirq; pending = local_softirq_pending(); account_system_vtime(current); cpu = smp_processor_id(); restart: + available_mask = -1; + softirq = 0; + same_prio_skipped = 0; /* Reset the pending bitmask before enabling irqs */ set_softirq_pending(0); - local_irq_enable(); - h = softirq_vec; do { - if (pending & 1) { - int prev_count = preempt_count(); + u32 softirq_mask = 1 << softirq; - trace_softirq_entry(h, softirq_vec); - h->action(h); - trace_softirq_exit(h, softirq_vec); - if (unlikely(prev_count != preempt_count())) { - printk(KERN_ERR "huh, entered softirq %td %s %p" - "with preempt_count %08x," - " exited with %08x?\n", h - softirq_vec, - softirq_to_name[h - softirq_vec], - h->action, prev_count, preempt_count()); - preempt_count() = prev_count; - } + if (!(pending & 1)) + goto next; - rcu_bh_qsctr_inc(cpu); - cond_resched_softirq_context(); + debug_check_preempt_count_start(&preempt_count); + +#if defined(CONFIG_PREEMPT_SOFTIRQS) && defined(CONFIG_PREEMPT_HARDIRQS) + /* + * If executed by a same-prio hardirq thread + * then skip pending softirqs that belong + * to softirq threads with different priority: + */ + if (same_prio_only) { + struct task_struct *tsk; + + tsk = __get_cpu_var(ksoftirqd)[softirq].tsk; + if (tsk && tsk->normal_prio != current->normal_prio) { + same_prio_skipped |= softirq_mask; + available_mask &= ~softirq_mask; + goto next; + } } +#endif + /* + * Is this softirq already being processed? + */ + if (per_cpu(softirq_running, cpu) & softirq_mask) { + available_mask &= ~softirq_mask; + goto next; + } + per_cpu(softirq_running, cpu) |= softirq_mask; + local_irq_enable(); + + h->action(h); + + debug_check_preempt_count_stop(&preempt_count, h); + + rcu_bh_qsctr_inc(cpu); + cond_resched_softirq_context(); + local_irq_disable(); + per_cpu(softirq_running, cpu) &= ~softirq_mask; +next: h++; + softirq++; pending >>= 1; } while (pending); - local_irq_disable(); - + or_softirq_pending(same_prio_skipped); pending = local_softirq_pending(); - if (pending && --max_restart) - goto restart; + if (pending & available_mask) { + if (--max_restart) + goto restart; + } if (pending) trigger_softirqs(); @@ -323,7 +405,7 @@ asmlinkage void __do_softirq(void) __local_bh_disable((unsigned long)__builtin_return_address(0)); lockdep_softirq_enter(); - ___do_softirq(); + ___do_softirq(0); lockdep_softirq_exit(); @@ -480,7 +562,7 @@ void __tasklet_hi_schedule(struct taskle unsigned long flags; local_irq_save(flags); - __tasklet_common_schedule(t, &__get_cpu_var(tasklet_vec), HI_SOFTIRQ); + __tasklet_common_schedule(t, &__get_cpu_var(tasklet_hi_vec), HI_SOFTIRQ); local_irq_restore(flags); } @@ -488,11 +570,7 @@ EXPORT_SYMBOL(__tasklet_hi_schedule); void __tasklet_hi_schedule_first(struct tasklet_struct *t) { - BUG_ON(!irqs_disabled()); - - t->next = __get_cpu_var(tasklet_hi_vec).head; - __get_cpu_var(tasklet_hi_vec).head = t; - __raise_softirq_irqoff(HI_SOFTIRQ); + __tasklet_hi_schedule(t); } EXPORT_SYMBOL(__tasklet_hi_schedule_first); @@ -612,7 +690,7 @@ static void tasklet_hi_action(struct sof local_irq_disable(); list = __get_cpu_var(tasklet_hi_vec).head; __get_cpu_var(tasklet_hi_vec).head = NULL; - __get_cpu_var(tasklet_hi_vec).tail = &__get_cpu_var(tasklet_vec).head; + __get_cpu_var(tasklet_hi_vec).tail = &__get_cpu_var(tasklet_hi_vec).head; local_irq_enable(); __tasklet_action(a, list); @@ -812,8 +890,9 @@ static int ksoftirqd(void * __data) { struct sched_param param = { .sched_priority = MAX_USER_RT_PRIO/2 }; struct softirqdata *data = __data; - u32 mask = (1 << data->nr); + u32 softirq_mask = (1 << data->nr); struct softirq_action *h; + int cpu = data->cpu; #ifdef CONFIG_PREEMPT_SOFTIRQS init_waitqueue_head(&data->wait); @@ -825,7 +904,8 @@ static int ksoftirqd(void * __data) while (!kthread_should_stop()) { preempt_disable(); - if (!(local_softirq_pending() & mask)) { + if (!(local_softirq_pending() & softirq_mask)) { +sleep_more: __preempt_enable_no_resched(); schedule(); preempt_disable(); @@ -837,16 +917,26 @@ static int ksoftirqd(void * __data) data->running = 1; #endif - while (local_softirq_pending() & mask) { + while (local_softirq_pending() & softirq_mask) { /* Preempt disable stops cpu going offline. If already offline, we'll be on wrong CPU: don't process */ - if (cpu_is_offline(data->cpu)) + if (cpu_is_offline(cpu)) goto wait_to_die; local_irq_disable(); + /* + * Is the softirq already being executed by + * a hardirq context? + */ + if (per_cpu(softirq_running, cpu) & softirq_mask) { + local_irq_enable(); + set_current_state(TASK_INTERRUPTIBLE); + goto sleep_more; + } + per_cpu(softirq_running, cpu) |= softirq_mask; __preempt_enable_no_resched(); - set_softirq_pending(local_softirq_pending() & ~mask); + set_softirq_pending(local_softirq_pending() & ~softirq_mask); local_bh_disable(); local_irq_enable(); @@ -856,6 +946,7 @@ static int ksoftirqd(void * __data) rcu_bh_qsctr_inc(data->cpu); local_irq_disable(); + per_cpu(softirq_running, cpu) &= ~softirq_mask; _local_bh_enable(); local_irq_enable(); @@ -977,7 +1068,7 @@ static int __cpuinit cpu_callback(struct for (i = 0; i < MAX_SOFTIRQ; i++) { p = kthread_create(ksoftirqd, &per_cpu(ksoftirqd, hotcpu)[i], - "softirq-%s/%d", softirq_names[i], + "sirq-%s/%d", softirq_names[i], hotcpu); if (IS_ERR(p)) { printk("ksoftirqd %d for %i failed\n", i, @@ -1002,22 +1093,23 @@ static int __cpuinit cpu_callback(struct if (!per_cpu(ksoftirqd, hotcpu)[i].tsk) continue; kthread_bind(per_cpu(ksoftirqd, hotcpu)[i].tsk, - cpumask_any(cpu_online_mask)); + any_online_cpu(cpu_online_map)); } #endif case CPU_DEAD: case CPU_DEAD_FROZEN: { - struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; + struct sched_param param; for (i = 0; i < MAX_SOFTIRQ; i++) { + param.sched_priority = MAX_RT_PRIO-1; p = per_cpu(ksoftirqd, hotcpu)[i].tsk; + sched_setscheduler(p, SCHED_FIFO, ¶m); per_cpu(ksoftirqd, hotcpu)[i].tsk = NULL; - sched_setscheduler_nocheck(p, SCHED_FIFO, ¶m); kthread_stop(p); } takeover_tasklets(hotcpu); break; - } + } #endif /* CONFIG_HOTPLUG_CPU */ } return NOTIFY_OK; Index: linux-2.6-tip/net/ipv4/proc.c =================================================================== --- linux-2.6-tip.orig/net/ipv4/proc.c +++ linux-2.6-tip/net/ipv4/proc.c @@ -54,8 +54,8 @@ static int sockstat_seq_show(struct seq_ int orphans, sockets; local_bh_disable(); - orphans = percpu_counter_sum_positive(&tcp_orphan_count), - sockets = percpu_counter_sum_positive(&tcp_sockets_allocated), + orphans = percpu_counter_sum_positive(&tcp_orphan_count); + sockets = percpu_counter_sum_positive(&tcp_sockets_allocated); local_bh_enable(); socket_seq_show(seq); patches/preempt-realtime-xfs-compat-semaphore.patch0000664000076400007640000000212311160752235021572 0ustar tglxtglxSubject: rt: xfs fix From: Ingo Molnar Date: Sun Feb 08 17:26:51 CET 2009 XFS still relies on semaphore implementation internals: fs/xfs/linux-2.6/xfs_buf.c: In function ‘xfs_buf_lock_value’: fs/xfs/linux-2.6/xfs_buf.c:846: error: incompatible types in return Convert it to a compat semaphore. Loses hard-real-time priority inheritance support this way. Signed-off-by: Ingo Molnar --- fs/xfs/linux-2.6/xfs_buf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/fs/xfs/linux-2.6/xfs_buf.h =================================================================== --- linux-2.6-tip.orig/fs/xfs/linux-2.6/xfs_buf.h +++ linux-2.6-tip/fs/xfs/linux-2.6/xfs_buf.h @@ -145,7 +145,7 @@ typedef int (*xfs_buf_bdstrat_t)(struct #define XB_PAGES 2 typedef struct xfs_buf { - struct semaphore b_sema; /* semaphore for lockables */ + struct compat_semaphore b_sema; /* semaphore for lockables */ unsigned long b_queuetime; /* time buffer was queued */ atomic_t b_pin_count; /* pin count */ wait_queue_head_t b_waiters; /* unpin waiters */ patches/rt-move-update-wall-time-back-to-do-timer.patch0000664000076400007640000000243511160752235022062 0ustar tglxtglxSubject: rt: move update_wall_time back to do timer From: Thomas Gleixner Date: Wed, 30 Apr 2008 15:01:10 +0200 Heavy networking or high load rt tasks can starve the timer softirq. This can result in long loops in update_wall_time() once the timer softirq gets hold of the CPU again. This code runs with interrupts disabled and xtime lock write locked, so it can introduce pretty long latencies. Move update_wall_time() back into do_timer, so we avoid the looping and have a small but constant length irq off section every tick. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- kernel/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/kernel/timer.c =================================================================== --- linux-2.6-tip.orig/kernel/timer.c +++ linux-2.6-tip/kernel/timer.c @@ -1288,7 +1288,6 @@ static inline void update_times(void) ticks = jiffies - last_tick; if (ticks) { last_tick += ticks; - update_wall_time(); calc_load(ticks); } write_sequnlock_irqrestore(&xtime_lock, flags); @@ -1318,6 +1317,7 @@ static void run_timer_softirq(struct sof void do_timer(unsigned long ticks) { jiffies_64 += ticks; + update_wall_time(); } #ifdef __ARCH_WANT_SYS_ALARM patches/move-native-irq.patch0000664000076400007640000000212311160752235015301 0ustar tglxtglxSubject: move: native irq From: Ingo Molnar Date: Wed Feb 04 00:03:12 CET 2009 Signed-off-by: Ingo Molnar --- kernel/irq/migration.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) Index: linux-2.6-tip/kernel/irq/migration.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/migration.c +++ linux-2.6-tip/kernel/irq/migration.c @@ -50,6 +50,7 @@ void move_masked_irq(int irq) void move_native_irq(int irq) { struct irq_desc *desc = irq_to_desc(irq); + int mask = 1; if (likely(!(desc->status & IRQ_MOVE_PENDING))) return; @@ -57,8 +58,17 @@ void move_native_irq(int irq) if (unlikely(desc->status & IRQ_DISABLED)) return; - desc->chip->mask(irq); + /* + * If the irq is already in progress, it should be masked. + * If we unmask it, we might cause an interrupt storm on RT. + */ + if (unlikely(desc->status & IRQ_INPROGRESS)) + mask = 0; + + if (mask) + desc->chip->mask(irq); move_masked_irq(irq); - desc->chip->unmask(irq); + if (mask) + desc->chip->unmask(irq); } patches/jbd_assertions_smp_only.patch0000664000076400007640000000404111160752235017210 0ustar tglxtglxSubject: patches/jbd_assertions_smp_only.patch Signed-off-by: Ingo Molnar --- fs/jbd/transaction.c | 6 +++--- include/linux/jbd.h | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) Index: linux-2.6-tip/fs/jbd/transaction.c =================================================================== --- linux-2.6-tip.orig/fs/jbd/transaction.c +++ linux-2.6-tip/fs/jbd/transaction.c @@ -1582,7 +1582,7 @@ static void __journal_temp_unlink_buffer transaction_t *transaction; struct buffer_head *bh = jh2bh(jh); - J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); + J_ASSERT_JH_SMP(jh, jbd_is_locked_bh_state(bh)); transaction = jh->b_transaction; if (transaction) assert_spin_locked(&transaction->t_journal->j_list_lock); @@ -2077,7 +2077,7 @@ void __journal_file_buffer(struct journa int was_dirty = 0; struct buffer_head *bh = jh2bh(jh); - J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); + J_ASSERT_JH_SMP(jh, jbd_is_locked_bh_state(bh)); assert_spin_locked(&transaction->t_journal->j_list_lock); J_ASSERT_JH(jh, jh->b_jlist < BJ_Types); @@ -2166,7 +2166,7 @@ void __journal_refile_buffer(struct jour int was_dirty; struct buffer_head *bh = jh2bh(jh); - J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); + J_ASSERT_JH_SMP(jh, jbd_is_locked_bh_state(bh)); if (jh->b_transaction) assert_spin_locked(&jh->b_transaction->t_journal->j_list_lock); Index: linux-2.6-tip/include/linux/jbd.h =================================================================== --- linux-2.6-tip.orig/include/linux/jbd.h +++ linux-2.6-tip/include/linux/jbd.h @@ -260,6 +260,15 @@ void buffer_assertion_failure(struct buf #define J_ASSERT_JH(jh, expr) J_ASSERT(expr) #endif +/* + * For assertions that are only valid on SMP (e.g. spin_is_locked()): + */ +#ifdef CONFIG_SMP +# define J_ASSERT_JH_SMP(jh, expr) J_ASSERT_JH(jh, expr) +#else +# define J_ASSERT_JH_SMP(jh, assert) do { } while (0) +#endif + #if defined(JBD_PARANOID_IOFAIL) #define J_EXPECT(expr, why...) J_ASSERT(expr) #define J_EXPECT_BH(bh, expr, why...) J_ASSERT_BH(bh, expr) patches/preempt-realtime-sparseirq-waitqueue-init-fix.patch0000664000076400007640000000416311160752235023303 0ustar tglxtglxSubject: rt: CONFIG_SPARSEIRQ=y fix From: Ingo Molnar Date: Tue Feb 10 12:19:46 CET 2009 The desc->wait_for_handler waitqueue needs to be initialized for dynamically allocated irq descriptors. Signed-off-by: Ingo Molnar --- kernel/irq/handle.c | 1 + kernel/irq/manage.c | 3 +++ kernel/irq/numa_migrate.c | 1 + 3 files changed, 5 insertions(+) Index: linux-2.6-tip/kernel/irq/handle.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/handle.c +++ linux-2.6-tip/kernel/irq/handle.c @@ -106,6 +106,7 @@ static void init_one_irq_desc(int irq, s memcpy(desc, &irq_desc_init, sizeof(struct irq_desc)); spin_lock_init(&desc->lock); + init_waitqueue_head(&desc->wait_for_handler); desc->irq = irq; #ifdef CONFIG_SMP desc->cpu = cpu; Index: linux-2.6-tip/kernel/irq/manage.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/manage.c +++ linux-2.6-tip/kernel/irq/manage.c @@ -533,6 +533,7 @@ __setup_irq(unsigned int irq, struct irq /* Reset broken irq detection when installing new handler */ desc->irq_count = 0; desc->irqs_unhandled = 0; + init_waitqueue_head(&desc->wait_for_handler); /* * Check whether we disabled the irq via the spurious handler @@ -1023,6 +1024,8 @@ static int start_irq_thread(int irq, str if (desc->thread || !ok_to_create_irq_threads) return 0; + init_waitqueue_head(&desc->wait_for_handler); + desc->thread = kthread_create(do_irqd, desc, "IRQ-%d", irq); if (!desc->thread) { printk(KERN_ERR "irqd: could not create IRQ thread %d!\n", irq); Index: linux-2.6-tip/kernel/irq/numa_migrate.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/numa_migrate.c +++ linux-2.6-tip/kernel/irq/numa_migrate.c @@ -43,6 +43,7 @@ static bool init_copy_one_irq_desc(int i return false; } spin_lock_init(&desc->lock); + init_waitqueue_head(&desc->wait_for_handler); desc->cpu = cpu; lockdep_set_class(&desc->lock, &irq_desc_lock_class); init_copy_kstat_irqs(old_desc, desc, cpu, nr_cpu_ids); patches/smp-processor-id-fixups.patch0000664000076400007640000000236511160752235017010 0ustar tglxtglxSubject: smp: processor id fixups From: Ingo Molnar Date: Wed Feb 04 00:02:32 CET 2009 Signed-off-by: Ingo Molnar --- include/linux/netpoll.h | 2 +- kernel/workqueue.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6-tip/include/linux/netpoll.h =================================================================== --- linux-2.6-tip.orig/include/linux/netpoll.h +++ linux-2.6-tip/include/linux/netpoll.h @@ -77,7 +77,7 @@ static inline void *netpoll_poll_lock(st rcu_read_lock(); /* deal with race on ->npinfo */ if (dev && dev->npinfo) { spin_lock(&napi->poll_lock); - napi->poll_owner = smp_processor_id(); + napi->poll_owner = raw_smp_processor_id(); return napi; } return NULL; Index: linux-2.6-tip/kernel/workqueue.c =================================================================== --- linux-2.6-tip.orig/kernel/workqueue.c +++ linux-2.6-tip/kernel/workqueue.c @@ -209,7 +209,7 @@ static void delayed_work_timer_fn(unsign struct cpu_workqueue_struct *cwq = get_wq_data(&dwork->work); struct workqueue_struct *wq = cwq->wq; - __queue_work(wq_per_cpu(wq, smp_processor_id()), &dwork->work); + __queue_work(wq_per_cpu(wq, raw_smp_processor_id()), &dwork->work); } /** patches/raw-spinlocks-for-nmi-print.patch0000664000076400007640000000137311160752235017557 0ustar tglxtglxSubject: patches/raw-spinlocks-for-nmi-print.patch From: Clark Williams Signed-off-by: Ingo Molnar --- arch/x86/kernel/apic/nmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/arch/x86/kernel/apic/nmi.c =================================================================== --- linux-2.6-tip.orig/arch/x86/kernel/apic/nmi.c +++ linux-2.6-tip/arch/x86/kernel/apic/nmi.c @@ -417,7 +417,7 @@ nmi_watchdog_tick(struct pt_regs *regs, } if (cpumask_test_cpu(cpu, backtrace_mask)) { - static DEFINE_SPINLOCK(lock); /* Serialise the printks */ + static DEFINE_RAW_SPINLOCK(lock); /* Serialise the printks */ spin_lock(&lock); printk(KERN_WARNING "NMI backtrace for cpu %d\n", cpu); patches/adaptive-task-oncpu.patch0000664000076400007640000000752211161723440016142 0ustar tglxtglxSubject: sched: make task->oncpu available in all configurations From: Gregory Haskins Date: Tue, 20 May 2008 10:49:20 -0400 [ The following text is in the "utf-8" character set. ] [ Your display is set for the "iso-8859-1" character set. ] [ Some characters may be displayed incorrectly. ] We will use this later in the series to eliminate the need for a function call. [ Steven Rostedt: added task_is_current function ] Signed-off-by: Gregory Haskins Signed-off-by: Ingo Molnar --- include/linux/sched.h | 9 ++++++--- kernel/sched.c | 37 ++++++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 14 deletions(-) Index: linux-2.6-tip/include/linux/sched.h =================================================================== --- linux-2.6-tip.orig/include/linux/sched.h +++ linux-2.6-tip/include/linux/sched.h @@ -1194,10 +1194,8 @@ struct task_struct { int lock_depth; /* BKL lock depth */ #ifdef CONFIG_SMP -#ifdef __ARCH_WANT_UNLOCKED_CTXSW int oncpu; #endif -#endif int prio, static_prio, normal_prio; unsigned int rt_priority; @@ -2568,7 +2566,12 @@ static inline void mm_init_owner(struct #define TASK_STATE_TO_CHAR_STR "RSDTtZX" -extern int task_is_current(struct task_struct *task); +#ifdef CONFIG_SMP +static inline int task_is_current(struct task_struct *task) +{ + return task->oncpu; +} +#endif #endif /* __KERNEL__ */ Index: linux-2.6-tip/kernel/sched.c =================================================================== --- linux-2.6-tip.orig/kernel/sched.c +++ linux-2.6-tip/kernel/sched.c @@ -754,10 +754,12 @@ inline void update_rq_clock(struct rq *r rq->clock = sched_clock_cpu(cpu_of(rq)); } +#ifndef CONFIG_SMP int task_is_current(struct task_struct *task) { return task_rq(task)->curr == task; } +#endif /* * Tunables that become constants when CONFIG_SCHED_DEBUG is off: @@ -971,18 +973,39 @@ static inline int task_current(struct rq return rq->curr == p; } -#ifndef __ARCH_WANT_UNLOCKED_CTXSW static inline int task_running(struct rq *rq, struct task_struct *p) { +#ifdef CONFIG_SMP + return p->oncpu; +#else return task_current(rq, p); +#endif } +#ifndef __ARCH_WANT_UNLOCKED_CTXSW static inline void prepare_lock_switch(struct rq *rq, struct task_struct *next) { +#ifdef CONFIG_SMP + /* + * We can optimise this out completely for !SMP, because the + * SMP rebalancing from interrupt is the only thing that cares + * here. + */ + next->oncpu = 1; +#endif } static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev) { +#ifdef CONFIG_SMP + /* + * After ->oncpu is cleared, the task can be moved to a different CPU. + * We must ensure this doesn't happen until the switch is completely + * finished. + */ + smp_wmb(); + prev->oncpu = 0; +#endif #ifdef CONFIG_DEBUG_SPINLOCK /* this is a valid case when another task releases the spinlock */ rq->lock.owner = current; @@ -998,14 +1021,6 @@ static inline void finish_lock_switch(st } #else /* __ARCH_WANT_UNLOCKED_CTXSW */ -static inline int task_running(struct rq *rq, struct task_struct *p) -{ -#ifdef CONFIG_SMP - return p->oncpu; -#else - return task_current(rq, p); -#endif -} static inline void prepare_lock_switch(struct rq *rq, struct task_struct *next) { @@ -2697,7 +2712,7 @@ void sched_fork(struct task_struct *p, i if (likely(sched_info_on())) memset(&p->sched_info, 0, sizeof(p->sched_info)); #endif -#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) +#if defined(CONFIG_SMP) p->oncpu = 0; #endif #ifdef CONFIG_PREEMPT @@ -6702,7 +6717,7 @@ void __cpuinit init_idle(struct task_str __set_task_cpu(idle, cpu); rq->curr = rq->idle = idle; -#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) +#if defined(CONFIG_SMP) idle->oncpu = 1; #endif spin_unlock_irqrestore(&rq->lock, flags); patches/powerpc-compat-semaphore.patch0000664000076400007640000000141511160752235017202 0ustar tglxtglxSubject: powerpc-compat-semaphore.patch From: Thomas Gleixner Date: Fri, 20 Mar 2009 17:34:03 +0100 Signed-off-by: Thomas Gleixner --- drivers/macintosh/adb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/drivers/macintosh/adb.c =================================================================== --- linux-2.6-tip.orig/drivers/macintosh/adb.c +++ linux-2.6-tip/drivers/macintosh/adb.c @@ -83,7 +83,7 @@ static struct adb_driver *adb_controller BLOCKING_NOTIFIER_HEAD(adb_client_list); static int adb_got_sleep; static int adb_inited; -static DECLARE_MUTEX(adb_probe_mutex); +static COMPAT_DECLARE_MUTEX(adb_probe_mutex); static int sleepy_trackpad; static int autopoll_devs; int __adb_probe_sync; patches/posix-timers-prevent-broadcast-signals.patch0000664000076400007640000000224111160752235022001 0ustar tglxtglxSubject: posix-timers-prevent-broadcast-signals.patch From: Thomas Gleixner Date: Thu, 05 Feb 2009 17:38:20 +0100 Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- kernel/posix-timers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-2.6-tip/kernel/posix-timers.c =================================================================== --- linux-2.6-tip.orig/kernel/posix-timers.c +++ linux-2.6-tip/kernel/posix-timers.c @@ -420,6 +420,7 @@ static enum hrtimer_restart posix_timer_ static struct pid *good_sigevent(sigevent_t * event) { struct task_struct *rtn = current->group_leader; + int sig = event->sigev_signo; if ((event->sigev_notify & SIGEV_THREAD_ID ) && (!(rtn = find_task_by_vpid(event->sigev_notify_thread_id)) || @@ -428,7 +429,8 @@ static struct pid *good_sigevent(sigeven return NULL; if (((event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) && - ((event->sigev_signo <= 0) || (event->sigev_signo > SIGRTMAX))) + (sig <= 0 || sig > SIGRTMAX || sig_kernel_only(sig) || + sig_kernel_coredump(sig))) return NULL; return task_pid(rtn); patches/rt-mutex-trivial-tcp-preempt-fix.patch0000664000076400007640000000147611160752235020547 0ustar tglxtglxSubject: rt: mutex trivial tcp preempt fix From: Ingo Molnar Date: Wed Feb 04 00:03:05 CET 2009 Signed-off-by: Ingo Molnar --- net/ipv4/tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6-tip/net/ipv4/tcp.c =================================================================== --- linux-2.6-tip.orig/net/ipv4/tcp.c +++ linux-2.6-tip/net/ipv4/tcp.c @@ -1322,11 +1322,11 @@ int tcp_recvmsg(struct kiocb *iocb, stru (len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) && !sysctl_tcp_low_latency && dma_find_channel(DMA_MEMCPY)) { - preempt_enable_no_resched(); + preempt_enable(); tp->ucopy.pinned_list = dma_pin_iovec_pages(msg->msg_iov, len); } else { - preempt_enable_no_resched(); + preempt_enable(); } } #endif patches/preempt-irqs-timer.patch0000664000076400007640000001655611160752235016043 0ustar tglxtglxSubject: preempt: irqs timer From: Ingo Molnar Date: Wed Feb 04 00:03:09 CET 2009 Signed-off-by: Ingo Molnar --- include/linux/timer.h | 4 + kernel/timer.c | 131 ++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 99 insertions(+), 36 deletions(-) Index: linux-2.6-tip/include/linux/timer.h =================================================================== --- linux-2.6-tip.orig/include/linux/timer.h +++ linux-2.6-tip/include/linux/timer.h @@ -223,10 +223,12 @@ static inline void timer_stats_timer_cle extern void add_timer(struct timer_list *timer); -#ifdef CONFIG_SMP +#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_SOFTIRQS) + extern int timer_pending_sync(struct timer_list *timer); extern int try_to_del_timer_sync(struct timer_list *timer); extern int del_timer_sync(struct timer_list *timer); #else +# define timer_pending_sync(t) timer_pending(t) # define try_to_del_timer_sync(t) del_timer(t) # define del_timer_sync(t) del_timer(t) #endif Index: linux-2.6-tip/kernel/timer.c =================================================================== --- linux-2.6-tip.orig/kernel/timer.c +++ linux-2.6-tip/kernel/timer.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -69,6 +70,7 @@ struct tvec_root { struct tvec_base { spinlock_t lock; struct timer_list *running_timer; + wait_queue_head_t wait_for_running_timer; unsigned long timer_jiffies; struct tvec_root tv1; struct tvec tv2; @@ -316,9 +318,7 @@ EXPORT_SYMBOL_GPL(round_jiffies_up_relat static inline void set_running_timer(struct tvec_base *base, struct timer_list *timer) { -#ifdef CONFIG_SMP base->running_timer = timer; -#endif } static void internal_add_timer(struct tvec_base *base, struct timer_list *timer) @@ -605,9 +605,7 @@ __mod_timer(struct timer_list *timer, un { struct tvec_base *base, *new_base; unsigned long flags; - int ret; - - ret = 0; + int cpu, ret = 0; timer_stats_timer_set_start_info(timer); BUG_ON(!timer->function); @@ -624,7 +622,8 @@ __mod_timer(struct timer_list *timer, un debug_timer_activate(timer); - new_base = __get_cpu_var(tvec_bases); + cpu = raw_smp_processor_id(); + new_base = per_cpu(tvec_bases, cpu); if (base != new_base) { /* @@ -754,6 +753,18 @@ void add_timer_on(struct timer_list *tim spin_unlock_irqrestore(&base->lock, flags); } +/* + * Wait for a running timer + */ +void wait_for_running_timer(struct timer_list *timer) +{ + struct tvec_base *base = timer->base; + + if (base->running_timer == timer) + wait_event(base->wait_for_running_timer, + base->running_timer != timer); +} + /** * del_timer - deactive a timer. * @timer: the timer to be deactivated @@ -785,7 +796,34 @@ int del_timer(struct timer_list *timer) } EXPORT_SYMBOL(del_timer); -#ifdef CONFIG_SMP +#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_SOFTIRQS) +/* + * This function checks whether a timer is active and not running on any + * CPU. Upon successful (ret >= 0) exit the timer is not queued and the + * handler is not running on any CPU. + * + * It must not be called from interrupt contexts. + */ +int timer_pending_sync(struct timer_list *timer) +{ + struct tvec_base *base; + unsigned long flags; + int ret = -1; + + base = lock_timer_base(timer, &flags); + + if (base->running_timer == timer) + goto out; + + ret = 0; + if (timer_pending(timer)) + ret = 1; +out: + spin_unlock_irqrestore(&base->lock, flags); + + return ret; +} + /** * try_to_del_timer_sync - Try to deactivate a timer * @timer: timer do del @@ -850,7 +888,7 @@ int del_timer_sync(struct timer_list *ti int ret = try_to_del_timer_sync(timer); if (ret >= 0) return ret; - cpu_relax(); + wait_for_running_timer(timer); } } EXPORT_SYMBOL(del_timer_sync); @@ -895,6 +933,20 @@ static inline void __run_timers(struct t struct list_head *head = &work_list; int index = base->timer_jiffies & TVR_MASK; + if (softirq_need_resched()) { + spin_unlock_irq(&base->lock); + wake_up(&base->wait_for_running_timer); + cond_resched_softirq_context(); + cpu_relax(); + spin_lock_irq(&base->lock); + /* + * We can simply continue after preemption, nobody + * else can touch timer_jiffies so 'index' is still + * valid. Any new jiffy will be taken care of in + * subsequent loops: + */ + } + /* * Cascade timers: */ @@ -948,18 +1000,17 @@ static inline void __run_timers(struct t lock_map_release(&lockdep_map); if (preempt_count != preempt_count()) { - printk(KERN_ERR "huh, entered %p " - "with preempt_count %08x, exited" - " with %08x?\n", - fn, preempt_count, - preempt_count()); - BUG(); + print_symbol("BUG: unbalanced timer-handler preempt count in %s!\n", (unsigned long) fn); + printk("entered with %08x, exited with %08x.\n", preempt_count, preempt_count()); + preempt_count() = preempt_count; } } + set_running_timer(base, NULL); + cond_resched_softirq_context(); spin_lock_irq(&base->lock); } } - set_running_timer(base, NULL); + wake_up(&base->wait_for_running_timer); spin_unlock_irq(&base->lock); } @@ -1111,11 +1162,11 @@ void update_process_times(int user_tick) /* Note: this timer irq context must be accounted for as well. */ account_process_tick(p, user_tick); + scheduler_tick(); run_local_timers(); if (rcu_pending(cpu)) rcu_check_callbacks(cpu, user_tick); printk_tick(); - scheduler_tick(); run_posix_cpu_timers(p); } @@ -1161,19 +1212,6 @@ static inline void calc_load(unsigned lo } /* - * This function runs timers and the timer-tq in bottom half context. - */ -static void run_timer_softirq(struct softirq_action *h) -{ - struct tvec_base *base = __get_cpu_var(tvec_bases); - - hrtimer_run_pending(); - - if (time_after_eq(jiffies, base->timer_jiffies)) - __run_timers(base); -} - -/* * Called by the local, per-CPU timer interrupt on SMP. */ void run_local_timers(void) @@ -1184,13 +1222,36 @@ void run_local_timers(void) } /* - * Called by the timer interrupt. xtime_lock must already be taken - * by the timer IRQ! + * Time of day handling: */ -static inline void update_times(unsigned long ticks) +static inline void update_times(void) { - update_wall_time(); - calc_load(ticks); + static unsigned long last_tick = INITIAL_JIFFIES; + unsigned long ticks, flags; + + write_seqlock_irqsave(&xtime_lock, flags); + ticks = jiffies - last_tick; + if (ticks) { + last_tick += ticks; + update_wall_time(); + calc_load(ticks); + } + write_sequnlock_irqrestore(&xtime_lock, flags); +} + + +/* + * This function runs timers and the timer-tq in bottom half context. + */ +static void run_timer_softirq(struct softirq_action *h) +{ + struct tvec_base *base = __get_cpu_var(tvec_bases); + + update_times(); + hrtimer_run_pending(); + + if (time_after_eq(jiffies, base->timer_jiffies)) + __run_timers(base); } /* @@ -1202,7 +1263,6 @@ static inline void update_times(unsigned void do_timer(unsigned long ticks) { jiffies_64 += ticks; - update_times(ticks); } #ifdef __ARCH_WANT_SYS_ALARM @@ -1536,6 +1596,7 @@ static int __cpuinit init_timers_cpu(int } spin_lock_init(&base->lock); + init_waitqueue_head(&base->wait_for_running_timer); for (j = 0; j < TVN_SIZE; j++) { INIT_LIST_HEAD(base->tv5.vec + j); patches/ata-irq-save-nort.patch0000664000076400007640000000343611160752235015540 0ustar tglxtglxSubject: Do not disable interrupts in ide code for preempt-rt From: Steven Rostedt Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar --- drivers/ata/libata-sff.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) Index: linux-2.6-tip/drivers/ata/libata-sff.c =================================================================== --- linux-2.6-tip.orig/drivers/ata/libata-sff.c +++ linux-2.6-tip/drivers/ata/libata-sff.c @@ -824,9 +824,9 @@ unsigned int ata_sff_data_xfer_noirq(str unsigned long flags; unsigned int consumed; - local_irq_save(flags); + local_irq_save_nort(flags); consumed = ata_sff_data_xfer(dev, buf, buflen, rw); - local_irq_restore(flags); + local_irq_restore_nort(flags); return consumed; } @@ -865,7 +865,7 @@ static void ata_pio_sector(struct ata_qu unsigned long flags; /* FIXME: use a bounce buffer */ - local_irq_save(flags); + local_irq_save_nort(flags); buf = kmap_atomic(page, KM_IRQ0); /* do the actual data transfer */ @@ -873,7 +873,7 @@ static void ata_pio_sector(struct ata_qu do_write); kunmap_atomic(buf, KM_IRQ0); - local_irq_restore(flags); + local_irq_restore_nort(flags); } else { buf = page_address(page); ap->ops->sff_data_xfer(qc->dev, buf + offset, qc->sect_size, @@ -1003,7 +1003,7 @@ next_sg: unsigned long flags; /* FIXME: use bounce buffer */ - local_irq_save(flags); + local_irq_save_nort(flags); buf = kmap_atomic(page, KM_IRQ0); /* do the actual data transfer */ @@ -1011,7 +1011,7 @@ next_sg: count, rw); kunmap_atomic(buf, KM_IRQ0); - local_irq_restore(flags); + local_irq_restore_nort(flags); } else { buf = page_address(page); consumed = ap->ops->sff_data_xfer(dev, buf + offset, patches/origin.list0000664000076400007640000122704311161723165013435 0ustar tglxtglxcommit c4cff064be678f1e8344d907499f2a81282edc19 Author: Tom Zanussi tracing/filters: clean up filter_add_subsystem_pred() commit ee6cdabc820a29bd607f38d9cb335c3ceddc673b Author: Tom Zanussi tracing/filters: fix bug in copy_pred() commit 75c8b417526529d0a7072e4d93ec99dbd483a6f4 Author: Tom Zanussi tracing/filters: use list_for_each_entry_safe commit b118415bfad6d75792a85ac999e25149db8e6919 Author: Frederic Weisbecker tracing/events: don't discard an event after commit commit 7e6ea92df3fd7cbe74e7985c6f3e40255c44b201 Author: Frederic Weisbecker tracing/ftrace: make nop-tracer use polling wait for events on pipe commit 07edf7121374609709ef1b0889f6e7b8d6a62ec1 Author: Frederic Weisbecker tracing/events: don't use wake up for events commit 9bd7d099ab3f10dd666da399c064999bae427cd9 Author: Frederic Weisbecker tracing/events: make the filter files writable commit f762dd68218665bb87d4e4a0eeac86fde7530293 Author: Gertjan van Wingerde Update my email address commit 2aac0cf88681bfa092f731553bc7fbd23516be73 Author: Tyler Hicks eCryptfs: NULL crypt_stat dereference during lookup commit 8faece5f906725c10e7a1f6caf84452abadbdc7b Author: Tyler Hicks eCryptfs: Allocate a variable number of pages for file headers commit 18a0d89e54ca0f6f33582f99ae39867b2c975559 Author: Benjamin Herrenschmidt radeonfb: Whack the PCI PM register until it sticks commit fe9f57f250ab4d781b99504caeb218ca2db14c1a Author: Ingo Molnar tracing: add run-time field descriptions for event filtering, kfree fix commit cfb180f3e71b2a280a254c8646a9ab1beab63f84 Author: Tom Zanussi tracing: add per-subsystem filtering commit 7ce7e4249921d5073e764f7ff7ad83cfa9894bd7 Author: Tom Zanussi tracing: add per-event filtering commit 2d622719f1572ef31e0616444a515eba3094d050 Author: Tom Zanussi tracing: add ring_buffer_event_discard() to ring buffer commit b8b94265337f83b7db9c5f429b1769d463d7da8c Author: Dmitri Vorobiev tracing: fix four sparse warnings commit f80d2d7725b04f8225b11b55e43bb2c77c819926 Author: Dmitri Vorobiev tracing, Text Edit Lock: Fix one sparse warning in kernel/extable.c commit 1cc185211a9cb913f6adbe3354e5c256f456ebd2 Author: Dmitri Vorobiev x86: Fix a couple of sparse warnings in arch/x86/kernel/apic/io_apic.c commit cf027f645e6aee4f0ca6197a6b6a57f327fdb13f Author: Tom Zanussi tracing: add run-time field descriptions for event filtering commit 0cf53ff62b3e9e491ff5e5f05b193fb6ce643047 Author: Frederic Weisbecker tracing: keep the tracing buffer after self-test failure commit cf586b61f80229491127d3c57c06ed93c9f530d3 Author: Frederic Weisbecker tracing/function-graph-tracer: prevent hangs during self-tests commit da40a037c5ed51693e739ff9b21e013414244644 Author: Peter Zijlstra lockdep: fix deadlock in lockdep_trace_alloc, take 2 commit 45c7b28f3c7e3a45cc5a597cc19816a9015ee8ae Author: Jeremy Fitzhardinge Revert "x86: create a non-zero sized bm_pte only when needed" commit b125130b22d67f249beba10b71a254558b5279d0 Author: Li Zefan blktrace: avoid accessing NULL bdev->bd_disk commit cd649b8bb830d65c57c3c8b98d57b5402256d8bd Author: Li Zefan blktrace: remove sysfs_blk_trace_enable_show/store() commit 15152e448b693fa41de40f1e40ffbe717a3aab88 Author: Li Zefan blktrace: report EBUSY correctly commit cbe28296eb1ac441b35cf45804d0ae808add7dd1 Author: Li Zefan blktrace: don't increase blk_probes_ref if failed to setup blk trace commit 3c289ba7c320560ee74979a8895141c829046a2d Author: Li Zefan blktrace: remove blk_probe_mutex commit 5006ea73f38caef6065d1136808413813271633f Author: Li Zefan blktrace: make blk_tracer_enabled a bool flag commit 1a17662ea033674a58bad3603531b0b5d42572f6 Author: Li Zefan blktrace: fix possible memory leak commit 1894e36754d682cc049b2b1c3825da8e585967d5 Author: Jaswinder Singh Rajput x86: pci-nommu.c cleanup commit d53a44446076a7dd68a4fb7f549fb6aeda9bfc2c Author: Jaswinder Singh Rajput x86: io_delay.c cleanup commit 8383d821e7481f7cde9c17b61deb1b4af43b2cd9 Author: Jaswinder Singh Rajput x86: rtc.c cleanup commit c8344bc218ce7ebc728337839698566a79edfe5a Author: Jaswinder Singh Rajput x86: i8253 cleanup commit 390cd85c8ae4dc54ffba460a0e6575889170f56e Author: Jaswinder Singh Rajput x86: kdebugfs.c cleanup commit 271eb5c588e5d0a41eca6e118b6927af3f0f04b9 Author: Jaswinder Singh Rajput x86: topology.c cleanup commit 09c9e84d474d917d9de5b9011ed2064b03a19677 Author: Frederic Weisbecker tracing/ring-buffer: don't annotate rb_cpu_notify with __cpuinit commit 0b3ba0c3ccc7ced2a06fed405e80c8e1c77a3ee7 Author: Jaswinder Singh Rajput x86: mpparse.c introduce check_physptr helper function commit 5a5737eac224f01e264477954d92ed6e69047b7a Author: Jaswinder Singh Rajput x86: mpparse.c introduce smp_dump_mptable helper function commit 17a7cccf240f796dbbe880b31ae46dbb58f5bece Author: Paul Mackerras perfcounters: fix type/event_id layout on big-endian systems commit 04c93ce4991fce731dab346d03964504339347db Author: Bartlomiej Zolnierkiewicz x86: fix IO APIC resource allocation error message commit 04cb9ac11ba898049c99dc67ede6e68f6d700dee Author: Lai Jiangshan rcu: rcu_barrier VS cpu_hotplug: Ensure callbacks in dead cpu are migrated to online cpu commit 14fc9fbc700dc95b4f46ebd588169324fe6deff8 Author: Hiroshi Shimamoto x86: signal: check signal stack overflow properly commit b0992675bc7a5eca3c6a5eeea5ed680cec09c8e7 Author: Peter Zijlstra lockdep: fix deadlock in lockdep_trace_alloc commit afaebb6720cc62df1b03e36c2f699b00cfee784e Author: Li Zefan blktrace: avoid accessing NULL bdev->bd_disk commit 9626d7ee4addbf97245c129e24ba9a9b765bd5ef Author: Li Zefan blktrace: remove sysfs_blk_trace_enable_show/store() commit 55feae54fd7ccfcbdf198e34e05ff61d9e975ed3 Author: Li Zefan blktrace: report EBUSY correctly commit 64ddedc03c9ecbe97b0700e85c5f11d2f5a4565c Author: Li Zefan blktrace: don't increase blk_probes_ref if failed to setup blk trace commit a2df44c805026d40fae556b04f9addbce486bbe2 Author: Li Zefan blktrace: remove blk_probe_mutex commit e73fe657c9a1edba1611b4642b2d226634c1a652 Author: Li Zefan blktrace: make blk_tracer_enabled a bool flag commit 86d7c7acc6b5ec500f319120f7e72ea62fb6252d Author: Li Zefan blktrace: fix possible memory leak commit 8b3229288a401f45b95c9b0aa9a551b82947a101 Author: Paul Mackerras perf_counter: powerpc: clean up perc_counter_interrupt commit 37dda04c68bf043ddd3ebe13fbf7bae491f5da6d Author: Peter Zijlstra perf_counter: unify irq output code commit db3a944aca35ae6117ede92876990767676c3f55 Author: Peter Zijlstra perf_counter: revamp syscall input ABI commit ee78a855ff4d8d3d77b46696994dca393228bb8a Author: Peter Zijlstra perf_counter: hook up the tracepoint events commit 789ce7d327a1548779d8b3ca15f244e17c899fe8 Author: Peter Zijlstra perf_counter: fix up counter free paths commit 56675f6a68ace46db70af12bdd39b6103cc54929 Author: Peter Zijlstra perf_counter: generic context switch event commit 50d8b58c48c7acb4f4ed80c24593ffe2a9c7d1ce Author: Peter Zijlstra perf_counter: fix uninitialized usage of event_list commit 505f2b970b2269ce4cb669b3ff4f6479d379cec2 Author: Ingo Molnar tracing, Text Edit Lock - kprobes architecture independent support, nommu fix commit 70f454408e68fdba2c2529ab7d6ec3c3525e59f2 Author: Heiko Carstens s390: remove arch specific smp_send_stop() commit 0f3507555f6fa4acbc85a646d6e8766230db38fc Author: venkatesh.pallipadi@intel.com x86, CPA: Add set_pages_arrayuc and set_pages_array_wb commit 9ae2847591c857bed44bc094b908b412bfa1b244 Author: venkatesh.pallipadi@intel.com x86, PAT: Add support for struct page pointer array in cpa set_clr commit 728c9518873de0bbb92b66daa1943b12e5b9f80f Author: venkatesh.pallipadi@intel.com x86, CPA: Add a flag parameter to cpa set_clr() commit ac199db0189c091f2863312061c0575937f68810 Author: Peter Zijlstra ftrace: event profile hooks commit 28bea271e58e429eccfad3d7ee2ad12d6ee015bf Author: Peter Zijlstra ftrace: ensure every event gets an id commit 23725aeeab10ba02bcf10ec49ad73146b54cb52f Author: Peter Zijlstra ftrace: provide an id file for each event commit 65c24491b4fef017c64e39ec64384fde5e05e0a0 Author: Jeff Moyer aio: lookup_ioctx can return the wrong value when looking up a bogus context commit 87c3a86e1c220121d0ced59d1a71e78ed9abc6dd Author: Davide Libenzi eventfd: remove fput() call from possible IRQ context commit d0115552cdb0b4d4146975889fee2e9355515c4b Author: Linus Torvalds Move cc-option to below arch-specific setup commit 5087f8d2a2f2daff5a913d72d8ea3ad601948e10 Author: Steven Rostedt function-graph: show binary events as comments commit 40ce74f19c28077550646c76d96a075bf312e461 Author: Steven Rostedt tracing: remove recording function depth from trace_printk commit 2fbcdb35aca614f9529a0e7d340146cf0b71684f Author: Steven Rostedt function-graph: calculate function depth within function graph tracer commit 5ef841f6f32dce0b752a4fa0622781ee67a0e874 Author: Steven Rostedt tracing: make print_(b)printk_msg_only global commit a8e7d49aa7be728c4ae241a75a2a124cdcabc0c5 Author: Linus Torvalds Fix race in create_empty_buffers() vs __set_page_dirty_buffers() commit 68df3755e383e6fecf2354a67b08f92f18536594 Author: Linus Torvalds Add '-fwrapv' to gcc CFLAGS commit 3bf832ce1fe6988148d392599f34ca0c6a34427d Author: Frederic Weisbecker tracing/ring-buffer: fix non cpu hotplug case commit ac5f6c96859e9a664ac05b04bc96ed1caad5fe29 Author: Steven Rostedt function-graph: consolidate prologues for output commit 71ff49d71bb5cfcd2689b54cb433c0e6990a1d86 Author: Jeremy Fitzhardinge x86: with the last user gone, remove set_pte_present commit b40c757964bbad76ecfa88eda9eb0b4d76dd8b40 Author: Jeremy Fitzhardinge x86/32: no need to use set_pte_present in set_pte_vaddr commit 8c083f081d0014057901c68a0a3e0f8ca7ac8d23 Author: Rusty Russell cpumask: remove cpumask allocation from idle_balance, fix commit 4a44bac1f98223ed77e47bf3b42fcfd10cddd85f Author: Ingo Molnar symbols, stacktrace: look up init symbols after module symbols commit 0c7e5b187fc599a40c1e6392926424d26cd0cf41 Author: Stephen Rothwell numa, cpumask: move numa_node_id default implementation to topology.h, fix commit 17ad6ea621b1c7952ebd7330ce65de26b6ee9cca Author: Stephen Rothwell numa, cpumask: move numa_node_id default implementation to topology.h, fix commit c58603e81b3ed4f1c7352e091fe43fd0bd8d06cc Author: Ingo Molnar x86: mpparse: clean up code by introducing a few helper functions, fix commit 35d40952dba7b0689a16bd1463fb7698f8dbe639 Author: FUJITA Tomonori dma-debug: warn of unmapping an invalid dma address commit 20152e8def6c6fc9525f29fd0621fecea521eda6 Author: Dmitri Vorobiev audit: Restrict definition of a static function in kernel/auditsc.c commit 67f5ca081c6ace125e8ccc76b8a7d99b091abaa7 Author: Dmitri Vorobiev modules: Restrict definition of a label in kernel/module.c commit df7c8e845e8e2030e8ae947e0ace56d184d0e9a0 Author: Rusty Russell cpumask: remove cpumask allocation from idle_balance commit e9d9df44736d116726f4596f7e2f9ce2764ffc0a Author: Lai Jiangshan ftrace: protect running nmi (V3) commit 5f641356127712fbdce0eee120e5ce115860c17f Author: H. Peter Anvin x86, setup: fix the setting of 480-line VGA modes commit ec625cb29e66824f7ce41082617aeb93fa4e42e2 Author: Ingo Molnar tracepoints: dont update zero-sized tracepoint sections commit 09933a108e6730a464a1ab676c9decc11aee0edc Author: Jaswinder Singh Rajput tracing: fix oops in tracepoint_update_probe_range() commit d0573facf21d1e5cfbc1ddac272b7592722e6c01 Author: Greg Kroah-Hartman Staging: benet: remove driver now that it is merged in drivers/net/ commit a6830278568a8bb9758aac152db15187741e0113 Author: Jaswinder Singh Rajput x86: mpparse: clean up code by introducing a few helper functions commit 4acd4d00f716873e27e7b60ae292cbdbfae674dd Author: Steven Rostedt tracing: give easy way to clear trace buffer commit 0dd54847af013a7fa91c60a9f909f76c3c812d22 Author: Jesse Brandeburg e1000e: fix unmap bug commit 33bfe0386ff55f5c1c9e18cbb84a17064168bc5c Author: Jesse Brandeburg e1000: fix unmap bug commit c38da5692e3a4d5d303c04cbf7e526f1eb761076 Author: Rusty Russell x86: cpumask: x86 mmio-mod.c use cpumask_var_t for downed_cpus commit 89bd55d1855f8e9a4e9add8e93f3144d049c469e Author: Rusty Russell x86: cpumask: update 32-bit APM not to mug current->cpus_allowed commit 4bae1967357bfc78a2fad1be5e81a4b868980ae6 Author: Ingo Molnar x86: microcode: cleanup commit af5c820a3169e81af869c113e18ec7588836cd50 Author: Rusty Russell x86: cpumask: use work_on_cpu in arch/x86/kernel/microcode_core.c commit 0fb1d9bcbcf701a45835aa150c57ca54ea685bfa Author: Martin Schwidefsky [S390] make page table upgrade work again commit f481bfafd36e621d6cbc62d4b25f74811410aef7 Author: Martin Schwidefsky [S390] make page table walking more robust commit 2887fc5aa60803b9d6d38c79248805f08d8b0e28 Author: Gerald Schaefer [S390] Dont check for pfn_valid() in uaccess_pt.c commit cf087343805ebfea2b1234b06fd5f12273e865b1 Author: Heiko Carstens [S390] ftrace/mcount: fix kernel stack backchain commit f55d63854e426e95d7858c2662c2353262a5af70 Author: Heiko Carstens [S390] topology: define SD_MC_INIT to fix performance regression commit 4fa81ed27781a12f6303b9263056635ae74e3e21 Author: Martin Schwidefsky [S390] __div64_31 broken for CONFIG_MARCH_G5 commit cde5edbda8ba7d600154ce4171125a48e4d2a21b Author: Jaswinder Singh Rajput x86: kprobes.c fix compilation warning commit 5355f757b33eb85551cfac2824b88ee7ab7d9a9d Author: Ingo Molnar Revert "Revert "kprobes: check CONFIG_FREEZER instead of CONFIG_PM"" commit 4e16c888754468a58d4829c2eba2c6aa3a065e2b Author: Jaswinder Singh Rajput x86: cpu/mttr/cleanup.c fix compilation warning commit 465499895e41ee15ebc75fe90dfe7b595e9b46d5 Author: Peter Zijlstra lockdep: add stack dumps to asserts commit f02b8624fedca39886b0eef770dca70c2f0749b3 Author: Ananth N Mavinakayanahalli kprobes: Fix locking imbalance in kretprobes commit 84be58d4601c86306cd939ebf58a9b90989883a4 Author: Ingo Molnar dma-debug: fix dma_debug_add_bus() definition for !CONFIG_DMA_API_DEBUG commit 490362003457f8d387f6f6e73e3a7efbf56c3314 Author: Frederic Weisbecker tracing/ftrace: stop {irqs, preempt}soff tracers when tracing is stopped commit a635cf0497342978d417cae19d4a4823932977ff Author: Carsten Emde tracing: fix command line to pid reverse map commit 50d88758a3f9787cbdbdbc030560b815721eab4b Author: Thomas Gleixner tracing: fix trace_find_cmdline() commit 2c7eea4c62ba090b7f4583c3d7337ea0019be900 Author: Thomas Gleixner tracing: replace the crude (unsigned) -1 hackery commit 18aecd362a1c991fbf5f7919ae051a77532ba2f8 Author: Thomas Gleixner tracing: stop command line recording when tracing is disabled commit af66df5ecf9c9e2d2ff86e8203510c1c4519d64c Author: Luis Henriques sched: jiffies not printed per CPU commit 2c74d66624ddbda8101d54d1e184cf9229b378bc Author: Rusty Russell x86, uv: fix cpumask iterator in uv_bau_init() commit 30e1e6d1af2b67558bccf322af2b3e0676b209ae Author: Rusty Russell cpumask: fix CONFIG_CPUMASK_OFFSTACK=y cpu hotunplug crash commit ce4e240c279a31096f74afa6584a62d64a1ba8c8 Author: Suresh Siddha x86: add x2apic_wrmsr_fence() to x2apic flush tlb paths commit 28909c2d050074dd503b52f649d879c579f3b6fa Author: Ingo Molnar perfcounters: fix crash on perfmon v1 systems commit 6af845e4eb36fb91b322aaf77ec1cab2220a48ad Author: Takashi Iwai ALSA: Fix vunmap and free order in snd_free_sgbuf_pages() commit 82f5d57163abed2e5ff271d03217b6f90c616eb8 Author: Jiri Slaby ALSA: mixart, fix lock imbalance commit 91054598f794fb5d8a0b1e747ff8e2e8fc2115b3 Author: Jiri Slaby ALSA: pcm_oss, fix locking typo commit 36c7b833e5d2501142a371e4e75281d3a29fbd6b Author: Viral Mehta ALSA: oss-mixer - Fixes recording gain control commit c673ba1c23941173c16ff24c7cb34199e826c8b5 Author: Takashi Iwai ALSA: hda - Workaround for buggy DMA position on ATI controllers commit 09240cf429505891d6123ce14a29f58f2a60121e Author: Takashi Iwai ALSA: hda - Fix DMA mask for ATI controllers commit a6b6a14e0c60561f2902b078bd28d0e61defad70 Author: Andrew Morton x86: use smp_call_function_single() in arch/x86/kernel/cpu/mcheck/mce_amd_64.c commit 62524d55e5b9ffe36e3bf3dd7a594114f150b449 Author: Steven Rostedt tracing: make power tracer start/stop methods lighter weight commit 5fec6ddcb43a91aa9a254c8ecf174c803de6f07e Author: Steven Rostedt tracing: make sched_switch stop/start light weight commit 97e7e4f391cac2b00417b581b432533d245d4fd0 Author: Witold Baryluk tracing: optimization of branch tracer commit af4617bdba34aa556272b34c3986b0a4d588f568 Author: Steven Rostedt tracing: add global-clock option to provide cross CPU clock to traces commit 37886f6a9f62d22530ffee8d3f9215c8345b6969 Author: Steven Rostedt ring-buffer: add api to allow a tracer to change clock source commit 9aac397525dc7945b1582a80cef5860516bca452 Author: Geoff Levand powerpc/ps3: ps3_defconfig updates commit fa4b57cc045d6134b9862b2873f9c8ba9ed53ffe Author: Suresh Siddha x86, dmar: use atomic allocations for QI and Intr-remapping init commit 68a8ca593fac82e336a792226272455901fa83df Author: Suresh Siddha x86: fix broken irq migration logic while cleaning up multiple vectors commit 6e2b75740bed35df98b8113300579e13ed2ce848 Author: Masami Hiramatsu module: fix refptr allocation and release order commit 05c3dc2c4b60387769cbe73174347de4cf85f0c9 Author: Suresh Siddha x86, ioapic: Fix non atomic allocation with interrupts disabled commit 29b61be65a33c95564fa82e7e8d60d97adb68ea8 Author: Suresh Siddha x86, x2apic: cleanup ifdef CONFIG_INTR_REMAP in io_apic code commit 0280f7c416c652a2fd95d166f52b199ae61122c0 Author: Suresh Siddha x86, x2apic: cleanup the IO-APIC level migration with interrupt-remapping commit cf6567fe40c55e9cffca7355cd34e50fb2871e4e Author: Suresh Siddha x86, x2apic: fix clear_local_APIC() in the presence of x2apic commit 7c6d9f9785d156d0438401ef270322da3d5247db Author: Suresh Siddha x86, x2apic: use virtual wire A mode in disable_IO_APIC() with interrupt-remapping commit 2e93456f5c069cf889c0c3acd1246ee88c49ae5c Author: Suresh Siddha x86, intr-remapping: fix free_irte() to clear all the IRTE entries commit 1531a6a6b81a4e6f9eec9a5608758a6ea14b96e0 Author: Suresh Siddha x86, dmar: start with sane state while enabling dma and interrupt-remapping commit eba67e5da6e971993b2899d2cdf459ce77d3dbc5 Author: Suresh Siddha x86, dmar: routines for disabling queued invalidation and intr remapping commit 9d783ba042771284fb4ee5013c3d94220755ae7f Author: Suresh Siddha x86, x2apic: enable fault handling for intr-remapping commit 0ac2491f57af5644f88383d28809760902d6f4d7 Author: Suresh Siddha x86, dmar: move page fault handling code to dmar.c commit 4c5502b1c5744b2090414e1b80ca6388d5c46e06 Author: Suresh Siddha x86, x2apic: fix lock ordering during IRQ migration commit be721696cac9d66566d59b205ee573ecb2f7c35b Author: H. Peter Anvin x86, setup: move 32-bit code to .text32 commit 0a699af8e613a670be50245366fa18cb19ac5172 Author: H. Peter Anvin x86-32: move _end to a dummy section commit 8a0845c51b2e300f5204a323b874f7f58ea0eff7 Author: Thomas Bartosik USB: storage: Unusual USB device Prolific 2507 variation added commit e7f2f0d77a7b483a26054f29ba8393831b25a8a4 Author: Achilleas Kotsis USB: Add device id for Option GTM380 to option driver commit 56a21827439a4d715b510bfaf488534e6f4ad2f8 Author: Dirk Hohndel USB: Add Vendor/Product ID for new CDMA U727 to option driver commit 716a9c8561d9c50ec454f4fbd39a265892feda2c Author: Moritz Muehlenhoff USB: Updated unusual-devs entry for USB mass storage on Nokia 6233 commit 0cc6bfe901b946df125d8e37186d8e45f876457d Author: Dan Williams USB: Option: let cdc-acm handle Sony Ericsson F3507g / Dell 5530 commit 391016f6e2fe3b9979b4c6880a76e5e434d6947c Author: Alan Stern USB: EHCI: expedite unlinks when the root hub is suspended commit 508db8c954d55ed30f870d2c24d741ba6269d13c Author: Karsten Wiese USB: EHCI: Fix isochronous URB leak commit 9ea19b82f3126da4e47d6b94563a3c2cd586f6e2 Author: Albert Pauw USB: option.c: add ZTE 622 modem device commit 49fa09215c03116449184057f062c6aea2f1d0b4 Author: Jiri Slaby USB: wusbcore/wa-xfer, fix lock imbalance commit a08b43aee46ed4272ad7bee2c785edcf313339b3 Author: Jiri Slaby USB: misc/vstusb, fix lock imbalance commit 46c9844c4014be53c67622dcd3ba4302f36e9cac Author: Jiri Slaby USB: misc/adutux, fix lock imbalance commit 909b6c3fc20ea772dc63a03986d74148fcbb1a1d Author: Jiri Slaby USB: image/mdc800, fix lock imbalance commit eeafa64b7a4134da24d48ed944e48541f8171152 Author: Jiri Slaby USB: atm/cxacru, fix lock imbalance commit c497e715f93d148d751c055401568684eea0bf6b Author: Jan Dumon USB: unusual_devs: Add support for GI 0431 SD-Card interface commit c6535668798b0644e1af5934c2aec0e912280449 Author: Robert M. Kenney USB: serial: new cp2101 device id commit b0d659002168146ec6b03d1ef062d8dcf05ff510 Author: Michael Hennerich USB: serial: ftdi: enable UART detection on gnICE JTAG adaptors blacklist interface0 commit 7f82b6dd7015aabca2fd55fb690248f742cd67f3 Author: Axel Wachtler USB: serial: add FTDI USB/Serial converter devices commit 6ff10464096540e14d7575a72c50d0316d003714 Author: Alan Stern USB: usbfs: keep async URBs until the device file is closed commit 228dd05dbfdd0fced8ab1a28ed73b500ba6bb0a6 Author: Greg Kroah-Hartman USB: usbtmc: add protocol 1 support commit 5b10916ea0a62920204517e1c4ce14560b4f96ab Author: Greg Kroah-Hartman USB: usbtmc: fix stupid bug in open() commit 704439ddf9f8ff1fc8c6d8abaac4bc4c95697e39 Author: Jeremy Fitzhardinge x86/brk: put the brk reservations in their own section commit 0b1c723d0bd199300a1a2de57a46000d17577498 Author: Jeremy Fitzhardinge x86/brk: make the brk reservation symbols inaccessible from C commit 76a67ec6fb79ff3570dcb5342142c16098299911 Author: J. Bruce Fields nfsd: nfsd should drop CAP_MKNOD for non-root commit 84f09f46b4ee9e4e9b6381f8af31817516d2091b Author: Benny Halevy NFSD: provide encode routine for OP_OPENATTR commit 60ac98213914cc615c67e84bfb964aa95a080d13 Author: H. Peter Anvin x86-32: tighten the bound on additional memory to map commit b8a22a6273d5aed248db2695ce9bf65eb3e9fbe6 Author: Jeremy Fitzhardinge x86-32: remove ALLOCATOR_SLOP from head_32.S commit c090f532db3ab5b7be503f8ac84b0d33a18646c6 Author: Jeremy Fitzhardinge x86-32: make sure we map enough to fit linear map pagetables commit ee568b25ee9e160b32d1aef73d8b2ee9c05d34db Author: Linus Torvalds Avoid 64-bit "switch()" statements on 32-bit architectures commit 30390880debce4a68fd23e87a787f27609e4bf4a Author: Masami Hiramatsu prevent boosting kprobes on exception address commit 8d8cb0f2734f2554092f527ed479af2d97b56b37 Author: Thomas Gleixner softirq: make wakeup_softirqd static again commit f2d28a2ebcb525a6ec7e2152106ddb385ef52b73 Author: Guillaume Knispel printk: correct the behavior of printk_timed_ratelimit() commit a4bd6a93c3f14691c8a29e53eb04dc734b27f0db Author: Kumar Gala powerpc/mm: Respect _PAGE_COHERENT on classic ppc32 SW commit c9310920e6e7ae0a5c0accbd57d34c194cb31780 Author: Piotr Ziecik powerpc/5200: Enable CPU_FTR_NEED_COHERENT for MPC52xx commit 9e8912e04e612b43897b4b722205408b92f423e5 Author: Linus Torvalds Fast TSC calibration: calculate proper frequency error bounds commit a6a80e1d8cf82b46a69f88e659da02749231eb36 Author: Linus Torvalds Fix potential fast PIT TSC calibration startup glitch commit 86f319529372953e353dc998bc6a761949614903 Author: Joerg Roedel dma-debug/x86: register pci bus for dma-debug leak detection commit 41531c8f5f05aba5ec645d9770557eedbf75b422 Author: Joerg Roedel dma-debug: add a check dma memory leaks commit 2e34bde18576a02c897ae6b699ea26301d92be1b Author: Joerg Roedel dma-debug: add checks for kernel text and rodata commit 6c132d1bcdc716e898b4092bb1abc696505c37e7 Author: David Woodhouse dma-debug: print stacktrace of mapping path on unmap error commit 187f9c3f05373df4f7cbae2e656450acdbba7558 Author: Joerg Roedel dma-debug: Documentation update commit 2118d0c548e8a2205e1a29eb5b89e5f2e9ae2c8b Author: Joerg Roedel dma-debug: x86 architecture bindings commit ac26c18bd35d982d1ba06020a992b1085fefc3e2 Author: David Woodhouse dma-debug: add function to dump dma mappings commit 337fff8b5ed0573ea106491c6de47bd7fe623500 Author: Thomas Gleixner debugobjects: delay free of internal objects commit 1be1cb7b47f0744141ed61cdb25648819ae1a56f Author: Thomas Gleixner debugobjects: replace static objects when slab cache becomes available commit 708dc5125309cd33c5daaad3026cc4ae6ef39c8b Author: Luis Henriques sched: small optimisation of can_migrate_task() commit 80dd99b368cf6501be88ab517bbbb5bf352b75b8 Author: Luis Henriques sched: fix typos in documentation commit f0348c438c9ea156194d31fadde4a9e75522196f Author: Yinghai Lu x86: MTRR workaround for system with stange var MTRRs commit dde332b660cf0bc2baaba678b52768a0fb6e6da2 Author: Krzysztof Helt ALSA: opl3sa2 - Fix NULL dereference when suspending snd_opl3sa2 commit c269fc8c537d761f36cb98e637ae934d9331a9d5 Author: Tom Zanussi tracing: fix leak in event_format_read() commit 6adaad14d7d4d3ef31b4e2dc992b18b5da7c4eb3 Author: Steven Rostedt tracing: stop comm recording on tracing off commit 4ca530852346be239b7c19e7bec5d2b78855bebe Author: Steven Rostedt tracing: protect reader of cmdline output commit d33a1976fbee1ee321d6f014333d8f03a39d526c Author: Eric Sandeen ext4: fix bb_prealloc_list corruption due to wrong group locking commit 03303549b1695dc024d4a653cc16bd79f78f9750 Author: Frederic Weisbecker tracing/ftrace: fix the check on nopped sites commit 42854dc0a6320ff36722749acafa0697522d9556 Author: Jeremy Fitzhardinge x86, paravirt: prevent gcc from generating the wrong addressing mode commit 7a2cf4af1554d891b440cc3a649d01ed222206c3 Author: Greg Ungerer m68k: merge the non-MMU and MMU versions of siginfo.h commit 9df3d51b59bd6aa48aee76e0cde4b89d854f3694 Author: Greg Ungerer m68k: use the MMU version of unistd.h for all m68k platforms commit 8dba99e077ae999c85b41c4567c852313528c7a7 Author: Greg Ungerer m68k: merge the non-MMU and MMU versions of signal.h commit 230d1866a9f9b08c2ab4cb1b60f33fe230ee0a87 Author: Greg Ungerer m68k: merge the non-MMU and MMU versions of ptrace.h commit c5f5d3e6ed4405999d5becaffe18415182fa8eb5 Author: Greg Ungerer m68k: use MMU version of setup.h for both MMU and non-MMU commit b35f8caa0890169000fec22902290d9a15274cbd Author: Milan Broz dm crypt: wait for endio to complete before destruction commit b2174eebd1fadb76454dad09a1dacbc17081e6b0 Author: Huang Ying dm crypt: fix kcryptd_async_done parameter commit d659e6cc98766a1a61d6bdd283f95d149abd7719 Author: Mikulas Patocka dm io: respect BIO_MAX_PAGES limit commit f80a557008462a0a4adef25407f1872e793d8dd5 Author: Mikulas Patocka dm table: rework reference counting fix commit bc0fd67feba2e0770aad85393500ba77c6489f1c Author: Milan Broz dm ioctl: validate name length when renaming commit 8032b526d1a3bd91ad633dd3a3b5fdbc47ad54f1 Author: Rusty Russell linux.conf.au 2009: Tuz commit ee6f779b9e0851e2f7da292a9f58e0095edf615a Author: Zhang Le filp->f_pos not correctly updated in proc_task_readdir commit 250981e6e1ef04947eccaa55e8c25ddcaa47a02e Author: Thomas Gleixner x86: reduce preemption off section in exit thread commit 73cb3e53323f97188dff7f6c2ec9eab19d5fb1ce Author: Paul Mackerras perfcounters: abstract wakeup flag setting in core to fix powerpc build commit a6bc3262c561780d2a6587aa3d5715b1e7d8fa13 Author: Stephen Rothwell sparseirq, powerpc/cell: fix unused variable warning in interrupt.c commit 514ec49a5f5146a6c0ade1a688787acf13617868 Author: Hidetoshi Seto x86, mce: remove incorrect __cpuinit for intel_init_cmci() commit 2fc1dfbe17e7705c55b7a99da995fa565e26f151 Author: Frederic Weisbecker tracing/core: fix early free of cpumasks commit ac1d52d0b85854958c7e78c8006e39aadb6ce4b8 Author: Frederic Weisbecker tracing/ftrace: fix double calls to tracing_start() commit 59f586db98919d7d9c43527b26c8de1cdf9ed912 Author: Frederic Weisbecker tracing/core: fix missing mutex unlock on tracing_set_tracer() commit 0ea1c4156bf9e2eb370cc5c6fa6eb112bd844dec Author: Frederic Weisbecker tracing/syscalls: select kallsysms commit 5be71b61f17b0e3bc8ad0b1a1b7b53ab7d574ebb Author: Frederic Weisbecker tracing/syscalls: protect thread flag toggling from races commit 6404434525bb9f8f2239998f30fd7c93f2efa5b3 Author: Frederic Weisbecker tracing/syscalls: various cleanups commit ac99c58c9e56967037382e31f865b72b10127965 Author: Frederic Weisbecker tracing/syscalls: fix missing release of tracing commit a05ef46731a1953590062e09a92c2c83ed32a086 Author: Greg Ungerer m68k: merge the non-MMU and MMU versions of sigcontext.h commit 9863a0babc2f0d920dfb4ddecf4e5b5342cb986b Author: Greg Ungerer m68k: merge the non-MMU and MMU versions of swab.h commit f9847004bf94ba5457738cb5e0f868821864ff50 Author: Greg Ungerer m68k: merge the non-MMU and MMU versions of param.h commit da511997d2bbc09f5e39385e0ed209578db07c91 Author: Roel Kluin acpi-wmi: unsigned cannot be less than 0 commit b36a50f92d1c4300a88f606b4d2bbdc4f442a2d7 Author: Mathieu Chouquet-Stringer thinkpad-acpi: fix module autoloading for older models commit 54b1ec893e869c815d390afa42aacf1499858112 Author: Carlos Corbacho acer-wmi: Unmark as 'experimental' commit 5fcdd177d063f1d8d569d746ab1bf206b0dfb2e8 Author: Carlos Corbacho acpi-wmi: Unmark as 'experimental' commit 013d67fd4f0da8f6af60a376f1a254266ab658ef Author: Dan Carpenter acer-wmi: double free in acer_rfkill_exit() commit d263da311ab403e3a84fa24920edc826147a550c Author: Corentin Chary platform/x86: depends instead of select for laptop platform drivers commit e73e2c62f7646d54e30ef8863ac0be0b8e4ef0eb Author: Corentin Chary asus-laptop: use select instead of depends on commit 7950b71c3bd7b27b2874088a6c4efe3e13579f8b Author: Corentin Chary eeepc-laptop: restore acpi_generate_proc_event() commit 6050c8dd70b21a9d927983aeb6357fecffa7fb23 Author: Corentin Chary asus-laptop: restore acpi_generate_proc_event() commit 27ce34198345886854643b9572f9a06d2e7500d2 Author: Cyrill Gorcunov acpi: check for pxm_to_node_map overflow commit 176f9c1804df09f3e9b998c0642e212592ac6283 Author: Jiri Slaby ACPI: remove doubled status checking commit 45e7798886af101c4a908a896bbba5a84ee5cc32 Author: Zhang Rui ACPI suspend: Blacklist Toshiba Satellite L300 that requires to set SCI_EN directly on resume commit 7b46ecd5fcebf381a7bde966db352d8fb1b8e944 Author: Len Brown Revert "ACPI: make some IO ports off-limits to AML" commit a140449584522c3eea1bb381f746d40939e6f62a Author: Andy Whitcroft suspend: switch the Asus Pundit P1-AH2 to old ACPI sleep ordering commit ea8dbdd17099a9a5864ebd4c87e01e657b19c7ab Author: françois romieu r8169: revert "r8169: read MAC address from EEPROM on init (2nd attempt)" commit 97d477a914b146e7e6722ded21afa79886ae8ccd Author: françois romieu r8169: use hardware auto-padding. commit b0fe551000179c868d46266278a890eab878baca Author: Ingo Molnar kconfig: improve seed in randconfig commit 184832c981fd38b1052f2dfa0262e793fa6c67d3 Author: Sam Ravnborg kconfig: fix randconfig for choice blocks commit 5bee17f18b595937e6beafeee5197868a3f74a06 Author: Kyle McMartin parisc: sba_iommu: fix build bug when CONFIG_PARISC_AGP=y commit 0920dce7d5889634faa336f65833ee44f3b7651e Author: Akinobu Mita x86, mm: remove unnecessary include file from iomap_32.c commit c61cf4cfe7c73c7aa62dde3ff82cd475b9c41481 Author: Yinghai Lu x86: print out more info in e820_update_range() commit 59a6667adeb794c27195f7dc4c4d115e90631637 Author: Ingo Molnar slob: turn off for now commit c04b033bfe196bb4cac45e46d20d3affbaebf23b Author: Tim Blechmann perf_counter: include missing header commit 6d7942dc2a70a7e74c352107b150265602671588 Author: Yinghai Lu x86: fix 64k corruption-check commit 682337fe062e939578d933c74157ae9a36baa4ce Author: Alexander Duyck igb: remove ASPM L0s workaround commit 2adc544c5cad41a5c5cabf7d4e1d4573b1fc54eb Author: Sam Ravnborg kbuild: fix 'make randconfig' bugs commit b6bca2d9ee55ebfb4b45dc1144afb8dead6e1119 Author: Ingo Molnar kbuild, make randconfig: improve PRNG seed commit bf722c9d324864b4256edaa330751b77f2a19861 Author: Ingo Molnar lockdep: annotate reclaim context (__GFP_NOFS), fix SLOB commit 2bd2753ff46346543ab92e80df9d96366e21baa5 Author: Yinghai Lu x86: put initial_pg_tables into .bss commit 796216a57fe45c04adc35bda1f0782efec78a713 Author: Jeremy Fitzhardinge x86: allow extend_brk users to reserve brk space commit 7543c1de84ed93c6769c9f20dced08a522af8912 Author: Yinghai Lu x86-32: compute initial mapping size more accurately commit 6de6cb442e76bbaf2e685150be8ddac0f237a59c Author: Jeremy Fitzhardinge x86: use brk allocation for DMI commit ccf3fe02e35f4abca2589f99022cc25084bbd8ae Author: Jeremy Fitzhardinge x86-32: use brk segment for allocating initial kernel pagetable commit 5368a2be34b96fda9c05d79424fa63a73ead04ed Author: H. Peter Anvin x86: move brk initialization out of #ifdef CONFIG_BLK_DEV_INITRD commit 93dbda7cbcd70a0bd1a99f39f44a9ccde8ab9040 Author: Jeremy Fitzhardinge x86: add brk allocation for very, very early allocations commit b9719a4d9cfa5d46fa6a1eb3e3fc2238e7981e4d Author: Jeremy Fitzhardinge x86: make section delimiter symbols part of their section commit bfbd442f69ec9c58590ffc6e93ac8d6809caa48b Author: Grant Likely Fix Xilinx SystemACE driver to handle empty CF slot commit 059ea3318c8ede71851a52b4359fbf1ab0cec301 Author: Li Zefan block: fix memory leak in bio_clone() commit 87092698c665e0a358caf9825ae13114343027e8 Author: un'ichi Nomura block: Add gfp_mask parameter to bio_integrity_clone() commit 1d885526f2f3fffacee2ecb541270bd00168adff Author: Daisuke Nishimura vmscan: pgmoved should be cleared after updating recent_rotated commit 84814d642a4f1f294bd675ab11aae1ca54c6cedb Author: Tyler Hicks eCryptfs: don't encrypt file key with filename key commit 15e7b8767605dc0cb9bd4594caabfec392385210 Author: Johannes Weiner nommu: ramfs: don't leak pages when adding to page cache fails commit 020fe22ff14320927f394de222cbb11708bcc7a8 Author: Enrik Berkhan nommu: ramfs: pages allocated to an inode's pagecache may get wrongly discarded commit de9307c68624b03d2922a02a661ce31e20f078cc Author: Dhananjay Phadke netxen: remove old flash check. commit f4c3c4cdb1de232ff37cf4339eb2f36c84e20da6 Author: Jaswinder Singh Rajput x86: cpu_debug add support for various AMD CPUs commit 8d03c7a0c550e7ab24cadcef5e66656bfadec8b9 Author: Eric Sandeen ext4: fix bogus BUG_ONs in in mballoc code commit 48f4c485c275e9550fa1a1191768689cc3ae0037 Author: Sebastian Andrzej Siewior x86/centaur: merge 32 & 64 bit version commit ed681a91ab805341675d166a9592551093c0a2d9 Author: Vegard Nossum vsprintf: unify the format decoding layer for its 3 users, cleanup commit adf26f84a62b492e002d3b75af671f23ddd3be0a Author: Vegard Nossum fix regression from "vsprintf: unify the format decoding layer for its 3 users" commit d4c90e37a21154c1910b2646e9544bdd32d5bc3a Author: Yinghai Lu x86: print the continous part of fixed mtrrs together commit 63516ef6d6a8379ee5c32463efc6a75f9da8a309 Author: Yinghai Lu x86: fix get_mtrr() warning about smp_processor_id() with CONFIG_PREEMPT=y commit 78a8b35bc7abf8b8333d6f625e08c0f7cc1c3742 Author: Yinghai Lu x86: make e820_update_range() handle small range update commit 0f3fa48a7eaf5d1118cfda1650e8c759b2a116e4 Author: Ingo Molnar x86: cpu/common.c more cleanups commit b478b782e110fdb4135caa3062b6d687e989d994 Author: Lai Jiangshan kallsyms, tracing: output more proper symbol name commit 895791dac6946d535991edd11341046f8e85ea77 Author: Pallipadi, Venkatesh VM, x86, PAT: add a new vm flag to track full pfnmap at mmap commit 88200bc28da38bcda1cb1bd218216e83b426d8a8 Author: Jaswinder Singh Rajput x86: entry_32.S fix compile warnings - fix work mask bit width commit 9766cdbcb260389669e9679b2aa87c11832f479f Author: Jaswinder Singh Rajput x86: cpu/common.c cleanups commit 5a89392225c6147d10328a64b06b756561e97edf Author: Lennert Buytenhek mv643xx_eth: fix unicast address filter corruption on mtu change commit a83860c2da9303c864a53c299d17f608f9643541 Author: Ralf Baechle MIPS: Mark Eins: Fix configuration. commit 3b289d6e35a1a535c19a5b079f0500526754e650 Author: Zhang Le MIPS: Fix TIF_32BIT undefined problem when seccomp is disabled commit 08ec9af1c0622b0858099a8644a33af02dd3019f Author: David S. Miller xfrm: Fix xfrm_state_find() wrt. wildcard source address. commit 9616a75505be9b87f9625c4d87d8b07a45ddad4d Author: Benjamin Herrenschmidt emac: Fix clock control for 405EX and 405EXr chips commit e90d400c2b65c7bf038d3646780f4a81f602cd19 Author: Chris Leech ixgbe: fix multiple unicast address support commit 59f8e169e25c5fce91826412c38359ecaf940b82 Author: Dave Jones via-velocity: Fix DMA mapping length errors on transmit. commit 5d82720a7f41f0c877e026c7d17e3bf20ccdbae0 Author: FUJITA Tomonori ide: save the returned value of dma_map_sg commit 3eb76c1ccde496c3c0bfda23d1c803e40b762ce6 Author: Borislav Petkov ide-floppy: do not map dataless cmds to an sg commit e9c1670c2a14ef9cc20d86b24b829f3947aad34e Author: Tejun Heo ata_piix: add workaround for Samsung DB-P70 commit e3e4385f6181f434c0d786998ad1d0eef4e21c9b Author: Stuart MENEFY libata: Keep shadow last_ctl up to date during resets commit 9d51af7bd2f1d730cb6eeeb9ff837e3441ad4e07 Author: Mark Lord sata_mv: fix MSI irq race condition commit 855b0993f216a9b0f9cb33573bd05e314105d86c Author: Ron Mercer qlge: bugfix: Pad outbound frames smaller than 60 bytes. commit 6612a6344aba8ba7b5af67cd006453bfedbb2967 Author: Ron Mercer qlge: bugfix: Move netif_napi_del() to common call point. commit a7a655f22c75f48e0afe8b86be03ecd70bd68b07 Author: Ron Mercer qlge: bugfix: Tell hw to strip vlan header. commit c3c6496dc3d94d87bb0da86cf0bf48764577bf77 Author: Ron Mercer qlge: bugfix: Increase filter on inbound csum. commit 9fae6c3f648e38f023b99b5f5a5280907b2e796e Author: Ilya Yanok dnet: replace obsolete *netif_rx_* functions with *napi_* commit a00d0bb86b20a86a72f4df9d6e31dda94c02b4fa Author: Matthias Schwarzzot V4L/DVB (10978): Report tuning algorith correctly commit 26f26fa8e3a0822aa43ee0a80bd0196fa2554c42 Author: Hans Werner V4L/DVB (10977): STB6100 init fix, the call to stb6100_set_bandwidth needs an argument commit 1d06059c13fc64b67027334507f734ec0f2f4b6c Author: Igor M. Liplianin V4L/DVB (10976): Bug fix: For legacy applications stv0899 performs search only first time after insmod. commit b5d067b8e331ce78f4a81eb220965ffa36069d3f Author: Manu Abraham V4L/DVB (10975): Bug: Use signed types, Offsets and range can be negative commit d284e4f71dd42826fb60df33846ba310310c6c51 Author: Sigmund Augdal V4L/DVB (10974): Use Diseqc 3/3 mode to send data commit ccd50dfd92ea2c4ba9e39531ac55db53393e783e Author: Ingo Molnar tracing/syscalls: support for syscalls tracing on x86, fix commit a27cdc586523eec54717c8c56ff079b3869770d2 Author: Peter Zijlstra perf_counter: fix hrtimer sampling commit bed1ffca022cc876fb83161d26670e9b5d3cf36b Author: Frederic Weisbecker tracing/syscalls: core infrastructure for syscalls tracing, enhancements commit f58ba100678f421bdcb000a3c71793f432dfab93 Author: Frederic Weisbecker tracing/syscalls: support for syscalls tracing on x86 commit f9a36fa5413f1b2694841c410a6fdb4666e78f16 Author: Thomas Gleixner x86: disable __do_IRQ support commit cb065c06b6cc615a58860d619d7fa7952cd6a18b Author: Thomas Gleixner genirq: deprecate obsolete typedefs and defines commit 0e57aa11abb15b70db53d1f95ae70b3c980ac885 Author: Thomas Gleixner genirq: deprecate __do_IRQ commit 5a62faa871ced0248d301d746be7a4281ff9614d Author: Peter Zijlstra perf_counter: add an event_list commit 8f3afa70c4c92a6bbc40979b7c62d190f153b66c Author: Peter Zijlstra perf_counter: hrtimer based sampling for software time events commit d0533c760d521e645e1508e13ebd48fe077c988b Author: Peter Zijlstra perf_counter: provide major/minor page fault software events commit d7b687bec5ac0d4788d744afe441de1e944e844f Author: Peter Zijlstra perf_counter: provide pagefault software events commit bd753921015e7905bcba8dc1221754a17b4e4cb6 Author: Peter Zijlstra perf_counter: software counter event infrastructure commit bb970a7d38d0fc5c4078c1995c0b64f5a51476b9 Author: Peter Zijlstra perf_counter: x86: use ULL postfix for 64bit constants commit d341b774edeaa5ab7ad298182eec2b3a356a4b7a Author: Peter Zijlstra perf_counter: add comment to barrier commit a2f332582c1ccbbd90b864c2efde042a87626914 Author: Peter Zijlstra perf_counter: use list_move_tail() commit 951eb69a11dc7fe56d13c4f80900d85b7b79aefb Author: Peter Zijlstra perf_counter: x86: fix 32-bit irq_period assumption commit 84648567ee357abd8879257018f38f8b6b35334d Author: Peter Zijlstra hrtimer: fix rq->lock inversion (again) commit 082edb7bf443eb8eda15b482d16ad9dd8137ad24 Author: Rusty Russell numa, cpumask: move numa_node_id default implementation to topology.h commit 0b966252d9e5d95ec2d11e63d7e55b42913aa5b7 Author: Rusty Russell cpumask: convert node_to_cpumask_map[] to cpumask_var_t commit a9d0a1a38352c4fb8946e73b3e42ba4ada29e733 Author: Thomas Gleixner genirq: add doc to struct irqaction commit 4553573277906901f62f73c0432b332c53de5e2c Author: Thomas Gleixner genirq: use kzalloc instead of explicit zero initialization commit bedd30d986a05e32dc3eab874e4b9ed8a38058bb Author: Thomas Gleixner genirq: make irqreturn_t an enum commit c8e2aeef0b8ac9fb8821b8b3734c031579d0b77a Author: Thomas Gleixner genirq: remove redundant if condition commit 3dd3d46b78c22503957230ca5981849b7bb29b9a Author: Thomas Gleixner genirq: remove unused hw_irq_controller typedef commit e690e5337d953a0936a9735424a454ec21bae0a5 Author: Peter Zijlstra sched: remove extra call overhead for schedule() commit e94142a67f8bad494c593f0a07c9fc2fbec98c0e Author: Lai Jiangshan ftrace: remove struct list_head from struct dyn_ftrace commit 850a80cfaa5aec3e626eb3736eff890a80e4fa77 Author: Lai Jiangshan ftrace: use seq_read commit c95dbf27e201587b2a6cf63f8501a0313d9b4801 Author: Ingo Molnar panic: clean up kernel/panic.c commit d1dedb52acd98bd5e13e1ff4c4d045d58bbd16fe Author: Ingo Molnar panic, smp: provide smp_send_stop() wrapper on UP too commit ffd71da4e3f323b7673b061e6f7e0d0c12dc2b49 Author: Ingo Molnar panic: decrease oops_in_progress only after having done the panic commit 641cd4cfcdc71ce01535b31cc4d57d59a1fae1fc Author: Ingo Molnar generic-ipi: eliminate WARN_ON()s during oops/panic commit 88f502fedba82eff252b6420e8b8328e4ae25c67 Author: Ingo Molnar futex: remove the pointer math from double_unlock_hb, fix commit 5a8ac9d28dae5330c70562c7d7785f5104059c17 Author: Américo Wang x86: ptrace, bts: fix an unreachable statement commit fa9d13cf135efbd454453a53b6299976bea245a9 Author: Zhaolei ftrace: don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec commit b00f0b6dc1773b4c8f538503247da050b5ea631b Author: Zhaolei ftrace: avoid double-free of dyn_ftrace commit 3ff42da5048649503e343a32be37b14a6a4e8aaf Author: Andreas Herrmann x86: mtrr: don't modify RdDram/WrDram bits of fixed MTRRs commit e8f208e8f727515bc605f241a5f854b41f77d0ed Author: Kyle McMartin parisc: update defconfigs commit 1b3fa2ce64363c289b3b14723cca7290bf91cfce Author: Frederic Weisbecker tracing/x86: basic implementation of syscall tracing for x86 commit ee08c6eccb7d1295516f7cf420fddf7b14e9146f Author: Frederic Weisbecker tracing/ftrace: syscall tracing infrastructure, basics commit 0cb385e3ff54ee095d9873209f4da764dfb17fec Author: Kyle McMartin parisc: define x->x mmio accessors commit d4995244bd4c02eb7bea3c63aee81a2f2b64910e Author: Kay Sievers parisc: dino: struct device - replace bus_id with dev_name(), dev_set_name() commit 8b6649c575e0d8312f62fe643ae43558892da2e1 Author: Kyle McMartin parisc: convert cpu_check_affinity to new cpumask api commit 9dfe914da83ebc88f85d94b4d30d0e45882766d1 Author: Kyle McMartin parisc: convert (read|write)bwlq to inlines commit 7c4be70e6d07582a111a1b66942c8a1d45528dfb Author: Kyle McMartin parisc: fix use of new cpumask api in irq.c commit 5a8247ca4c6441cafbb852cb1048d1056734a90c Author: Mike Travis parisc: update parisc for new irq_desc commit 763461194817bc39905c7c41d08e8d9548a3916d Author: Grant Grundler parisc: update MAINTAINERS commit 9785d646c10b0707412516ffe56b71b9eb18861f Author: Grant Grundler parisc: fix wrong assumption about bus->self commit c1da90fd099531e9449019dc53a5a02a5eaef2b4 Author: Helge Deller parisc: fix 64bit build commit 2cfeb9a6755d4d7be1026422b6aced48e3bad492 Author: Helge Deller parisc: add braces around arguments in assembler macros commit 7f384ce780c6091968fc848b14f17b45cb849e14 Author: Helge Deller parisc: fix dev_printk() compile warnings for accessing a device struct commit ddd1f6c66dd964c106377f2be37b318794f112f4 Author: Helge Deller parisc: remove unused local out_putf label commit e448372c79c49ef80df23496339ce0915abef76e Author: Helge Deller parisc: fix `struct pt_regs' declared inside parameter list warning commit 24dc029f71c1411c5974a79848d68bb3e34263b9 Author: Helge Deller parisc: fix section mismatch warnings commit bfe4f4f800ccbb499a1120735016a20d3feacd4f Author: James Bottomley parisc: remove klist iterators commit 8980a7baf93e478205e32ec7d6ef3bfb6c0bdfa7 Author: Helge Deller parisc: BUG_ON() cleanup commit f507cd22035fdadd5dbb476dd05e9e7ee21c3b84 Author: Geert Uytterhoeven ps3/block: Replace mtd/ps3vram by block/ps3vram commit 899039e8746bb9a09b6487ddb8ab2275ce9d0256 Author: Steven Rostedt softirq: no need to have SOFTIRQ in softirq name commit 773e673de27297d07d852e7e9bfd1a695cae1da2 Author: Yinghai Lu x86: fix e820_update_range() commit 7f96f93f02b7637491a1637dee12dcdcd40b9802 Author: Steven Rostedt tracing: move binary buffers into per cpu directory commit 73e907de7d5cecef43d9949ab8f4fdca508168c7 Author: Rusty Russell cpumask: remove x86 cpumask_t uses. commit 76ba0ecda0de9accea9a91cb6dbde46782110e1c Author: Rusty Russell cpumask: use cpumask_var_t in uv_flush_tlb_others. commit 5c6cb5e2b1798694c859fd3821a34404355e1030 Author: Rusty Russell cpumask: remove cpumask_t assignment from vector_allocation_domain() commit d680eb8bcd0e43b20067fd2c810d76463db5444e Author: Rusty Russell cpumask: make Xen use the new operators. commit 70ba2b6a70f0077707977e3b107478768492040d Author: Rusty Russell cpumask: clean up summit's send_IPI functions commit 4f0628963c86d2f97b8cb9acc024a7fe288a6a57 Author: Rusty Russell cpumask: use new cpumask functions throughout x86 commit 3f76a183de8ad3aeb7425f3d9685bb6003abd1a5 Author: Rusty Russell x86: unify cpu_callin_mask/cpu_callout_mask/cpu_initialized_mask/cpu_sibling_setup_mask commit 155dd720d06a219ddf5a56b473cb3325441fc879 Author: Rusty Russell cpumask: convert struct cpuinfo_x86's llc_shared_map to cpumask_var_t commit c032ef60d1aa9af33730b7a35bbea751b131adc1 Author: Rusty Russell cpumask: convert node_to_cpumask_map[] to cpumask_var_t commit 71ee73e72228775a076a502b3c92028fa59e2889 Author: Rusty Russell x86: unify 32 and 64-bit node_to_cpumask_map commit b9c4398ed43a7ed023e091610c23ba7412aec2a8 Author: Rusty Russell cpumask: remove x86's node_to_cpumask now everyone uses cpumask_of_node commit b643decad6c80b6886a01a8c2229be6b7951ff7b Author: Rusty Russell x86: arch_send_call_function_ipi_mask commit 996867d0965775dfa62447d0bddb5dc6818a7892 Author: Rusty Russell cpumask: convert arch/x86/kernel/cpu/mcheck/mce_64.c commit 7ad728f98162cb1af06a85b2a5fc422dddd4fb78 Author: Rusty Russell cpumask: x86: convert cpu_sibling_map/cpu_core_map to cpumask_var_t commit fcef8576d8a64fc603e719c97d423f9f6d4e0e8b Author: Rusty Russell cpumask: convert arch/x86/kernel/nmi.c's backtrace_mask to a cpumask_var_t commit bc9b83dd1f66402b870301c3c7117b9c1484abb4 Author: Rusty Russell cpumask: convert c1e_mask in arch/x86/kernel/process.c to cpumask_var_t. commit d3d2e7f24384cccedd29a0582ad4b014ac646abc Author: Rusty Russell cpumask: remove obsolete topology_core_siblings and topology_thread_siblings: x86 commit 23c5c9c66263311de1295b42382e5bc1e7c36c47 Author: Rusty Russell cpumask: remove cpu_coregroup_map: x86 commit cb3d560f36c1e4aa3c26a1d79e9b6e62ab69896c Author: Rusty Russell cpumask: remove the now-obsoleted pcibus_to_cpumask(): x86 commit 101aaca1f32d9923331ddc63a7a72b3a7f934c02 Author: Rusty Russell cpumask: remove dangerous CPU_MASK_ALL_PTR, &CPU_MASK_ALL.: x86 commit a70f730282019f487aa33a84e5ac9a5e89c5abd0 Author: Rusty Russell cpumask: replace node_to_cpumask with cpumask_of_node. commit c69fc56de1df5769f2ec69c915c7ad5afe63804c Author: Rusty Russell cpumask: use topology_core_cpumask/topology_thread_cpumask instead of cpu_core_map/cpu_sibling_map commit 5f77af93266e107bd46c010c51d772c0fb003232 Author: Antti Palosaari V4L/DVB (10972): zl10353: i2c_gate_ctrl bug fix commit bdc067582b8b71c7771bab076bbc51569c594fb4 Author: Steven Rostedt tracing: add comment for use of double __builtin_consant_p commit eb1871f34358024acfa3523ef375ef14b7527173 Author: Steven Rostedt tracing: left align location header in stack_trace commit 7a46c594bf7f1f2eeb1e12d4b857d5f581957a92 Author: Li Zefan cpuacct: reduce one NULL check in fast-path commit 4c6ed8f496fe89ff81b3d6e617a531bedfb613e4 Author: Ingo Molnar Merge branches 'tracing/ftrace' and 'linus' into tracing/core commit 4bb9c5c02153dfc89a6c73a6f32091413805ad7d Author: Pallipadi, Venkatesh VM, x86, PAT: Change is_linear_pfn_mapping to not use vm_pgoff commit 5cc985488845ec7227a2c5cfd2fd62cf57fb411a Author: Steven Rostedt ring-buffer: document reader page design commit 91219bcbdcccc1686b0ecce09e28825c93619c07 Author: Jaswinder Singh Rajput x86: cpu_debug add write support for MSRs commit f28e55765e40450c127e44d00ae65d0cd1a4efec Author: Steven Rostedt tracing: show event name in trace for TRACE_EVENT created events commit 0d890355bff25e1dc03a577a90ed80741489ca54 Author: Yinghai Lu x86: separate mtrr cleanup/mtrr_e820 trim to separate file commit c1ab7e93c6ddf8a068719b97b7e26c3d8eba7c32 Author: Yinghai Lu x86: print out mtrr_range_state when user specify size commit 8ad9790588ee2e69118b2b294ddab6f3f0379ad9 Author: Yinghai Lu x86: more MTRR debug printouts commit 698609bdcd35d0641f4c6622c83680ab1a6d67cb Author: Jan Beulich x86: create a non-zero sized bm_pte only when needed commit 5c0e6f035df983210e4d22213aed624ced502d3d Author: Jan Beulich x86: fix code paths used by update_mptable commit 82034d6f59b4772f4233bbb61c670290803a9960 Author: Jan Beulich x86: clean up output resulting from update_mptable option commit 9a50156a1c7bfa65315facaffdfbed6513fcfd3b Author: Jan Beulich x86: properly __init-annotate recent early_printk additions commit dc9dd5cc854cde110d2421f3a11fec7597e059c1 Author: Jan Beulich x86: move save_mr() into .meminit.text commit 13c6c53282d99c82e79b02477efd2c1e30a991ef Author: Jan Beulich x86, 32-bit: also use cpuinfo_x86's x86_{phys,virt}_bits members commit 46d50c98d90cd7feaa5977a09c574063e5c99b3d Author: Jan Beulich x86, 32-bit: also limit NODES_HIGH_SHIFT here commit dd63fdcc63f0f853b116b52e56200a0e0227cf5f Author: Ingo Molnar x86: unify kmap_atomic_pfn() and iomap_atomic_prot_pfn(), fix commit 7a81d9a7da03d2f27840d659f97ef140d032f609 Author: Jan Beulich x86: smarten /proc/interrupts output commit 889a6c367283709a80dad9413488472596a1a1d2 Author: KOSAKI Motohiro tracing: Don't use tracing_record_cmdline() in workqueue tracer fix commit 39842323ceb368d2ea36ab7696aedbe296e13b61 Author: Jason Baron tracing: tracepoints for softirq entry/exit - tracepoints commit 5d592b44b29a1d73e13d5c9e3426eed843bdc359 Author: Jason Baron tracing: tracepoints for softirq entry/exit - add softirq-to-name array commit e447e1df2e568cd43d1918963c9f09fae85aea57 Author: Steven Rostedt tracing: explain why stack tracer is empty commit 2da03ecee6308ea174e8a02b92a3c4ec92e886c8 Author: Steven Rostedt tracing: fix stack tracer header commit 7975a2be16dd42df2cab80c80cb6ece382edb6ec Author: Steven Rostedt tracing: export trace formats to user space commit e9fb2b6d5845e24f104713591286b6f39761c027 Author: Steven Rostedt tracing: have event_trace_printk use static tracer commit 828275574e0161bdddb5817d4bd76a0265ef0470 Author: Steven Rostedt tracing: make bprint event use the proper event id commit 48ead02030f849d011259244bb4ea9b985479006 Author: Frederic Weisbecker tracing/core: bring back raw trace_printk for dynamic formats strings commit db526ca329f855510e8ce672332eba3304aed590 Author: Steven Rostedt tracing: show that buffer size is not expanded commit 8aabee573dff131a085c63de7667eacd94ba4ccb Author: Steven Rostedt ring-buffer: remove unneeded get_online_cpus commit 59222efe2d184956464abe5b637bc842ff053b93 Author: Steven Rostedt ring-buffer: use CONFIG_HOTPLUG_CPU not CONFIG_HOTPLUG commit 1027fcb206a0fb8348e63aff078c74bdee1c2698 Author: Steven Rostedt tracing: protect ring_buffer_expanded with trace_types_lock commit a123c52b46a1f84bcec3dc963351896c6d6afaf7 Author: Steven Rostedt tracing: fix comments about trace buffer resizing commit d820ac4c2fa881079e6b689d2098adce337558ae Author: Ingo Molnar locking: rename trace_softirq_[enter|exit] => lockdep_softirq_[enter|exit] commit 3d7bdf7880ea243f25cddd847ca65475ed627e5f Author: Darren Hart futex: unlock before returning -EFAULT commit 638f9d766fa5b59953f8d1870f18fbd0cca84d33 Author: Darren Hart futex: additional (get|put)_futex_key() fixes commit f061d35150003b7fd5b133d14d66a74500fdaa60 Author: Darren Hart futex: remove the pointer math from double_unlock_hb commit 712e53e46a1da35fcd88c05aa0c675b10f7c0e9d Author: Tao Ma ocfs2: Use xs->bucket to set xattr value outside commit 74e77eb30d0ecbb12964d005b439c8b84a505b84 Author: Tao Ma ocfs2: Fix a bug found by sparse check. commit d9ae49d6e2b1ac9166e58ae3c9345135604beaa6 Author: Tiger Yang ocfs2: tweak to get the maximum inline data size with xattr commit 6c9fd1dc0a597e575617a7de7086c8a3efa8f524 Author: Tiger Yang ocfs2: reserve xattr block for new directory with inline data commit 1522ac3ec95ff0230e7aa516f86b674fdf72866c Author: Russell King [ARM] Fix virtual to physical translation macro corner cases commit 305b07680f6c6a7e59f996c5bd85f009caff5bb1 Author: Russell King [ARM] update mach-types commit 446c92b2901bedb3725d29b4e73def8aba623ffc Author: Uwe Kleine-König [ARM] 5421/1: ftrace: fix crash due to tracing of __naked functions commit 16a6791934a1077609482dd6c091aa8b4c39a834 Author: H. Peter Anvin x86: use targets in the boot Makefile instead of CLEAN_FILES commit f9c5107c2bcad91dd56d23888653d7bfa1a9696e Author: H. Peter Anvin x86: remove additional vestiges of the zImage/bzImage split commit 9f4c899c0d90e1b51b6864834f3877b47c161a0e Author: Trond Myklebust NFS: Fix the fix to Bugzilla #11061, when IPv6 isn't defined... commit 2842c3b5449f31470b61db716f1926b594fb6156 Author: Theodore Ts'o ext4: Print the find_group_flex() warning only once commit eb53b4e8fef10ccccb49a6dbb5e19ca84ba5a305 Author: Magnus Damm irq: export remove_irq() and setup_irq() symbols commit cbf94f06824780183e4bba165c7c29d5c7bd9a51 Author: Magnus Damm irq: match remove_irq() args with setup_irq() commit f21cfb258df6dd3ea0b3e56d75c7e994edb81b35 Author: Magnus Damm irq: add remove_irq() for freeing of setup_irq() irqs commit 02dde8b45c5460794b9052d7c12939fe3eb63c2c Author: Jan Beulich x86: move various CPU initialization objects into .cpuinit.rodata commit 821508d4ef7920283b960057903505fed609fd16 Author: Jan Beulich x86: move a few device initialization objects into .devinit.rodata commit 6a5c05f002c3e4f24887a5fe8e7df757d339d368 Author: Jan Beulich x86: fix HYPERVISOR_update_descriptor() commit f3b6eaf0149186ad0637512ec363582c91e06ee6 Author: Ingo Molnar x86: memcpy, clean up commit dd1ef4ec4721ddc0a1f2b73a4f67930cb320665c Author: Jan Beulich x86-64: remove unnecessary spill/reload of rbx from memcpy commit c2810188c1b810c68139608a207befae0a4f1e69 Author: Jan Beulich x86-64: move save_paranoid into .kprobes.text commit 9fa7266c2f0cdfcb09eacba2d3624bec7df78641 Author: Jan Beulich x86: remove leftover unwind annotations commit e4dc5b7a36a49eff97050894cf1b3a9a02523717 Author: Darren Hart futex: clean up fault logic commit e8f6386c01a5699c115bdad10271a24076364c97 Author: Darren Hart futex: unlock before returning -EFAULT commit 16f4993f4e9860715918efd4eeac928f8de1218b Author: Darren Hart futex: use current->time_slack_ns for rt tasks too commit 5eb3dc62fc5986e85715041c23dcf3832812be4b Author: Darren Hart futex: add double_unlock_hb() commit de87fcc124a5d4a171aa32707b3265608ebda6e7 Author: Darren Hart futex: additional (get|put)_futex_key() fixes commit b2d0994b1301fc3a6a89e1889578dac9227840e3 Author: Darren Hart futex: update futex commentary commit 6b7c5b947c671a96e39f9526a5fd70c178b8dfd1 Author: Sathya Perla net: Add be2net driver. commit 2c5849ea38fdad477d72dcf1c8c4842db4b33aae Author: David S. Miller dnet: Fix warnings on 64-bit. commit 4796417417a62e2ae83d92cb92e1ecf9ec67b5f5 Author: Ilya Yanok dnet: Dave DNET ethernet controller driver (updated) commit 554f786e284a6ce859d51f62240d615603944c8e Author: Steven Rostedt ring-buffer: only allocate buffers for online cpus commit 9aba60fe6eb20453de53a572143bef22fa929fba Author: Steven Rostedt tracing: fix trace_wait to know to wait on all cpus or just one commit 1852fcce181faa237c010a3dbedb473cf9d4555f Author: Steven Rostedt tracing: expand the ring buffers when an event is activated commit 73c5162aa362a543793f4a957c6c536dcbaa89ce Author: Steven Rostedt tracing: keep ring buffer to minimum size till used commit afcfe024aebd74b0984a41af9a34e009cf5badaf Author: Stuart Bennett x86: mmiotrace: quieten spurious warning message commit 01d37c428ae080563c0a3bb8bdfa88c65a6891d3 Author: Trond Myklebust SUNRPC: xprt_connect() don't abort the task if the transport isn't bound commit fba91afbec2c004e2c8733ae9e0ca6998e962c64 Author: Trond Myklebust SUNRPC: Fix an Oops due to socket not set up yet... commit 5e47c478b0b69bc9bc3ba544e4b1ca3268f98fef Author: H. Peter Anvin x86: remove zImage support commit ff8cf9a93800e8118ea097c1aba7203d59a0f3f1 Author: John Dykstra ipv6: Fix BUG when disabled ipv6 module is unloaded commit 12074fa1073013dd11f1cff41db018d5cff4ecd9 Author: Akinobu Mita x86: debug check for kmap_atomic_pfn and iomap_atomic_prot_pfn() commit bb6d59ca927d855ffac567b35c0a790c67016103 Author: Akinobu Mita x86: unify kmap_atomic_pfn() and iomap_atomic_prot_pfn() commit 8229d754383e8cd905c38b56bd7365c7fc10dfc1 Author: Jaswinder Singh Rajput x86: cpu architecture debug code, build fix, cleanup commit bb7f5f6c26d0a304fb3af92591a1dddd39b6ac61 Author: Cyrill Gorcunov x86: shrink __ALIGN and __ALIGN_STR definitions commit df1c99d416500da8d26a4d78777467c53ee7689e Author: Mike Galbraith sched: add avg_overlap decay commit bf5172d07ac38e538e01143289e9b46076494ad5 Author: Thomas Gleixner x86: convert obsolete irq_desc_t typedef to struct irq_desc commit 60db56422043aaa455ac7f858ce23c273220f9d9 Author: Tejun Heo percpu: fix spurious alignment WARN in legacy SMP percpu allocator commit 5490fa96735ce0e2af270c0868987d644b9a38ec Author: KOSAKI Motohiro x86, mce: use round_jiffies() instead round_jiffies_relative() commit fee7b0d84cc8c7bc5dc212901c79e93eaf83a5b5 Author: Huang Ying x86, kexec: x86_64: add kexec jump support for x86_64 commit 5359454701ce51a4626b1ef6eb7b16ec35bd458d Author: Huang Ying x86, kexec: x86_64: add identity map for pages at image->start commit fef3a7a17418814733ebde0b40d8e32747677c8f Author: Huang Ying x86, kexec: fix kexec x86 coding style commit d7371c41b0cda782256b1df759df4e8d4724584c Author: Ian Dall Bug 11061, NFS mounts dropped commit a71ee337b31271e701f689d544b6153b75609bc5 Author: Suresh Jayaraman NFS: Handle -ESTALE error in access() commit 57df675c60c5cf0748ddba9c7f85afde1530d74d Author: Chuck Lever NLM: Fix GRANT callback address comparison when IPv6 is enabled commit 78851e1aa4c3b796d5f0bb11b445016726302b44 Author: Chuck Lever NLM: Shrink the IPv4-only version of nlm_cmp_addr() commit ae46141ff08f1965b17c531b571953c39ce8b9e2 Author: Trond Myklebust NFSv3: Fix posix ACL code commit ef95d31e6de6be9602ce950b85fb7ab8af46ae42 Author: Trond Myklebust NFS: Fix misparsing of nfsv4 fs_locations attribute (take 2) commit eb9b55ab4d73280597fd183b367d50452f4d7846 Author: Trond Myklebust SUNRPC: Tighten up the task locking rules in __rpc_execute() commit 395a87bfefbc400011417e9eaae33169f9f036c0 Author: Eric Sandeen ext4: fix header check in ext4_ext_search_right() for deep extent trees. commit 96fe2ab830d7dffee1b3d8abf27ced4d7d5765e7 Author: Johannes Weiner HID: fix waitqueue usage in hiddev commit 48e7a3c95c9f98c2cb6f894820e3cc2d0448e92f Author: Johannes Weiner HID: fix incorrect free in hiddev commit 80370cb758e7ca2692cd9fb5e413d970b1f4b2b2 Author: Steven Rostedt tracing: use raw spinlocks for trace_vprintk commit 6cc3c6e12bb039047974ad2e7e2d46d15a1b762f Author: Peter Zijlstra trace_clock: fix preemption bug commit ef18012b248b47ec9a12c3a83ca5e99782d39c5d Author: Steven Rostedt tracing: remove funky whitespace in the trace code commit f24ade3a3332811a512ed3b6c6aa69486719b1d8 Author: Ingo Molnar x86, sched_clock(): mark variables read-mostly commit 9b779edf4b97798d037bb44fca2719ac184d0f14 Author: Jaswinder Singh Rajput x86: cpu architecture debug code commit 913d952eb573c3d1f7487e83b5590e13e7cae2bd Author: Chris Mason Btrfs: Clear space_info full when adding new devices commit 0e3d0f0566f3fcf664782f597070bbc669d78454 Author: Steven Rostedt tracing: update comments to match event code macros commit 823f9124fb2e33eeb624d139978a52089f8a02ae Author: Steven Rostedt tracing: document TRACE_EVENT macro in tracepoint.h commit 30a8fecc2d34f086df34fe2f2b926f080e002600 Author: Steven Rostedt tracing: flip the TP_printk and TP_fast_assign in the TRACE_EVENT macro commit 4184ea7f908d95f329febc3665cf66da8568b467 Author: Chris Mason Btrfs: Fix locking around adding new space_info commit 2314c4ae1461c9e8b26cf8b9a851f280bc5769e1 Author: Steven Rostedt tracing: add back the available_events file commit 57310a98a354e84279d7c8af2f48805a62372e53 Author: Peter Zijlstra sched: optimize ttwu vs group scheduling commit 40e26815fafd3b8c4aced17b1f22e68ef33eb8db Author: Steven Rostedt tracing: do not allow modifying the ftrace events via the event files commit 7cf49427042400d40bdc80b5c3399b6b5945afa8 Author: Masami Hiramatsu x86: expand irq-off region in text_poke() commit 5fa0ae19822d60307059ee64b80ba9e5effdce58 Author: Andrew Vasquez [SCSI] qla2xxx: Update version number to 8.03.00-k4. commit ca42f2b5f58702e5751e1423bd2f7987b0760eab Author: Andrew Vasquez [SCSI] qla2xxx: Correct overwrite of pre-assigned init-control-block structure size. commit c6b2fca8205dc33e3bb444835769e4ea4c6bc58d Author: Andrew Vasquez [SCSI] qla2xxx: Correct truncation in return-code status checking. commit ee546b6e048586381462ce7bb51c7ddc03819619 Author: Anirban Chakraborty [SCSI] qla2xxx: Correct vport delete bug. commit 605aa2bcd5e9dddc4666f12e0c19822809186d6d Author: Lalit Chandivade [SCSI] qla2xxx: Use correct value for max vport in LOOP topology. commit 6431c5dc5eeaa79863b4af300c081a01e2ccd0bb Author: Andrew Vasquez [SCSI] qla2xxx: Correct address range checking for option-rom updates. commit ce8eb2bf05042452107e489782105d2e235cbdd0 Author: Steven Rostedt tracing: fix printk format specifier commit 4469c195da43bf8220f53da8b576c0e154c2b662 Author: Robert Love [SCSI] fcoe: Change fcoe receive thread nice value from 19 (lowest priority) to -20 commit 55c8bafba549e3e82f6999db8c5a62fc3c255c14 Author: Chris Leech [SCSI] fcoe: fix handling of pending queue, prevent out of order frames (v3) commit c826a3145736e3baabebccfd0aecfbb6dae059f2 Author: Vasu Dev [SCSI] fcoe: Out of order tx frames was causing several check condition SCSI status commit e904158159e9812d06646767b7c81846dc3b05e6 Author: Roel Kluin [SCSI] fcoe: fix kfree(skb) commit 74846bf85e42b4ba851d3f0dd67aa1df245895f9 Author: Yi Zou [SCSI] fcoe: ETH_P_8021Q is already in if_ether and fcoe is not using it anyway commit 422819cfa3a2605a0b3bdc33aaef0bc2feaeaada Author: Yi Zou [SCSI] libfc: do not change the fh_rx_id of a recevied frame commit 03ec862dff57ca3d1fcb439b99aadc45bc5c2f28 Author: Robert Love [SCSI] fcoe: Correct fcoe_transports initialization vs. registration commit a468f328ad83f14556e5961ef1de80b32b428d32 Author: Robert Love [SCSI] fcoe: Use setup_timer() and mod_timer() commit fc47ff6b1b27fb736f255ed8cd490356e0cd228f Author: Robert Love [SCSI] libfc, fcoe: Remove unnecessary cast by removing inline wrapper commit b2ab99c9a300e572105d6db7f6efe0a4d1572167 Author: Robert Love [SCSI] libfc, fcoe: Cleanup function formatting and minor typos commit 34f42a070fc98f5dc07e9fa2338b7b8d1dc347eb Author: Robert Love [SCSI] libfc, fcoe: Fix kerneldoc comments commit bbb76b552a9cef86777181c8577acc907b122b41 Author: Américo Wang ptrace: remove a useless goto commit 39e874f8afbdb3745e2406ce4ecbde9ac4cbaa78 Author: Frederic Weisbecker vsprintf: fix bug in negative value printing commit db434ac6bff0d991d0b60166dc9d6405b873d0f7 Author: Eilon Greenstein bnx2x: Using DMAE to initialize the chip commit 6dc7d8c843024c2636cf52d3f93047acbcd765f2 Author: Eilon Greenstein bnx2x: Casting page alignment commit 916c775ff297dc60219a4f0e5527ba6ab4a88ed4 Author: Eilon Greenstein bnx2x: Adding restriction on sge_buf_size commit bbcd3063597a3824357cd83c501c2a2aa21ef37b Author: KOSAKI Motohiro tracing: Don't assume possible cpu list have continuous numbers commit 631595fbf4aeac260e664a8a002897e4db6a50dd Author: KOSAKI Motohiro doc: add trace_buf_size description to kernel-parameters.txt commit 8c5dfd25519bf302ba43daa59976c4d675a594a7 Author: Stoyan Gaydarov x86: BUG to BUG_ON changes commit 66c3a75772247c31feabefb724e082220a1ab060 Author: Tejun Heo percpu: generalize embedding first chunk setup helper commit 6074d5b0a319fe8400ff079a3c289406ca024321 Author: Tejun Heo percpu: more flexibility for @dyn_size of pcpu_setup_first_chunk() commit e01009833e22dc87075d770554b34d797843ed23 Author: Tejun Heo percpu: make x86 addr <-> pcpu ptr conversion macros generic commit 19390c4d03688b9940a1836f06b76ec622b9cd6f Author: Tejun Heo linker script: define __per_cpu_load on all SMP capable archs commit 157587d7ac555458da9f682e3250135e468470a6 Author: Steven Rostedt tracing: remove obsolete TRACE_EVENT_FORMAT macro commit d6e2ca4c05be6a5ab16030a9f227301bd6acc9f0 Author: Steven Rostedt tracing: convert irq trace points to new macros commit 12b5fdb8bbb2d2fc31746d7b672c12fd8897aa08 Author: Steven Rostedt tracing: convert the sched trace points to the TRACE_EVENT macros commit da4d03020c2af32f73e8bfbab0a66620d85bb9bb Author: Steven Rostedt tracing: new format for specialized trace points commit 9cc26a261d43e5898287a1f5808132f8f05ceb1c Author: Steven Rostedt tracing: use generic __stringify commit 2939b0469d04ba9ac791aca9a81625d7eb50662b Author: Steven Rostedt tracing: replace TP with TP_ commit 156b5f172a64103bcb13b6d26288388b9019caa3 Author: Steven Rostedt tracing: typecast sizeof and offsetof to unsigned int commit 49a39551990e7d10f65a41138dd5e5613616343e Author: Ingo Molnar Revert "qa: disable jffs2 for now" commit c3ffc7a40b7e94b094efe1c8ab4e24370a782b65 Author: KOSAKI Motohiro tracing: Don't use tracing_record_cmdline() in workqueue tracer commit 7bffc23e56e92c14b787bf4d95249a32085bfed5 Author: Ingo Molnar tracing: optimize trace_printk() commit 8a20d84d09ab5d121f989cd99e4fc5f4b49f98ba Author: Ingo Molnar tracing: trace_printk() fix, move format array to data section commit 0feca851c1b3cb4ebfa3149144b3d5de0879ebaa Author: Jeremy Fitzhardinge x86-32: make sure virt_addr_valid() returns false for fixmap addresses commit 4c76c04421dfe7be3e5a1d8ab1b2a3be0b02558e Author: Yinghai Lu x86: introduce bootmem_state commit e954ef20c29b7af07a8cb5452f14fb69e3d9d2b2 Author: Yinghai Lu x86: fix warning about nodeid commit 8827247ffcc9e880cbe4705655065cf011265157 Author: Wang Chen x86: don't define __this_fixmap_does_not_exist() commit 888b55dc314d26239d84c3b187dae555a81c1605 Author: KOSAKI Motohiro ftrace: tracing header should put '#' at the beginning of a line commit 26fe8c643f7ca90e3d9ee2bf3c5d3d83cca650ec Author: Paul E. McKenney rcu: documentation 1Q09 update commit 42b40b3d55f5782b00b74d9105c3565fbfa5cb80 Author: KOSAKI Motohiro ftrace: fix documentation typo s/trace_max_latency/tracing_max_latency/ commit e255357764f92afcafafbd4879b222b8c752065a Author: Jaswinder Singh Rajput x86: perf_counter cleanup commit 184fe4ab1f2e4dfa45584889bb3820031648386b Author: Peter Zijlstra x86: perf_counter cleanup commit 1f442d70c84aa798e243e721eba728a98434cd86 Author: Yinghai Lu x86: remove smp_apply_quirks()/smp_checks() commit 3a450de1365d20afde406f0d9b2931a5e4a4fd6a Author: Cliff Wickman x86: UV: remove uv_flush_tlb_others() WARN_ON commit ccea34b5d0fbab081496d1860f31acee99fa8a6d Author: Tejun Heo percpu: finer grained locking to break deadlock and allow atomic free commit 0ae4d4ae47d2ccbcad813b0d6d8fe12590c7d648 Author: Robert Love [SCSI] libfc: Cleanup libfc_function_template comments commit efaf5c085dd2d31757b0ff7886970dfddd8d1808 Author: Robert Love [SCSI] libfc: check for err when recv and state is incorrect commit d3b33327cab0c8e9cae2c12d908ca79433c0d1ac Author: Robert Love [SCSI] libfc: rename rp to rdata in fc_disc_new_target() commit 23f11f9076fcd6ee20c56e413b11f1b5658e3f82 Author: Robert Love [SCSI] libfc: correct RPORT_TO_PRIV usage commit 5101ff99f59aefb72e0c96e82aa32048ac9f8425 Author: Robert Love [SCSI] libfc: Don't violate transport template for rogue port creation commit f7db2c150cf5082cf74555f30a1305938041de80 Author: Steve Ma [SCSI] libfc: exch mgr is freed while lport still retrying sequences commit 26d9cab558f901051d0b69b2c445c8588931ce8d Author: Vasu Dev [SCSI] libfc: fixed a read IO data integrity issue when a IO data frame lost commit 6755db1cd4587084be85f860b7aa7c0cc9d776dc Author: Chris Leech [SCSI] libfc: rport retry on LS_RJT from certain ELS commit bc0e17f691085315ae9303eb5b0883fe16dfe6b1 Author: Vasu Dev [SCSI] libfc, fcoe: fixed locking issues with lport->lp_mutex around lport->link_status commit a7e84f2b83f17f8f11da34ccef3ba5a862dc0182 Author: Vasu Dev [SCSI] libfc: fixed a soft lockup issue in fc_exch_recv_abts commit 78342da3682ec843e3e6301af5c723c88a46c408 Author: Vasu Dev [SCSI] libfc: handle RRQ exch timeout commit 571f824c3cd7b7f5a40ba100f7e576b6b0fe826a Author: Abhijeet Joglekar [SCSI] libfc: when rport goes away (re-plogi), clean up exchanges to/from rport commit 1f6ff364ceda516f88351a8ab640e656beed0b26 Author: Abhijeet Joglekar [SCSI] libfc: Pass lport in exch_mgr_reset commit 9de36825b321fe9fe9cf73260554251af579f4ca Author: Ingo Molnar tracing: trace_bprintk() cleanups commit 769b0441f438c4bb4872cb8560eb6fe51bcc09ee Author: Frederic Weisbecker tracing/core: drop the old trace_printk() implementation in favour of trace_bprintk() commit 1ba28e02a18cbdbea123836f6c98efb09cbf59ec Author: Lai Jiangshan tracing: add trace_bprintk() commit 1427cdf0592368bdec57276edaf714040ee8744f Author: Lai Jiangshan tracing: infrastructure for supporting binary record commit fef20d9c1380f04ba9492d6463148db07b413708 Author: Frederic Weisbecker vsprintf: unify the format decoding layer for its 3 users commit 4370aa4aa75391a5e2e06bccb0919109f725ed8e Author: Lai Jiangshan vsprintf: add binary printf commit 20214fcd74bddc16d65d466212f5dd32aafe8868 Author: Darius Augulis MX1 fix include commit 7ab152470e8416ef2a44c800fdc157e2192f2974 Author: Cyrill Gorcunov x86: linkage.h - guard assembler specifics by __ASSEMBLY__ commit 78ff7fae04554b49d29226ed12536268c2500d1f Author: Masami Hiramatsu x86: implement atomic text_poke() via fixmap commit 3945dab45aa8c89014893bfa8eb1e1661a409cef Author: Masami Hiramatsu tracing, Text Edit Lock - SMP alternatives support commit 4460fdad85becd569f11501ad5b91814814335ff Author: Mathieu Desnoyers tracing, Text Edit Lock - kprobes architecture independent support commit 0e39ac444636ff5be39b26f1cb56d79594654dda Author: Mathieu Desnoyers tracing, Text Edit Lock - Architecture Independent Code commit a56dbddf06b653ef9c04ca3767f260fd31ccebab Author: Tejun Heo percpu: move fully free chunk reclamation into a work commit 9f7dcf224bd09ec9ebcbfb383bf2c465e0e0b03d Author: Tejun Heo percpu: move chunk area map extension out of area allocation commit 1880d93b80acc3171850e9df5048bcb26b75c2f5 Author: Tejun Heo percpu: replace pcpu_realloc() with pcpu_mem_alloc() and pcpu_mem_free() commit 5dd61dfabcaa5bfb67afb8a2d255bd1e156562e3 Author: Pekka Enberg x86: rename do_not_nx to disable_nx in mm/init_64.c commit c77a3b59c624454c501cbfa1a3611d5a00bf9532 Author: Pekka Enberg x86: fix uninitialized variable in init_memory_mapping() commit 5ed0cec0ac5f1b3759bdbe4d9df32ee4ff8afb5a Author: Lai Jiangshan sched: TIF_NEED_RESCHED -> need_reshed() cleanup commit af438c0f114b6f731b923b5c07150f6159471502 Author: Ingo Molnar tracing, power-trace: make it build even if the power-tracer is turned off commit d1a8e7792047f7dca7eb5759250e2c12800bf262 Author: Yinghai Lu x86: make "memtest" like "memtest=17" commit 10dd3ebe213c31bff14b4dae3c5d32a76b1fad7c Author: KOSAKI Motohiro tracing: fix deadlock when setting set_ftrace_pid commit 422d3c7a577b15e1384c9d4e72a9540896b685fa Author: KOSAKI Motohiro tracing: current tip/master can't enable ftrace commit 6b19b0c2400437a3c10059ede0e59b517092e1bd Author: Tejun Heo x86, percpu: setup reserved percpu area for x86_64 commit edcb463997ed7b2ffa3bac76e3e75957318f2e01 Author: Tejun Heo percpu, module: implement reserved allocation and use it for module percpu variables commit 3e24aa58907c62bc79d1094e941a374568f62522 Author: Tejun Heo percpu: add an indirection ptr for chunk page map access commit 9a4f8a878b68d5a5d9ee60908a52cf6a55e1b823 Author: Tejun Heo x86: make embedding percpu allocator return excessive free space commit cafe8816b217b98dc3f268d3b77445da498beb4f Author: Tejun Heo percpu: use negative for auto for pcpu_setup_first_chunk() arguments commit 61ace7fa2fff9c4b6641c506b6b3f1a9394a1b11 Author: Tejun Heo percpu: improve first chunk initial area map handling commit 2441d15c97d498b18f03ae9fba262ffeae42a08b Author: Tejun Heo percpu: cosmetic renames in pcpu_setup_first_chunk() commit 6a242909b01120f6f3d571c0b75e20ec61f0d8d3 Author: Tejun Heo percpu: clean up percpu constants commit 880860e392d92c457e8116cdee39ec4d109174ee Author: Paul Mackerras perfcounters/powerpc: add support for POWER4 processors commit aabbaa6036fd847c583f585c6bae82b5a033e6c7 Author: Paul Mackerras perfcounters/powerpc: add support for POWER5+ processors commit 770cb24345c0f6e0d47bd2b94aa6d67bea6f8b54 Author: Steven Rostedt tracing: add format files for ftrace default entries commit 33b0c229e3abeae00493ed1d6f0b07191977a0a2 Author: Steven Rostedt tracing: move print of event format to separate file commit 5e2336a0d47c9661a40cc5ef85135ce1406af6e8 Author: Steven Rostedt tracing: make all file_operations const commit e08e7b5f01de7ec246b996c65e9c26c7cea0c62d Author: Mauro Carvalho Chehab V4L/DVB (10834): zoran: auto-select bt866 for AverMedia 6 Eyes commit 4c6c390eb8ba0c569279266a98c604508c695ef8 Author: Vitaly Wool V4L/DVB (10832): tvaudio: Avoid breakage with tda9874a commit d2c452306ab402d7a3572bc3bf8e575796529bf8 Author: Gregory Lardiere V4L/DVB (10789): m5602-s5k4aa: Split up the initial sensor probe in chunks. commit 86028598de16538f02519141756ccf4accfc29a6 Author: Paul Mackerras perfcounters/powerpc: fix oops with multiple counters in a group commit 40ada30f9621fbd831ac2437b9a2a399aad34b00 Author: Ingo Molnar tracing: clean up menu commit b5e8acf66ff5db707c7e08df49fdf6b415878442 Author: Peter Zijlstra perfcounters: IRQ and NMI support on AMD CPUs, fix commit a31fba5d68cebf8f5fefd03e079dab94875e25f5 Author: Joerg Roedel dma-debug: add checks for sync_single_sg_* commit 948408ba3e2a67ed0f95e18ed5be1c622c2c5fc3 Author: Joerg Roedel dma-debug: add checks for sync_single_range_* commit b9d2317e0c4aed02afd20022083b2a485289605d Author: Joerg Roedel dma-debug: add checks for sync_single_* commit 6bfd4498764d6201399849d2e80fda95db7742c0 Author: Joerg Roedel dma-debug: add checking for [alloc|free]_coherent commit 972aa45ceaf65376f33aa75958fcaefc9e752fa4 Author: Joerg Roedel dma-debug: add add checking for map/unmap_sg commit f62bc980e6fd26434012c0d5676ecb17179d9ee4 Author: Joerg Roedel dma-debug: add checking for map/unmap_page/single commit 2d62ece14fe04168a7d16688ddd2d17ac472268c Author: Joerg Roedel dma-debug: add core checking functions commit 788dcfa6f17424695823152890d30da09f62f9c3 Author: Joerg Roedel dma-debug: add debugfs interface commit 59d3daafa17265f01149df8eab3fb69b9b42cb2e Author: Joerg Roedel dma-debug: add kernel command line parameters commit 6bf078715c1998d4d10716251cc10ce45908594c Author: Joerg Roedel dma-debug: add initialization code commit 3b1e79ed734f58ac41ca0a287ff03ca355f120ad Author: Joerg Roedel dma-debug: add allocator code commit 30dfa90cc8c4c9621d8d5aa9499f3a5df3376307 Author: Joerg Roedel dma-debug: add hash functions for dma_debug_entries commit b0f3f28e0f14eb335f67bfaae33ce8b8d74fd58b Author: Peter Zijlstra perfcounters: IRQ and NMI support on AMD CPUs commit ef449e6d21b6e560c7ec36ed285ec3a34e0b12ed Author: Hartley Sweeten [ARM] 5419/1: ep93xx: fix build warnings about struct i2c_board_info commit 33dd6f92a1a7ad85c54d47fd9d73371a32c0bde4 Author: Matthew Wilcox [SCSI] sd: Don't try to spin up drives that are connected to an inactive port commit 2002c258faaa8f89543df284fdbaa9e4b171547f Author: Steven Rostedt tracing: add tracing_on/tracing_off to kernel.h commit b2b352590d94651579e6914ecdb08d30b2cb5f19 Author: Ingo Molnar x86: UV, SGI RTC: add generic system vector, build fix on UP commit f2f45e5f3c921c73c913e9a9c00f21ec01c86b4d Author: Joerg Roedel dma-debug: add header file and core data structures commit ed26dbe5ae045e5bf95c6dc27497397a3fde52e1 Author: Jeremy Fitzhardinge x86: pre-initialize boot_cpu_data.x86_phys_bits to avoid system_state tests commit dc16ecf7fd1fad7436832121435d4926a81d469e Author: Jeremy Fitzhardinge x86-32: use specific __vmalloc_start_set flag in __virt_addr_valid commit a964e33c5d7c0ea46376d20c2f02edf01c9db251 Author: Jeremy Fitzhardinge x86: clean up old gcc warnings commit d4cc510c61b050ef38e842a12feef71c56d7cf81 Author: Uwe Kleine-König [ARM] 5418/1: restore lr before leaving mcount commit 62436fe9ee10f5e0dd087b106d69d93c9549935a Author: Ingo Molnar x86: move init_memory_mapping() to common mm/init.c, build fix on 32-bit PAE commit 5ee00bd4691e7364bb7b62e2068d473cd5cb9320 Author: Joerg Roedel dma-debug: add Kconfig entry commit 4fcb208391be5cf82c6fe2779c5eb9245ac97e91 Author: Pekka Enberg x86: move function and variable declarations to asm/init.h commit e53fb04fce6d246ebed755b904ed1b0b814a754c Author: Pekka Enberg x86: unify kernel_physical_mapping_init() function signatures commit 298af9d89f3f5292e81a0a00f729c415adc4d8fb Author: Pekka Enberg x86: fix up some bad global variable names in mm/init.c commit f765090a2617b8d9cb73b71e0aa850c29460d8be Author: Pekka Enberg x86: move init_memory_mapping() to common mm/init.c commit 0c0f756fd679d9747d52dad51fce3a5bb362eec3 Author: Pekka Enberg x86: add stub init_gbpages() for 32-bit init_memory_mapping() commit b47e3418c52b26f6143fc696326ae52a21324551 Author: Pekka Enberg x86: ifdef 32-bit and 64-bit NR_RANGE_MR for save_mr() unification commit c338d6f60fc29dfc74bd82b91526ef43ba992bab Author: Pekka Enberg x86: ifdef 32-bit and 64-bit pfn setup in init_memory_mapping() commit 01ced9ec14ad1b4f8a533c2f2b5a4fe4c92c1099 Author: Pekka Enberg x86: ifdef 32-bit and 64-bit setup in init_memory_mapping() commit d58e854e36ddf241ebc243e4122c5ab087bf38df Author: Pekka Enberg x86: add table start and end sanity checks to 32-bit init_memory_mapping() commit cbba65796df99f3ca9bf70d14e5a19384c54b6a1 Author: Pekka Enberg x86: unify kernel_physical_mapping_init() call in init_memory_mapping() commit c464573cb3d3bdd45eed8f5f59596f84ede95a0c Author: Pekka Enberg x86: rename after_init_bootmem to after_bootmem in mm/init_32.c commit 96083ca11bc85265c7ef9e791a57e3514d8f605a Author: Pekka Enberg x86: remove unnecessary save_mr() sanity check commit 54e63f3a4282a8bc5b39db29095f076ece2b1073 Author: Pekka Enberg x86: ifdef 32-bit specific setup in init_memory_mapping() commit e7179853e7552ba6631e2cdd9f5c374383403b4b Author: Pekka Enberg x86: move pgd_base out of init_memory_mapping() commit 49a2bf7303b0dc5fccbb3ff7cf2e7751f0e3953d Author: Pekka Enberg x86: find_early_table_space() unification commit 4bbd4fa03832208f0e6e0b9e73a0ffa2620a626a Author: Pekka Enberg x86: add gbpages support to 32-bit init_memory_mapping() commit c3f5d2d8b5fa6eb0cc1c47fd162bf6432f206f42 Author: Pekka Enberg x86: init_memory_mapping() trivial cleanups commit 8a0be9ef8225638d26b455788f988c8f84ce9e75 Author: Frederic Weisbecker sched: don't rebalance if attached on NULL domain commit 2485e5184452ccbda34ff83883883d9107800dff Author: Ingo Molnar perfcounters: fix reserved bits sizing commit 0012693ad4f636c720fed3802027f9427962f540 Author: Frederic Weisbecker tracing/function-graph-tracer: use the more lightweight local clock commit ff2c8a4167eb143c5e2a03148fa996978938e8d7 Author: Hannes Eder IOMMU-API: use ANSI style function declaration for 'iommu_found' commit 5f812de63ce515265ebd84e932c762136924ab84 Author: FUJITA Tomonori AMD IOMMU: remove unnecessary ifdef commit 7d3a50609461c545cae183525f1600ac05402e91 Author: Ingo Molnar Revert "block: fix SCSI crash" commit c2473066f5c629afc2c65f61206cd1e6b4729f07 Author: Jens Axboe block: fix missing bio back/front segment size setting in blk_recount_segments() commit 03d78913f01e8f6599823f00357ed17b32747d3d Author: David Rientjes lockdep: remove duplicate CONFIG_DEBUG_LOCKDEP definitions commit 1400b3faab8fedfffde5a7fe47098e2732d4aa76 Author: Dimitri Sivanich x86: UV, SGI RTC: fix uv_time.c for UP commit a1aade478862fca8710904532cbc6efed97fd05a Author: Yinghai Lu x86/doc: mini-howto for using earlyprintk=dbgp commit 526211bc58c4b3265352801c5a7f469af5c34711 Author: Ingo Molnar tracing: move utility functions from ftrace.h to kernel.h commit 5e1607a00bd082972629d3d68c95c8bcf902b55a Author: Ingo Molnar tracing: rename ftrace_printk() => trace_printk() commit ded4214e0247fe1a6daec0baf7c71ae49910413b Author: FUJITA Tomonori block: fix SCSI crash commit e9d25fe6eaa2c720bb3ea661b660e58d54fa38bf Author: Steven Rostedt tracing: have latency tracers set the latency format commit 27d48be84477d2f0a2e2ac3738a3971dece631d5 Author: Steven Rostedt tracing: consolidate print_lat_fmt and print_trace_fmt commit 5fd73f862468280d4cbb5ba4321502f911f9f89a Author: Steven Rostedt tracing: remove extra latency_trace method from trace structure commit c032ef64d680717e4e8ce3da65da6419a35f8a2c Author: Steven Rostedt tracing: add latency output format option commit e74da5235cec6cb71eb338c987f876ecc793138b Author: Steven Rostedt tracing: fix seq read from trace files commit 2dc5d12b1f43134e9bc5037f69f4739cfdfab93e Author: Steven Rostedt tracing: do not return EFAULT if read copied anything commit 4f3640f8a358f2183a8c966f299eeb55ca523e06 Author: Steven Rostedt ring-buffer: fix timestamp in partial ring_buffer_page_read commit e543ad76914abec1acf6631604a4154cd7a2ca6b Author: Steven Rostedt tracing: add cpu_file intialization for ftrace_dump commit fc5efe3941c47c0278fe1bbcf8cc02a03a74fcda Author: Yinghai Lu x86: fix bootmem cross node for 32bit numa, cleanup commit 731ddea63600c24ff01e6e5144cea88bf7266ac5 Author: Pekka Enberg x86: move free_initrd_mem() to common mm/init.c commit f62432395ec54e93f113091bcb2e2017eeed7683 Author: Yinghai Lu x86: reserve exact size of mptable commit 8d4dd919b46ed982da6ef6bf6fcec454cd7a5b1b Author: Yinghai Lu x86: ioremap mptable commit b68adb16f29c8ea02f21f5ebf65bcabffe217e9f Author: Yinghai Lu x86: make 32-bit init_memory_mapping range change more like 64-bit commit a71edd1f46c8a599509bda478fb4eea27fb0da63 Author: Yinghai Lu x86: fix bootmem cross node for 32bit numa commit 5ab5ab34498f94d60884c4ccea890601e429042e Author: Dimitri Sivanich x86: UV, SGI RTC: add UV RTC clocksource/clockevents commit 8661984f628c6f7d9cbaac6697f26d6b0be3ad3b Author: Dimitri Sivanich x86: UV, SGI RTC: loop through installed UV blades commit acaabe795a62bba089c185917af86b44654313dc Author: Dimitri Sivanich x86: UV, SGI RTC: add generic system vector commit 8ca7fe267f58462825729443f3e3b44ef4901cf0 Author: Koen Kooi ARM: OMAP: board-omap3beagle: set i2c-3 to 100kHz commit e951651657610305c9af0045fd64c6a5b0bc4b80 Author: Aaro Koskinen ARM: OMAP: Allow I2C bus driver to be compiled as a module commit 80ea3bac3a47bc73efa334d0dd57099d0ff14216 Author: Aaro Koskinen ARM: OMAP: sched_clock() corrected commit 87d99d6f7ee3ec73b2b0212427b173502ec9d6cb Author: David Brownell ARM: OMAP: Fix compile error if pm.h is included commit 6298e719cf388f43b674f43799af467d3e4e5aa7 Author: Pekka Enberg x86: set_highmem_pages_init() cleanup, #2 commit efed792d6738964f399a508ef9e831cd60fa4657 Author: Peter Zijlstra tracing: add lockdep tracepoints for lock acquire/release commit 1075414b06109a99b0e87601e84c74a95bd45681 Author: Peter Zijlstra lockdep: require framepointers for x86 commit 26575e28df5eb2050c02369843faba38cecb4d8c Author: Peter Zijlstra lockdep: remove extra "irq" string commit 1c21f14ec48a2256fb03682b24dddd23eacdc96f Author: Peter Zijlstra lockdep: fix incorrect state name commit 73af76dfd1f998dba71d8e8e785cbe77a990bf17 Author: Ingo Molnar x86, mce: fix build failure in arch/x86/kernel/cpu/mcheck/threshold.c commit 540aca06b737cc38965b52eeceefba3d24376461 Author: Pekka Enberg x86: move devmem_is_allowed() to common mm/init.c commit 2743a5b0fa6f309da904f2190a9cc25deee34dbd Author: Paul Mackerras perfcounters: provide expansion room in the ABI commit 2cadf9135eb3b6d84b6427314be827ddd443c308 Author: Steven Rostedt tracing: add binary buffer files for use with splice commit 474d32b68d6d842f3e710e9ae9fe2568c53339f8 Author: Steven Rostedt ring-buffer: make ring_buffer_read_page read from start on partial page commit e3d6bf0a0781a269f34250fd41e0d3dbfe540cf1 Author: Steven Rostedt ring-buffer: replace sizeof of event header with offsetof commit ef7a4a161472b952941bf78855a9cd95703c024e Author: Steven Rostedt ring-buffer: fix ring_buffer_read_page commit 41be4da4e85e58520b934040966a6ae919c66c2d Author: Steven Rostedt ring-buffer: reset write field for ring_buffer_read_page commit f254f3909efaf59ca2d0f408de2d044dace60706 Author: Jeremy Fitzhardinge x86: un-__init fill_pud/pmd/pte commit 4e8304758cc09a6097dbd2c4f44a5369e5c1edb0 Author: Jeremy Fitzhardinge x86: remove vestigial fix_ioremap prototypes commit f45964ed6971db2e7ae6cb9b164def1d23b46612 Author: Saeed Bishara [ARM] orion5x: pass dram mbus data to xor driver commit 6b1f22c4418f4684806b4ee499f2c623f5ed998b Author: Ingo Molnar fix "scsi: aic7xxx hang since v2.6.28-rc1", v2 commit 633ddaa7f471e9db181f993c1458d6f4bae321ca Author: Steven Rostedt tracing: fix return value to registering events commit 03787ceed8f7bf06af29f3b213017d89f8e9423d Author: Ingo Molnar x86: set_highmem_pages_init() cleanup, fix !CONFIG_NUMA && CONFIG_HIGHMEM=y commit 867c5b5292583b1e474cbbcb4c77f09bfca3903c Author: Pekka Enberg x86: set_highmem_pages_init() cleanup commit e5b2bb552706ca0e30795ee84caacbb37cec5705 Author: Pekka Enberg x86: unify free_init_pages() and free_initmem() commit e087edd8c056292191bb989baf49f83ee509e624 Author: Pekka Enberg x86: make sure initmem is writable on 64-bit commit 05f209e7b936a48e341d36831079116a06658ccc Author: Pekka Enberg x86: add sanity checks to init_32.c commit fd578f9c0a0a7bf3e460e6f21cdc6f4018949e80 Author: Pekka Enberg x86: use roundup() instead of PAGE_ALIGN() in find_early_table_space() commit 2b688dfd0a93cf3b17c38feef693361da47b0606 Author: Pekka Enberg x86: move __VMALLOC_RESERVE to pgtable_32.c commit 2505170211f7630361a852e25b60f4df4c878daa Author: Hiroshi Shimamoto x86, signals: fix xine & firefox bustage commit 496dbb3f131a3a78af2630551d2df985f9d59f4f Author: Ingo Molnar Revert "menu: fix embedded menu snafu" commit 044d408409cc4e1bc75c886e27ca85c270db104c Author: Peter Zijlstra genirq: assert that irq handlers are indeed running in hardirq context commit c79a61f55773d2519fd0525bf58385f7d20752d3 Author: Uwe Kleine-Koenig tracing: make CALLER_ADDRx overwriteable commit 96ccd21cd13140221bda74a4fc4e53ffeba7c7d4 Author: Steven Rostedt tracing: add print format to event trace format files commit c5e4e19271edfdf1abd4184933d40d646da6a091 Author: Steven Rostedt tracing: add trace name and id to event formats commit 91729ef96661bfa7dc53923746cd90b62d5495cc Author: Steven Rostedt tracing: add ftrace headers to event format files commit 981d081ec8b958b7d962ee40d433581a55d40fc5 Author: Steven Rostedt tracing: add format file to describe event struct fields commit f9520750c4c9924c14325cd951efae5fae58104c Author: Steven Rostedt tracing: make trace_seq_reset global and rename to trace_seq_init commit 11a241a3302277db05561e01477528629d806c4e Author: Steven Rostedt tracing: add protection around modify trace event fields commit d20e3b03842bfeb9d21817ff19054c277cc3eac0 Author: Steven Rostedt tracing: add TRACE_FIELD_SPECIAL to record complex entries commit 9976b39b5031bbf76f715893cf080b6a17683881 Author: Jeremy Fitzhardinge xen: deal with virtually mapped percpu data commit 2fb6b2a048ed8fa3f049c7d42f7a2dd3f0c8d7a6 Author: Jeremy Fitzhardinge x86: add forward decl for tss_struct commit 389d1fb11e5f2a16b5e34c547756f0c4dec641f7 Author: Jeremy Fitzhardinge x86: unify chunks of kernel/process*.c commit db949bba3c7cf2e664ac12e237c6d4c914f0c69d Author: Jeremy Fitzhardinge x86-32: use non-lazy io bitmap context switching commit 3e8ebb5c433f016dff5824587436642d87fc2e6c Author: Kyle McMartin debug_objects: add boot-parameter toggle to turn object debugging off again commit b67802ea8061393f7bd2d4db934646e76096027c Author: Wang Chen sched: kill unused parameter of pick_next_task() commit 72fd455ba54b5a02b9c74221b9ded8b1845b464a Author: Wang Chen sched, documentation: remove old O(1) scheduler document commit b6122b3843216f3f8e9624f9e876f4f0514f9205 Author: Jiri Slaby x86_32: apic/numaq_32, fix section mismatch commit 2fcb1f1f38e9b10ee5f339be4e17ba5cad9b4421 Author: Jiri Slaby x86_32: apic/summit_32, fix section mismatch commit 871d78c6d9fc83b2ad584788a175fcfca07a3666 Author: Jiri Slaby x86_32: apic/es7000_32, fix section mismatch commit a1ef58f442542d8b3e3b963339fbc522c36e827c Author: Jaswinder Singh Rajput x86: use pr_info in perf_counter.c commit 169e41eb7f5464c077a7e0e129f025759d04cc54 Author: Jaswinder Singh Rajput x86: decent declarations in perf_counter.c commit fae176d6e03578fee7cfe948ff9ae81bf7ea0ef0 Author: Jiri Slaby x86_32: apic/summit_32, fix cpu_mask_to_apicid commit 0edc0b324a37c4bf9e13f3194f2f45c677808792 Author: Jiri Slaby x86_32: apic/es7000_32, fix cpu_mask_to_apicid commit c2b20cbd057b97e2f440fa3bc90b3df51de324fe Author: Jiri Slaby x86_32: apic/es7000_32, cpu_mask_to_apicid cleanup commit 9694cd6c17582cd6c29bf4a4e4aa767862ff4f4c Author: Jiri Slaby x86_32: apic/bigsmp_32, de-inline functions commit f180053694b43d5714bf56cb95499a3c32ff155c Author: Ingo Molnar x86, mm: dont use non-temporal stores in pagecache accesses commit f5c1aa1537be39d8b9bb5279b5881d81898fd3cd Author: Ingo Molnar Revert "gpu/drm, x86, PAT: PAT support for io_mapping_*" commit d0c4f570276cb4d2dc4215b90eb7cb6e2bdd4a15 Author: Tejun Heo bootmem, x86: further fixes for arch-specific bootmem wrapping commit af6326d72c95d6e0bbc88c92185c654f57acef3b Author: Tejun Heo alpha: fix typo in recent early vmalloc change commit 02d51fdfb2bfcf6bbd776f983177f55868aa0a79 Author: Tejun Heo percpu: kill compile warning in pcpu_populate_chunk() commit 327f4387e39cf7bfe79a673e56dbf5479db3fec9 Author: Jaswinder Singh Rajput x86: remove double copy of show_cpuinfo_core for 32 and 64 bit commit 3650c759fc49552e5fb0131dc04631404b2b898d Author: Vegard Nossum Revert "kmemcheck: disable CPA self-test" commit 57b44409a2f8ce0c7f923e55f3050428342bbd39 Author: Vegard Nossum x86: don't track page tables with kmemcheck commit 9d102c1b89a020067500486bd133b20813c21b3d Author: Eric Dumazet rcu: increment quiescent state counter in ksoftirqd() commit f87ad35d37fa543925210550f7db20a54c83ed70 Author: Jaswinder Singh Rajput x86: AMD Support for perf_counter commit b56a3802dc6df29aa27d2c12edf420258091ad66 Author: Jaswinder Singh Rajput x86: prepare perf_counter to add more cpus commit 39bc66625d7a761f6e5c5b3d81d88e7c9359ca84 Author: Ingo Molnar kmemcheck: fix split_page() of the page allocator, fix commit f2034f1e1adaac6713a6d48b5a2d4f3aa3e63ccb Author: Steven Rostedt tracing: create the C style tracing for the irq subsystem commit 629928041c53771f9902753d50fef6b35f36d33d Author: Steven Rostedt tracing: create the C style tracing for the sched subsystem commit fd99498989f3b3feeab89dcadf537138ba136d24 Author: Steven Rostedt tracing: add raw fast tracing interface for trace events commit e803b01ba7932a24773fa603a333827904b3492f Author: Vegard Nossum kmemcheck: disable CPA self-test commit 7df4b20d10108f0c1aa08ed3a7c0bfd9b9014562 Author: Pekka Enberg kmemcheck: make kconfig accessible for other architectures commit 1fae0279ce4811fa123001515d1ed3d68c1d557f Author: Hiroshi Shimamoto x86: signal: introduce helper align_sigframe() commit 75779f05264b9968d7ae7ecb4ca5127b08785692 Author: Hiroshi Shimamoto x86: signal: unify get_sigframe() commit 36a4526583ad61fe7cb7432f53bce52ea198813a Author: Hiroshi Shimamoto x86: signal: use 16 bytes boundary for rt_sigframe commit 97286a2b64725aac2d584ddd1f94871f9991d5a1 Author: Hiroshi Shimamoto x86: signal: intrroduce get_sigframe() and replace get_sigstack() commit 144b0712dd9dd9ebd4e80c4e5388c9f6afc2b497 Author: Hiroshi Shimamoto x86: signal: add __user annotation commit c32e827b25054cb17b79cf97fb5e63ae4ce2223c Author: Steven Rostedt tracing: add raw trace point recording infrastructure commit ef5580d0fffce6e0a01043bac0625128b5d409a7 Author: Steven Rostedt tracing: add interface to write into current tracer buffer commit 3d7ba938da8481b4f7f9ed3d943dbae49389b284 Author: Steven Rostedt tracing: add subsystem sched for sched events commit 0ec2ef1505b3e1f54b07bf64f184c92859c3e13f Author: Steven Rostedt tracing: add subsystem irq for irq events commit b628b3e629b1436710e59a21cc020fbb04a52ce1 Author: Steven Rostedt tracing: make the set_event and available_events subsystem aware commit 6ecc2d1ca39177edb6fbdb7412948b0e9f409d02 Author: Steven Rostedt tracing: add subsystem level to trace events commit eb594e45f6979cd10b18d87f7b3f02119e00a108 Author: Steven Rostedt tracing: move trace point formats to files in include/trace directory commit b542b8f29ca47d0b4174ae2f13d5567181f59d5e Author: Vegard Nossum kmemcheck: fix split_page() of the page allocator commit 9b7ff384ee76ced9638ab236db588a6f13916336 Author: Vegard Nossum trace: annotate bitfields in struct ring_buffer_event commit 1fcb01fa2d408e520816bfec5643e9bd0d20d0f3 Author: Vegard Nossum kmemcheck: bitfields: introduce hack to work around gcc bug commit 3d11709f5c12b86b039efc16b86cf11873a8ab4f Author: Vegard Nossum kmemcheck: decode sign/zero-extension move instructions correctly commit 5bdc48d1a90e3e34dd5c2756298190d3a48c3984 Author: Vegard Nossum kmemcheck: add opcode self-testing at boot commit c577b098f9bf467fb05dc279ba83604cb3f7cea0 Author: Gustavo F. Padovan x86, fixmap: unify fixmap.h commit c78f322ce8cea6052bc99513b57283d4d325a13e Author: Gustavo F. Padovan x86, fixmap: prepare fixmap_32.h for unification commit e365bcd9214db993436de7bc915b76ab8402045f Author: Gustavo F. Padovan x86, fixmap: prepare fixmap_64.h for unification commit 5f403fa9de5b3bb1309ec5f72b1e52e5b51321d4 Author: Gustavo F. Padovan x86, fixmap: add CONFIG_EFI commit 2ae38daf25204b7c3725e053052f77469eff62cf Author: Gustavo F. Padovan x86, fixmap: add CONFIG_X86_{LOCAL,IO}_APIC commit fd862dde18c3e360f510780e1d1bf615866b11c2 Author: Gustavo F. Padovan x86, fixmap: define reserve_top_address for x86_64 commit ab93e3c45dbac66c2e8e24fd560c052a3907903e Author: Gustavo F. Padovan x86, fixmap: define FIXADDR_BOOT_* and redefine FIX_ADDR_SIZE commit d09375a9ec80d8bae06196bb247460e0829d884c Author: Gustavo F. Padovan x86, fixmap: rename __FIXADDR_SIZE and __FIXADDR_BOOT_SIZE commit 0cfe82451dfa3ebf4e69158f2eb450f2fbb6b715 Author: Steven Rostedt tracing: replace kzalloc with kcalloc commit efeff568677aa325f84d3ce37c219019887a79eb Author: Werner Almesberger [ARM] S3C64XX: Fix s3c64xx_setrate_clksrc commit fdca9bf2dae14218704ddd7dc60ad1b198c1d787 Author: Ben Dooks [ARM] S3C64XX: sparse warnings in arch/arm/plat-s3c64xx/irq.c commit 3782d3605522b836f53c6d11f76abf5404425c1b Author: Ben Dooks [ARM] S3C64XX: sparse warnings in arch/arm/plat-s3c64xx/s3c6400-clock.c commit 5c6a3ae1b4beebb56e2916b84f1208d96a9e32ff Author: Steven Rostedt tracing: use newline separator for trace options list commit 85a2f9b46f8cd8aaa11c64c715e1ea3ec27ec486 Author: Steven Rostedt tracing: use pointer error returns for __tracing_open commit d8e83d26b5ab3b31ee0ff6d093a2627707a1e221 Author: Steven Rostedt tracing: add protection around open use of current_tracer commit 577b785f55168d5acb3d123ba41bfe8d7981e044 Author: Steven Rostedt tracing: add tracer dependent options to options directory commit a8259075074fb09c230b4cd2c8d3ee3c49d6ecd1 Author: Steven Rostedt tracing: add options directory and core option files commit 41ba41d7c7e1d2a3c9cdfe16c1ee9f7af4693ae2 Author: Ben Dooks [ARM] S3C64XX: Fix USB host clock mux list commit 19c5957081a6ffbf014e6c944e6aafee3c1632c3 Author: Ben Dooks [ARM] S3C64XX: Fix name of USB host clock. commit 4271c3bd46a0f0448118cf618c7210237a98e6bf Author: Ben Dooks [ARM] S3C64XX: Rename IRQ_UHOST to IRQ_USBH commit 24d4076734b4ecf083a6be611040fe0743e59989 Author: Mark Brown [ARM] S3C64XX: Do gpiolib configuration earlier commit 8bd8dbdf3725ce569467bd704840249869f626d6 Author: Mark Brown [ARM] S3C64XX: Staticise s3c64xx_init_irq_eint() commit 027191a8c6602d3fb6dde3820517339e1daf191d Author: Mark Brown [ARM] SMDK6410: Declare iodesc table static commit 778974797793e7dcd42e3701e09c686b6419cb35 Author: Mark Brown [ARM] SMDK6410: Correct I2C device name for WM8580 commit 789b4ad36c7037758309df98f1efa65d0c26527d Author: Mark Brown [ARM] S3C64XX: Fix section mismatch for s3c64xx_register_clocks() commit 28fd2d397bab5c7fb0eed0c20b6766c99ae34a8f Author: Ben Dooks [ARM] S3C64XX: Set GPIO pin when select IRQ_EINT type commit 2740c04567618a70f1fb5ec9a46def6cb1aa96ab Author: Arnd Bergmann emu101k1.h: fix duplicate include of commit ba1d755a36f66101aa88ac9ebb54694def6ec38d Author: Ingo Molnar fix warning in arch/x86/kernel/cpu/intel_cacheinfo.c commit 8325d9c09dedf45476f4d6261d1b6a72e4a7453f Author: Peter Zijlstra sched_clock: cleanups commit 83ce400928680a6c8123d492684b27857f5a2d95 Author: Ingo Molnar x86: set X86_FEATURE_TSC_RELIABLE commit b342501cd31e5546d0c9ca8ceff5ded1832f9e5b Author: Ingo Molnar sched: allow architectures to specify sched_clock_stable commit a2a5ac8650b570bea3cb3614f77739dcd07d6632 Author: John Stultz time: ntp: fix bug in ntp_update_offset() & do_adjtimex(), fix commit 14131f2f98ac350ee9e73faed916d2238a8b6a0d Author: Ingo Molnar tracing: implement trace_clock_*() APIs commit 6409c4da289d6905f7ae2bd0630438368439bda2 Author: Ingo Molnar sched: sched_clock() improvement: use in_nmi() commit af39241b90a345556b8884adff87096afe71b050 Author: Jason Baron tracing, genirq: add irq enter and exit trace events commit a4018f9f46a26bd33038688433fbdcfdfe5e024d Author: Ingo Molnar Revert "firetv: disable for now" commit 5fdb7eafff8492b1b2b8a8e3cb51a19376048927 Author: Linus Torvalds fix DVB + ieee1394: firedtv driver crash commit 06d115ed1c4fbb6af750f0b08f1ca59354b6fc77 Author: Vegard Nossum net: annotate struct sock bitfield commit 195a9ef3619dfa45805b2b3f6414a3f54ebfa2d9 Author: Vegard Nossum kmemcheck (bitfields): don't actually initialize the bitfield commit 3b900d44190c7da8681101c57a5be6b354dab2c7 Author: Ingo Molnar x86: fix !ACPI build for es7000_32.c commit 0b1da1c8fc1a0cb71f17701efad06855a059f752 Author: Ingo Molnar x86: apic: simplify secondary CPU wakeup methods, fix commit c2a6c9b541822b087ae16ae46b417c3bbd996c3d Author: Vegard Nossum c2port: annotate bitfield for kmemcheck commit e9290751a5b6c446678cd08907f5d7bf30e4649f Author: Vegard Nossum kmemcheck: depend on DEBUG_KERNEL commit 1188029d13d19b72da698bc0d43da348f068d970 Author: Pekka Enberg kmemcheck: use kmemcheck_pte_lookup() instead of open-coding it commit 1fc55ed40a5087ed8b1ea966f52e56d2629e5f99 Author: Pekka Enberg kmemcheck: missing whitespace in do_page_fault() commit 97808e7866d5067ae6f202ea52ed2e4285705b8b Author: Vegard Nossum kmemcheck: reverse dependencies between DEBUG_PAGEALLOC and KMEMCHECK commit c3f5f316daeb63595c26cb43357f97fb0dead706 Author: Pekka Enberg kmemcheck: move 64-bit ifdef out of kmemcheck_opcode_decode() commit a1cda228835b66ae7e3976ff7090a2ad5f98de57 Author: Pekka Enberg kmemcheck: remove multiple ifdef'd definitions of the same global variable commit 3a1d4ea7d74a9b3c6d827386b0bdb8682abb1cc3 Author: Pekka Enberg kmemcheck: make initialization message less confusing commit 25ca0ccbba2313ff84f390d495dc97132d033ca0 Author: Pekka Enberg kmemcheck: remove forward declarations from error.c commit 114833d4ec58292b14f0b016a5b27b8279ac4427 Author: Vegard Nossum x86: don't use MMX/SSE in xor routines if kmemcheck is compiled in commit 5c75f9c88bfffa44a9ca85777a3724459515722f Author: Vegard Nossum crypto: don't track xor test pages with kmemcheck commit 8656e7a2fa6afcd8682990f804a2a9674568738f Author: Frederic Weisbecker tracing/core: make the per cpu trace files in per cpu directories commit 1f5bcabf1b997d6b76a09114b5a79423495a1263 Author: Ingo Molnar x86: apic: simplify secondary CPU wakeup methods commit c40c6f85a7594ad842233885386a0ca4cd40eafe Author: Li Zefan cpuacct: add a branch prediction commit 0917c01f8e793f57a53cf886533d4c75c67f6e89 Author: Ingo Molnar x86: remove update_apic from x86_quirks, fix commit f3dfd2656deb81a0addee4f4ceff66b50a387388 Author: Paul Mackerras perfcounters: fix a few minor cleanliness issues commit df0aaab15b7e448ef7aee7057ba28a14c4ff60b1 Author: Pekka Enberg kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled commit 129d8bc828e011bda0b7110a097bf3a0167f966e Author: Yinghai Lu x86: don't compile vsmp_64 for 32bit commit 2b6163bf5772644068694583816fa41e8474239f Author: Yinghai Lu x86: remove update_apic from x86_quirks commit 742bd95ba96e19b3f7196c3a0834ebc17c8ba006 Author: Paul Mackerras perfcounters/powerpc: Add support for POWER5 processors commit 3cdfdf91fcc77cfc82592e2b5c2ab35abe819c41 Author: Steven Rostedt tracing: wrap arguments with PARAMS commit eef62a6826b8ab530cefff5aa55c1661a209c803 Author: Steven Rostedt tracing: rename DEFINE_TRACE_FMT to just TRACE_FORMAT commit 13093cb0e59053bf97910de3a24f07cdff71c62c Author: Ingo Molnar gpu/drm, x86, PAT: PAT support for io_mapping_*, export symbols for modules commit e317603694bfd17b28a40de9d65e1a4ec12f816e Author: Tejun Heo percpu: fix too low alignment restriction on UP commit 3497622198eb5860b333564b1b4ea774dded0a1e Author: Ingo Molnar firetv: disable for now commit e82c508de19482db1ddee1834c4de300589a0a12 Author: H. Peter Anvin compiler-gcc4: conditionalize #error on __KERNEL__ commit e75bb54d6d0b257b117e42800c7d7a4650e0aa36 Author: Arnd Bergmann remove __KERNEL_STRICT_NAMES commit cf7ea4cbd015402cc6e7204962c978a3b052ecd2 Author: Arnd Bergmann make netfilter use strict integer types commit 52ba0b69e339cf4edd314dd5819ef51bc4efee33 Author: Arnd Bergmann make drm headers use strict integer types commit 713cbcd94b9688fa7de060fd0e8a9d48798ac163 Author: Arnd Bergmann make MTD headers use strict integer types commit 57b4b9d7b56d283b6619a893341be16d1a0467a6 Author: Arnd Bergmann make most exported headers use strict integer types commit c0264157bba0cafd9265f30d846553161c0477b3 Author: Arnd Bergmann make exported headers use strict posix types commit 39854fe8c165872d743f6a0c4860ca2de8e45ac9 Author: Ingo Molnar time: ntp: clean up second_overflow() commit 069569e025706f27f939785f86a94d5d8ce55dce Author: Ingo Molnar time: ntp: simplify ntp_tick_adj calculations commit 2b9d1496e7835a603c340e8f0dd81f4b74d5f248 Author: Ingo Molnar time: ntp: make 64-bit constants more robust commit e96291653b2e4df02f160b574070f6e632868e5e Author: Ingo Molnar time: ntp: refactor do_adjtimex() some more commit 80f2257116474ceed5fccab510b4f7245c0f49d7 Author: Ingo Molnar time: ntp: refactor do_adjtimex() commit 10dd31a7a17254d6ba793305fc590455393e610e Author: Ingo Molnar time: ntp: fix bug in ntp_update_offset() & do_adjtimex() commit c7986acba211e8285e14c9603fb89e6f4ea0b9f8 Author: Ingo Molnar time: ntp: micro-optimize ntp_update_offset() commit 478b7aab1682246a3d1e76e27a0aecb2f0013379 Author: Ingo Molnar time: ntp: simplify ntp_update_offset_fll() commit f939890b6687e05c42361655fb6610fa08f5a601 Author: Ingo Molnar time: ntp: refactor and clean up ntp_update_offset() commit bc26c31d446bc9c24cd6f7003777a05fe268ae48 Author: Ingo Molnar time: ntp: refactor up ntp_update_frequency() commit 9ce616aaefcb9309cb9c49a36310ebda6061b98b Author: Ingo Molnar time: ntp: clean up ntp_update_frequency() commit bbd1267690bb6940d0722dd33e929442c0409c01 Author: Ingo Molnar time: ntp: simplify the MAX_TICKADJ_SCALED definition commit 3c972c2444dcb7088999c32b8c5a7ab3b8a6c0b6 Author: Ingo Molnar time: ntp: simplify the second_overflow() code flow commit 53bbfa9e9437e70b322368e82c723112d690e304 Author: Ingo Molnar time: ntp: clean up kernel/time/ntp.c commit 43b818841f1e7d5763c56e9561f399329db00cbe Author: Vegard Nossum mm: fix lazy vmap purging (use-after-free error) commit 0b13fda1e0936b3d64c4c407f183d33fa6bd2ad4 Author: Ingo Molnar generic-ipi: cleanups commit 34754b69a6f87aa6aa2860525a82f12532f83afd Author: Peter Zijlstra x86: make vmap yell louder when it is used under irqs_disabled() commit d2b0261506602bd969164879206027b30358ffdf Author: Ingo Molnar alloc_percpu: fix UP build commit 6e2756376c706e4da3454a272947983f92e80a7e Author: Peter Zijlstra generic-ipi: remove CSD_FLAG_WAIT commit 8969a5ede0f9e17da4b943712429aef2c9bcd82b Author: Peter Zijlstra generic-ipi: remove kmalloc() commit 0dcec8c27ba44cd11c6e68c46d5fd553818a3837 Author: Ingo Molnar alloc_percpu: add align argument to __alloc_percpu, fix commit d7350c3f45694104e820041969c8185c5f99e57c Author: Frederic Weisbecker tracing/core: make the read callbacks reentrants commit b04cc6b1f6398b0e0b60d37e27ce51b4899672ec Author: Frederic Weisbecker tracing/core: introduce per cpu tracing files commit 17581ad812a9abb0182260374ef2e52d4a808a64 Author: Venkatesh Pallipadi gpu/drm, x86, PAT: PAT support for io_mapping_* commit 7880f7464546842ee14179bef16a6e14381ea638 Author: Venkatesh Pallipadi gpu/drm, x86, PAT: routine to keep identity map in sync commit 15d0d3b3371227f846b9f644547fde081c7e1c0c Author: Nick Piggin generic IPI: simplify barriers and locking commit 63823126c221dd721ce7351b596b3b73aa943613 Author: Andreas Herrmann x86: memtest: add additional (regular) test patterns commit 9e5f6cf5f755ca5c52071c317421fae19966a658 Author: Andreas Herrmann x86: update description for memtest boot parameter commit bfb4dc0da45f8fddc76eba7e62919420c7d6dae2 Author: Andreas Herrmann x86: memtest: wipe out test pattern from memory commit 570c9e69aaa84689fb8ed2a3a4af39ca54ba7a47 Author: Andreas Herrmann x86: memtest: adapt log messages commit 7dad169e57eda1f0aa6dc5ac43a898b4b0ced2c7 Author: Andreas Herrmann x86: memtest: cleanup memtest function commit 6d74171bf7315257d276aa35400c5a8d6a993f19 Author: Andreas Herrmann x86: memtest: introduce array to select memtest patterns commit 40823f737e5bd186a1156fb1c28f360260e1e084 Author: Andreas Herrmann x86: memtest: reuse test patterns when memtest parameter exceeds number of available patterns commit 886b5b73d71e4027d7dc6c14f5f7ab102201ea6b Author: Ingo Molnar tracing: remove /debug/tracing/latency_trace commit 95108fa34a83ffd97e0af959e4b28d7c62008781 Author: Ingo Molnar x86: usercopy: check for total size when deciding non-temporal cutoff commit 3255aa2eb636a508fc82a73fabbb8aaf2ff23c0f Author: Ingo Molnar x86, mm: pass in 'total' to __copy_from_user_*nocache() commit 2d542cf34264ac92e9e7ac55c0b096b066d569d2 Author: Ingo Molnar tracing/hw-branch-tracing: convert bts-tracer mutex to a spinlock commit 1473e4417c79f12d91ef91a469699bfa911f510f Author: Steven Rostedt tracing: make event directory structure commit f3fe8e4a38fd19dbb3f8ffb1826aa840ae304a65 Author: Steven Rostedt tracing: add schedule events to event trace commit b77e38aa240c3bd9c55c98b9f7c81541e042eae5 Author: Steven Rostedt tracing: add event trace infrastructure commit 7c37730cd31ddb2d3a1da142af9b18c29b8c433b Author: Steven Rostedt tracing: add DEFINE_TRACE_FMT to tracepoint.h commit d325100504f1d0c296a1fbfef558deaa655e2240 Author: Tejun Heo x86: convert cacheflush macros inline functions commit 24ff954233ecfd45801383f831626f88937ebe6f Author: Tejun Heo x86, percpu: fix minor bugs in setup_percpu.c commit 15d4fcd615989ed83fe848e6a3c7e9f0361cf0d0 Author: H. Peter Anvin x86, mce: enable machine checks in 32-bit defconfig commit 1250fbed1471b681f3e75e4938f356a1c0a92d5e Author: Andi Kleen x86, mce: enable machine checks in 64-bit defconfig commit df975409cf0b986347ad50bbcaf8c297d5786efd Author: Ingo Molnar Revert "fix warning in drivers/isdn/sc/shmem.c" commit 46cb27f5169d37be38be8e5729b9a0100e989fa8 Author: Yinghai Lu x86: check range in reserve_early() commit be71b8553d0522aba535a815baaebb1f0bb9a9ec Author: Andi Kleen x86, mce, cmci: recheck CMCI banks after APIC has been enabled on CPU #0 commit 5ca8681ca10f671427710f4954644359856581a3 Author: Andi Kleen x86, mce, cmci: disable CMCI on rebooting commit df20e2eb3e59b8625021a1bc8b1b53a4edc6008b Author: H. Peter Anvin x86, mce, cmci: remove incorrect __cpuinit/__cpuexit annotations commit 88ccbedd9ca85d1aca6a6f99df48dce87b7c02d4 Author: Andi Kleen x86, mce, cmci: add CMCI support commit 03195c6b40f2b4db92545921daa7c3a19b4e4c32 Author: Andi Kleen x86, mce, cmci: define MSR names and fields for new CMCI registers commit ee031c31d6381d004bfd386c2e45821211507499 Author: Andi Kleen x86, mce, cmci: use polled banks bitmap in machine check poller commit 8457c84d68678cbfd4167a9073b89da58e48c037 Author: Andi Kleen x86, mce: replace machine check events logged interval with ratelimit commit f9695df42cdbca78530b4458c38ecfdd0bb90079 Author: Andi Kleen x86, mce, cmci: avoid potential reentry of threshold interrupt commit b276268631af3a1b0df871e10d19d492f0513d4b Author: Andi Kleen x86, mce, cmci: factor out threshold interrupt handler commit 41fdff322e26c4a86fe65cf577f2556a650cb7bc Author: Andi Kleen x86, mce, cmci: export MAX_NR_BANKS commit b5f26d05565d070b7b352dba56b1f96e10021980 Author: Jiri Slaby x86_32: summit_32, de-inline functions commit 10b614eaa847447c2c8646030728309d14bd2d05 Author: Jiri Slaby x86_32: summit_32, use BAD_APICID commit 499aa86dcbc3c4daf7d2c59c5c30e1a78220fbc1 Author: Markus Metzger x86, ptrace: remove CONFIG guards around declarations commit 5e01cb695d29619dd551bac7d6aa4ef1dc8ebc95 Author: Markus Metzger x86, ftrace: fix section mismatch in hw-branch-tracer commit 9f331119a4f95a44d918fe6d5e85998fabf99b72 Author: Cyrill Gorcunov x86: efi_stub_32,64 - add missing ENDPROCs commit bc8b2b9258488b932cd399112e01d5afffc4ee96 Author: Cyrill Gorcunov x86: head_64.S - use GLOBAL macro commit b3baaa138cd4223bffb6ca64b873d25cfb1d7c70 Author: Cyrill Gorcunov x86: entry_64.S - add missing ENDPROC commit 57e372932cec8eb141cde039aaeaa91b69fceba2 Author: Cyrill Gorcunov x86: invalid_vm86_irq -- use predefined macros commit 5e112ae23b404ccba0a61630b82ec44f0d084880 Author: Cyrill Gorcunov x86: head_64.S - use IDT_ENTRIES instead of hardcoded number commit 2a0b1001116de51f13b2969a9a52bd2bc294644f Author: Cyrill Gorcunov x86: head_64.S - remove useless balign commit 30d697fa3a25fed809a873b17531a00282dc1234 Author: Salman Qazi x86: fix performance regression in write() syscall commit 40150d37be7f7949b2ec07d511244da856647d84 Author: Tejun Heo percpu: add __read_mostly to variables which are mostly read only commit 8ac837571491e239e64bd87863c1679d8002e8a2 Author: Tejun Heo x86: add remapping percpu first chunk allocator commit 89c9215165ca609096e845926d9a18f1306176a4 Author: Tejun Heo x86: add embedding percpu first chunk allocator commit 5f5d8405d1c50f5cf7e1dbfe9c9b44e2f015c8fd Author: Tejun Heo x86: separate out setup_pcpu_4k() from setup_per_cpu_areas() commit 8d408b4be37bc49c9086531f2ebe411cf5731746 Author: Tejun Heo percpu: give more latitude to arch specific first chunk initialization commit d9b55eeb1d55ef2dc5a4fdbff9604c2c68cb5649 Author: Tejun Heo percpu: remove unit_size power-of-2 restriction commit 458a3e644c3327be529393982e24277eda8f1ac7 Author: Tejun Heo x86: update populate_extra_pte() and add populate_extra_pmd() commit c0c0a29379b5848aec2e8f1c58d853d3cb7118b8 Author: Tejun Heo vmalloc: add @align to vm_area_register_early() commit 2d0aae41695257603fc281b519677131ab5a752b Author: Tejun Heo bootmem: reorder interface functions and add a missing one commit c132937556f56ee4b831ef4b23f1846e05fde102 Author: Tejun Heo bootmem: clean up arch-specific bootmem wrapping commit cb83b42e23bd6c4bf91793a320fbe83787c13596 Author: Tejun Heo percpu: fix pcpu_chunk_struct_size commit ec5b3d32437571b8a742069a4cfd04edb6b6eda5 Author: H. Peter Anvin x86, mce: remove invalid __cpuinit/__cpuexit annotations commit bda3a89745d7bb88d3e735046c0cdc3d0eb2ac24 Author: Stas Sergeev x86: minor cleanup in the espfix code commit 12e2a32cb0bd5269962d1f4ad48c0c04a8aa1162 Author: David Howells Fix recursive lock in free_uid()/free_user_ns() commit 9f732a9fde38b11c8c6248701a1df349314cc4ef Author: Karsten Wiese drm: Fix oops in i915_gem_retire_requests commit d095cd46dac104e4d2a4967c7c19b55a12f78240 Author: Paul Mackerras perfcounters/powerpc: Make exclude_kernel bit work on Apple G5 processors commit ecda06289f8202d4c6beb235f59ea464f4a91209 Author: Yinghai Lu x86: check mptable physptr with max_low_pfn on 32bit commit 0d3a9cf5ab041c15691fd03dab3af0841af63606 Author: Jeremy Fitzhardinge acpi: add some missing section markers commit 8e6dafd6c741cd4679b4de3c5d9698851e4fa59c Author: Ingo Molnar x86: refactor x86_quirks support commit d85a881d780cc7aaebe1b7aefcddbcb939acbe2d Author: Ingo Molnar x86: remove various unused subarch hooks commit 965c7ecaf2e2b083d711a01ab33735a4bdeee1a4 Author: Ingo Molnar x86: remove the Voyager 32-bit subarch commit b88d5ebcbbcc86df87a8c410596a93777b0d82cf Author: Vegard Nossum kmemcheck: fix shadow updates that cross page boundaries commit e5118e018d4c519dcbba0b6f3b2cd55ce9da6c77 Author: Vegard Nossum kmemcheck: fix an incorrect BUG_ON() commit 8425091ff8af2addae118fc510a523b84ce51115 Author: Ravikiran G Thirumalai x86: improve the help text of X86_EXTENDED_PLATFORM commit faebb4cffa5735bc9d054dd4e6e5963afbf545f0 Author: Vegard Nossum kmemcheck: make ftrace and kmemcheck mutually exclusive commit 35f663c35fae24037b138602ba30c9207936167a Author: Vegard Nossum kmemcheck: fix CONFIG_KMEMCHECK=n build failure commit ef1f87aa7ba6224bef1b750b3272ba281d8f43ed Author: Suresh Siddha x86: select x2apic ops in early apic probe only if x2apic mode is enabled commit c23e253e67c9d8a91a0ffa33c1f571a17f0a2403 Author: Andreas Herrmann x86: hpet: stop HPET_COUNTER when programming periodic mode commit 8d6f0c8214928f7c5083dd54ecb69c5d615b516e Author: Andreas Herrmann x86: hpet: provide separate functions to stop and start the counter commit b98103a5597b87211a1c74077b06faeac554bedc Author: Andreas Herrmann x86: hpet: print HPET registers during setup (if hpet=verbose is used) commit a967bb3fbe640056bacb0357722f51676bb06e3c Author: Hiroshi Shimamoto x86: ia32_signal: introduce {get|set}_user_seg() commit 8801ead40caa8ba9c7d47a06ff1247c166cbfd5a Author: Hiroshi Shimamoto x86: ia32_signal: introduce GET_SEG() macro commit a47e3ec197f515e25c77805f02d26f9e86456f65 Author: Hiroshi Shimamoto x86: ia32_signal: remove unused debug code commit c426d3e01905ed17ef75d352517734b909a325e4 Author: Vegard Nossum kmemcheck: depend on !SLUB_DEBUG_ON commit 8cd4001345dd678039c358a32931712efa7c3127 Author: Vegard Nossum kmemcheck: add hooks for the page allocator commit a076963828988cc78a92c35b9cc9fb972f4626f0 Author: Vegard Nossum kmemcheck: don't track allocated page tables commit 1293c377546790bd89b2dacc839e82c0f7d02137 Author: Vegard Nossum kmemcheck: add hooks for page- and sg-dma-mappings commit caa8eeff1dd1cbad65cee9fe916ca01726cc4c83 Author: Vegard Nossum kmemcheck: rip out REP instruction emulation commit 3f9306e955d74c93644d5e73dd64392f46267bb6 Author: Vegard Nossum kmemcheck: disable fast string operations on P4 CPUs commit 5b739d9e0bb101c1cf3eb0f9765ee68ed3508c0c Author: Vegard Nossum kmemcheck: annotate inet_timewait_sock bitfields commit 3416a436c1cac972c3f0e096a7be59d99e34843e Author: Vegard Nossum ieee1394/csr1212: fix false positive kmemcheck report commit 36bbcb1fdb295e5cf2451d5885cfe439d70eadf4 Author: Vegard Nossum ieee1394: annotate bitfield commit ee1e6901b7ef47eb550ffea127147b0ae5fd32cf Author: Vegard Nossum net: annotate bitfields in struct inet_sock commit c0141a169bbb4a69b4ed34266ea4938d77a905ab Author: Vegard Nossum net: use kmemcheck bitfields API for skbuff commit 8e8d424ea82996137e1e4ea8a04bc34fb73e34a8 Author: Vegard Nossum kmemcheck: bitfield API commit b319eed0aa0a6d710887350a3cb734c572aa64c4 Author: Ingo Molnar x86, mm: fault.c, simplify kmmio_fault(), cleanup commit 2366c298b5afe52e635afd5604b69ce9fd4471fc Author: Hannes Eder x86: numa_32.c: fix sparse warning: Using plain integer as NULL pointer commit fc6fcdfbb8f1b2553255170f221cd57a4108591f Author: Hannes Eder x86: kexec/i386: fix sparse warnings: Using plain integer as NULL pointer commit 071372894fdf260f219396317dbfe5947254d133 Author: Ingo Molnar section checks: turn them back on commit cae3aeb83fef5a7c9c8ac40e653e59dd9a35469c Author: Tejun Heo percpu: clean up size usage commit f8eeb2e6be367d79be3617f0a12646bced8b2fe6 Author: Ingo Molnar x86, mm: fault.c, update copyrights commit cd1b68f08f6328737928e5b8ba8ef80394680ff0 Author: Ingo Molnar x86, mm: fault.c, give another attempt at prefetch handing before SIGBUS commit 7c178a26d3e753d2a4346d3e4b8aa549d387f698 Author: Ingo Molnar x86, mm: fault.c, remove #ifdef from fault_in_kernel_space() commit d951734654f76a370a89b4e531af9b765bd13541 Author: Ingo Molnar x86, mm: rename TASK_SIZE64 => TASK_SIZE_MAX commit c3731c68668325abddee8665018c74c7156a57be Author: Ingo Molnar x86, mm: fault.c, remove #ifdef from do_page_fault() commit 1cc99544dde9e48602979f16b9309fade6e93051 Author: Ingo Molnar x86, mm: fault.c, unify oops handling commit 8f7661496cece8320137d5e26808825498fd2b26 Author: Ingo Molnar x86, mm: fault.c, unify oops printing commit f2f13a8535174dbb813a0607a9d4737cfba98f6c Author: Ingo Molnar x86, mm: fault.c, reorder functions commit b18018126f422f5b706fd750373425e10e84b486 Author: Ingo Molnar x86, mm, kprobes: fault.c, simplify notify_page_fault() commit b814d41f0987c7648d7ed07471258101c95c026b Author: Ingo Molnar x86, mm: fault.c, simplify kmmio_fault() commit 121d5d0a7e5808fbcfda484efd7ba840ac93450f Author: Ingo Molnar x86, mm: fault.c, enable PF_RSVD checks on 32-bit too commit 8c938f9fae887f6e180bf802aa1c33cf74712aff Author: Ingo Molnar x86, mm: fault.c, factor out the vm86 fault check commit 107a03678cac0dd6cf7095f81442a4fa477e4700 Author: Ingo Molnar x86, mm: fault.c, refactor/simplify the is_prefetch() code commit 2d4a71676f4d89418a0d53e60b89e8b804b390b2 Author: Ingo Molnar x86, mm: fault.c cleanup commit 4377245aa93b65b6597e4b7bb460fb9abc48b56b Author: Steven Rostedt ftrace: break out modify loop immediately on detection of error commit 90c7ac49aa819feb9433b5310089fca6399881c0 Author: Steven Rostedt ftrace: immediately stop code modification if failure is detected commit 16239630974516a8879a3695ee9b4dc661f79f96 Author: Steven Rostedt ftrace, x86: make kernel text writable only for conversions commit fdb17aeb28aaad3eae5ef57e70cb287d34d1049d Author: Alok Kataria x86, vmi: TSC going backwards check in vmi clocksource, cleanup commit 91f73f90d97fa67effbb49e0a79c50cf26dfe324 Author: Frederic Weisbecker tracing/markers: make markers select tracepoints commit 000ab691172db3921efa3cb7f17fc79235a1de7f Author: Steven Rostedt ftrace: allow archs to preform pre and post process for code modification commit 7a5714e0186030676d79a7b4b9830c8e45c3b0a1 Author: Ingo Molnar x86, pat: add large-PAT check to split_large_page() commit 3c3e5694add02e665bbbd0fecfbbdcc0b903097a Author: Steven Rostedt x86: check PMD in spurious_fault handler commit ecab22aa6dc9d42ca52de2cad0854b4c6bd85ac9 Author: Vegard Nossum x86: use symbolic constants for MSR_IA32_MISC_ENABLE bits commit f9349a8f978929a0c71d2c42ae299f7d462c239d Author: Frederic Weisbecker tracing/function-graph-tracer: make set_graph_function file support ftrace regex commit fe1200b63d158b28eef6d4de1e5b5f99c681ba2f Author: Christoph Lameter SLUB: Introduce and use SLUB_MAX_SIZE and SLUB_PAGE_SHIFT constants commit 11124411aa95827404d6bfdfc14c908e1b54513c Author: Tejun Heo x86: convert to the new dynamic percpu allocator commit fbf59bc9d74d1fb30b8e0630743aff2806eafcea Author: Tejun Heo percpu: implement new dynamic percpu allocator commit 8fc48985006da4ceba24508db64ec77fc0dfe3bb Author: Tejun Heo vmalloc: add un/map_kernel_range_noflush() commit f0aa6617903648077dffe5cfcf7c4458f4610fa7 Author: Tejun Heo vmalloc: implement vm_area_register_early() commit f2a8205c4ef1af917d175c36a4097ae5587791c8 Author: Tejun Heo percpu: kill percpu_alloc() and friends commit 313e458f81ec3852106c5a83830fe0d4f405a71a Author: Rusty Russell alloc_percpu: add align argument to __alloc_percpu. commit b36128c830a8f5bd7d4981f5b0b69950f5928ee6 Author: Rusty Russell alloc_percpu: change percpu_ptr to per_cpu_ptr commit 6b588c18f8dacfa6d7957c33c5ff832096e752d3 Author: Tejun Heo module: reorder module pcpu related functions commit 734269521e320ad14ed39ae9b64d482b9028dcd2 Author: Tejun Heo vmalloc: call flush_cache_vunmap() from unmap_kernel_range() commit 42f8faecf7a88371de0f30aebb052d1ae51762c0 Author: Lai Jiangshan x86: use percpu data for 4k hardirq and softirq stacks commit f6d1826dfad0d15fd14a455facc80b91f2ee642f Author: H. Peter Anvin x86, mce: use %ll instead of %L for 64-bit numbers commit b79109c3bbcf52cac5103979b283b9e5df4e796c Author: Andi Kleen x86, mce: separate correct machine check poller and fatal exception handler commit b5f2fa4ea00a179ac1c2ff342ceeee261dd75e53 Author: Andi Kleen x86, mce: factor out duplicated struct mce setup into one function commit 0d7482e3d76522157c9d741d79fce22c401fa0c5 Author: Andi Kleen x86, mce: implement dynamic machine check banks support commit e35849e910a6543d37c0d13648ef166678d03565 Author: Andi Kleen x86, mce: enable machine checks in 64-bit defconfig commit ab76f3d771590d5c89faa3219559c5d3fc0ce0c2 Author: Alain Knaff bzip2/lzma: make internal initramfs compression configurable commit ab59d3b70f7a47987f80e153d828363faec643fe Author: Alain Knaff bzip2/lzma: don't leave empty files around on failure commit e4aa7ca5a2e6d44f07ceb87d9448113f5b48a334 Author: Alain Knaff bzip2/lzma: don't stop search at first unconfigured compression commit cb425afd2183e90a481bb211ff49361a117a3ecc Author: Cyrill Gorcunov x86: compressed head_32 - use ENTRY,ENDPROC macros commit 2d4eeecb98ade6a736940d43311275b7d32dab21 Author: Cyrill Gorcunov x86: compressed head_64 - use ENTRY,ENDPROC macros commit 324bda9e47f53aebec1376ee89bba8128c8455e2 Author: Cyrill Gorcunov x86: pmjump - use GLOBAL,ENDPROC macros commit 2f7955509710fd378a1ac96e19d29d5a0e3301fd Author: Cyrill Gorcunov x86: copy.S - use GLOBAL,ENDPROC macros commit 1b25f3b4e18d1acffeb41258a18f13db71da9a7a Author: Cyrill Gorcunov x86: linkage - get rid of _X86 macros commit 95695547a7db44b88a7ee36cf5df188de267e99e Author: Cyrill Gorcunov x86: asm linkage - introduce GLOBAL macro commit 00a8bf859331e349713274825e6fbf20bf2ac15a Author: Ingo Molnar tracing/function-graph-tracer: fix merge commit 5752674e140db5bce08c6bc60021a9bc3b960800 Author: Ingo Molnar Documentation/ftrace.txt: update commit 985ec20ad531f2641ab9d5193e37891fe959fc7d Author: Frederic Weisbecker tracing/function-graph-tracer: provide documentation for the function graph tracer commit d1f9cbd78841f1a797c77e9117e4882f932c2ef6 Author: Frederic Weisbecker tracing/function-graph-tracer: fix traces weirdness while absolute time printing commit 71d8f9784a99991a7571dd20226f5f450dda7f34 Author: Hiroshi Shimamoto x86: syscalls.h: remove asmlinkage from declaration of sys_rt_sigreturn() commit de5483029b8f18e23395d8fd4f4ef6ae15beb809 Author: Jaswinder Singh Rajput x86: include/asm/processor.h remove double declaration of print_cpu_info commit fdcedf7b75808dd72c3cc0b931be11b04d75c60a Author: john stultz time: apply NTP frequency/tick changes immediately commit 01953e03a588683e9767f633e4a8be715d20930c Author: Ingo Molnar Revert "dell-laptop.c: disable temporarily" commit 7432ef107e7d59bd484641f813e96666637676d3 Author: Ingo Molnar Revert "eppc-laptop: disable temporarily" commit 712406a6bf59ebf4a00358bb59a4a2a1b2953d90 Author: Steven Rostedt tracing/function-graph-tracer: make arch generic push pop functions commit 74019224ac34b044b44a31dd89a54e3477db4896 Author: Ingo Molnar timers: add mod_timer_pending() commit 7e4cbd14b28546e6f758d01b0d7f3f4647fada52 Author: Alan Stern fix "scsi: aic7xxx hang since v2.6.28-rc1" commit e027abc28a63432fc42ca173348d9b3ca0c84fbc Author: Ingo Molnar scsi: temporarily undo scsi reverts commit fa7c7f6e11f70d62505074a8b30a776236850dec Author: Frederic Weisbecker tracing/core: remove unused parameter in tracing_fill_pipe_page() commit 6eaaa5d57e76c454479833fc8594cd7c3b75c789 Author: Frederic Weisbecker tracing/core: use appropriate waiting on trace_pipe commit 5e3275ea447fe47611033263c761d04d28275046 Author: Ingo Molnar Revert "Revert "libata: Add 32bit PIO support"" commit ef41df4344ff952c79746d44a6126bd2cf7ed2bc Author: Huang Ying x86, mce: fix a race condition in mce_read() commit d6b75584a3eaab8cb2ab3e8cf90c5e57c1928a85 Author: Andi Kleen x86, mce: disable machine checks on offlined CPUs commit 5b4408fdaa62474dd9485cddb9126370d90d4b82 Author: Andi Kleen x86, mce: don't set up mce sysdev devices with mce=off commit 52d168e28bc11dd026b620fe1767cadde5a747cd Author: Andi Kleen x86, mce: switch machine check polling to per CPU timer commit 9bd984058088d6ef7af6946591a207e51a2f4890 Author: Andi Kleen x86, mce: always use separate work queue to run trigger commit 123aa76ec0cab5d4881cd8509faed43231e68801 Author: Andi Kleen x86, mce: don't disable machine checks during code patching commit 973a2dd1d50a11d380086601f14e59116f93e8c5 Author: Andi Kleen x86, mce: disable machine checks on suspend commit 9be1b56a3e718aa998772019c57c398dbb19e258 Author: Ingo Molnar x86, apic: separate 32-bit setup functionality out of apic_32.c commit a7eb518998529c08cc53fef17756d9fe433b0c23 Author: H. Peter Anvin x86: truncate ISA addresses to unsigned int commit f17c75453b2d195eba0a90d9f16a3ba88c85b3b4 Author: Ingo Molnar irq: name 'p' variables a bit better commit 2a05180fe2e5b414f0cb2ccfc80e6c90563e3c67 Author: Ingo Molnar x86, apic: move remaining APIC drivers to arch/x86/kernel/apic/* commit 8316e38100c70cd1443ac90074eccdd033aa218d Author: Ingo Molnar irq: further clean up the free_irq() code flow commit 35ebf1caa4854ad5ba25f3a72967acc064147994 Author: Steven Rostedt ftrace: show unlimited when traceon or traceoff has no counter commit 73d8b8bc4f24a97a406d09c8268ac019f4ac661e Author: Wenji Huang tracing: fix typing mistake in hint message and comments commit d2ef7c2f0f9ab48c25eafc0ebad0df5f7930420b Author: Wenji Huang tracing: fix the return value of trace selftest commit af513098452b8887d7c0e15a39d7cb74479501bd Author: Wenji Huang tracing: use the more proper parameter commit b6887d7916e44c1d8913084fb6aa5004d9473f1a Author: Steven Rostedt ftrace: rename _hook to _probe commit f62bae5009c1ba596cd475cafbc83e0570a36e26 Author: Ingo Molnar x86, apic: move APIC drivers to arch/x86/kernel/apic/* commit be163a159b223e94b3180afdd47a8d468eb9a492 Author: Ingo Molnar x86, apic: rename 'genapic' to 'apic' commit ab6fb7c0b03e2c3286f316c840347be8b9ee3d9f Author: Ingo Molnar x86, apic: remove ->store_NMI_vector() commit cb81eaedf12d3e5e6e3dcf3320089660f7fb7464 Author: Ingo Molnar x86, numaq_32: clean up, misc commit 36afc3af04f4d3dfa709f7659fcadb3336d66ed2 Author: Ingo Molnar x86, numaq_32: clean up commit 7da18ed924b182f8174de243c55a323c56398675 Author: Ingo Molnar x86, es7000: misc cleanups commit 352887d1c9d99d4c2f0fbac6176ef0cd4fe7a820 Author: Ingo Molnar x86, es7000: remove dead code, clean up commit d3185b37df05e9ad7ce987a9a0419ffe1af9d23f Author: Ingo Molnar x86, es7000: remove externs commit b9e0d1aa9767707cad24db32d8ce0409df16d491 Author: Ingo Molnar x86, apic: remove apicid_cluster() commit 2c4ce18c95d632c9227ebcc6d45da11a9ef1ec70 Author: Ingo Molnar x86, es7000: clean up commit 2f205bc47f615b7bd0c7aba817d67ce25760eaf1 Author: Ingo Molnar x86, apic: clean up the cpu_2_logical_apiciddeclaration commit 77313190d121dd1fffa965aff6e9f0782a307bb8 Author: Ingo Molnar x86, apic: clean up arch/x86/kernel/bigsmp_32.c commit 5c615feb90ce63f2293a7ac7809f320f46c75e0a Author: Ingo Molnar x86, apic: remove stale references to APIC_DEFINITION commit e641f5f525acb163ba71d92de79c9c7366deae03 Author: Ingo Molnar x86, apic: remove duplicate asm/apic.h inclusions commit 7b6aa335ca1a845c2262ec7a595b4521bca0f79d Author: Ingo Molnar x86, apic: remove genapic.h commit e2780a68f889c9d7ec8e78d58a3a2be8cfebf202 Author: Ingo Molnar x86, apic: merge genapic.h into apic.h commit 28aa29eeb3918f820b914679cfc4404972f2df32 Author: Ingo Molnar remove: genapic prepare commit 6a24a244cd3a02d5b290293c32fcf2c6e92b4235 Author: Steven Rostedt ftrace: clean up coding style commit 7d01d32d3b9becd6deba318b718db3d9fc181d23 Author: Ingo Molnar x86, apic: fix build fallout of genapic changes commit c1eeb2de41d7015678bdd412b48a5f071b84e29a Author: Yinghai Lu x86: fold apic_ops into genapic commit 06cd9a7dc8a58186060a91b6ddc031057435fd34 Author: Yinghai Lu x86: add x2apic config commit ee8b53c1cfe33aecf0c77c0aa3ce437f0d84d831 Author: Ingo Molnar x86: remove stale arch/x86/include/asm/page_64.h.rej file commit 73d3fd96e77745742f3750b7b19ee42204adc210 Author: Ingo Molnar ftrace: fix !CONFIG_DYNAMIC_FTRACE ftrace_swapper_pid definition commit 97d0bb8dcd8c2812e1927cdb51d7b1f9c98352b5 Author: Ingo Molnar ftrace: fix !CONFIG_FTRACE [un_]register_ftrace_command() prototypes commit e110e3d1eaa0f9628918be67ddd32e8ad65a2871 Author: Steven Rostedt ftrace: add pretty print function for traceon and traceoff hooks commit 809dcf29ce4e1723709910878e050bd187617e0e Author: Steven Rostedt ftrace: add pretty print to selected fuction traces commit 8fc0c701c5b6c0c3e242758c3acef6f9047940a9 Author: Steven Rostedt ftrace: show selected functions in set_ftrace_filter commit 23b4ff3aa479c9e3bb23cb6b2d0a97878399784a Author: Steven Rostedt ftrace: add traceon traceoff commands to enable/disable the buffers commit 988ae9d6b2bc3ebdc1a488490250a6812f85e9d4 Author: Steven Rostedt ring-buffer: add tracing_is_on to test if ring buffer is enabled commit 59df055f1991c9fc0c71a9230663c39188f6972f Author: Steven Rostedt ftrace: trace different functions with a different tracer commit e6ea44e9b4c12325337cd1c06103cd515a1c02b2 Author: Steven Rostedt ftrace: consolidate mutexes commit 52baf11922db7377b580dd5448a07f71c6a35611 Author: Steven Rostedt ftrace: convert ftrace_lock from a spinlock to mutex commit f6180773d90595650e11de0118bb112018290915 Author: Steven Rostedt ftrace: add command interface for function selection commit e68746a271eb3393a2183840be9e903caddf765b Author: Steven Rostedt ftrace: enable filtering only when a function is filtered on commit 64e7c440618998fd69eee6ab490b042d12248021 Author: Steven Rostedt ftrace: add module command function filter selection commit 9f4801e30ad291e27284e873696da1ead92d68fa Author: Steven Rostedt ftrace: break up ftrace_match_records into smaller components commit 7f24b31b01a271b62346d9df084b029e48612163 Author: Steven Rostedt ftrace: rename ftrace_match to ftrace_match_records commit 265c831cb03d533cbe159af45798ac9fef534260 Author: Steven Rostedt ftrace: add do_for_each_ftrace_rec and while_for_each_ftrace_rec commit 0c75a3ed633419d75d823d5dcb05d42924c6ae61 Author: Steven Rostedt ftrace: state that all functions are enabled in set_ftrace_filter commit 37a25424252b6cff4dd4b1937ab6a1dbfcadabcc Author: Ingo Molnar perfcounters: fix acpi_idle_do_entry() workaround commit 2b8f836fb196acede88b6cc772e9057e0a9c0223 Author: Américo Wang sched: use TASK_NICE for task_struct commit 98c061b6cf2e7a1010286a7a4f672c4623e1b3e0 Author: Yinghai Lu x86: make APIC_init_uniprocessor() more like smp_prepare_cpus() commit 3bd25d0fa3ed588a6735b815cb0c146c23888ace Author: Yinghai Lu x86: pre init pirq_entries[] commit 3023a3e27b909b3b309edac4bc9beb8103f127fa Author: Ingo Molnar inotify: fix GFP_KERNEL related deadlock commit c99608637eac8834d830496c462c054137772122 Author: Jeremy Fitzhardinge x86, xen: do multicall callbacks with interrupts disabled commit 3d39e9d07b576ee72f2c94cfad9e618fe21763b2 Author: Jeremy Fitzhardinge x86, xen: degrade BUG to WARN when multicall fails commit b93d51dc62a41b5c2d6f32a0870709dc0cc55545 Author: Ian Campbell x86, xen: record and display initiator of each multicall when debugging commit 9033304a1520df346862c95743a6c2023f21f057 Author: Jeremy Fitzhardinge x86, xen: short-circuit tests for dom0 commit 73ca2f8380311115723c7afe811f3ed1f0ba945e Author: Ingo Molnar perfcounters: remove duplicate definition of LOCAL_PERF_VECTOR commit 970ec1a8213cd1a1ea29972ebbe4575a8b30bca1 Author: Yinghai Lu [IA64] fix __apci_unmap_table commit 6700ec65c207068a81a535e9dca616fefac21671 Author: Ingo Molnar lockdep: annotate reclaim context (__GFP_NOFS), fix commit a0a522ce3d6d8c907e45d4f2730ee8573484cc88 Author: Henrik Austad sched: idle_at_tick is only used when CONFIG_SMP is set commit a234aa9ecdf47a5461573a21dc0b154278df5ba8 Author: Rakib Mullick tracing: fix section mismatch in trace_hw_branches.c commit 88d0f550d71493cd975a11a03c166211b2f3bd32 Author: Yinghai Lu x86: make 32bit to call enable_IO_APIC early like 64bit commit ae88a23b32fa7e0dc9fa7ce735966e68eb41b0bc Author: Ingo Molnar irq: refactor and clean up the free_irq() code flow commit 327ec5699c29454322d0136375f717f509c145b6 Author: Ingo Molnar irq: clean up manage.c commit f6db44df5bd39ed33883786d35342759af796e4a Author: Yinghai Lu x86: fix typo in filter_cpuid_features() commit 868a23a8043f2a3042dae60105c89bd4680187ba Author: Peter Zijlstra lockdep: build fix for !PROVE_LOCKING commit 9833f8cb952b9aa3f98a71e7bef8820cee3261a0 Author: Peter Zijlstra lockstat: warn about disabled lock debugging commit b4b136f44b3b7adb9265fd5566d0ea9b99b1cd5f Author: Peter Zijlstra lockdep: use stringify.h commit 4f367d8adca947bed4385740a13d1efb1a06fba1 Author: Peter Zijlstra lockdep: simplify check_prev_add_irq() commit f510b233cfc7bfd57b6007071c52aa42e3d16b06 Author: Peter Zijlstra lockdep: get_user_chars() redo commit 3ff176ca47911630d1555f150d36daa2d0819ea9 Author: Peter Zijlstra lockdep: simplify get_user_chars() commit 38aa2714382d886f77f2565277fce293122808b0 Author: Peter Zijlstra lockdep: add comments to mark_lock_irq() commit cf2ad4d13c4ac6366c730fcf6c6be00db12fb75f Author: Peter Zijlstra lockdep: remove macro usage from mark_held_locks() commit 9d3651a23dc1f7ed7d207f9118459d3a73d485a7 Author: Peter Zijlstra lockdep: fully reduce mark_lock_irq() commit 42c50d544e009cd9b1a8e74d7c5ce8d03ca917ad Author: Peter Zijlstra lockdep: merge the !_READ mark_lock_irq() helpers commit 780e820b2dfefdfead9243724c2d2b73f379fda6 Author: Peter Zijlstra lockdep: merge the _READ mark_lock_irq() helpers commit cd95302d255264c5e6ebe1063320d80517bf2f83 Author: Peter Zijlstra lockdep: simplify mark_lock_irq() helpers #3 commit f989209e2f604730888a6daa3b3ff30ed0c9d7c0 Author: Peter Zijlstra lockdep: further simplify mark_lock_irq() helpers commit 604de3b5b63ebc33a762c44d9c742f235b010346 Author: Peter Zijlstra lockdep: simplify the mark_lock_irq() helpers commit 6a6904d3475cc5e4a506b5c3c3684444e22c4cc4 Author: Peter Zijlstra lockdep: split up mark_lock_irq() commit fabe9c42c6328de314d811887b4752eb3d202291 Author: Peter Zijlstra lockdep: generate usage strings commit d7b1b02134272840f4b655136e00c461e1cf1d53 Author: Peter Zijlstra lockdep: generate the state bit definitions commit 9851673bc32bc9fcafbbaeffc858ead434bd6d58 Author: Peter Zijlstra lockdep: move state bit definitions around commit 5346417e17daf5a7712e4cf030b45414e46607cf Author: Peter Zijlstra lockdep: simplify mark_lock() commit 36bfb9bb03db2002a8574600c6aeb4cdd1ba01a6 Author: Peter Zijlstra lockdep: simplify mark_held_locks commit 9fe51abf7a1c787f918f66fa3cef9cd0cedb3791 Author: Peter Zijlstra lockdep: lockdep_states.h commit a652d7081bc96b3094e85ca30e47f50185d2f717 Author: Peter Zijlstra lockdep: sanitize reclaim bit names commit 4fc95e867f1e75351b89db3c68212dfcce7ea563 Author: Peter Zijlstra lockdep: sanitize bit names commit cf40bd16fdad42c053040bcd3988f5fdedbb6c57 Author: Nick Piggin lockdep: annotate reclaim context (__GFP_NOFS) commit 6f2b9b9a9d750a9175dc79c74bfed5add840983c Author: Johannes Berg timer: implement lockdep deadlock detection commit bf33a70a73876b163d62612e9567cbac6604ba7e Author: James Bottomley x86: fix "__udivdi3" [drivers/scsi/aha1542.ko] undefined commit 9b3651cbc26cfcea8276ecaff66718ea087f2e91 Author: Jeremy Fitzhardinge x86: move more pagetable-related definitions into pgtable*.h commit 0341c14da49e7b93d2998926f6ac89a3129e3fa1 Author: Jeremy Fitzhardinge x86: use _types.h headers in asm where available commit c466ed2e4337c5eb03b283da507eb5328ab06c73 Author: Dimitri Sivanich x86, UV: set full apicid in uv_hub_send_ipi commit b5f9fd0f8a05c9bafb91a9a85b9110938d8e585b Author: Jason Baron tracing: convert c/p state power tracer to use tracepoints commit 694aa960608d2976666d850bd4ef78053bbd0c84 Author: Ian Campbell xen: fix xen_flush_tlb_others commit beb6943d8df7ce9278282101af4e0f6f7b648451 Author: Ingo Molnar x86 headers: protect page_32.h via __ASSEMBLY__ commit e43623b4ed1d0a1a86f0e05a2df8b9637b90ddd7 Author: Ingo Molnar x86 headers: include page_types.h in pgtable_types.h commit 56cefcea7c8769ffc04a5609e6ac849e36685468 Author: Ingo Molnar x86 headers: include linux/types.h commit 999c7880cc8eeb0cbe6610b8c6d0ab0ec51cd848 Author: Ingo Molnar x86 headers: remove duplicate pud_large() definition commit c07c99b67233ccaad38a961c17405dc1e1542aa4 Author: Paul Mackerras perfcounters: make context switch and migration software counters work again commit 0e43785c57fee50fbc00ea0378e941efb61fa0c2 Author: Johannes Weiner irq: use GFP_KERNEL for action allocation in request_irq() commit 2a7b8df04c11a70105c1abe67d006455d3bdc944 Author: Steven Rostedt sched: do not account for NMIs commit 45141d4667d208421ca787a3301542b6a5e0b112 Author: Steven Rostedt ring-buffer: rename label out_unlock to out_reset commit 5a5fb7dbe88dd57dc2bef0f3be9da991e789612d Author: Steven Rostedt preempt-count: force hardirq-count to max of 10 commit 9f8d979f082a3ee1b27f32b7e0811b51c3ad1d15 Author: Ingo Molnar softlockup: move 'one' to the softlockup section in sysctl.c commit d88316c243e5458a1888edbe0353c4dec6e61c73 Author: Ingo Molnar x86, 32-bit: refactor find_low_pfn_range() commit 4769843bc265a9c24584b98709cf39e1df5c1404 Author: Ingo Molnar x86, 32-bit: clean up find_low_pfn_range() commit 3023533de43c5c01c660e1b48d3700b028eb4615 Author: Ingo Molnar x86: fix warning in find_low_pfn_range() commit c7b9f6812fda6189df64aea42ba79a2727ed1550 Author: Serge E. Hallyn fix namespaces: bug at mm/slub.c:2750 commit bd282422fe9566a89bc34af325efb6d2701903be Author: Ingo Molnar x86, defconfig: turn off CONFIG_SCSI_ISCSI_ATTRS=y commit 556831063bcf8fd818e92227c40e3eaabe759bab Author: Ingo Molnar x86, defconfig: turn off CONFIG_ENABLE_WARN_DEPRECATED commit dd5fc55449c5e7e4f008d7d26cda9e6e2bc94980 Author: Ingo Molnar x86, defconfig: update the 64-bit defconfig commit bc8bd002b8371ece81c9adbdce49d7e68f0a0cbc Author: Ingo Molnar x86, defconfig: update the 32-bit defconfig commit cb60a4c797de4a3df7f9fcac2215dc4d29086940 Author: Nick Piggin fix: Commit 31a12666d8f0c22235297e1c1575f82061480029 slows down Berkeley DB commit 58105ef1857112a186696c9b8957020090226a28 Author: Randy Dunlap x86: UV: fix header struct usage commit 744525092727827a9cf0044074db3e22dcf354fd Author: H. Peter Anvin x86: merge sys_rt_sigreturn between 32 and 64 bits commit 54321d947ae9d6a051b81e3eccaf2d8658aeecc6 Author: Jeremy Fitzhardinge x86: move pte types into pgtable*.h commit e2f5bda94152fa567f6b48126741014123f982b8 Author: Jeremy Fitzhardinge x86: define pud_flags and pud_large properly to allow non-PAE builds commit e42778de31d78ae262a3b901264eabefb9c3b51b Author: Jeremy Fitzhardinge x86: move defs around to allow paravirt.h to just include page_types.h commit 1dfc07aad5479f1fb832ff6f61a5a9ce822d9e1f Author: Jeremy Fitzhardinge x86: move 2 and 3 level asm-generic defs into page-defs commit 51c78eb3f0eb033f9fb4f2316851df1d9b07b953 Author: Jeremy Fitzhardinge x86: create _types.h counterparts for page*.h commit 1484096ceb4d5f2b27c0fe53f125ee0903eac9af Author: Jeremy Fitzhardinge x86: Include pgtable_32|64_types.h in pgtable_types.h commit fb3551491b20442c0de0d4debd54f40c654bbe98 Author: Jeremy Fitzhardinge x86: Split pgtable_64.h into pgtable_64_types.h and pgtable_64.h commit f402a65f93c7127b2bd93a4b2fe182cd859fb4c1 Author: Jeremy Fitzhardinge x86: Split pgtable_32.h into pgtable_32.h and pgtable_32_types.h commit 8d19c99faf6165ef095138dd595d46b9bbb34055 Author: Jeremy Fitzhardinge Split pgtable.h into pgtable_types.h and pgtable.h commit b924a28138572f03bc8647c2be8f876d27e2666a Author: Jeremy Fitzhardinge x86: rename *-defs.h to *-_types.h for consistency commit b12bdaf11f935d7be030207e3c77faeaeab8ded3 Author: Brian Gerst x86: use regparm(3) for passed-in pt_regs pointer commit 89e4b5930d8a59395219e7e3e4702e4653022b93 Author: Jaswinder Singh Rajput arlan-main.c fix compilation warnings for phys_addr_t commit 76a856397a5e08c43268b76afb1ef607f68e0fe2 Author: Jaswinder Singh Rajput ne3210.c fix compilation warning for phys_addr_t commit f537a53da9389f56df277057684df23997410e9c Author: Jaswinder Singh Rajput iscsi_ibft.c fix compilation warning commit 9c8976a1a51ce4a3e458cdf1c10cf651e7e97113 Author: Jaswinder Singh Rajput falcon fix compilation warnings commit 804852e4ffc983f9ee7600f78218698546fdc58d Author: Jaswinder Singh Rajput drm_proc.c fix compilation warning commit ba1511bf7fbda452138e4096bf10d5a382710f4f Author: Jaswinder Singh Rajput x86: kernel/mpparse.c fix compilation warnings commit 7651194fb715b2d57658c05a710408f6b8448951 Author: Jaswinder Singh Rajput x86: mm/init_32.c fix compilation warning commit 17993b49b1f540aace8e9b4242530d0b3376eb2a Author: Ingo Molnar x86: make hibernation always-possible commit 8e1568f3500287d0b36c9776132cb53a42d5651d Author: Yinghai Lu pci, x86, acpi: fix early_ioremap() leak commit c5c606d9dce6e0852a401c57a8b0542acdbb6796 Author: Ravikiran G Thirumalai x86: cleanup, rename CONFIG_X86_NON_STANDARD to CONFIG_X86_EXTENDED_PLATFORM commit 4bcf349a0f90d1e69eb35c6df0fa285c886c1cd6 Author: Paul Mackerras perfcounters: fix refcounting bug, take 2 commit 1c0040047d5499599cc231ca3f105be3ceff8562 Author: Dean Nelson SGI IA64 UV: fix ia64 build error in the linux-next tree commit 00f62f614bb713027b9296068d1879fbca511eb7 Author: Arnaldo Carvalho de Melo ring_buffer: pahole struct ring_buffer commit b22f4858126a6aa852ad745b94f6b25dbdea708e Author: Frederic Weisbecker tracing/sysprof: add missing tracing_{start,stop}_record_cmdline() commit 9c8bb6b534d1c89a20bf9bb45e1471cf8f4747c0 Author: Brian Gerst x86: drop -fno-stack-protector annotations after pt_regs fixes commit 253f29a4ae9cc6cdc7b94f96517f27a93885a6ce Author: Brian Gerst x86: pass in pt_regs pointer for syscalls that need it commit aa78bcfa01dec3cdbde3cda098ce32abbd9c3bf6 Author: Brian Gerst x86: use pt_regs pointer in do_device_not_available() commit ebd9026d9f8499abc60d82d949bd37f88fe34a41 Author: Ingo Molnar stackprotector: fix multi-word cross-builds commit 5c79d2a517a9905599d192db8ce77ab5f1a2faca Author: Tejun Heo x86: fix x86_32 stack protector bugs commit 5af759176cc767e7426f89764bde4996ebaaf419 Author: Mike Galbraith perfcounters: fix use after free in perf_release() commit 160d8dac12932ad6eb4a359b66521e2e3282ea7d Author: Ingo Molnar x86, apic: make generic_apic_probe() generally available commit cf2592f59c0e8ed4308adbdb2e0a88655379d579 Author: Frederic Weisbecker softlockup: ensure the task has been switched out once commit 0e81cb59c7120191c0243c686b591797bc79e5c6 Author: Alok Kataria x86, apic: fix initialization of wakeup_cpu commit ad0b0fd554dfc126b5750d14908dccc3bbf602be Author: Arjan van de Ven sched, latencytop: incorporate review feedback from Andrew Morton commit e7669b8e329255bbcb40af65b38e342825d97a46 Author: Hannes Eder tracing: fix sparse warning: attribute function with __acquires/__releases commit 5e39841c45cf5e6ea930ede1b0303309e03037a2 Author: Hannes Eder tracing: fix sparse warnings: fix (un-)signedness commit 4fd2735881bf4d8bf5e30979f31fc2f1b1d505fa Author: Hannes Eder tracing: fix sparse warnings: make symbols static commit 0475f9ea8e2cc030298908949e0d5da9f2fc2cfe Author: Paul Mackerras perf_counters: allow users to count user, kernel and/or hypervisor events commit c3706f005c3aaf570e71f0f083fdbb59a5a9fa2e Author: Wenji Huang tracing: fix typos in comments commit 810dc73265cd690b2bc6010489b4317bba2cda39 Author: Wenji Huang tracing: provide correct return value after outputting the event commit f54fc98aa656f334c1571df6e3ca9178ea223847 Author: Wenji Huang tracing: remove unneeded variable commit 4543ae7ce1cb8b5ff27a59009e7991ea63791a71 Author: Tobias Klauser tracing: storage class should be before const qualifier commit 966657883fdc3a2883a5e641ca4ec8f79ffb8ecd Author: Steven Rostedt tracing, x86: fix constraint for parent variable commit 667d24125839b6f3363d8177d7ed9fab8a40e45f Author: Lai Jiangshan ring_buffer: fix ring_buffer_read_page() commit b85fa01ed958ca59523a2db3c2ee647b98745d6a Author: Lai Jiangshan ring_buffer: fix typing mistake commit 22105e8880c11b2c9d51c933ce9a60812ec3052d Author: Ingo Molnar Revert "kprobes: check CONFIG_FREEZER instead of CONFIG_PM" commit 60a5317ff0f42dd313094b88f809f63041568b08 Author: Tejun Heo x86: implement x86_32 stack protector commit ccbeed3a05908d201b47b6c3dd1a373138bba566 Author: Tejun Heo x86: make lazy %gs optional on x86_32 commit d9a89a26e02ef9ed03f74a755a8b4d8f3a066622 Author: Tejun Heo x86: add %gs accessors for x86_32 commit f0d96110f9fd98a1a22e03b8adba69508843d910 Author: Tejun Heo x86: use asm .macro instead of cpp #define in entry_32.S commit d627ded5ab2f7818154d57369e3a8cdb40db2569 Author: Tejun Heo x86: no stack protector for vdso commit 5d707e9c8ef2a3596ed5c975c6ff05cec890c2b4 Author: Tejun Heo stackprotector: update make rules commit 76397f72fb9f4c9a96dfe05462887811c81b0e17 Author: Tejun Heo x86: stackprotector.h misc update commit 6cd61c0baa8bce32271226198b46c67a7a05d108 Author: Tejun Heo elf: add ELF_CORE_COPY_KERNEL_REGS() commit bf56957d176c279175464f385f3eb03d65819328 Author: Ian Campbell xen: expose enable_IO_APIC for 32-bit commit ca97ab90164c7b978abf9d82dc82d6dc2cbac4a0 Author: Jeremy Fitzhardinge x86: unstatic ioapic entry funcs commit c3e137d1e882c4fab9adcce7ae2be9bf3eb64c4c Author: Jeremy Fitzhardinge x86: add mp_find_ioapic_pin commit 4924e228ae039029a9503ad571d91086e4042c90 Author: Jeremy Fitzhardinge x86: unstatic mp_find_ioapic so it can be used elsewhere commit 3c552ac8a747d6c26d13302c54d71dae9f56f4ac Author: Jeremy Fitzhardinge x86: make apic_* operations inline functions commit 34cd4998d38f9bd04f34b78a7cb0c7f1bee00bd9 Author: Steven Rostedt tracing: clean up splice code commit ff98781bab2735e6c89793034173e0cb5007a7e5 Author: Eduard - Gabriel Munteanu tracing: Move pipe waiting code out of tracing_read_pipe(). commit 3c56819b14b00dd449bd776303e61f8532fad09f Author: Eduard - Gabriel Munteanu tracing: splice support for tracing_pipe commit b825e6cc7b1401862531df497a4a4daff8102ed5 Author: Yinghai Lu x86, es7000: fix ACPI table mappings commit 7d97277b754d3ee098a5ec69b6aaafb00c94e2f2 Author: Yinghai Lu acpi/x86: introduce __apci_map_table, v4 commit 05876f88ed9a66b26af613e222795ae790616252 Author: Jeremy Fitzhardinge acpi: remove final __acpi_map_table mapping before setting acpi_gbl_permanent_mmap commit eecb9a697f0b790e5840dae8a8b866bea49a86ee Author: Jeremy Fitzhardinge x86: always explicitly map acpi memory commit 1c14fa4937eb73509e07ac12bf8db1fdf4c42a59 Author: Jeremy Fitzhardinge x86: use early_ioremap in __acpi_map_table commit d278c48435625cb6b7edcf6a547620768b175709 Author: Mike Galbraith perf_counters: account NMI interrupts commit 23a185ca8abbeef64b6ffc33059b1d630e43ec10 Author: Paul Mackerras perf_counters: make software counters work as per-cpu counters commit b91facc367366b3f71375f337eb5997ec9ab4e69 Author: Frederic Weisbecker tracing/function-graph-tracer: handle the leaf functions from trace_pipe commit 90af9514ac99f51e81682c7bec8f9fb88a17a95c Author: Ian Campbell xen: explicitly initialise the cpu field of irq_info commit 3445a8fd7c6868bd9db0d1bea7d6e89004552122 Author: Jeremy Fitzhardinge xen: make sure that softirqs get handled at the end of event processing commit d77bbd4db475e2edc78edb7f94a258159c140b54 Author: Jeremy Fitzhardinge xen: remove irq bindcount commit ced40d0f3e8833bb8d7d8e2cbfac7da0bf7008c4 Author: Jeremy Fitzhardinge xen: pack all irq-related info together commit 792dc4f6cdacf50d3f2b93756d282fc04ee34bd5 Author: Jeremy Fitzhardinge xen: use our own eventchannel->irq path commit 54a353a0f845c1dad5fc8183872e750d667838ac Author: Jeremy Fitzhardinge xen: set irq_chip disable commit 7c1d7cdcef1b54f4a78892b6b99d19f12c4f398e Author: Jeremy Fitzhardinge x86: unify do_IRQ() commit 9b2b76a3344146c4d8d300874e73af8161204f87 Author: Jeremy Fitzhardinge x86: add handle_irq() to allow interrupt injection commit 1dfba05d0f1a9b4245bb242a7c17fe448811a520 Author: Ingo Molnar tracing/blktrace: move the tracing file to kernel/trace, fix commit c47c1b1f3a9d6973108020df1dcab7604f7774dd Author: Ingo Molnar x86, pgtable.h: fix 2-level 32-bit build commit e5f7f202f31fd05e9de7e1ba5a7b30de7855f5aa Author: Ingo Molnar x86, pgtable.h: macro-ify *_page() methods commit 726c0d95b6bd06cb83efd36a76ccf03fa9a770f0 Author: Ingo Molnar x86: early_printk.c - fix pgtable.h unification fallout commit 17406b82d621930cca8ccc1272cdac9a7dae8e40 Author: Mandeep Singh Baines softlockup: remove timestamp checking from hung_task commit b5db03c4355e568f1567758287b30a6a262d5057 Author: Arnaldo Carvalho de Melo tracing: handle unregistering the current tracer commit 3861a17bcc0af815f684c6178bc9ec2d790c350e Author: Frederic Weisbecker tracing/function-graph-tracer: drop the kernel_text_address check commit 1292211058aaf872eeb2a0e2677d237916b4501f Author: Frederic Weisbecker tracing/power: move the power trace headers to a dedicated file commit 7447dce96f2233d250bc39a4a10a42f7c3dd46fc Author: Frederic Weisbecker tracing/function-graph-tracer: provide a selftest for the function graph tracer commit 2db270a80b8f2238e536876cfb3987af02684df8 Author: Frederic Weisbecker tracing/blktrace: move the tracing file to kernel/trace commit 44581a28e805a31661469c4b466b9cd14b36e7b6 Author: Brian Gerst x86: fix abuse of per_cpu_offset commit 2add8e235cbe0dcd672c33fc322754e15500238c Author: Brian Gerst x86: use linker to offset symbols by __per_cpu_load commit d3770449d3cb058b94ca1d050d5ced4a66c75ce4 Author: Brian Gerst percpu: make PER_CPU_BASE_SECTION overridable by arches commit 548c8933801c9ee347b6f1bad2491e4286a4f3a2 Author: Hannes Eder kernel/irq: fix sparse warning: make symbol static commit 2c344e9d6e1938fdf15e93c56d6fe42f8410e9d3 Author: Arjan van de Ven x86: don't pretend that non-framepointer stack traces are reliable commit cc6c50066ec1ac98bef97117e2f078bb89bbccc7 Author: Yinghai Lu x86: find nr_irqs_gsi with mp_ioapic_routing commit f72dccace737df74d04a96461785a3ad61724b9f Author: Yinghai Lu x86: check_timer cleanup commit abcaa2b8319a7673e76c2391cb5de3045ab1b401 Author: Yinghai Lu x86: use NR_IRQS_LEGACY to replace 16 commit f1ee5548a6507d2b4293635c61ddbf12e2c00e94 Author: Yinghai Lu x86/irq: optimize nr_irqs commit 005bf0e6fa0e9543933fe2e36322af649df7cacb Author: Yinghai Lu irq: optimize init_kstat_irqs/init_copy_kstat_irqs commit 0f3c2a89c1451cdf6328f99977bd9decd4f708e1 Author: Yinghai Lu irq: clear kstat_irqs commit 634e42c35d9d673fb8b54ba9f55a1b456e112472 Author: Ingo Molnar Revert "fix warning in kernel/power/main.c" commit c30e802fa220a95a0d592561a869273eedadd102 Author: Vegard Nossum tasklets: new tasklet scheduling function commit 0fb807c3e573ff9de2965ca38c907605d4735d16 Author: Jaswinder Singh Rajput unconditionally include asm/types.h from linux/types.h commit 57794a9d48b63e34acbe63282628c9f029603308 Author: Wenji Huang trace: trivial fixes in comment typos. commit a81bd80a0b0a405dc0483e2c428332d69da2c79f Author: Steven Rostedt ring-buffer: use generic version of in_nmi commit 9a5fd902273d01170fd033691bd70b142baa7309 Author: Steven Rostedt ftrace: change function graph tracer to use new in_nmi commit 375b38b4214f29109a393ab762d468054bf52354 Author: Steven Rostedt nmi: add generic nmi tracking state commit 4e6ea1440c67de32d7c89aacf233472dfc3bce82 Author: Steven Rostedt ftrace, x86: rename in_nmi variable commit d8b891a2db13c8ed296158d6f8c4e335896d0cef Author: Steven Rostedt ring-buffer: allow tracing_off to be used in core kernel code commit 78d904b46a72fcf15ea6a39672bbef92953876b5 Author: Steven Rostedt ring-buffer: add NMI protection for spinlocks commit 1830b52d0de8c60c4f5dfbac134aa8f69d815801 Author: Steven Rostedt trace: remove deprecated entry->cpu commit fb08b20fe7c8491a35a4369cce60fcb886d7609d Author: Jeremy Fitzhardinge x86: Fix compile error in arch/x86/kernel/early_printk.c commit 133822c5c038b265ddb6545cda3a4c88815c7d3d Author: Jeremy Fitzhardinge x86: asm/io.h: unify ioremap prototypes commit 976e8f677e42757e5586ea04a9ac8bb8ddaa037e Author: Jeremy Fitzhardinge x86: asm/io.h: unify virt_to_phys/phys_to_virt commit dee5847df4461d56802c534c7ac0e15830591533 Author: Jeremy Fitzhardinge x86: unify pte_hidden commit 15d1e527c206430006ba971be66033a16a4bb91b Author: Jeremy Fitzhardinge x86: make _PAGE_HIDDEN conditional commit 26c8e3179933c5c9071b16db76ab6de58a787d06 Author: Jeremy Fitzhardinge x86: make pgd/pud/pmd/pte_none consistent commit 18a7a199f97a7509fb987722e543f1aac3d7ada5 Author: Jeremy Fitzhardinge x86: add and use pgd/pud/pmd_flags commit 6cf7150084500962b8e225e2409ec01ed06a2c71 Author: Jeremy Fitzhardinge x86: unify io_remap_pfn_range commit 7325cc2e333cdaaabd2103552458876ea85adb33 Author: Jeremy Fitzhardinge x86: unify pgd_none commit deb79cfb365c96ff960570d1bcf2c205424b6195 Author: Jeremy Fitzhardinge x86: unify pud_none commit cc290ca38cc4c78b0d6175633232f05b8d8732ab Author: Jeremy Fitzhardinge x86: unify pages_to_mb commit 99510238bb428091e7caba020bc5e18b5f30b619 Author: Jeremy Fitzhardinge x86: unify pmd_bad commit a61bb29af47b0e4052566d25f3391894306a23fd Author: Jeremy Fitzhardinge x86: unify pgd_bad commit 30f103167fcf2b08de64f5f37ece6bfff7392290 Author: Jeremy Fitzhardinge x86: unify pgd_bad commit 3f6cbef1d7f474d16f3a824c6d2910d930778fbd Author: Jeremy Fitzhardinge x86: unify pud_large commit 3fbc2444f465710cdf0c832461a6a14338437453 Author: Jeremy Fitzhardinge x86: unify pte_offset_kernel commit 346309cff6127a38731cf102de3413a562700b84 Author: Jeremy Fitzhardinge x86: unify pte_index commit 97e2817d3423d753fd2f80ea936a370032846382 Author: Jeremy Fitzhardinge x86: unify pmd_pfn commit 3180fba0eec0d14e4ac8183a90d643d0d3383c75 Author: Jeremy Fitzhardinge x86: unify pmd_pfn commit bd44d64db1db6acf2dea9ba130b8cb0a54e1dabd Author: Jeremy Fitzhardinge x86: remove redundant pfn_pmd definition commit 01ade20d5a22e6ef002cbb751dddc3a01a78f998 Author: Jeremy Fitzhardinge x86: unify pmd_offset commit e24d7eee0beda24504bf6a4aa03be68328557475 Author: Jeremy Fitzhardinge x86: unify pmd_index commit 20063ca4eb26d4b10f01d59925deea4aeee415e8 Author: Jeremy Fitzhardinge x86: unify pmd_page commit 3ffb3564cd3cd59de8a0d74430ffe2d43ae11f19 Author: Jeremy Fitzhardinge x86: unify pmd_page_vaddr commit 3d081b1812bd4de2bbef58c6d598ddf45493010e Author: Jeremy Fitzhardinge x86: unify pud_offset commit 7cfb81024bc1dbe8ad2bf5affd58a6a7ad4172ba Author: Jeremy Fitzhardinge x86: unify pud_index commit 777cba16aac5a1096db0b936912eb7fd06fb0cc5 Author: Jeremy Fitzhardinge x86: unify pgd_page commit f476961cb16312fe4cb80b2b457ef9acf220a7fc Author: Jeremy Fitzhardinge x86: unify pud_page commit aca159dbb13a5221819d5b3849b8c013f4829e9e Author: Jeremy Fitzhardinge x86: include pgtable_SIZE.h earlier commit 6fff47e3ac5e17f7e164ac4ff9ea29aba3c54d73 Author: Jeremy Fitzhardinge x86: unify pud_page_vaddr commit c5f040b12b2381591932a007432e7ed86b3f2796 Author: Jeremy Fitzhardinge x86: unify pgd_page_vaddr commit 4fea801ac95d6534a93aa01d3ac62be163d845af Author: Jeremy Fitzhardinge x86: unify pmd_none commit 649e8ef60fac0a2f6960cdb090d73e78717ac065 Author: Jeremy Fitzhardinge x86: unify pmd_present commit 9f38d7e85e914f10a875f65d283432d55a12fc27 Author: Jeremy Fitzhardinge x86: unify pgd_present commit 5ba7c91341be61e0942f792c237ac067d9f32f51 Author: Jeremy Fitzhardinge x86: unify pud_present commit 7c683851d96c8313586c0695b25ca41bde9f0f73 Author: Jeremy Fitzhardinge x86: unify pte_present commit 8de01da35e9dbbb4a9d1e9d5a37df98395dfa558 Author: Jeremy Fitzhardinge x86: unify pte_same commit a034a010f48bf49efe25098c16c16b9708ccbba5 Author: Jeremy Fitzhardinge x86: unify pte_none commit d206bbd3e4bda3e4d32e6fd248e79367b8a797b9 Author: Ingo Molnar pipes: increase buffering from 64K to 256K commit 527bdfee18ac6a4c026060c2c2b1144df9a5bf1f Author: Jaswinder Singh Rajput make linux/types.h as assembly safe commit 2678c07b07ac2076675e5d57653bdf02e9af1950 Author: Jaswinder Singh Rajput Neither asm/types.h nor linux/types.h is required for arch/ia64/include/asm/fpu.h commit 304cc6ae1bf7a8e6d00053fbe0b7e2b26cdddda2 Author: Ingo Molnar ring_buffer: remove unused flags parameter, fix commit b6f11df26fdc28324cf9c9e3b77f2dc985c1bb13 Author: Arnaldo Carvalho de Melo trace: Call tracing_reset_online_cpus before tracer->init() commit 51a763dd84253bab1d0a1e68e11a7753d1b702ca Author: Arnaldo Carvalho de Melo tracing: Introduce trace_buffer_{lock_reserve,unlock_commit} commit 0a9877514c4fed10a70720293b37213dd172ee3e Author: Arnaldo Carvalho de Melo ring_buffer: remove unused flags parameter commit 8f9ca475c994e4d32f405183d07e8c7eedbdbdb4 Author: Ingo Molnar x86: clean up arch/x86/Kconfig* commit 4f179d121885142fb907b64956228b369d495958 Author: Ingo Molnar x86, numaq: cleanups commit a146649bc19d5eba4f5bfac6720c5f252d517a71 Author: Ingo Molnar smp, generic: introduce arch_disable_smp_support(), build fix commit c5e954820335ef5aed1662b70aaf5deb9de16735 Author: Yinghai Lu x86: move default_ipi_xx back to ipi.c commit fdbecd9fd14198853bec4cbae8bc7af93f2e3de3 Author: Ingo Molnar x86, apic: explain the purpose of max_physical_apicid commit 65a4e574d2382d83f71b30ea92f86d2e40a6ef8d Author: Ingo Molnar smp, generic: introduce arch_disable_smp_support() instead of disable_ioapic_setup() commit 56fc82c5360cdf0b250b5eb74f38657b0402faa5 Author: Tejun Heo modpost: NOBITS sections may point beyond the end of the file commit 130ace11a9dc682541336d1fe5cb3bc7771a149e Author: Tejun Heo x86: style cleanups for xen assemblies commit 94be52dc075a32af4aa73d7e10f68734d62d6af2 Author: Mandeep Singh Baines softlockup: convert read_lock in hung_task to rcu_read_lock commit ce9dbe244bf2063c41792e40dae7745957b118e0 Author: Mandeep Singh Baines softlockup: check all tasks in hung_task commit ca835567dcb7c513a26a4396d86f12848e62de8d Author: Ingo Molnar drm, i915: select framebuffer support automatically commit 82aa9a1829199233f9bdaf26e2ee271114f4701e Author: Ingo Molnar perfcounters: fix "perf counters kills oprofile" bug, v2 commit dac74940289f350c2590bec92737833bad608541 Author: Steven Rostedt trace: code style clean up commit 7be421510b91491d5aa5a29fa1005712039b95af Author: Arnaldo Carvalho de Melo trace: Remove unused trace_array_cpu parameter commit 97e5b191ae7dc0f4f5b82b9db29782928b103b4d Author: Arnaldo Carvalho de Melo trace_branch: Remove unused function commit 268ccda0cb4d1292029d07ee3dbd07117baf6ecb Author: Arnaldo Carvalho de Melo trace: assign defaults at register_ftrace_event commit f036be96dd9ce442ffb9ab33e3c165f5178815c0 Author: Ingo Molnar printk: introduce printk_once() commit 18114f61359ac05e3aa797d53d63f40db41f798d Author: Hiroshi Shimamoto x86: uaccess: use errret as error value in __put_user_size() commit e4d0407185cdbdcfd99fc23bde2e5454bbc46329 Author: Jeremy Fitzhardinge xen: use direct ops on 64-bit commit 5393744b71ce797f1b1546fafaed127fc50c2b61 Author: Jeremy Fitzhardinge xen: make direct versions of irq_enable/disable/save/restore to common code commit 383414322b3b3ced0cbc146801e0cc6c60a6c5f4 Author: Jeremy Fitzhardinge xen: setup percpu data pointers commit 1f4f931501e9270c156d05ee76b7b872de486304 Author: Jeremy Fitzhardinge xen: fix 32-bit build resulting from mmu move commit 0973a06cde8cc1522fbcf2baacb926f1ee3f4c79 Author: Hiroshi Shimamoto x86: mm: introduce helper function in fault.c commit ae7462b4f1fe1f36b5d562dbd5202a2eba01f072 Author: Arnaldo Carvalho de Melo trace: make the trace_event callbacks return enum print_line_t commit d9793bd8018f835c64b10f44e278c86cecb8e932 Author: Arnaldo Carvalho de Melo trace: judicious error checking of trace_seq results commit 5b75af0a02fcf3b8899f38ff6f22164c5d8e2fdd Author: Mike Galbraith perfcounters: fix "perf counters kill oprofile" bug commit f5deb79679af6eb41b61112fadcda28b2a4cfb0d Author: Huang Ying x86: kexec: Use one page table in x86_64 machine_kexec commit 0eb592dbba40baebec9cdde3ff4574185de6cbcc Author: Jeremy Fitzhardinge x86/paravirt: return full 64-bit result commit 063f8913afb48842b9329e195d90d2c28e58aacc Author: Ingo Molnar x86: document 64-bit and 32-bit function call convention ABI commit da89ae05381945c17b9ce64121f78055fcd96764 Author: Randy Dunlap libfc: needs CRC32 commit b6b24fb850f0fb3fd42252b71e8e2e5c7be14dae Author: Ingo Molnar af9005_usb_module_init(): BUG: unable to handle kernel paging request at ff100000 commit 939b366977d29b5c0d53d1ea3b0b8cefb1e76202 Author: Arnaldo Carvalho de Melo blktrace: fix coding style in recent patches commit 750e1c18251345e662bb7e7062b5fd5c1ade36de Author: Jaswinder Singh Rajput headers_check fix cleanup: linux/reiserfs_fs.h commit 5007b1fc4ef2c1b496536b2f026353c1d44d92ef Author: Jaswinder Singh Rajput headers_check fix cleanup: linux/nubus.h commit f2cddb29ebfc02dfd2c4b439aa0433393ad15575 Author: Jaswinder Singh Rajput headers_check fix cleanup: linux/coda_psdev.h commit 08a06b83ff8b2779289f733348c669f31cb65d51 Author: Arnaldo Carvalho de Melo blkftrace: binary tracing, synthesizing old format commit 2c9b238eb325895d3312dad64e2685783575e474 Author: Arnaldo Carvalho de Melo trace: Change struct trace_event callbacks parameter list commit c4a8e8be2d43cc22b371e8e9c05c253409759d94 Author: Frederic Weisbecker trace: better manage the context info for events commit 0d688da5505d77bcef2441e0a22d8cc26459702d Author: Yasunori Goto IA64: fix swiotlb alloc_coherent for non DMA_64BIT_MASK devices, fix commit 79fb0768fbd371f3b94d909f51f587b3a24ab272 Author: Steven Rostedt trace: let boot trace be chosen by command line commit b2821ae68b14480bfc85ea1629537163310bc5cd Author: Steven Rostedt trace: fix default boot up tracer commit 452c37bf9ac283491821d3d339f7fbef3a783e1f Author: Ingo Molnar Revert "fix warning in drivers/media/video/usbvision/usbvision-i2c.c" commit 3bacaf110769850896e2a2a7196fa69d7a7de42d Author: Ingo Molnar Revert "fix warnings in drivers/media/dvb/ttusb-dec/ttusb_dec.c" commit 3c2f59bc7f15c6e1c22263cfd222639a267c1436 Author: Ingo Molnar Revert "fix warning in drivers/media/dvb/frontends/drx397xD.c" commit cbd0fcc75c1b78101c131e990e803a1521c9470f Author: Ingo Molnar Revert "fix warning in drivers/media/dvb/dvb-usb/af9005-fe.c" commit 99bd720b253cc8fa1e094e89ea4ddb3902fb43f6 Author: Ingo Molnar Revert "fix warning in drivers/media/common/tuners/mxl5007t.c" commit ef3892bd63420380d115f755d351d2071f1f805f Author: Yinghai Lu x86, percpu: fix kexec with vmlinux commit 3bd323a1da42525317e2ce6c93b97b5ba653bc9d Author: H. Peter Anvin x86 setup: a20: early timeout for a nonexistent keyboard controller commit 15c554439faedfa490389b31db893dc764245e88 Author: Jaswinder Singh Rajput headers_check fix: x86, setup.h commit 8d4b4981195849dd50ed94be33ede926c6f41dcd Author: Jaswinder Singh Rajput headers_check fix: x86, prctl.h commit 11d9f653aff1d445b4300ae1d2e2d675a0e9172f Author: Jaswinder Singh Rajput headers_check fix: linux/reinserfs_fs.h commit 7d7dc0d6b0565484e0623cb08b5dcdd56424697b Author: Jaswinder Singh Rajput headers_check fix: linux/socket.h commit 9fe03bc3139503fbad66016bf714f4575babf651 Author: Jaswinder Singh Rajput headers_check fix: linux/nubus.h commit 25d00fddf8d23234da2d45c051a14450939496d6 Author: Jaswinder Singh Rajput headers_check fix: linux/in6.h commit 7e7f4eae28711fbb7f4d5e4b0aa3195776194bc1 Author: Jaswinder Singh Rajput headers_check fix: linux/coda_psdev.h commit 664c7954721adfc9bd61de6ec78f89f482f1a802 Author: Jeremy Fitzhardinge x86/vmi: fix interrupt enable/disable/save/restore calling convention. commit e584f559c7b8711cccdf319400acd6294b2c074e Author: Jeremy Fitzhardinge x86/paravirt: don't restore second return reg commit 15081c61362618a0c81cc8d04e45e7427bc1ed71 Author: Jaswinder Singh Rajput x86: irqinit_32.c fix compilation warning commit 1ff8f739c7cc4eaa89b6ba986494f458ff7bdbef Author: Jaswinder Singh Rajput headers_check fix: xtensa, swab.h commit 48109870bab7e66f30f933cd218258368024cd9f Author: Jaswinder Singh Rajput headers_check fix: powerpc, swab.h commit 1a16bc4590fcc94630571c541c8fef7a0845c2c0 Author: Jaswinder Singh Rajput headers_check fix: powerpc, spu_info.h commit 122bb2207b8107ce117d10fcfd3a2f6c3804a362 Author: Jaswinder Singh Rajput headers_check fix: powerpc, ps3fb.h commit 9f2cd967b7f029ebe2c74969709ff9c745344dba Author: Jaswinder Singh Rajput headers_check fix: powerpc, kvm.h commit 785857f5f0b7fbeed934e39af24edec471637375 Author: Jaswinder Singh Rajput headers_check fix: powerpc, elf.h commit 4be2c7ff4f362e41706e84a3d6726bdcda9ab65f Author: Jaswinder Singh Rajput headers_check fix: powerpc, bootx.h commit 726da1e3408caae6af8372f93380f18986f1003b Author: Jaswinder Singh Rajput headers_check fix: parisc, swab.h commit 79f95ac2412c993e52f02cfde1f71d141b2e530d Author: Jaswinder Singh Rajput headers_check fix: parisc, pdc.h commit bef53ca086e069a3fb8e6bf4ecf06221de9b445f Author: Jaswinder Singh Rajput headers_check fix: mn10300, swab.h commit a9f6acc5ab36c7533c9b3e224f7c209d8da4048d Author: Jaswinder Singh Rajput headers_check fix: mips, swab.h commit ae612fb05b0f60ff58e2a86eea46dc99532d62c5 Author: Jaswinder Singh Rajput headers_check fix: mips, sigcontext.h commit d8cbec15af88e067f33cb78efad15d581fa79b12 Author: Jaswinder Singh Rajput headers_check fix: m32r, swab.h commit 040c92b8e5f080e1f5a610bf0e10c683328dce75 Author: Jaswinder Singh Rajput headers_check fix: ia64, swab.h commit 6ce795065bdd2bfeebd97fa91a95918dcff7d0ec Author: Jaswinder Singh Rajput headers_check fix: ia64, kvm.h commit 1ecbb7fcfd20803bdd403de0c9c514da7d6c8843 Author: Jaswinder Singh Rajput headers_check fix: ia64, intrinsics.h commit a812a9170c5db5390280eb4fa075f1555e6ae53c Author: Jaswinder Singh Rajput headers_check fix: ia64, gcc_intrin.h commit fa9ea6c7abd94482ecd84e130676b6a1b3e61c2c Author: Jaswinder Singh Rajput headers_check fix: ia64, fpu.h commit 295803eea178d777cf3813b16696c54b0b2bcd23 Author: Jaswinder Singh Rajput headers_check fix: h8300, swab.h commit dacd762eabf69e32f0e9181f99fd19b6f96ea5c5 Author: Jaswinder Singh Rajput headers_check fix: frv, swab.h commit 350eb8b3cb5e4860a4c8352f2cca00e6eb4a16b2 Author: Jaswinder Singh Rajput headers_check fix: blackfin, swab.h commit 1c6ce704f1e965f64ad0b017842854ceec5b9cc7 Author: Jaswinder Singh Rajput headers_check fix: avr32, swab.h commit e42ec2418fa96f98ed8d4e6d8a572a7200156df6 Author: Jaswinder Singh Rajput headers_check fix: arm, swab.h commit 4af3bf6b393a2cec947cd42cc10fc03f5b782484 Author: Jaswinder Singh Rajput headers_check fix: arm, setup.h commit f100e6d0368742ddb8b6b9be986536e63117c05a Author: Jaswinder Singh Rajput headers_check fix: arm, a.out.h commit 3fd59061b7b16dd0bb7bf779ba297daa5f0bf0f5 Author: Jaswinder Singh Rajput headers_check fix: alpha, swab.h commit 0fc2eb3bade59365ed0b28b8ea3b5c448b2f4a26 Author: Jaswinder Singh Rajput headers_check fix: alpha, statfs.h commit 5e54f5986a579b8445aa1d5ad3435c2cf7568bed Author: Mandeep Singh Baines softlockup: remove unused definition for spawn_softlockup_task commit 795f99b61d20c34cb04d17d8906b32f745a635ec Author: Jeremy Fitzhardinge xen: setup percpu data pointers commit 11e3a840cd5b731cdd8f6f956dfae78a8046d09c Author: Jeremy Fitzhardinge x86: split loading percpu segments from loading gdt commit 552be871e67ff577ed36beb2f53d078b42304739 Author: Brian Gerst x86: pass in cpu number to switch_to_new_gdt() commit 2749ebe320ff9f77548d10fcc0a3464ac21c8e58 Author: Cliff Wickman x86: UV fix uv_flush_send_and_wait() commit d8106d2e24d54497233ca9cd97fa9bec807de458 Author: Ingo Molnar x86, vm86: clean up invalid_vm86_irq() commit 009eb3fe146aa6f1951f3c5235851bb8d1330dfb Author: Ingo Molnar x86, irq: describe NR_IRQ sizing details, clean up commit c379698fdac7cb65c96dec549850ce606dd6ceba Author: Ingo Molnar x86, irq_vectors.h: remove needless includes commit 9fc2e79d4f239c1c1dfdab7b10854c7588b39d9a Author: Ingo Molnar x86, irq: add IRQ layout comments commit 3e92ab3d7e2edef5dccd8b0db21528699c81d2c0 Author: Ingo Molnar x86, irqs, voyager: remove Voyager quirk commit ed74ca6d5a3e57eb0969d4e14e46cf9f88d25d3f Author: Ingo Molnar x86, voyager: move Voyager-specific defines to voyager.h commit 647ad94fc0479e33958cb4d0e20e241c0bcf599c Author: Ingo Molnar x86, apic: clean up spurious vector sanity check commit 5da690d29f0de17cc1835dd3eb8f8bd0945521f0 Author: Ingo Molnar x86, apic: unify the APIC vector enumeration commit 8f47e16348e8e25eedf639092a8a2f10a66aba34 Author: Ingo Molnar x86: update copyrights commit d1de36f5b5a30b8f9dae7142516fb122ce1e0661 Author: Ingo Molnar x86, apic: clean up header section commit 193c81b979adbc4a540bf89e75b9039fae75bf82 Author: Ingo Molnar x86, irq: add LOCAL_PERF_VECTOR commit 7e3fa56141175026136b392fd026d5d07c49720e Author: Sam Ravnborg kbuild: drop check for CONFIG_ in headers_check commit 4767afbf1f60f73997a7eb69a86d380f1fb27a92 Author: Jeremy Fitzhardinge x86/paravirt: fix missing callee-save call on pud_val commit da5de7c22eb705be709a57e486e7475a6969b994 Author: Jeremy Fitzhardinge x86/paravirt: use callee-saved convention for pte_val/make_pte/etc commit 791bad9d28d405d9397ea0c370ffb7c7bdd2aa6e Author: Jeremy Fitzhardinge x86/paravirt: implement PVOP_CALL macros for callee-save functions commit ecb93d1ccd0aac63f03be2db3cac3fa974716f4c Author: Jeremy Fitzhardinge x86/paravirt: add register-saving thunks to reduce caller register pressure commit 9104a18dcdd8dfefdddca8ce44988563f13ed3c4 Author: Jeremy Fitzhardinge x86/paravirt: selectively save/restore regs around pvops calls commit b8aa287f77be943e37a84fa4657e27df95269bfb Author: Jeremy Fitzhardinge x86: fix paravirt clobber in entry_64.S commit 41edafdb78feac1d1f8823846209975fde990633 Author: Jeremy Fitzhardinge x86/pvops: add a paravirt_ident functions to allow special patching commit 319f3ba52c71630865b10ac3b99dd020440d681d Author: Jeremy Fitzhardinge xen: move remaining mmu-related stuff into mmu.c commit 6b64ee02da20d6c0d97115e0b1ab47f9fa2f0d8f Author: Ingo Molnar x86, apic, 32-bit: add self-IPI methods commit 3ac6cffea4aa18007a454a7442da2855882f403d Author: Tejun Heo linker script: use separate simpler definition for PERCPU() commit ecf441b593ac41cb8cd8cd3695110167c42e098c Author: Randy Dunlap kmemtrace: fix printk formats, fix commit 4d87c5bec5389625d80b71108795aecf82cd670d Author: Andrew Morton fix "sparseirq: use kstat_irqs_cpu on non-x86 architectures too" commit 26f7ef14a76b0e590a3797fd7b2f3cee868d9664 Author: Yinghai Lu x86: don't treat bigsmp as non-standard commit 43f39890db2959b10891cf7bbf3f53fffc8ce3bd Author: Yinghai Lu x86: seperate default_send_IPI_mask_sequence/allbutself from logical commit 1ff2f20de354a621ef4b56b9cfe6f9139a7e493b Author: Yinghai Lu x86: fix compiling with 64bit with def_to_bigsmp commit 36ef4944ee8118491631e317e406f9bd15e20e97 Author: Yinghai Lu x86, apic unification: remove left over files commit 39ba5d43fc9133696240fc8b6b13e7a41fea87cd Author: Yasuaki Ishimatsu x86: unify PM-Timer messages commit 754ef0cd65faac4840ada4362bda322d9a811fbf Author: Yasuaki Ishimatsu x86: fix debug message of CPU clock speed commit 4272ebfbefd0db40073f3ee5990bceaf2894f08b Author: Yinghai Lu x86: allow more than 8 cpus to be used on 32-bit commit 019a1369667c3978f9644982ebe6d261dd2bbc40 Author: Hiroshi Shimamoto x86: uaccess: fix compilation error on CONFIG_M386 commit fbeb2ca0224182033f196cf8f63989c3e6b90aba Author: Suresh Siddha x86: unify genapic code, unify subarchitectures, remove old subarchitecture code, xapic fix commit dba3d36b2f0842ed7f25c33cd3a2ccdb3d0df9db Author: Ingo Molnar Revert "generic, x86: fix __per_cpu_load relocation" commit 010060741ad35eacb504414bc6fb9bb575b15f62 Author: Peter Zijlstra x86: add might_sleep() to do_page_fault() commit d7ab5c46ae2743079a40bb4060e510418c0842b4 Author: FUJITA Tomonori intel-iommu: make dma mapping functions static commit dfb805e831cc5306b14eacd64e0b36d0d973ee0d Author: FUJITA Tomonori IA64: fix VT-d dma_mapping_error commit 97d9800de9df9c6e71b00c0a26239c7d7f6a46c4 Author: FUJITA Tomonori IA64: fix swiotlb alloc_coherent for non DMA_64BIT_MASK devices commit 0a1e8869f453ceda121a1ff8d6c4380832377be7 Author: Cyrill Gorcunov x86: trampoline_64.S - use predefined constants with simplification commit b3a8c34886d0e3dd3a24a5b614ee025181da2f41 Author: Arnaldo Carvalho de Melo trace_sched_wakeup: Remove unused variable commit f04109bf1be7449e27d38ae1bb8465013374bd49 Author: Arnaldo Carvalho de Melo trace: Use tracing_reset_online_cpus in more places commit 700a3dcb9036d17d3a67d0a7ceee9d4373fbb570 Author: Arnaldo Carvalho de Melo blktrace: Use tracing_reset_online_cpus commit 65d370862f64973611a271ced61864b5f9bb6fc0 Author: Mike Galbraith perfcounters: fix refcounting bug commit 3769e7b4d8ef113e08221a210f849ba57475aff5 Author: Ingo Molnar x86/Voyager: move to the X86_32_NON_STANDARD code section commit e0c7ae376a13fd79a4dad8becab51040d13dfa90 Author: Ingo Molnar x86: rename X86_GENERICARCH to X86_32_NON_STANDARD commit e2c75d9f54334646b3dcdf1fea0d1afe7bfbf644 Author: Ingo Molnar x86: remove the subarch menu commit 6a48565ed6ac76f351def25cd5e9f181331065f6 Author: Ingo Molnar x86: move X86_VSMP from subarch menu commit 9c39801763ed6e08ea8bc694c5ab936643a2b763 Author: Ingo Molnar x86: move non-standard 32-bit platform Kconfig entries commit f67ae5c9e52e385492b94c14376e322004701555 Author: Ingo Molnar x86: move VOYAGER to the NON_STANDARD_PLATFORM section commit 9e111f3e167a14dd6252cff14fc7dd2ba4c650c6 Author: Ingo Molnar x86: move ELAN to the NON_STANDARD_PLATFORM section commit 06ac8346af04f6a972072f6c5780ba734832ad13 Author: Ingo Molnar x86: cleanup, introduce CONFIG_NON_STANDARD_PLATFORMS commit 1ec2dafd937c0f6fed46cbd8f6878f2c1db4a623 Author: Ingo Molnar x86/Voyager: remove ISA quirk commit 1c61d8c309a4080980474de8c6689527be180782 Author: Ingo Molnar x86/Voyager: remove power management Kconfig quirk commit 4b19ed915576e8034c3653b4b10b79bde10f69fa Author: Ingo Molnar x86/Voyager: remove HOTPLUG_CPU Kconfig quirk commit e006235e5b9cfb785ecbc05551788e33f96ea0ce Author: Ingo Molnar x86/Voyager: remove MCE quirk commit 7cd92366a593246650cc7d6198e2c7d3af8c1d8a Author: Ingo Molnar x86/Voyager: remove APIC/IO-APIC Kbuild quirk commit c3e6a2042fef33b747d2ae3961f5312af801973d Author: Ingo Molnar x86/Voyager: remove PARAVIRT Kconfig quirk commit 54523edd237b9e792a3b76988fde23a91d739f43 Author: Ingo Molnar x86/Voyager: remove KVM_GUEST quirk commit e084e531000a488d2d27864266c13ac824575a8b Author: Ingo Molnar x86/Voyager: remove KVM_CLOCK quirk commit f154f47d5180c2012bf97999e6c600d45db8af2d Author: Ingo Molnar x86/Voyager: remove VMI Kconfig quirk commit 36619a8a80793a803588a17f772313d5c948357d Author: Ingo Molnar x86/VisWS: remove Kconfig quirk commit 550fe4f198558c147c6b8273a709568222a1668a Author: Ingo Molnar x86/Voyager: remove X86_FIND_SMP_CONFIG Kconfig quirk commit f095df0a0cb35a52605541f619d038339b90d7cc Author: Ingo Molnar x86/Voyager: remove X86_BIOS_REBOOT Kconfig quirk commit 23394d1c9346d9c0aabbc1b6fca52a9c0aa1c297 Author: Ingo Molnar x86/Voyager: remove X86_HT Kconfig quirk commit c0b5842a457d44c8788b3fd0c64969be7ef673cd Author: Ingo Molnar x86: generalize boot_cpu_id commit 3e5095d15276efd14a45393666b1bb7536bf179f Author: Ingo Molnar x86: replace CONFIG_X86_SMP with CONFIG_SMP commit f2fc0e3071230bb9ea9f64a08c3e619ad1357cfb Author: Ingo Molnar x86/Voyager: remove ARCH_SUSPEND_POSSIBLE Kconfig quirk commit aced3cee555f0b2fd58501e9b8a8a1295011e134 Author: Ingo Molnar x86/Voyager: remove HIBERNATION Kconfig quirk commit 49793b0341a802cf5ee4179e837a2eb20f12c9fe Author: Ingo Molnar x86/Voyager: remove KGDB Kconfig quirk commit e0ec9483dbe8f534e0f3ef413f9eba9a5ff78050 Author: Ingo Molnar x86/Voyager: remove KVM Kconfig quirk commit 07ef83ae9e99377f38f4d0e472ba6ff09324e5e9 Author: Ingo Molnar x86/Voyager: remove NATSEMI Kconfig quirk commit 72ee6ebbb3fe1ac23d1a669b177b858d2028bf09 Author: Ingo Molnar x86/Voyager: remove MCA Kconfig quirk commit 61b8172e57c4b8db1fcb7f5fd8dfda85ffd8e052 Author: Ingo Molnar x86: disable Voyager temporarily commit e7c64981949ec983ee41c2927c036fdb00d8e68b Author: Ingo Molnar x86/Voyager: clean up BROKEN Kconfig reference commit 6bda2c8b32febeb38ee128047253751e080bad52 Author: Ingo Molnar x86: remove subarchitecture support commit 1164dd0099c0d79146a55319670f57ab7ad1d352 Author: Ingo Molnar x86: move mach-default/*.h files to asm/ commit 7b38725318f4517af6168ccbff99060d67aba1c8 Author: Ingo Molnar x86: remove subarchitecture support code commit d53e2f2855f1c7c2725d550c1ae6b26f4d671c50 Author: Ingo Molnar x86, smp: remove mach_ipi.h commit 9f4187f0a3b93fc215b4472063b6c0b44364e60c Author: Ingo Molnar x86, bigsmp: consolidate header code commit b3daa3a1a56cf09fb91773f3658692fd02d08bb1 Author: Ingo Molnar x86, bigsmp: consolidate code commit 61b90b7ca10cc65d8b850ab542859dc593e5a381 Author: Ingo Molnar x86, NUMAQ: Consolidate code commit 2e096df8edefad78155bb406a5a86c182b17786e Author: Ingo Molnar x86, ES7000: Consolidate code commit 83d7aeabe4cf20e59b5d7fd56a75cfd0e0b6b880 Author: Suresh Siddha x86: remove mach_apic.h, fix commit 1dcdd3d15ecea0c22a09d4d001a39d425fceff2c Author: Ingo Molnar x86: remove mach_apic.h commit 7c20dcc545d78946e40e8fab99637fe815b1d211 Author: Ingo Molnar x86, summit: consolidate code, fix commit a448720ca3248e8a7a426336885549d6e923fd8e Author: Jeremy Fitzhardinge x86: unify asm/io.h: IO_SPACE_LIMIT commit 72fac1d1475c7abc0c4480580937af5bef93b370 Author: Ingo Molnar sata_sil: fix build breakage commit 3fdbaa2ec4bf090aa920a0d184c975cdc36ecbe8 Author: Kumar Gala dmi: Fix build breakage commit b11b867f78910192fc54bd0d09148cf768c7aaad Author: Ingo Molnar x86, summit: consolidate code commit 5a44632f77a9c867621f7bf80c233eac75fea672 Author: Ingo Molnar x86, numaq: consolidate code commit 328386d7ab600aa0993a1226f5817ac30a735724 Author: Ingo Molnar x86, smp: refactor ->wake_cpu commit 1f75ed0c1311a50ed393bcac258de65680d360e5 Author: Ingo Molnar x86: remove mach_apicdef.h commit b2af018ff26f1a2a026f548f7f0e552589905689 Author: Ingo Molnar x86: remove mach_mpspec.h commit fb5b33c9f62ca9222c11841d61ddb7dc1a6552e9 Author: Ingo Molnar x86: eliminate asm/mach-*/mach_mpparse.h commit 0939e4fd351c58d08d25650797749f18904461af Author: Ingo Molnar x86, smp: eliminate asm/mach-default/mach_wakecpu.h commit 018e047f3a98bd8d9e9d78b19bc38415f0c34dd7 Author: Ingo Molnar x86, ES7000: consolidate the APIC code commit 25dc004903a38f0b6f6626dbbab058c8709c5398 Author: Ingo Molnar x86, smp: refactor ->inquire_remote_apic() methods commit 3d5f597e938c425554cb7668fd3c9d6a536a984a Author: Ingo Molnar x86, smp: remove ->restore_NMI_vector() commit 7bd06ec63a1204ca44b9f1dc487b8632016162d1 Author: Ingo Molnar x86, smp: refactor ->store/restore_NMI_vector() methods commit 333344d94300500e401cffb4eea10a5ab6e5a41d Author: Ingo Molnar x86, smp: refactor ->smp_callin_clear_local_apic() methods commit a965936643e28af8152d9e960b966baa1a5588a2 Author: Ingo Molnar x86, smp: refactor ->wait_for_init_deassert() commit abfa584c8df8b691cf18f51c7d4af27e5b32be4a Author: Ingo Molnar x86: set ->trampoline_phys_low/high on 64-bit too commit 6f177c01db6b865181fbc6c948381b290ee09718 Author: Ingo Molnar x86, smp: clean up ->trampoline_phys_low/high handling commit dac5f4121df3c39fdb2ea57acd669a0ae19e46f8 Author: Ingo Molnar x86, apic: untangle the send_IPI_*() jungle commit debccb3e77be52cfc26c5a99e123c114c5c72aeb Author: Ingo Molnar x86, apic: refactor ->cpu_mask_to_apicid*() commit 94af18755266edf46803564414d74f9621aaded8 Author: Ingo Molnar x86, apic: get rid of *_APIC_ID_MASK definitions commit 5b8127277bc4cdca78eda5ee900a314642822ace Author: Ingo Molnar x86, apic: refactor ->apic_id_mask & APIC_ID_MASK commit ca6c8ed4646f8ccaa4f7db618bf69b8b8fb49767 Author: Ingo Molnar x86, apic: refactor ->get_apic_id() & GET_APIC_ID() commit 9c7642470ecf03d8b4946a2addc8fe631b8426dd Author: Ingo Molnar x86: consolidate the ->mps_oem_check() code commit 1322a2e2db87c938d8381f8501af9a4d0eab8bc7 Author: Ingo Molnar x86, mpparse: call the generic quirk handlers early commit 5f836405ef632ba82f4a5261ff2be4198e53b51b Author: Ingo Molnar x86, smp: clean up mps_oem_check() commit cb8cc442dc7e07cb5438b357843ab4095ad73933 Author: Ingo Molnar x86, apic: refactor ->phys_pkg_id() commit d4c9a9f3d416cfa1f5ffbe09d864d069467fe693 Author: Ingo Molnar x86, apic: unify phys_pkg_id() commit b0b20e5a3a6615ae750804523aeedd32911bb9d6 Author: Ingo Molnar x86, es7000: clean up es7000_enable_apic_mode() commit 4904033302c745342e3b3a611881cdee57fbe06a Author: Ingo Molnar x86: refactor ->enable_apic_mode() subarch methods commit a27a621001f4c3e57caf47feff4b014577fd01c6 Author: Ingo Molnar x86: refactor ->check_phys_apicid_present() subarch methods commit d83093b50416f4ca59d3a84b2ddc217748214d64 Author: Ingo Molnar x86: refactor ->setup_portio_remap() subarch methods commit 8058714a41afc4c983acb274b1adf7bd3cfe7f6e Author: Ingo Molnar x86, apic: clean up ->apicid_to_cpu_present() commit a21769a4461801454930a06bc18bd8249cd9e993 Author: Ingo Molnar x86, apic: clean up ->cpu_present_to_apicid() commit 5257c5111ca21c8e857b65a79ab986b313e1c362 Author: Ingo Molnar x86, apic: clean up ->cpu_to_logical_apicid() commit 3f57a318c36e1f24070a18df8c4971ca08d33142 Author: Ingo Molnar x86, apic: clean up ->apicid_to_node() commit 33a201fac698a93d9d1ffa77030ba2ff38d1a3d1 Author: Ingo Molnar x86, apic: streamline the ->multi_timer_check() quirk commit 72ce016583916fb7ffcbaa6a3e1f8f731b79a865 Author: Ingo Molnar x86, apic: clean up ->setup_apic_routing() commit d190cb87c4503014353f2310c4bfa2268fa7111d Author: Ingo Molnar x86, apic: clean up ->ioapic_phys_id_map() commit a5c4329622a3437adef4b2a4288d127957743c97 Author: Ingo Molnar x86, apic: clean up ->init_apic_ldr() commit e2d40b1878bd13ca1028ddd299c48e4821ac3535 Author: Ingo Molnar x86, apic: clean up ->vector_allocation_domain() commit 2e867b17cc02e1799f18126af0ddd7b63dd8f6f4 Author: Ingo Molnar x86, apic: remove no_balance_irq and no_ioapic_check flags commit d1d7cae8fd54a301a0de531b48451649933ffdcf Author: Ingo Molnar x86, apic: clean up check_apicid*() callbacks commit bdb1a9b62fc182d4da3143e346f7a0925d243352 Author: Ingo Molnar x86, apic: rename genapic::apic_destination_logical to genapic::dest_logical commit 0b06e734bff7554c31eac4aad2fc9be4adb7c1c1 Author: Ingo Molnar x86: clean up the APIC_DEST_LOGICAL logic commit 08125d3edab90644724652eedec3e219e3e0f2e7 Author: Ingo Molnar x86: rename ->ESR_DISABLE to ->disable_esr commit f6f52baf2613dd319e9ba3f3319bf1f1c442e4b3 Author: Ingo Molnar x86: clean up esr_disable() methods commit fe402e1f2b67a63f1e53ab2a316fc20f7ca4ec91 Author: Ingo Molnar x86, apic: clean up / remove TARGET_CPUS commit 0a9cc20b9c18372ba5a9fea990f5812f3ee01e32 Author: Ingo Molnar x86, apic: clean up target_cpus methods commit 7fe732862d9697cc1863286fbcace9a67f231b4c Author: Ingo Molnar x86, apic: remove IRQ_DEST_MODE commit 38bd77a6c35168b03b65f7438cdcc1257d550924 Author: Ingo Molnar x86, apic: remove ES7000_IRQ_DELIVERY_MODE and ES7000_IRQ_DEST_MODE commit d8a3539e64f8e27b0ab5bb7e7ba3b8f34b739224 Author: Ingo Molnar x86, apic: remove BIGSMP_IRQ_DELIVERY_MODE and BIGSMP_IRQ_DEST_MODE commit 1b1bcb3ff4e4934d949574cec90679219ace5412 Author: Ingo Molnar x86, apic: remove NUMAQ_IRQ_DELIVERY_MODE and NUMAQ_IRQ_DEST_MODE commit 82daea6b0890f739be1ad4ab1c1b922b1555582e Author: Ingo Molnar x86, apic: remove SUMMIT_IRQ_DELIVERY_MODE and SUMMIT_IRQ_DEST_MODE commit dcafa4a8c95ce063cbae0a5e61632bc3c4924e66 Author: Ingo Molnar x86, apic: remove DEFAULT_IRQ_DELIVERY_MODE and DEFAULT_IRQ_DEST_MODE commit 9b5bc8dc12421a4b17047061f473d85c1797d543 Author: Ingo Molnar x86, apic: remove IRQ_DEST_MODE / IRQ_DELIVERY_MODE commit f8987a1093cc7a896137e264c24e04d4048e9f95 Author: Ingo Molnar x86, genapic: rename int_delivery_mode, et. al. commit 7ed248daa56156f2fd7175f90b62fc6397b0c7b7 Author: Ingo Molnar x86: clean up apic->apic_id_registered() methods commit 306db03b0d71bf9c94155c0c4771a79fc70b4b27 Author: Ingo Molnar x86: clean up apic->acpi_madt_oem_check methods commit 9a6801da55e4a4492e8f666ac272efe8186682c8 Author: Ingo Molnar x86: remove APIC_INIT / APICFUNC / IPIFUNC commit 491a50c4fbcf6cc39a702a16a2dfaf42f0eb8058 Author: Ingo Molnar x86, genapic: cleanup 32-bit apic_summit template commit fed53ebf3c4e233e085c453a27ae287ccbf149fb Author: Ingo Molnar x86, genapic: cleanup 32-bit apic_es7000 template commit fea3437adf778cfe69b7f8cff0afb8060d84b647 Author: Ingo Molnar x86, genapic: cleanup 32-bit apic_numaq template commit d26b6d6660d704ffa59f22ad57c9103e3fba289f Author: Ingo Molnar x86, genapic: cleanup 32-bit apic_bigsmp template commit 0a7e8c64142b2ae5aacdc509ed112b8e362ac8a4 Author: Ingo Molnar x86, genapic: cleanup 32-bit apic_default template commit 504a3c3ad45d200a6ac8be5aa019c8fa05e26dc8 Author: Ingo Molnar x86: clean up apic_x2apic_cluster commit 05c155c235c757329ec89ad591516538ed8352c0 Author: Ingo Molnar x86: clean up apic_x2apic_phys commit c7967329911013a05920ef12832935c541bb8c9a Author: Ingo Molnar x86: clean up apic_x2apic_uv_x commit 4c3e51e05a7eefead4033b187394458ff8626497 Author: Ingo Molnar x86: clean up genapic_phys_flat commit f2f05ee8b8d346d4edee766384a5fedafdd4f9f8 Author: Ingo Molnar x86: clean up genapic_flat commit c8d46cf06dc2e3a8f57a350eb9f9b19fd7f2ffe5 Author: Ingo Molnar x86: rename 'genapic' to 'apic' commit 6781d948cc05b02df915650f2eb49550a1631df9 Author: Ingo Molnar x86, genapic: provide IPI callbacks unconditionally commit 505deeb1a228e5b0bf6ac5d0d78f4a4253a9efe9 Author: Ingo Molnar x86, genapic: cleanups commit ced733ec0bfe9a8a5140a7aefdfe802598e4b8c0 Author: Ingo Molnar x86, genapic: finish unification commit ef7471b13f3ef81074af1972b97355df9df3cdf3 Author: Ingo Molnar x86, genapic: unify struct genapic commit 943d0f74d47724d0e33083674c16a834f080af2c Author: Ingo Molnar x86, genapic: refactor genapic_32.h commit 6e7a59944a2971c4fb400bfbecb2f68570086b05 Author: Ingo Molnar x86, genapic: refactor genapic_64.h commit 8f6d86dc4178957d9814b1784848012a927a3898 Author: Peter Zijlstra x86: cpu_init(): remove ugly #ifdef construct around debug register clear commit 042cbaf88ab48e11afb725541e3c2cbf5b483680 Author: Andreas Schwab x86 setup: fix asm constraints in vesa_store_edid commit fb4467274de0c93e15c4a4fd3249d62454ba57dc Author: FUJITA Tomonori IA64: fix compile error on IA64_DIG_VTD commit 890252823766e562301e61340f3187a14033d045 Author: Cyrill Gorcunov x86: ftrace - simplify wait_for_nmi commit 32c0bd9624115041cfec31c0436995418083090a Author: Arnaldo Carvalho de Melo blktrace: the ftrace interface needs CONFIG_TRACING commit bd0838fc48c174cd386447059a414318e78169e1 Author: Hiroshi Shimamoto x86: intel_cacheinfo: fix compiler warning commit cf3997f507624757f149fcc42b76fb03c151fb65 Author: Tejun Heo x86: clean up indentation in setup_per_cpu_areas() commit 22f25138c345ec46a13744c93c093ff822cd98d1 Author: James Bottomley x86: fix build breakage on voyage commit 2697fbd5faf19c84c17441b1752bdcbdcfd1248c Author: Brian Gerst x86: load new GDT after setting up boot cpu per-cpu area commit 1825b8edc2034c012ae48f797d74efd1bd9d4f72 Author: Brian Gerst x86: remove extra barriers from load_gs_base() commit b2d2f4312b117a6cc647c8521e2643a88771f757 Author: Brian Gerst x86: initialize per-cpu GDT segment in per-cpu setup commit 89c9c4c58ee86e6e8802597271f23679e0c46647 Author: Brian Gerst x86: make Voyager use x86 per-cpu setup. commit 34019be1cd2941128b5de6d7c0fbdb51f967d268 Author: Brian Gerst x86: don't assume boot cpu is #0 commit 1688401a0fddba8991aa5c0943b8ae9583998d60 Author: Brian Gerst x86: move this_cpu_offset commit 996db817e3d1529d711e55b938d72ae4060b39fd Author: Brian Gerst x86: only compile setup_percpu.o on SMP commit ec70de8b04bf37213982a5e8f303bc38679f3f8e Author: Brian Gerst x86: move apic variables to apic.c commit 74631a248dc2c2129a96f6b8b706ed54bb5c3d3c Author: Brian Gerst x86: always page-align per-cpu area start and size commit 2f2f52bad72f5e1ca5d1b9ad00a7b57a8cbd9159 Author: Brian Gerst x86: move setup_cpu_local_masks() commit 6470aff619fbb9dff8dfe8afa5033084cd55ca20 Author: Brian Gerst x86: move 64-bit NUMA code commit 0d77e7f04d5da160307f4f5c030a171e004f602b Author: Brian Gerst x86: merge setup_per_cpu_maps() into setup_per_cpu_areas() commit bb3f0b59ad005d2d2ecbbe9bd048eab6d1ecbd31 Author: Yinghai Lu x86: make irqinit_32.c more like irqinit_64.c, v2 commit 157f9c00e88529ed84bd7d581a40d411e5414cf0 Author: Arnaldo Carvalho de Melo tracing/blktrace: fix up checkpatch reported problems in ftrace plugin patch commit 0ee2ad84d36760c8e36a6a6729998dc7a4eacf38 Author: Heiko Carstens sysrq: include interrupt.h instead of irq.h commit 5a611268b69f05262936dd177205acbce4471358 Author: Brian Gerst generic, x86: fix __per_cpu_load relocation commit c71a896154119f4ca9e89d6078f5f63ad60ef199 Author: Arnaldo Carvalho de Melo blktrace: add ftrace plugin commit 9011262a37cb438f0fa9394b5e83840db8f9680a Author: Arnaldo Carvalho de Melo ftrace: add ftrace_vprintk commit d5e397cb49b53381e4c99a064ca733c665646de8 Author: Ingo Molnar x86: improve early fault/irq printout commit 34707bcd0452aba644396767bc9fb61585bdab4f Author: Ingo Molnar x86, debug: remove early_printk() #ifdefs from head_32.S commit 2d4d57db692ea790e185656516e6ebe8791f1788 Author: Frederic Weisbecker x86: micro-optimize __raw_read_trylock() commit cc2f6d90e950b69ad31d483c19cc1d121bb25c16 Author: Randy Dunlap kmemtrace: fix printk format warnings commit 6626bff24578753808c8b5bd4f1619e14e980f0f Author: Thomas Gleixner hrtimer: prevent negative expiry value after clock_was_set() commit b38b0665905538e76e26f2a4c686179abb1f69f6 Author: H. Peter Anvin x86: filter CPU features dependent on unavailable CPUID levels commit 75a048119e76540d73132cfc8e0fa0c0a8bb6c83 Author: H. Peter Anvin x86: handle PAT more like other CPU features commit b1882e68d17a93b523dce09c3a181319aace2f0e Author: H. Peter Anvin x86: clean up stray space in commit 3b4b75700a245d0d48fc52a4d2f67d3155812aba Author: Hiroshi Shimamoto x86: ia32_signal: use {get|put}_user_try and catch commit 98e3d45edad207b4358948d6e2cac4e482c3bb5d Author: Hiroshi Shimamoto x86: signal: use {get|put}_user_try and catch commit fe40c0af3cff3ea461cf25bddb979abc7279d4df Author: Hiroshi Shimamoto x86: uaccess: introduce try and catch framework commit 3415dd9146c574bffe8f012c096bfc2bc62b9508 Author: Mike Galbraith perfcounters fix section mismatch warning in perf_counter.c::perf_counters_lapic_init() commit 4b39fd96855254a244f71245b41a91cdecb87d63 Author: Mike Galbraith perfcounters: ratelimit performance counter interrupts commit b041cf22ddb742874040d0a3259d0be46f3d3a4b Author: Ian Campbell x86: rename arch/x86/kernel/pci-swiotlb_64.c => pci-swiotlb.c commit 1b023a96d9b44f50f4d8ff28c15f5b80e354760f Author: Mike Galbraith perfcounters: throttle on too high IRQ rates commit 9005f3ebebfcfe9ccd731d16c468907a35ac1f9a Author: Frederic Weisbecker tracing/function-graph-tracer: various fixes and features commit 7e49fcce1bdadd723ae6a0b3b324c4daced61563 Author: Steven Rostedt trace, lockdep: manual preempt count adding for local_bh_disable commit b06a830183b610c0a88c29a92feb7991a867ab46 Author: Steven Rostedt trace: fix logic to start/stop counting commit 94523e818f283d3c69f621406f633afff46dbf82 Author: Steven Rostedt trace: remove internal irqsoff disabling for trace output commit 99d0000f710f3432182761f65f9658f1cf0bf455 Author: Ingo Molnar x86, xen: fix hardirq.h merge fallout commit 2de3a5f7956eb81447feea3aec68193ddd8534bb Author: Brian Gerst x86: make irq_cpustat_t fields conditional commit 22da7b3df3a2e26a87a8581575dbf26e465a6ac7 Author: Brian Gerst x86: merge hardirq_{32,64}.h into hardirq.h commit 658a9a2c34914e8114eea9c4d85d4ecd3ee33b98 Author: Brian Gerst x86: sync hardirq_{32,64}.h commit 3819cd489ec5d18a4cbd2f05acdc516473caa105 Author: Brian Gerst x86: remove include of apic.h from hardirq_64.h commit 03d2989df9c1c7df5b33c7a87e0790465461836a Author: Brian Gerst x86: remove idle_timestamp from 32bit irq_cpustat_t commit 6522869c34664dd5f05a0a327e93915b1281c90d Author: Jeremy Fitzhardinge x86: add pte_set_flags/clear_flags for pte flag manipulation commit ab897d2013128f470240a541b31cf5e636984e71 Author: Jeremy Fitzhardinge x86/pvops: remove pte_flags pvop commit 4c50d9ea9ca9e46b65aeffed3e0d6f54ff38c8d4 Author: Robert Richter cpumask: modifiy oprofile initialization commit d639bab8da86d330493487e8c0fea8ca31f53427 Author: venkatesh.pallipadi@intel.com x86 PAT: ioremap_wc should take resource_size_t parameter commit 69507c06539332e6e49f83aa478844130233bece Author: Steven Rostedt ring-buffer: reset timestamps when ring buffer is reset commit f8ec1062f589cdb1cffcffab1376124a1bc08500 Author: Steven Rostedt wakeup-tracer: show scheduling data in output commit 3244351c31211a8b1ba8b4b34c3de04d5dfa03e4 Author: Steven Rostedt trace: separate out rt tasks from wakeup tracer commit 97b17efe4537e11bf6669106cfe4ee2c5331b267 Author: Steven Rostedt ring-buffer: do not swap if recording is disabled commit 5bc4564b224c3d9fe6dddafa25f56059bd978231 Author: Steven Rostedt trace: do not disable wake up tracer on output of trace commit d52a61c04c6c0814ca270a088feedb126436598e Author: Yinghai Lu irq: clean up irq stat methods commit e81838d2555e77c893f720c25bfb0c0e5782ef57 Author: David Miller sparc64: Fix build by using kstat_irqs_cpu() commit 623d3f0c619f3576dae69709ca8aa93ac76d8c63 Author: David Miller sparc64: Fix build by including linux/irq.h into time_64.c commit fb746d0e1365b7472ccc4c3d5b0672b34a092d0b Author: Johannes Weiner x86: optimise page fault entry, cleanup commit 03b486322e994dde49e67aedb391867b7cf28822 Author: Nick Piggin x86: make UV support configurable commit cc86c9e0dc1a41451240b948bb39d46bb2536ae8 Author: Hiroshi Shimamoto x86: uaccess: rename __put_user_u64() to __put_user_asm_u64() commit 4d5d783896fc8c37be88ee5837ca9b3c13fcd55b Author: Hiroshi Shimamoto x86: uaccess: fix style problems commit 5b221278d61e3907a5e4104a844b63bc8bb3d43a Author: Ingo Molnar x86: uv cleanup, build fix #2 commit ace6c6c840878342f698f0da6588dd5ded755369 Author: Ingo Molnar x86: make x86_32 use tlb_64.c, build fix, clean up X86_L1_CACHE_BYTES commit 4ec71fa2d2c3f1040348f2604f4b8ccc833d1c2e Author: Ingo Molnar x86: uv cleanup, build fix commit 55f4949f5765e7a29863b6d17a774601810732f5 Author: Ingo Molnar x86, mm: move tlb.c to arch/x86/mm/ commit 16c2d3f895a3bc8d8e4c76c2646a6b750c181299 Author: Tejun Heo x86: rename tlb_64.c to tlb.c commit 02cf94c370e0dc9bf408fe45eb86fe9ad58eaf7f Author: Tejun Heo x86: make x86_32 use tlb_64.c commit 6dd01bedee6c3191643db303a1dc530bad56ec55 Author: Tejun Heo x86: prepare for tlb merge commit bdbcdd48883940bbd8d17eb01172d58a261a413a Author: Tejun Heo x86: uv cleanup commit d650a5148593b65a3c3f9a344f46b91b7dfe7713 Author: Brian Gerst x86: merge irq_regs.h commit 6826c8ff07b5f95df0473a748a9831707079b940 Author: Brian Gerst x86: merge mmu_context.h commit 0dd76d736eeb3e0ef86c5b103b47ae0e15edebad Author: Brian Gerst x86: set %fs to __KERNEL_PERCPU unconditionally for x86_32 commit 299e26992a737804e13e74fdb97cdab470ed19ac Author: Brian Gerst x86: fix percpu_write with 64-bit constants commit 06deef892c7327992434917fb6592c233430803d Author: Brian Gerst x86: clean up gdt_page definition commit 67e68bde02fe783efc2ce2ca31bdb992f5235f8d Author: Tejun Heo x86: update canary handling during switch commit 0c3ab3b0a2f0e7881abf0a64821499148602142c Author: Ingo Molnar sound: disable mptav commit afb33f8c0d7dea8c48ae1c2e3af5b437aa8dd7bb Author: Jiri Kosina x86: remove byte locks commit 92181f190b649f7ef2b79cbf5c00f26ccc66da2a Author: Nick Piggin x86: optimise x86's do_page_fault (C entry point for the page fault path) commit 3690b5e6fd9daa030039ae9bda69044228bd476d Author: Lai Jiangshan trace_workqueue: use percpu data for workqueue stat commit ce5e5540c0e839781e7cd134517d5d2e9e819636 Author: Markus Metzger x86, ds, bts: cleanup DS configuration commit e2ea5399bb4fb7aaafb08f846db453f4eec55160 Author: Markus Metzger x86, ftrace, hw-branch-tracer: documentation commit 11edda06289d412d13ff7c672bd72e043f637e74 Author: Markus Metzger x86, ftrace, hw-branch-tracer: change trace format commit e23b8ad83430a6fdfbdbfac365f5b0312dd57f10 Author: Markus Metzger x86, ftrace, hw-branch-tracer: reset trace buffer on close commit b1818748b0cf9427e48acf9713295e829a0d715f Author: Markus Metzger x86, ftrace, hw-branch-tracer: dump trace on oops commit 5c5317de147e9b38ea9c4cbdc2d15bed7648d036 Author: Markus Metzger x86, ftrace, hw-branch-tracer: support hotplug cpus commit 5766b842b23c6b40935a5f3bd435b2bcdaff2143 Author: Ingo Molnar x86, cpumask: fix tlb flush race commit 6b7c38d55587f43bcd2cbce3a98b1c0826982090 Author: Tejun Heo linker script: kill PERCPU_VADDR_PREALLOC() commit 0d974d4592708f85044751817da4b7016e1b0602 Author: Brian Gerst x86: remove pda.h commit 947e76cdc34c782fc947313d4331380686eebbad Author: Brian Gerst x86: move stack_canary into irq_stack commit 8c7e58e690ae60ab4215b025f433ed4af261e103 Author: Brian Gerst x86: rework __per_cpu_load adjustments commit 0bd74fa8e29dcad98f7e8ffe01ec05fb3326abaf Author: Brian Gerst percpu: refactor percpu.h commit 8ce031972b40da58c268caba8c5ea3c0856d7131 Author: Brian Gerst x86: remove pda_init() commit b4a8f7a262e79ecb0b39beb1449af524a78887f8 Author: Tejun Heo x86: conditionalize stack canary handling in hot path commit c6e50f93db5bd0895ec7c7d1b6f3886c6e1f11b6 Author: Tejun Heo x86: cleanup stack protector commit 5cdc5e9e69d4dc3a3630ae1fa666401b2a8dcde6 Author: Ingo Molnar x86: fully honor "nolapic", fix commit 813104e203fcea49cd06b2f2efbf233b7a4d0029 Author: Ingo Molnar Revert "[SCSI] simplify scsi_io_completion()" commit 84db5454289fe4880e41dd3ccb9aa378982f4d09 Author: Ingo Molnar Revert "[SCSI] Fix uninitialized variable error in scsi_io_completion" commit 0eb603807e5763943766d80cc3959f3dc11210db Author: Ingo Molnar Revert "[SCSI] Fix error handling for DIF/DIX" commit 3cd94dda5fd07f3697f234ed13772f9f3240b1e5 Author: Ingo Molnar Revert "[SCSI] scsi_lib: don't decrement busy counters when inserting commands" commit c27aed5c9389fc1071cb93c03c9e7f9a38cfce7e Author: Ingo Molnar Revert "[SCSI] scsi_lib: fix DID_RESET status problems" commit 422e79a8b39d9ac73e410dc3cd099aecea82afd2 Author: Michael Ellerman x86: Remove never-called arch_setup_msi_irq() commit b43f70933e7753a284733d5ae355f6778bd118ce Author: Steven Rostedt ftrace: test for running of recordmcount.pl twice on an object commit 5662a2f8e7313f78d6b17ab383f3e4f04971c335 Author: Ingo Molnar x86, rdc321x: remove/move leftover files commit 603a148f434742fff08273207ffa44176cad13a1 Author: Mandeep Singh Baines softlockup: fix potential race in hung_task when resetting timeout commit 87b264065880fa696c121dad8498a60524e0f6de Author: Brian Gerst x86-64: Use absolute displacements for per-cpu accesses. commit c2558e0eba66b49993e619da66c95a50a97830a3 Author: Brian Gerst x86-64: Move isidle from PDA to per-cpu. commit e7a22c1ebcc1caa8178df1819d05128bb5b45ab9 Author: Brian Gerst x86-64: Move nodenumber from PDA to per-cpu. commit 5689553076c4a67b83426b076082c63085b7567a Author: Brian Gerst x86-64: Move irqcount from PDA to per-cpu. commit 3d1e42a7cf945e289d6ba26159aa0e2b0645401b Author: Brian Gerst x86-64: Move oldrsp from PDA to per-cpu. commit 9af45651f1f7c89942e016a1a00a7ebddfa727f8 Author: Brian Gerst x86-64: Move kernelstack from PDA to per-cpu. commit c6f5e0acd5d12ee23f701f15889872e67b47caa6 Author: Brian Gerst x86-64: Move current task from PDA to per-cpu and consolidate with 32-bit. commit ea9279066de44053d0c20ea855bc9f4706652d84 Author: Brian Gerst x86-64: Move cpu number from PDA to per-cpu and consolidate with 32-bit. commit 92d65b2371d86d40807e1dbfdccadc4d501edcde Author: Brian Gerst x86-64: Convert exception stacks to per-cpu commit 26f80bd6a9ab17bc8a60b6092e7c0d05c5927ce5 Author: Brian Gerst x86-64: Convert irqstacks to per-cpu commit 9eb912d1aa6b8106e06a73ea6702ec3dab0d6a1a Author: Brian Gerst x86-64: Move TLB state from PDA to per-cpu and consolidate with 32-bit. commit 1b437c8c73a36daa471dd54a63c426d72af5723d Author: Brian Gerst x86-64: Move irq stats from PDA to per-cpu and consolidate with 32-bit. commit 653d60ce6c712c23345ac8a8e987df0680506e80 Author: Ingo Molnar dell-laptop.c: disable temporarily commit d859e29fe34cb833071b20aef860ee94fbad9bb2 Author: Paul Mackerras perf_counter: Add counter enable/disable ioctls commit 74e7904559a10cbb9fbf9139c5c42fc87c0f62a4 Author: Tejun Heo linker script: add missing .data.percpu.page_aligned commit 145cd30bac885dffad9db9d487baad07b68a3d04 Author: Tejun Heo linker script: add missing VMLINUX_SYMBOL commit cef30b3a84e1c7cbd49987d83c5863c001445842 Author: Mike Travis x86: put trigger in to detect mismatched apic versions. commit 6eb714c63ed5bd663627f7dda8c4d5258f3b64ef Author: Mike Travis cpufreq: use work_on_cpu in acpi-cpufreq.c for drv_read and drv_write commit e1d9ec6246a2668a5d037f529877efb7cf176af8 Author: Rusty Russell work_on_cpu: Use our own workqueue. commit 68564a46976017496c2227660930d81240f82355 Author: Rusty Russell work_on_cpu: don't try to get_online_cpus() in work_on_cpu. commit af432eb1cc3178ec7109aca2283aafb1c12ccac1 Author: Mandeep Singh Baines softlockup: fix to allow compiling with !DETECT_HUNG_TASK commit 74296a8ed6aa3c5bf672808ada690de7ba323ecc Author: Ingo Molnar irq: provide debug_poll_all_shared_irqs() method under CONFIG_DEBUG_SHIRQ commit ceacc2c1c85ac498ca4cf297bdfe5b4aaa9fd0e0 Author: Peter Zijlstra sched: make plist a library facility commit cd3adf52309867955d6e2175246b526442235805 Author: Tejun Heo x86_64: initialize this_cpu_off to __per_cpu_load commit a338af2c648f5e07c582154745a6c60cd2d8bf12 Author: Tejun Heo x86: fix build bug introduced during merge commit 6dbde3530850d4d8bfc1b6bd4006d92786a2787f Author: Ingo Molnar percpu: add optimized generic percpu accessors commit 004aa322f855a765741d9437a98dd8fe2e4f32a6 Author: Tejun Heo x86: misc clean up after the percpu update commit 49357d19e4fb31e28796eaff83499e7584c26878 Author: Tejun Heo x86: convert pda ops to wrappers around x86 percpu accessors commit b12d8db8fbfaed1e8222a15333a3645599636854 Author: Tejun Heo x86: make pda a percpu variable commit 9939ddaff52787b2a7c1adf1b2afc95421aa0884 Author: Tejun Heo x86: merge 64 and 32 SMP percpu handling commit 1a51e3a0aed18767cf2762e95456ecfeb0bca5e6 Author: Tejun Heo x86: fold pda into percpu area on SMP commit c8f3329a0ddd751241e96b4100df7eda14b2cbc6 Author: Tejun Heo x86: use static _cpu_pda array commit f32ff5388d86518c0375ccdb330d3b459b9c405e Author: Tejun Heo x86: load pointer to pda into %gs while brining up a CPU commit 3e5d8f978435bb9ba4dfe3f4514e65e7885db1a9 Author: Tejun Heo x86: make percpu symbols zerobased on SMP commit a698c823e15149941b0f0281527d0c0d1daf2639 Author: Tejun Heo x86: make vmlinux_32.lds.S use PERCPU() macro commit c90aa894f0240084f2c6e42e2333b211d6cfe2b2 Author: Mike Travis x86: cleanup early setup_percpu references commit f10fcd47120e80f66665567dbe17f5071c7aef52 Author: Tejun Heo x86: make early_per_cpu() a lvalue and use it commit 7de6883faad71e3a253d55b9e1a47b89ebce0a31 Author: Tejun Heo x86: fix pda_to_op() commit e162b39a368f0401e41b558f430c354d12a85b37 Author: Mandeep Singh Baines softlockup: decouple hung tasks check from softlockup detection commit 34cb61359b503d7aff6447acb037a5efd6ce93b2 Author: Ingo Molnar sched: fix !CONFIG_SCHEDSTATS build failure commit 2d68259db26ad57fd9643f1c69b5181ec9836ca9 Author: Magnus Damm clockevents: let set_mode() setup delta information commit 745b1626dd71ce9661a05ea4db57859ed5c773d2 Author: Steven Rostedt trace: set max latency variable to zero on default commit a225cdd263f340c864febb1992802fb5b08bc328 Author: Steven Rostedt ftrace: remove static from function tracer functions commit 3eb36aa05329a47cbe201c151fd0024a4a3649cd Author: Steven Rostedt ftrace: combine stack trace in function call commit 5e4abc9839191e213965e0f1dbf36e2e44356c3a Author: Steven Rostedt trace: clean up format errors in calls to trace_seq_printf commit c37abc5515b5ed5b1d2134d2deaead492d9f92a2 Author: Steven Rostedt trace: add gcc printf check to trace_seq_printf commit bb3c3c95f330f7bf16e33b002e48882616089db1 Author: Steven Rostedt ftrace: move function tracer functions out of trace.c commit 5361499101306cfb776c3cfa0f69d0479bc63868 Author: Steven Rostedt ftrace: add stack trace to function tracer commit 6c1a99afbda99cd8d8c69d756387041567a13d87 Author: Lai Jiangshan ftrace: fix trace_output commit 152705c84380675cb7a93b4298f797c4efa84377 Author: Ingo Molnar netxen: disable temporarily commit c99dbbe9f8f6b3e9383e64710217e873431d1c31 Author: Mike Travis sched: fix warning on ia64 commit f2a082711905312dc7b6675e913fee0c4689f7ae Author: Mike Travis x86: fix build warning when CONFIG_NUMA not defined. commit 5cd7376200be7b8bab085557ff5876b04bd84191 Author: Ingo Molnar fix: crash: IP: __bitmap_intersects+0x48/0x73 commit e56d0cfe7790fd3218ae4f6aae1335547fea8763 Author: Baodong Chen Documentation/x86/boot.txt: modify fieldname commit 54da5b3d44238eeb7417bacf792fb416d473bf4d Author: Ingo Molnar x86: fix broken flush_tlb_others_ipi(), fix commit a08c4743ed5b861c4fa3d75be00da7106c926296 Author: Jan Beulich x86: avoid early crash in disable_local_APIC() commit f11826385b63566d98c02d35f592232ee77cd791 Author: Jan Beulich x86: fully honor "nolapic" commit e52fb7c097238d34f4d8e2a596f8a3f85b0c0565 Author: Peter Zijlstra sched: prefer wakers commit 831451ac4e44d3a20b581ce726ef1d1144373f7d Author: Peter Zijlstra sched: introduce avg_wakeup commit 55922173f1f63903b6de03711ab8ff980cbe58d2 Author: Ingo Molnar tracing: trace_stat.c cleanup commit 42fab4b2cdc02cf28e2474ccfd75bc9225076590 Author: Li Zefan tracing/ftrace: add missing unlock in register_stat_tracer() commit d2287f5ebea9ff2487d614719775f0b03fce15f6 Author: Mike Travis irq: update all arches for new irq_desc, fix commit cf47b8f3d96b0b8b10b557444a28b3ca4024ff82 Author: Chris Mason Btrfs: stop spinning on mutex_trylock and let the adaptive code spin for us commit 4a2b8dda3f8705880ec7408135645602d5590f51 Author: Frederic Weisbecker tracing/function-graph-tracer: fix a regression while suspend to disk commit 0ee6b6cf5bdb793b4c68507dd65adf16341aa4ca Author: Steven Rostedt trace: stop all recording to ring buffer on ftrace_dump commit 6f3b34402e7282cde49dff395d7ea462bf33bf50 Author: Lai Jiangshan ring_buffer: reset write when reserve buffer fail commit 428aee1460a75197f0190534b4d610450ee59af1 Author: Steven Rostedt trace: print ftrace_dump at KERN_EMERG log level commit 9aaa65790f6dbc3fa134c1687c6b72ea0873a5c2 Author: Ingo Molnar dell-laptop.c: disable temporarily commit ee287587dafd77fd211e50637561224605c214b4 Author: H. Peter Anvin bzip2/lzma: update boot protocol specification commit 95c4bff0308eb0819436b730a836846d3e784657 Author: Cyrill Gorcunov x86: headers cleanup - boot.h commit dbca1df48e89d8aa59254fdc10ef16c16e73d94e Author: Cyrill Gorcunov x86: headers cleanup - setup.h commit a7c4e68615e20771f279c51a2bec8980675c78c7 Author: Cyrill Gorcunov x86: headers cleanup - sigcontext32.h commit 444027031cd069ea7e48b016cb33bbf201c8a9f0 Author: Cyrill Gorcunov x86: headers cleanup - prctl.h commit 73310a169aebe257efdd35a763cce1c7658f40c9 Author: H. Peter Anvin init: make initrd/initramfs decompression failure a KERN_EMERG event commit ac6e60ee405aa3bf718f7fe4cb01b7ee0b8877ec Author: Chris Mason mutex: adaptive spinnning, performance tweaks commit 0d66bf6d3514b35eb6897629059443132992dbd7 Author: Peter Zijlstra mutex: implement adaptive spinning commit 41719b03091911028116155deddc5eedf8c45e37 Author: Peter Zijlstra mutex: preemption fixes commit 93d81d1aca26e64a75d06a85f7e128b5f49053e7 Author: Peter Zijlstra mutex: small cleanup commit 812d5ee7d1352533146eec8d74ab35604abd5184 Author: Ingo Molnar eppc-laptop: disable temporarily commit 398a153b16b09a68739928d4502455db9725ac86 Author: Gregory Haskins sched: fix build error in kernel/sched_rt.c when RT_GROUP_SCHED && !SMP commit b07430ac37103218b5c1e542490a1b98e6deb3d6 Author: Gregory Haskins sched: de CPP-ify the scheduler code commit b665967979d0e990f196e7c4ba88e17c9ed9b781 Author: Yinghai Lu x86: make 32bit MAX_HARDIRQS_PER_CPU to be NR_VECTORS commit 32632920a788fb13da35b131b77cc4324c38c1c5 Author: Uwe Kleine-Koenig ftrace, trivial: fix typo "resgister" -> "register" commit e1d8aa9f1dd655a3534b22fcfbecb70cdb125766 Author: Frederic Weisbecker tracing: add a new workqueue tracer commit 002bb86d8d42f18937aef396c3ecd65c7e02e21a Author: Frederic Weisbecker tracing/ftrace: separate events tracing and stats tracing engine commit a14a07b8018b714e03a39ff2180c66e307ef4238 Author: Shaohua Li ftrace, ia64: IA64 dynamic ftrace support commit d3e75ff14bc1453c4762428395aac9953a023efc Author: Shaohua Li ftrace, ia64: IA64 static ftrace support commit 418071eb6adbfd3980b2f57f7df8e03921e3f1d7 Author: Shaohua Li ftrace, ia64: Add recordmcount for ia64 commit f00012074b1a1a67d9c8603617bbbab267347ca6 Author: Shaohua Li ftrace, ia64: Add macro for ftrace_caller commit 25aac9dc7c8c73798c1be8aa36141f980d32579e Author: Shaohua Li ftrace, ia64: explictly ignore a file in recordmcount.pl commit 18c167fd6d8feec5d337bd8fbc3a17da4cc37652 Author: Shaohua Li ftrace, ia64: make recordmcount distinct module compile commit 0a2a18b721abc960fbcada406746877d22340a60 Author: Ingo Molnar x86: change the default cache size to 64 bytes commit 09b3ec7315a18d885127544204f1e389d41058d0 Author: Frederik Deweerdt x86, tlb flush_data: replace per_cpu with an array commit c2c21745ecba23c74690a124bcd371f83bd71e45 Author: Jaswinder Singh Rajput x86: replacing mp_config_intsrc with mpc_intsrc commit b5ba7e6d1e7e2ac808afd21be1e56dc34caf20e6 Author: Jaswinder Singh Rajput x86: replacing mp_config_ioapic with mpc_ioapic commit 3b6f9e5cb21964b7ce12bf81076f830885563ec8 Author: Paul Mackerras perf_counter: Add support for pinned and exclusive counter groups commit a4a0acf8e17e3d08e28b721ceceb898fbc959ceb Author: Suresh Siddha x86: fix broken flush_tlb_others_ipi() commit 01d0287f068de2934109ba9b989d8807526cccc2 Author: Paul Mackerras powerpc/perf_counter: Make sure PMU gets enabled properly commit 2bd51ff76cc07d789eab1896990b2d29249b789e Author: Ingo Molnar Revert "mm: vmalloc use mutex for purge" commit 4a046d1754ee6ebb6f399696805ed61ea0444d4c Author: Yinghai Lu x86: arch_probe_nr_irqs commit e65e49d0f3714f4a6a42f6f6a19926ba33fcda75 Author: Mike Travis irq: update all arches for new irq_desc commit 23a22d57a8962479ca630c9542e62d6f86fdf927 Author: H. Peter Anvin bzip2/lzma: comprehensible error messages for missing decompressor commit 0b0f0b1c2c87de299df6f92a8ffc0a73bd1bb960 Author: Yinghai Lu sparseirq: use kstat_irqs_cpu on non-x86 architectures too commit 42bb8cc5e81028e217105299001070d57eb84ad7 Author: Andi Kleen x86: hpet: allow force enable on ICH10 HPET commit 3b9dc9f2f123286aaade54c45fef6723d587c664 Author: Jaswinder Singh Rajput x86: module_64.c fix style problems commit e17029ad69c7b1518413c00f793d89bb77b8527b Author: Jaswinder Singh Rajput x86: module_32.c fix style problems commit 448dd2fa3ec915ad4325868ef8bb9b9490d9f6a9 Author: Jaswinder Singh Rajput x86: msr.c fix style problems commit dd3feda7748b4c2739de47daaaa387fb01926c15 Author: Jaswinder Singh Rajput x86: microcode_intel.c fix style problems commit 28e08861b9afab4168b758fb7b95aa7a4da0f668 Author: Christophe Saout xen: fix too early kmalloc call commit dd0e6ba22ea21bcc2c420b385a170593c58f4c08 Author: Paul Mackerras perf_counter: Always schedule all software counters in commit 92296c6d6e908c35fca287a21af27be814af9c75 Author: Mike Travis cpumask, irq: non-x86 build failures commit 542d865bbed4ce1f050f586e53cf1cfadda93766 Author: Mike Travis kstat: modify kstat_irqs_legacy to be variable sized commit 9332fccdedf8e09448f3b69b624211ae879f6c45 Author: Mike Travis irq: initialize nr_irqs based on nr_cpu_ids commit 0fa0ebbf15addc1be8f73325d809c8547a9de304 Author: Mike Travis irq: allocate irq_desc_ptrs array based on nr_irqs commit e2f4d06545ec1f29b0e838ee34cbf3500ea5b9a4 Author: Mike Travis irq: use WARN() instead of WARN_ON(). commit 9594949b060efe86ecaa1a66839232a3b9800bc9 Author: Mike Travis irq: change references from NR_IRQS to nr_irqs commit c7a3589e7a1f8fdbd2536fe1bfa60b37f5121c69 Author: Mike Travis Xen: reduce memory required for cpu_evtchn_mask commit d38b223c86db3162dc85b5a1997ac8a210e1660b Author: Mike Travis cpumask: reduce stack usage in find_lowest_rq commit c90e785be2fd9dfaef1f030d0314e44052553736 Author: Mike Travis cpumask: use cpumask_var_t in dcdbas.c commit f9b90566cd46e19f670a1e60a717ff243f060a8a Author: Mike Travis x86: reduce stack usage in init_intel_cacheinfo commit a1c33bbeb7061f3ed39103c385844474eaa8f921 Author: Mike Travis x86: cleanup remaining cpumask_t code in mce_amd_64.c commit 0e21990ae7ee11af94f44f240b06e520cf1505d4 Author: Mike Travis SGI UV cpumask: use static temp cpumask in flush_tlb commit 4595f9620cda8a1e973588e743cf5f8436dd20c6 Author: Rusty Russell x86: change flush_tlb_others to take a const struct cpumask commit 802bf931f2688ad125b73db597ce63cc842fb27a Author: Mike Travis cpumask: fix bug in use cpumask_var_t in irq_desc commit 651f8118cf0a5724f23fe1de4a3d9d36b2e01c2e Author: Rusty Russell cpumask: convert other misc kernel functions commit 2f8975fbcf07103afab0bbaea5f5b1a9967ffb86 Author: Rusty Russell cpumask: convert drivers/net/sfc commit f7df8ed164996cd2c6aca9674388be6ef78d8b37 Author: Rusty Russell cpumask: convert misc driver functions commit fbd59a8d1f7cf325fdb6828659f1fb76631e87b3 Author: Rusty Russell cpumask: Use topology_core_cpumask()/topology_thread_cpumask() commit 7f7ace0cda64c99599c23785f8979a072e118058 Author: Mike Travis cpumask: update irq_desc to use cpumask_var_t commit d178a1eb5c034df1f74a2b67bf311afa5d6b8e95 Author: Yinghai Lu sparseirq: fix build with unknown irq_desc struct commit dee4102a9a5882b4f7d5cc165ba29e8cc63cf92e Author: Yinghai Lu sparseirq: use kstat_irqs_cpu instead commit 7106a5ab89c50c6b5aadea0850b40323804a922d Author: Benjamin LaHaise x86-64: remove locked instruction from switch_to() commit 961d7d0ee5150e0197cc81c2a8884ecb230276e2 Author: Ian Campbell swiotlb: do not use sg_virt() commit 0b8698ab5847cbe25775083659f00c658a8161c9 Author: Ian Campbell swiotlb: range_needs_mapping should take a physical address. commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc Author: Yinghai Lu sparseirq: make some func to be used with genirq commit 173ed24ee2d64f5de28654eb456ec1ee18a142e5 Author: Pekka Paalanen mmiotrace: count events lost due to not recording commit fe6f90e57fd31af8daca534ea01db2e5666c15da Author: Pekka Paalanen trace: mmiotrace to the tracer menu in Kconfig commit 5d2ad3316e29ad218f98d66b9c0ce6d4bcd05b77 Author: Pekka Paalanen doc: mmiotrace.txt, buffer size control change commit 034939b65ad5ff64b9709210b3469a95153c51a3 Author: Frederic Weisbecker tracing/ftrace: handle more than one stat file per tracer commit 67d347245f76a149c45bffb1a10145d31d61d1da Author: Andrew Morton kernel/trace/ring_buffer.c: use DIV_ROUND_UP commit 34a148bf0911a4a1cae85f8ecba57affb4d76aee Author: Andrew Morton kernel/trace/ring_buffer.c: reduce inlining commit 52811d8c9beb67da6bc4b770de3c4134376788a1 Author: Jaswinder Singh Rajput x86: smp.h move cpu_sibling_setup_mask and cpu_sibling_setup_map declartion to cpumask.h commit 493f6ca54e1ea59732dd334e35c5fe2d8e440b06 Author: Jaswinder Singh Rajput x86: smp.h move cpu_initialized_mask and cpu_initialized declartion to cpumask.h commit fb8fd077fbf0de6662acfd240e8e6b25cf3202ca Author: Jaswinder Singh Rajput x86: smp.h move cpu_callout_mask and cpu_callout_map declartion to cpumask.h commit 068790334cececc3d2d945617ccc585477da2e38 Author: Jaswinder Singh Rajput x86: smp.h move cpu_callin_mask and cpu_callin_map declartion to cpumask.h commit 5d3cb1e82a761ebc7001d7cbaab14db95c5b55d0 Author: Randy Dunlap mtd/lpddr/qinfo_probe.c needs lpddr_cmds to be compiled commit f1d26da598230cc050ee2c7890bd3cebd2e76e27 Author: Ingo Molnar Revert "libata: Add 32bit PIO support" commit 736f93236ce786d1bcf09ad4dcb38a360d35ea1b Author: Ingo Molnar bzip2/lzma: make flush_buffer() unconditional commit a5532d29c1ade8b4576f449d4e40678490b96594 Author: Parag Warudkar Fix net/irda build breakage commit f78628374a13bc150db77c6e02d4f2c0a7f932ef Author: Paul Mackerras powerpc/perf_counter: Add support for POWER6 commit 16b067993dee3dfde61b20027e0b168dc06201ee Author: Paul Mackerras powerpc/perf_counter: Add support for PPC970 family commit 4574910e5087085a1f330ff8373cee4503f5c77c Author: Paul Mackerras powerpc/perf_counter: Add generic support for POWER-family PMU hardware commit 76372722b5f8958cb13f5d3913db50fcf6a50ac4 Author: Ingo Molnar Revert "Revert "Revert parts of "x86: update mptable""" commit 93a6d3ce6962044fe9badf528fed46b455d58292 Author: Paul Mackerras powerpc: Provide a way to defer perf counter work until interrupts are enabled commit d662ed26734473d4cb5f3d78cebfec8f9126e97c Author: Paul Mackerras powerpc/perf_counter: Add perf_counter system call on powerpc commit 4eb96fcfe07b7f2a05577e57533840f8e26bea53 Author: Paul Mackerras perf_counter: Add dummy perf_counter_print_debug function commit 3cbed429a9ccdb7a243f733b1056fe5c39e9004c Author: Paul Mackerras perf_counter: Add optional hw_perf_group_sched_in arch function commit 9abf8a08bc8f18a3b125f834f00e2e71b49c15d2 Author: Paul Mackerras perf_counter: Fix the cpu_clock software counter commit ff6f05416ece2caec1a7a1f8180d6598e0ab9272 Author: Paul Mackerras perf_counter: Fix return value from dummy hw_perf_counter_init commit 889c92d21db40be0b7d22a59395060237895bb85 Author: H. Peter Anvin bzip2/lzma: centralize format detection commit 6c11b12ac6f101732d43b5682f5b3ae4dda4205f Author: Alain Knaff bzip2/lzma: fix decompress_inflate.c vs multi-block-with-embedded-filename commit 5619448fc55650cb76cbb825e16e4bb5d1390399 Author: H. Peter Anvin bzip2/lzma: fix constant in decompress_inflate commit 1eb1b3b65dc3e3ffcc6a60e115c085c0c11c1077 Author: Jaswinder Singh Rajput x86: rename all fields of mpf_intel mpf_X to X commit 41401db698cbb5d1869776bf336881db267e7d19 Author: Jaswinder Singh Rajput x86: rename intel_mp_floating to mpf_intel commit 97f750c1b68da7832b5487db352d67b95bd55af5 Author: Ingo Molnar wimax/i2400m: disable temporarily commit 88ed8981f95991a6d83ad81ed0fdca750ffee339 Author: Ingo Molnar Revert "pnp: Huge number of "io resource overlap" messages" commit 7f0eb53ac0fc15fd92ed6408b48f9344e0648569 Author: Ingo Molnar Revert "fix warning in drivers/pci/pci-driver.c" commit 9611d2a3d894917f8bf92a39a5e7f704711fed56 Author: Ingo Molnar Revert "proc: add /proc/*/stack" commit 01d07820a0df6b6134c1bb75b1e84c9d0cdab3be Author: KOSAKI Motohiro sparseirq: make for_each_irq_desc() more robust commit 6d652ea1d056390a0c33db92b44ed219284b71af Author: Jaswinder Singh Rajput x86: smp.h move boot_cpu_id declartion to cpu.h commit af8968abf09fe5984bdd206e54e0eeb1dc1fa29c Author: Jaswinder Singh Rajput x86: smp.h move cpu_physical_id declartion to cpu.h commit 96b89dc6598a50e3aac8e2c6d826ae3795b7d030 Author: Jaswinder Singh Rajput x86: smp.h move safe_smp_processor_id declartion to cpu.h commit f472cdba849cc3d838f3788469316e8572463a8c Author: Jaswinder Singh Rajput x86: smp.h move stack_processor_id declartion to cpu.h commit 68695dccc60618ea2bb456653ff1be1d72c5079f Author: Ingo Molnar Revert "x86: enable speedstep for Intel Pentium M processor 7x0 [1.6-2.26 GHz] (Sonoma) processors" commit 6e5385d44b2df05e50a8d07ba0e14d3e32685237 Author: Jaswinder Singh Rajput x86: smp.h move prefill_possible_map declartion to cpu.h commit dacf7333571d770366bff74d10b56aa545434605 Author: Jaswinder Singh Rajput x86: smp.h move zap_low_mappings declartion to tlbflush.h commit 7760ec77ab2a9e48bdd0d13341446a8a51f0b9f1 Author: Jaswinder Singh Rajput x86: smp.h remove obsolete function declaration commit c299030765292434b73572f9bcfe84951ff06614 Author: FUJITA Tomonori convert to use generic dma_map_ops struct, cleanup commit e8a9cbf6ae620d9e5ba9cb42001c033287a284a3 Author: Steven Rostedt trace: clean up funny line breaks in stat_seq_show commit ff288b274a9b383046fdbda4be3067daba4d5fe8 Author: Frederic Weisbecker tracing/ftrace: fix a memory leak in stat tracing commit 431aa3fbf5bbe3be79809c7e603c2ed2ac64b015 Author: Steven Rostedt ftrace: convert unsigned index to signed commit 76a971b8f7e9c0bc83b4cfb29b93c221352d80fc Author: Heiko Carstens fix: BUG: unable to handle kernel paging request at 6b6b6b6b commit fef386379597f637703811e74e200731041fa24f Author: Ingo Molnar Revert "fix warning in ipc/ipc_sysctl.c" commit a26ee60f90daffe1de6be0d093af86e7279b3dfd Author: Alain Knaff bzip2/lzma: fix built-in initramfs vs CONFIG_RD_GZIP commit fb9a4ca9820fd4d7c4906bd393004662451e273e Author: H. Peter Anvin bzip2/lzma: move initrd/ramfs options out of BLK_DEV commit 7856a16ea03ed9b17860d756ee6473c2e57882b2 Author: H. Peter Anvin bzip2/lzma: DECOMPRESS_GZIP should select ZLIB_INFLATE commit 07716e4df25523bf85b4e304d2cf63dbf3cbabf9 Author: Luck, Tony ia64: fix section mismatch swiotlb_dma_init -> swiotlb_init commit f98eee8ea99fe74ee9c4e867ba178ec3072793be Author: FUJITA Tomonori x86, ia64: remove duplicated swiotlb code commit 160c1d8e40866edfeae7d68816b7005d70acf391 Author: FUJITA Tomonori x86, ia64: convert to use generic dma_map_ops struct commit f0402a262e1a4c03fc66b83659823bdcaac3c41a Author: FUJITA Tomonori generic: add common struct for dma map operations commit d7dff84053524186b139342ac66a4160ce6bb517 Author: FUJITA Tomonori x86: remove map_single and unmap_single in struct dma_mapping_ops commit 33feffd4525fc2e4dd0a322fb5d07d61f85d791e Author: FUJITA Tomonori x86, pci-nommu: add map_page commit ffbbef5c0639dbf31a0511d8f65f574bb3e30758 Author: FUJITA Tomonori intel-iommu: add map_page and unmap_page commit 51491367c2541c51a9d435eec88b0e846223fb59 Author: FUJITA Tomonori x86, AMD IOMMU: add map_page and unmap_page commit 3991605c40b1059d0204d9fddfcf878429ab8948 Author: FUJITA Tomonori x86, calgary: add map_page and unmap_page commit 052aedbfb6cd4fd1a73010735da88a9dcc224673 Author: FUJITA Tomonori x86, gart: add map_page and unmap_page commit 4cf37bb7d9dc6dfb5d5fca7f735ba65ba173dabc Author: FUJITA Tomonori x86, swiotlb: add map_page and unmap_page commit abe6602bf197167efb3b37161b9c11748fa076e1 Author: FUJITA Tomonori x86: add map_page and unmap_page to struct dma_mapping_ops commit 055bcf99a1471ff0a2ef24863098f946a09c9161 Author: FUJITA Tomonori make sba DMA mapping functions static commit c7b3aee8af5bd0d73d5779a4ad82a1496771d3ef Author: FUJITA Tomonori remove hwsw_dma_ops commit c190ab0b2a5fb5cc97576c5f04f4419b6cf8dc8e Author: FUJITA Tomonori add dma_get_ops to struct ia64_machine_vector commit cdc28d59a31e3fd711982bd07600f3e5b449b9f7 Author: FUJITA Tomonori make sn DMA mapping functions static commit fad6a029c4afa499dddd8e9ff70264bb977ea7bf Author: FUJITA Tomonori remove dma operations in struct ia64_machine_vector commit b7ea6e951833a3add60fd47f2de6870b5d0589b3 Author: FUJITA Tomonori convert the DMA API to use dma_ops commit 4d9b977ca674dd40cfc1409a75cb73fca2cee423 Author: FUJITA Tomonori set up dma_ops appropriately commit c82e4417ace9a3a4dddf3332379c771c41040040 Author: FUJITA Tomonori add dma_mapping_ops for SWIOTLB commit b4391dd11df6214ad4c11706a3a606926e86a6ce Author: FUJITA Tomonori add dma_mapping_ops for SGI Altix commit 98c382bca9382128b2dbc2108a4c77d667d87abc Author: FUJITA Tomonori add dma_mapping_ops for intel-iommu commit 917f69b8b74e0b3283fcd1f2885949847d787d24 Author: FUJITA Tomonori add dma_mapping_ops for SWIOTLB and SBA IOMMU commit 0e9cbb9ba874f9466faf82931465f00ebe4bb18c Author: FUJITA Tomonori add dma_mapping_ops for SBA IOMMU commit e751ab3382de520475dabecb834791b6c1e3e742 Author: FUJITA Tomonori add map/unmap_single_attr and map/unmap_sg_attr to struct dma_mapping_ops commit 3e80680208ba6ce9635ca7c21ad0019442ea166a Author: Ingo Molnar kmemtrace: add kmemtrace_init() commit 723cbe0775514853c22dc45005af59c360916af1 Author: Eduard - Gabriel Munteanu kmemtrace: Remove the relay version of kmemtrace commit c8531ab343dec88ed8005e403b1b304c710b7494 Author: H. Peter Anvin bzip2/lzma: proper Kconfig dependencies for the ramdisk options commit 31f7c7008dc49ab66afb7858e4b1ed1a79f33e4b Author: Jouni Malinen ath9k: Enforce module build if rfkill is a module commit c6595706be752c6f0b843fb2a96f2166ac396b0b Author: Ingo Molnar Revert "ath9k: turn off temporarily" commit fb840645c465dd9db8103956803d133608cc2e2d Author: Mark Brown fix: sound/built-in.o: In function `wm8510_remove': commit 0216f84b8743b41d3b6c2dde3069e6b38885d12f Author: Ingo Molnar Revert "sound: temporarily disable SND_SOC_ALL_CODECS=y" commit 390b9f9e26fd5cb9d0daac6983fa3d48d2bdada6 Author: Rafael J. Wysocki fix KPROBE linking error commit 18a688b8ed16fa16eb4cc6fe5ab32d0bd48f33fe Author: Ingo Molnar sound: temporarily disable SND_SOC_ALL_CODECS=y commit 2e9f3bddcbc711bb14d86c6f068a779bf3710247 Author: H. Peter Anvin bzip2/lzma: make config machinery an arch configurable commit 0f5e2d2484ccd3062bb1f63083bafa37041bc868 Author: H. Peter Anvin bzip2/lzma: handle failures from bzip2 and lzma correctly commit ae03c49964af5033534e518eebe439c3b90f43a7 Author: Alain Knaff bzip2/lzma: x86 kernel compression support commit b172fd882d201cf8aa67cddd9c1a023421fd4956 Author: H. Peter Anvin bzip2/lzma: use a table to search for initramfs compression formats commit 30d65dbfe3add7f010a075991dc0bfeaebb7d9e1 Author: Alain Knaff bzip2/lzma: config and initramfs support for bzip2/lzma decompression commit bc22c17e12c130dc929218a95aa347e0f3fd05dc Author: Alain Knaff bzip2/lzma: library support for gzip, bzip2 and lzma decompression commit 3706460da236ab623ce1de341eb13209f7003e25 Author: Takashi Iwai ALSA: ASoC - Fix dependency of CONFIG_SND_SOC_ALL_CODECS on CONFIG_I2C commit cd2b3a6bf3b2fccdb711eb4b7b67ab79c5f62b43 Author: Ingo Molnar Revert "sound: temporarily disable SND_SOC_ALL_CODECS=y" commit 89fb3db1d8830821f5a85b141759d1536f585b2a Author: Ingo Molnar sound: temporarily disable SND_SOC_ALL_CODECS=y commit 528f20b8ae3d3fa770b1184b5d8e8cb242c6195e Author: Ingo Molnar Revert "kbuild: Disallow GCC 4.1.0 / 4.1.1" commit d23cbaaa342e5555a919a543095d656415a55950 Author: Ingo Molnar kbuild: Remove gcc 4.1.0 quirk from init/main.c commit 66b5c4a2c638b5a69d3e41abe4a2bae55035a92e Author: Ingo Molnar ath9k: turn off temporarily commit e6346e5ab54dcf12888a79dfd5402f5de09b3fad Author: Ingo Molnar kbuild: Disallow GCC 4.1.0 / 4.1.1 commit f09eac9034a4502cce558b0ec4bf7d422b8b355b Author: Ingo Molnar tracing/kmemtrace: fix typo commit 8010676cdfc27af4e27949b65352a0b8a4eced92 Author: Ingo Molnar infiniband: disable temporarily commit 39ea061b3eee24b8402258a9ce6a4bd241b1f000 Author: Ingo Molnar Revert "fix warning in fs/nfs/client.c" commit b81948bb80ac9fb86b9d2953c38797ec1d96ad44 Author: Ingo Molnar Revert "work around warning in fs/xfs/xfs_rtalloc.c" commit 3e95fe454cb34ed9baa56e8ee043ce23d8517183 Author: Ingo Molnar Revert "fix warning in drivers/media/video/cx18/cx18-mailbox.c" commit ba7527d2dafc498af316fd349d0faf7a30c72155 Author: Ingo Molnar Revert "fix warning in drivers/media/dvb/dvb-usb/anysee.c" commit dbf62360227fe772d00832b20c3c3e4e3f24c15e Author: Ingo Molnar Revert "infiniband: fix 2.6.28-git1 build failure" commit ad995509f12f0692c4bf3bc25d535b39af8ad53b Author: Ingo Molnar Revert "infiniband: disable temporarily" commit a70071135ec74815ff0f145b65823ae65da847fc Author: Ingo Molnar Revert "drm: fix leak of uninitialized data to userspace" commit 3fd4bc015ef879a7d2b955ce97fb125e3a51ba7e Author: Ingo Molnar tracing/kmemtrace: export kmemtrace_mark_alloc_node() / kmemtrace_mark_free() commit b6ab4afee4ed56d0f69df59485585cff828c327d Author: Ingo Molnar tracing, kvm: change MARKERS to select instead of depends on commit 36994e58a48fb8f9651c7dc845a6de298aba5bfc Author: Frederic Weisbecker tracing/kmemtrace: normalize the raw tracer event to the unified tracing API commit 5762ba1873b0bb9faa631aaa02f533c2b9837f82 Author: Sebastien Dugue hrtimers: allow the hot-unplugging of all cpus commit 26bfdcc19fad30114e078914bf467eae265b3c73 Author: Herbert Xu net: Fix percpu counters deadlock commit 7a51cffbd10886c0557677dd916c090097c691ef Author: Ingo Molnar relayfs: replace BUG() with WARN_ON() in relay_late_setup_files() commit 2a38b1c4f123afa4579cb1d29380b337e9195cbb Author: Ingo Molnar kmemtrace: move #include lines commit 1563513d34ed4b12ef32bc2adde4a53ce05701a1 Author: Gregory Haskins RT: fix push_rt_task() to handle dequeue_pushable properly commit 917b627d4d981dc614519d7b34ea31a976b14e12 Author: Gregory Haskins sched: create "pushable_tasks" list to limit pushing to one attempt commit 4075134e40804821f90866d7de56802e4dcecb1e Author: Gregory Haskins plist: fix PLIST_NODE_INIT to work with debug enabled commit 967fc04671feea4dbf780c9e55a0bc8fcf68a14e Author: Gregory Haskins sched: add sched_class->needs_post_schedule() member commit 8f45e2b516201d1bf681e6026fa5276385def565 Author: Gregory Haskins sched: make double-lock-balance fair commit 7e96fa5875d4a9be18d74d3ca7b90518d05bc426 Author: Gregory Haskins sched: pull only one task during NEWIDLE balancing to limit critical section commit 777c2f389e463428fd7e2871051a84d7fe84b172 Author: Gregory Haskins sched: only try to push a task on wakeup if it is migratable commit 74ab8e4f6412c0b2d730fe5de28dc21de8b92c01 Author: Gregory Haskins sched: use highest_prio.next to optimize pull operations commit a8728944efe23417e38bf22063f06d9d8ee21d59 Author: Gregory Haskins sched: use highest_prio.curr for pull threshold commit e864c499d9e57805ae1f9e7ea404dd223759cd53 Author: Gregory Haskins sched: track the next-highest priority on each runqueue commit 4d9842776a23e52ec4c60e0a79f5e1bbe91e463e Author: Gregory Haskins sched: cleanup inc/dec_rt_tasks commit a103e2ab7377dbbef2506be59c49a3f2ae10b60b Author: Ingo Molnar tracing/selftest: remove TRACE_CONT reference commit a4900437f3d76761a1646cd90254ccb01714a9ed Author: Vegard Nossum kmemtrace: add missing newline commit bf6803d6fd654d9a73cd90308b5225d78655d027 Author: Pekka Enberg kmemtrace: remove config option for enabling tracing at boot commit faa97abe6a3673af268abb661c6b663252a911aa Author: Pekka Enberg kmemtrace: allow kmemtrace to be enabled after boot commit 2e67624c22321fa40ad3aa89c307c84bd679d9b2 Author: Pekka Enberg kmemtrace: remove unnecessary casts commit 94b528d0564997d88e8bf166d8c9080536ad8bdc Author: Eduard - Gabriel Munteanu kmemtrace: SLUB hooks for caller-tracking functions. commit 73cd6af0413225b0ada8b8881c3e0cfd26506dfa Author: Eduard - Gabriel Munteanu kmemtrace: Better alternative to "kmemtrace: fix printk format warnings". commit 4a80b24bb2ec66a5cb7fa5ff8335907f09288200 Author: Eduard - Gabriel Munteanu kmemtrace: Fix typos in documentation. commit 5b882be4e00e53a44f47ad7eb997cac2938848bf Author: Eduard - Gabriel Munteanu kmemtrace: SLUB hooks. commit 3eae2cb24a96509e0a38cc48dc1538a2826f4e33 Author: Eduard - Gabriel Munteanu kmemtrace: SLOB hooks. commit 36555751c6751a5bdfd6d7bdf0648343bb1ef0de Author: Eduard - Gabriel Munteanu kmemtrace: SLAB hooks. commit aa46a7e0228c0477708ce44a0c5621902b3c157c Author: Eduard - Gabriel Munteanu kmemtrace: Additional documentation. commit b9ce08c01020eb28bfbfa6faf1c740281c5f418e Author: Eduard - Gabriel Munteanu kmemtrace: Core implementation. commit 35995a4d815586bc968a857f7235707940a2f755 Author: Eduard - Gabriel Munteanu SLUB: Replace __builtin_return_address(0) with _RET_IP_. commit f7d48cbde5c0710008caeaf7dbf14f4a9b064940 Author: Ingo Molnar tracing/ftrace: make trace_find_cmdline() generally available commit e302cf3f961ceb54c1dd0aff7ba8531df83be07a Author: Frederic Weisbecker tracing/branch-tracer: adapt to the stat tracing API commit dbd0b4b33074aa6b7832a9d9a5bd985eca5c1aa2 Author: Frederic Weisbecker tracing/ftrace: provide the base infrastructure for histogram tracing commit f633cef0200bbaec539e2dbb0bc4bed7f022f98b Author: Steven Rostedt ftrace: change trace.c to use registered events commit f0868d1e23a8efec33beb3aa688aab7fdb1ae093 Author: Steven Rostedt ftrace: set up trace event hash infrastructure commit c47956d9ae3341d2d1998bff26620fa3338c01e4 Author: Steven Rostedt ftrace: remove obsolete print continue functionality commit efdc64f0c792ea744bcc9203f35b908e66d42f41 Author: Wang Chen genirq: check chip->ack before calling commit 7a2f151e7a8b79b9e5acb735b1622fcf3e8919ef Author: Ingo Molnar infiniband: disable temporarily commit 30c52e4f0857f35b9670808af1f59919869b1e11 Author: Ingo Molnar fix warnings in security/keys/keyctl.c commit ee81b97d66f23954a5893ac96f13420afd8bf0d2 Author: Ingo Molnar fix warnings in drivers/misc/ics932s401.c commit baa1fb36aedb9358b2af8a88cc658d506b007384 Author: Ingo Molnar fix warning in drivers/acpi/sleep/main.c commit 16436457465aa89d8c6e399098711a6fe21984d4 Author: Ingo Molnar fix warning in drivers/pci/hotplug/ibmphp_core.c commit c8eb07f59386d3168c2cfdc2c0959ed2ab6edf7a Author: Ingo Molnar fix warning in drivers/media/dvb/dvb-usb/af9005-fe.c commit 2715c6ced43fbdf18db63d9ba4b05a85f4c849fb Author: Ingo Molnar fix warnings in drivers/mfd/da903x.c commit 2105e409bdc6089c59d5b729212c5f6ddc098740 Author: Wang Chen infiniband: fix 2.6.28-git1 build failure commit 8d2473a59f458450015084b88d2dccf09f6eb5dd Author: Ingo Molnar Revert "sound/soc/codecs/tlv320aic23.c: remove unused variable" commit 5d951e6fc80aeb2909fce0675b0c8bf093a837da Author: Ingo Molnar Revert "fix warning in sound/soc/codecs/wm8903.c" commit 50fdbe6cc7c1ba7390c450bd93969a1e226f356b Author: Ingo Molnar Revert "fix warning in drivers/net/wireless/ath9k/rc.c" commit e85489de016969adf1edc0f228ab0271632dfc76 Author: Ingo Molnar Revert "fix warning in drivers/net/wireless/iwlwifi/iwl-scan.c" commit 438e4863dff679cb2d32d0c6b29896516f0f5187 Author: Ingo Molnar Revert "fix warning in net/bluetooth/rfcomm/sock.c" commit 7e55424ee2f619f6ad00bf785b4c24e89e08ddb8 Author: Ingo Molnar Revert "fix warning in sound/pci/hda/patch_sigmatel.c" commit 694ed231e03a6cb57d3c3b255de765552321926b Author: Ingo Molnar Revert "fix warning in sound/pci/pcxhr/pcxhr_core.c" commit 899af3226b500d965ba93e4f95d5a04dc0cb30b2 Author: Cyrill Gorcunov V4L/DVB fixes, crash in af9005_usb_module_init() commit 2b583d8bc8d7105b58d7481a4a0ceb718dac49c6 Author: Jaswinder Singh Rajput x86: perf_counter remove unwanted hw_perf_enable_all commit 01ea1ccaa24dea3552e103be13b7897211607a8b Author: Yinghai Lu perf_counter: more barrier in blank weak function commit 1cc4fff0b360aeffeedb7d6db5089d88dd861700 Author: Frederic Weisbecker hrtimers: increase clock min delta threshold while interrupt hanging commit 36b21230589ee51763afcc9ba2d126973f3ae96c Author: Jaswinder Singh Rajput x86: eliminate atleast 10684 sparse warnings commit 412d0bb553c0227191f1bfd06100f561600bff22 Author: Frederic Weisbecker tracing/function-graph-tracer: strip ending newlines on comments commit 3871f2ffe53db3cef4fe0c18993ad9e6e0f69408 Author: Randy Dunlap sysrq: fix ftrace help msg & doc. commit 7e710aea4ed52acd42c0e1f34bcd13607bbd6649 Author: Mauro Carvalho Chehab V4L/DVB, Kbuild: fix compilation when dib7000p is not defined commit 07a19fb53900f7413caa2d83dd28f5ea849e6693 Author: Ingo Molnar Revert drivers/media/dvb/ fixlets commit e44aef58ecfbe061eb4c53b939bcc35fb1bee82d Author: Ingo Molnar perfcounters: include asm/perf_counter.h only if CONFIG_PERF_COUNTERS=y commit 2f18d1e8d07ae67dd0afce875287756d4bd31a46 Author: Ingo Molnar x86, perfcounters: add support for fixed-function pmcs commit f650a672359819454c3d8d4135ecd1558cde0b24 Author: Ingo Molnar perfcounters: add PERF_COUNT_BUS_CYCLES commit 235c7fc7c500e4fd1700c4ad01b5612bcdc1b449 Author: Ingo Molnar perfcounters: generalize the counter scheduler commit 8fe91e61cdc407c7556d3cd71cf20141a25bbcea Author: Ingo Molnar perfcounters: remove ->nr_inherited commit 0dff86aa7b9ec65a6d07167b7afb050b5fc98ddc Author: Ingo Molnar x86, perfcounters: print out the ->used bitmask commit 95cdd2e7851cce79ab839cb0b3cbe68d7911d0f1 Author: Ingo Molnar perfcounters: enable lowlevel pmc code to schedule counters commit 78b6084c907cea15bb40a564b974e072f5163781 Author: Ingo Molnar perfcounters: fix init context lock commit eef6cbf5844c620d9db9be99e4908cdf92492fb9 Author: Ingo Molnar perfcounters: pull inherited counters commit aa9c4c0f967fdb482ea95e8473ec3d201e6e0781 Author: Ingo Molnar perfcounters: fix task clock counter commit 7671581f1666ef4b54a1c1e598c51ac44c060a9b Author: Ingo Molnar perfcounters: hw ops rename commit 862a1a5f346fe7e9181ea51eaae48cf2cd70f746 Author: Ingo Molnar x86, perfcounters: refactor code for fixed-function PMCs commit 703e937c83bbad79075a7846e062e447c2fee6a4 Author: Ingo Molnar perfcounters: add fixed-mode PMC enumeration commit eb2b861810d4ff72454c83996b891df4e0aaff9a Author: Ingo Molnar x86, perfcounters: prepare for fixed-mode PMCs commit 5c167b8585c8d91206b395d57011ead7711e322f Author: Ingo Molnar x86, perfcounters: rename intel_arch_perfmon.h => perf_counter.h commit 7995888fcb0246543ee8027bf2835a250ba8c925 Author: Ingo Molnar perfcounters: tweak group scheduling commit 8fb9331391af95ca1f4e5c0a0da8120b13cbae01 Author: Ingo Molnar perfcounters: remove warnings commit 94c46572a6d9bb497eda0a14099d9f1360d57d5d Author: Jaswinder Singh x86: perf_counter.c intel_perfmon_event_map and max_intel_perfmon_events should be static commit a86ed50859d65a08beec9474df97b88438a996df Author: Ingo Molnar perfcounters: use hw_event.disable flag commit f65cb45cba63f249458b669aa67069eabc37b2f5 Author: Ingo Molnar perfcounters: flush on setuid exec commit 0cc0c027d4e028632933f1be2dc4cd730358183b Author: Ingo Molnar perfcounters: release CPU context when exiting task counters commit 75f224cf7700ed6006574dc3f2efa29860727570 Author: Ingo Molnar perfcounters: fix lapic initialization commit 088e2852c858159d47f71ee8da38e0fb1b21f806 Author: Ingo Molnar perfcounters, x86: fix sw counters on non-PMC CPUs commit 2b9ff0db19b5e2c77000b7201525f9c3d6e8328d Author: Ingo Molnar perfcounters: fix non-intel-perfmon CPUs commit e06c61a879910869aa5bf3f8f634abfee1a7bebc Author: Ingo Molnar perfcounters: add nr-of-faults counter commit 6c594c21fcb02c662f11c97be4d7d2b73060a205 Author: Ingo Molnar perfcounters: add task migrations counter commit 5d6a27d8a096868ae313f71f563b06074a7e34fe Author: Ingo Molnar perfcounters: add context switch counter commit 8cb391e8786c8072367f0aeb90551903fef074ba Author: Ingo Molnar perfcounters: fix task clock counter commit 9b51f66dcb09ac5eb6bc68fc111d5c7a1e0131d6 Author: Ingo Molnar perfcounters: implement "counter inheritance" commit ee06094f8279e1312fc0a31591320cc7b6f0ab1e Author: Ingo Molnar perfcounters: restructure x86 counter math commit 9b194e831fb2c322ed81a373e49620f34edc2778 Author: Ingo Molnar x86: implement atomic64_t on 32-bit commit 27af2b137e04cebee0a32762f19ee92d4a5e5e9a Author: Ingo Molnar net/wireless/reg.c: fix commit 447557ac7ce120306b4a31d6003faef39cb1bf14 Author: Ingo Molnar perf counters: update docs commit 6a930700c8b655a9e25e42fc4adc0b225ebbcefc Author: Ingo Molnar perf counters: clean up state transitions commit 1d1c7ddbfab358445a542715551301b7fc363e28 Author: Ingo Molnar perf counters: add prctl interface to disable/enable counters commit bae43c9945ebeef15e7952e317efb02393d3bfc7 Author: Ingo Molnar perf counters: implement PERF_COUNT_TASK_CLOCK commit 01b2838c4298c5e0d30b4993c195ac34dd9df61e Author: Ingo Molnar perf counters: consolidate hw_perf save/restore APIs commit 5c92d12411dfe5f0f3d1b1c1e2f756245e6f7249 Author: Ingo Molnar perf counters: implement PERF_COUNT_CPU_CLOCK commit 621a01eac89b5e2f81a4cf576568b31f40a02724 Author: Ingo Molnar perf counters: hw driver API commit ccff286d85098ba5438e22aa2ea807fc1e18cf2f Author: Ingo Molnar perf counters: group counter, fixes commit 04289bb9891882202d7e961c4c04d2376930e9f9 Author: Ingo Molnar perf counters: add support for group counters commit 9f66a3810fe0d4100972db84290f3ae4a4d77025 Author: Ingo Molnar perf counters: restructure the API commit dfa7c899b401d7dc5d85aca416aee64ac82812f2 Author: Thomas Gleixner perf counters: expand use of counter->event commit eab656ae04b9d3b83265e3db01c0d2c46b748ef7 Author: Thomas Gleixner perf counters: clean up 'raw' type API commit 4ac13294e44664bb7edf4daf52edb71e7c6bbe84 Author: Thomas Gleixner perf counters: protect them against CSTATE transitions commit 43874d238d5f208854a73c3225ca2a22833eec8b Author: Ingo Molnar perfcounters: consolidate global-disable codepaths commit 1e12567678054bc1d4c944ecfad17624b3e49345 Author: Ingo Molnar perfcounters, x86: clean up debug code commit 7e2ae34749edf19e76e594b9c4b2cdde1066afc5 Author: Ingo Molnar perfcounters, x86: simplify disable/enable of counters commit a465b8d5e8d2351ab676e9b9e4164b58adc59598 Author: Ingo Molnar Revert "fix warning in kernel/audit.c" commit 17c35a1dd22dd77a97213106611e7bbf68de46ec Author: Ingo Molnar Revert "fix warning in drivers/isdn/hysdn/hysdn_net.c" commit 4c59e4676dc95f6f58a2cff5390b2699fa5b5549 Author: Ingo Molnar perfcounters: select ANON_INODES commit 87b9cf4623ad4e5fc009e48c020593dffd5d3793 Author: Ingo Molnar x86, perfcounters: read out MSR_CORE_PERF_GLOBAL_STATUS with counters disabled commit 241771ef016b5c0c83cd7a4372a74321c973c1e6 Author: Ingo Molnar performance counters: x86 support commit e7bc62b6b3aeaa8849f8383e0cfb7ca6c003adc6 Author: Ingo Molnar performance counters: documentation commit 0793a61d4df8daeac6492dbf8d2f3e5713caae5e Author: Thomas Gleixner performance counters: core code commit 17486487a039499ee49b5af5105df5f112c504d0 Author: Ingo Molnar fix warning in arch/x86/boot/video-mode.c commit 6fb78c89be542ce398b4cae78c66d7e38bbd416b Author: Ingo Molnar fix warning in drivers/usb/serial/io_edgeport.c commit 05ba123533f4b47a15c63f85521ba1628d1ca20d Author: Ingo Molnar fix warning in drivers/usb/atm/ueagle-atm.c commit 399f571d374c5b7f6b8d45581b789bd136bea9b0 Author: Ingo Molnar fix warnings in drivers/net/wireless/zd1201.c commit d1494dc581d74790689dff9988f9410097b58fdf Author: Ingo Molnar Revert "ACPI suspend: fix build warning when CONFIG_ACPI_SLEEP=n" commit 394ca7a7afcfcda54ac0f87952aeeb7f55a0fd35 Author: Ingo Molnar fix warning in sound/pci/vx222/vx222.c commit c4446f0855c214c35cb5939300b21b5ffbb74938 Author: Ingo Molnar fix warning in sound/pci/via82xx.c commit f1c19a0bc49ccec0c989d7ee8c3d78d011a4c83d Author: Ingo Molnar fix warning in sound/pci/via82xx_modem.c commit d6271e22371e0bafa32ea6f9ebbd2e2f3c28e512 Author: Ingo Molnar fix warning in drivers/mtd/devices/mtd_dataflash.c commit 0e932f541cf7a7b19952177af216a8079be13518 Author: Ingo Molnar fix warning in drivers/isdn/hysdn/hysdn_net.c commit 7da10d30ff9be9ac7d52d367b831b66998c24292 Author: Ingo Molnar fix warning in drivers/isdn/hardware/eicon/maintidi.c commit e5e5492e7094ed4bea8daf0302f60fbb21daa4c7 Author: Ingo Molnar fix warning in drivers/net/wan/z85230.c commit 72db67df68608b55497608609e0dcbff9f3683ca Author: Ingo Molnar fix warning in sound/isa/sb/sb8.c commit b77ce61c316822d9e1b4d7768d72dc482e2fed75 Author: Ingo Molnar fix warning in drivers/scsi/ncr53c8xx.c commit 8a5ed3e84a24f8b1246b921141ffd3e4132f270e Author: Ingo Molnar fix warning in drivers/mtd/devices/phram.c commit ce909bc3adeb376fb67b7405901ca2411ea62a63 Author: Ingo Molnar fix type unsafe pointer use in drivers/pci/hotplug/cpqphp_core.c commit 52370c7eb10e2c1bc94db0e05f62a11a7801551b Author: Ingo Molnar fix warning in fs/ocfs2/slot_map.c commit c0df03c6c28e6856f2fb6bcd77c082df9d8801fb Author: Ingo Molnar fix warnings in fs/reiserfs/lbalance.c commit af4d2994e0e8e6e529b0e87f4e436dad062a9c05 Author: Ingo Molnar fix warning in fs/ocfs2/stack_user.c commit 867fa885913b6a6c5ee4bceb0143448c384bcba1 Author: Ingo Molnar fix warning in fs/ocfs2/cluster/heartbeat.c commit 809552d204591f4ae8ff02b0690a623c29cee76b Author: Ingo Molnar fix warning in drivers/scsi/advansys.c commit 9482f7a947e1df44b9a2b75e7c0f36abee5859c3 Author: Ingo Molnar fix assignment in fs/reiserfs/do_balan.c commit 8ffcd2a715ab3d0843fe181378251b97c8597762 Author: Ingo Molnar fix warning in drivers/usb/serial/mos7720.c commit d94b43b196712688c7b018edd69a4ca1650f61e0 Author: Ingo Molnar fix warning in drivers/net/s2io.c commit 78f065dd3b7f8116dafc7eb6bf966e8276580c15 Author: Ingo Molnar fix warnings in drivers/net/niu.c commit 9cc0c65af74e02da2c3d621cb061bd61b64cc24e Author: Ingo Molnar fix warning in drivers/net/niu.c commit 6d549078ead1cf730f5c14a4797936063317c3da Author: Ingo Molnar fix warning in fs/ocfs2/ioctl.c commit 86be7d94e78ed4529575bb971816b88f18a02899 Author: Ingo Molnar fix warnings in fs/omfs/file.c commit e2c99ca71b485021d9716c37eb7801629f4faedb Author: Ingo Molnar fix warning in fs/ocfs2/aops.c commit 7df683d8bc080945c4c23d8c045cfe33756fcd01 Author: Ingo Molnar fix warnings in drivers/usb/serial/keyspan_pda.c commit 1fbcee70f2e5aac67e6e57894ce44acfd21b2ec8 Author: Ingo Molnar fix warning in drivers/usb/serial/keyspan.c commit 098d62c764c711a51304ab51dc46a4af30b498a3 Author: Ingo Molnar fix warning in drivers/scsi/qla4xxx/ql4_mbx.c commit 32fd3b535aa43e290c33873124f91fec6a4329f7 Author: Ingo Molnar fix warning in drivers/net/qla3xxx.c commit ba58621694ef08b59b753bc5042b3db9472c5aff Author: Ingo Molnar fix warning in net/sunrpc/xprtrdma/svc_rdma_transport.c commit b91eb990a0d839e810bb15048af08a69ab1b6ffe Author: Ingo Molnar fix warning in net/sched/sch_hfsc.c commit 75b5e50b98940461aea8fae3ffca6bf25541c345 Author: Ingo Molnar fix warnings in fs/fat/namei_vfat.c commit d8b48c7665001f48a552786725c5c68d1fd9ee35 Author: Ingo Molnar fix warnings in fs/ecryptfs/keystore.c commit 4475e1cfc2ebf431dffb490203c86f13aa9555cb Author: Ingo Molnar fix warning in fs/cifs/readdir.c commit 42ccb35654d81b465bc9cb6822f90cfa396fa607 Author: Ingo Molnar fix warning in drivers/watchdog/w83697ug_wdt.c commit eaa6ce318c53cf726d1dc6de2bd38d6809063a8f Author: Ingo Molnar fix warnings in drivers/video/sis/init301.c commit ff74648c35f85939a666479669f9ddcc8e750ce5 Author: Ingo Molnar fix warnings in drivers/uwb/wlp/messages.c commit 769bff404d69f60fa4e9ca1554d2fa46341f744e Author: Ingo Molnar fix warning in drivers/uwb/whc-rc.c commit f9e36ca89b882f9bba0a83f4c69a5ab806c7f341 Author: Ingo Molnar fix warning in drivers/uwb/i1480/i1480-est.c commit 7df00800403ae90f142b4cb8e798002c52f555d2 Author: Ingo Molnar fix warning in drivers/usb/serial/io_edgeport.c commit e4ddf75de81e2df4435e8545668b51c779a8f38b Author: Ingo Molnar fix warning in drivers/scsi/megaraid/megaraid_mm.c commit 5da23a8ee5186b1b4e498d8bc2c45b1898a88d28 Author: Ingo Molnar fix warning in drivers/scsi/lpfc/lpfc_els.c commit c390a3784564c1fb2183e4a31ea39a9beb47d034 Author: Ingo Molnar fix warning in net/netfilter/nf_conntrack_ftp.c commit 8fecea67aa434dd1653c4a275532e29903caeb88 Author: Ingo Molnar fix warning in net/ipv6/ip6_flowlabel.c commit 67230f214ec140d07fcd32535841ee6eb4437364 Author: Ingo Molnar fix warning in net/dsa/mv88e6xxx.c commit 948158e35984f86e565db303e0f026e536edca85 Author: Ingo Molnar fix warning in net/dsa/mv88e6060.c commit 8574b3b4834c740d37d6eb2d6839037779b56da4 Author: Ingo Molnar fix warning in fs/dlm/netlink.c commit dc3d660a7870c50a6c401790ff80dfec27af0c9e Author: Ingo Molnar fix warning in fs/configfs/symlink.c commit 8e912b9772ff0d21b9dc71cff7a4105aeca0ae36 Author: Ingo Molnar fix warning in fs/cifs/cifssmb.c commit 960e61a18497d67988d160e090f98f4dd8e2a740 Author: Ingo Molnar fix warnings in fs/befs/linuxvfs.c commit 8bbec3ba0d093ca0d095fdb8820964cba6e8910c Author: Ingo Molnar remove unused code from drivers/rtc/rtc-ds1390.c commit 9b9c8fde6c9d175bb7a108e3d231626984364451 Author: Ingo Molnar fix warning in drivers/net/sis900.c commit 0420937720a520f0fe584ae65321126672f5b829 Author: Ingo Molnar fix warning in drivers/ata/sata_via.c commit 29ddc60f819f1e8fc9d7e2202b9807dbfad8e5fa Author: Ingo Molnar x86: fix warning in arch/x86/pci/amd_bus.c commit 8dad23d691de2e9235043b6cc84f731e6a6405c2 Author: Ingo Molnar fix warning in fs/locks.c commit 924a289446dadc9c3c9896c87446e0403c746537 Author: Ingo Molnar fix warning in drivers/net/wireless/iwlwifi/iwl-3945.c commit 22672393d84dc3c74b7cd46eebdb44d43747318b Author: Ingo Molnar fix warning in drivers/net/wireless/b43/main.c commit de965062d615afc885bd800976e488bd3c2d1d6f Author: Ingo Molnar fix warning in drivers/net/wireless/ath9k/rc.c commit 742cddc749294be3c0fa909e6255c5a338a1ac40 Author: Ingo Molnar fix error path in drivers/net/mlx4/en_rx.c commit 181787d1c30af364ffd15428fe6fab7798c3f3c1 Author: Ingo Molnar fix warning in drivers/net/cassini.c commit 397cfbf05e99c03380882df2b3f0cf04d02f487c Author: Ingo Molnar fix warning in drivers/misc/sgi-gru/grufault.c commit f3e67e2430546ef6e325358a4af3cd8bb5a62873 Author: Ingo Molnar fix warning in drivers/media/video/usbvision/usbvision-i2c.c commit edf69b6a63bfef16550dda21c4a747dcc096b4be Author: Ingo Molnar fix drivers/media/video/usbvideo/quickcam_messenger.c commit 491af31a6c682d62b4c0c600b0d21f14aeaf40f4 Author: Ingo Molnar fix warning in drivers/media/video/cx18/cx18-mailbox.c commit 728342aab1cd9cb80565b7061bca9f89b366285e Author: Ingo Molnar fix warnings in drivers/media/dvb/ttusb-dec/ttusb_dec.c commit 4dda565f69a71e06b76c975a66fb218cd9a4d08c Author: Ingo Molnar fix warning in drivers/media/dvb/frontends/drx397xD.c commit a2e4f4a682e5340f03371329e8624cc3dad12f21 Author: Ingo Molnar fix warning in drivers/media/common/tuners/mxl5007t.c commit 3b1e00b78a9ace372cb17d2cd57a30f55b732120 Author: Ingo Molnar fix warning in drivers/md/dm-raid1.c commit f50de19e643da0e573970acd42908fb152718a14 Author: Ingo Molnar fix warning in drivers/isdn/capi/capidrv.c commit 733e529a83dbadf1487200ced692cb1cb04fca96 Author: Ingo Molnar fix warning in drivers/block/DAC960.c commit 1b8695140309c64be9b54a16c319b93433910070 Author: Ingo Molnar fix warning in drivers/atm/horizon.c commit c07f8683ea0877f1f718c63acdc35d7acdd3079d Author: Ingo Molnar fix uninitialized memory use in drivers/atm/ambassador.c commit 7aec57d88e7c1d821fb72575f00e03c713d62ce5 Author: Ingo Molnar fix warning in drivers/ata/libata-scsi.c commit 31f57b3a03fcf85219b61c81311f3d17c7eb9e4d Author: Ingo Molnar fix warning in drivers/ata/libata-core.c commit 896f25a24a7558cf10912cf29d21bc93a1a5b238 Author: Ingo Molnar fix warning in drivers/acpi/executer/exprep.c commit 33f9e0e0d2305eca38421ba276687f5d3dd7e397 Author: Ingo Molnar fix warning in block/bsg.c commit 14bc29fd4ef95bfdfa056267f819068b55594932 Author: Ingo Molnar markers: fix warning in kernel/marker.c commit 55c57b31d2cc38fc519a4089d6206601a48624b2 Author: Ingo Molnar fix warning in mm/swapfile.c commit 2bf52c6afaca2f61bd50bd4931211d45d3a9595c Author: Ingo Molnar sched, cpusets: fix warning in kernel/cpuset.c commit 4f09d65373a7e4c95eca01322a05b27c8818b082 Author: Ingo Molnar werror: fix warning in drivers/misc/fujitsu-laptop.c commit 6d30018e482e52cf5bfea3cf1d5697c8158a59d7 Author: Ingo Molnar crypto: fix error flow of crypto/testmgr.c:test_comp() commit 7de55d6fd5de73854971d329845c3ec6ca2c6cfb Author: Ingo Molnar warning in fs/eventpoll.c commit 3e33d5619a2f0dd5005a43ee429b2584062ed1aa Author: Ingo Molnar fix warning in drivers/char/isicom.c commit 0792f11fb158e4beb016c0bc51539decf2e4d3bc Author: Ingo Molnar fix warning in drivers/char/ipmi/ipmi_msghandler.c commit f19db4ee21f0eccfe944cac7d9a2863585092d97 Author: Ingo Molnar fix warning in drivers/acpi/toshiba_acpi.c commit 52d284ace08b72ae066e0c008b9965e15f336b37 Author: Ingo Molnar warning in sound/pci/pcxhr/pcxhr.c commit 84f6cc34be83d50cc5c6d83c1d031209464d9228 Author: Ingo Molnar fix warning in sound/pci/pcxhr/pcxhr_mixer.c commit ea9e778a1be4f84300cf45ba7fd62f1126811acf Author: Ingo Molnar fix warning in sound/pci/pcxhr/pcxhr_core.c commit 9af3ec14787c84965dad150c06b14070132ffbd6 Author: Ingo Molnar fix warnings in drivers/video/mb862xx/mb862xxfb.c commit b868e7f3cb9905f3109e98354d5290b61bd9d249 Author: Ingo Molnar fix !CONFIG_PCI related warning in drivers/char/cs5535_gpio.c commit 7dae1f71a9bcd471e650c2f808693adc19ef8491 Author: Ingo Molnar improve the structure of pnpbios_thread_init() commit 2f9efdd2d029de51f71a1042147c7dcdea26c649 Author: Ingo Molnar vfs: warning in fs/nfsd/nfs4state.c commit fb6eecb5a025dde78fe63d5f36d0616678ab265b Author: Ingo Molnar nfsd: fix unused variable in fs/nfsd/nfsxdr.c commit 42c4de2b9f4873e1805af7cffa47526e43cd59d0 Author: Ingo Molnar vfs: warning in fs/nfsd/nfsxdr.c commit a38e306804efb500cd058b5c211d76ddc5c77d0b Author: Ingo Molnar vfs: turn vfs_lock_file() from macro into inline, on !FILE_LOCKING commit f9e6c2e84648f0d158ed9991fbe414c8e24a1e32 Author: Ingo Molnar fix warning in drivers/video/sis/sis_main.c commit ee98eda9c9b77abcb40b2e1f3d53652374624008 Author: Ingo Molnar annotate warning in fs/jfs/jfs_dmap.c commit 05f3120b6304adfa5c520afa166a825dacd07830 Author: Ingo Molnar work around warning in fs/xfs/xfs_mount.c commit 96c79254264033f1505198d5d362b68d88d1bbaf Author: Ingo Molnar fix warning in net/dccp/options.c commit a27ba285435299527da607a8b9462b440c483bd5 Author: Ingo Molnar fix warning in fs/ext4/extents.c commit 90d1e9b5d0359aecd9d62e26a5163346ec4266d6 Author: Ingo Molnar work around warning in fs/xfs/xfs_rtalloc.c commit 193e56a10e56505dc7eac9e5632834c72b55613d Author: Ingo Molnar fix warning in drivers/net/mlx4/mcg.c commit 77eb6ca2a4901873d3da1b57af9c7248c7f8a453 Author: Ingo Molnar fix warning in arch/x86/kernel/setup.c commit c7cdfa23904e903020ef6b3cb094afa09deb16a4 Author: Ingo Molnar fix warning in drivers/isdn/i4l/isdn_ppp.c commit 0ce195dcd97ca93ef8a452e338ab14aaac5b07b3 Author: Ingo Molnar fix warning in arch/x86/kernel/early-quirks.c commit a082a0f14925acabf6b211057923351e80405ed6 Author: Ingo Molnar fix warning in drivers/base/platform.c commit 0c5087726f72665398feb359ab9bd830ffb218f9 Author: Ingo Molnar fix warning in drivers/pci/pci-driver.c commit a53fbc0c78e23f665cdbf0a03de20ea039716d51 Author: Ingo Molnar #ifdef complications in drivers/acpi/sleep/main.c commit bcc35f75a3b9b96c53a74176b135304fc7ffe052 Author: Ingo Molnar fix warning in net/ax25/sysctl_net_ax25.c commit 1cc97e68741575a23d6520f4c5aebed4855fd9b7 Author: Ingo Molnar fix warnings in drivers/acpi/sbs.c commit 05d4ce452f37d04b88992f191da87a08999026a8 Author: Ingo Molnar fix warning in sound/pci/cs46xx/cs46xx_lib.c commit 59681c6c30e3f700af8d716f66e41ad18f726b80 Author: Ingo Molnar fix warning in net/sunrpc/xprtrdma/verbs.c commit ad8d03b315507a954160fcf04dc94cef9f118e77 Author: Ingo Molnar fix warning in net/bluetooth/rfcomm/sock.c commit 515891d0cf848929934cb5afaf860ba7162bdab0 Author: Ingo Molnar fix warning in drivers/video/matrox/matroxfb_crtc2.c commit cd69c4ef5afc42de360b232f784446be5525ff2e Author: Ingo Molnar fix warning in drivers/char/rtc.c commit 9c1e9cd1432551ef8e03c94c868a35091f58cf60 Author: Ingo Molnar fix warning in ipc/ipc_sysctl.c commit 5bfad16c5941eb98c8feac4dbcba26b93e69b4e0 Author: Ingo Molnar fix warning in drivers/message/fusion/mptbase.c commit adec6add45da21aa914c7068213d5c8ed0de6a35 Author: Ingo Molnar fix warning in kernel/profile.c commit 320451a3f79098ca800f2e58674074c26efee020 Author: Ingo Molnar fix warning in drivers/net/wireless/ray_cs.c commit 2998b15d972aeabfc8c4ae3a50c1438475df9f98 Author: Ingo Molnar fix warning in sound/pci/hda/patch_sigmatel.c commit 72c8ebb8c343b9e6ad91a4cf7b6ada8d6639d089 Author: Ingo Molnar fix warning in drivers/scsi/advansys.c commit 1b740f09d95736d9fbc589634324a4eba5f0d54c Author: Ingo Molnar fix warning in arch/x86/kernel/cpu/intel_cacheinfo.c commit a6c5f6e64e37959f9bce5bc5e180ac77375da9bc Author: Ingo Molnar fix warning in drivers/isdn/i4l/isdn_common.c commit decc1656e870c9e5bd94f2357b8496b8da6c2e73 Author: Ingo Molnar fix warning in net/netfilter/nf_conntrack_proto_sctp.c commit b547d51a26c5ed23571df50c7254439e2f5dbebe Author: Ingo Molnar fix warning in net/netfilter/ipvs/ip_vs_ctl.c commit be04beaa0b80eec2b699c4c82ff5f7942a131108 Author: Ingo Molnar werror: depends on !ENABLE_WARN_DEPRECATED && !ENABLE_MUST_CHECK commit acf109681c94f7af81785476f949b185f4b11742 Author: Ingo Molnar warnings, kbuild: allow scripts to override -Werror warnings commit 3f4176906b239b03347f6c517f907b2605064ee8 Author: Ingo Molnar werror: fix rename of config option commit a302c926eef2e3ab2b624358ec7dfe9c38a21560 Author: Ingo Molnar werror: enable more widely commit b7bf96322888952479fbd6b7c05f82557509ebc8 Author: David Howells werror: config, rework commit 2836db7cc529132e78627106fe209aa8391c461a Author: David Howells werror: config option commit 518d7af8a1e7faa26633aa9f53deaea9072a50b2 Author: David Howells werror: modtable warnings commit ceabbff4ca48322467d7991661c337839f579504 Author: Ingo Molnar fix warning in drivers/char/rocket.c commit 7573e149c202d1c903a3c2a05ef305d1995c05ec Author: Ingo Molnar fix warning in arch/x86/kernel/scx200_32.c commit 2281d27663a5f17689ec49e029b4962cba19d614 Author: Ingo Molnar fix warning in drivers/net/atlx/atl2.c commit 1a4ae23a74b96a6cc3d9025baf27bac2db436bf2 Author: Ingo Molnar include/linux/init.h: fix warning in drivers/crypto/hifn_795x.c commit 6a910db6dc3c10f61c8dafe06cac87eb72a4c185 Author: Ingo Molnar fix warning in drivers/video/aty/atyfb_base.c, #2 commit 7e85e15186669b9bc7b370ea59d3e6bf43c4b808 Author: Ingo Molnar fix warning in drivers/video/aty/atyfb_base.c commit c03748fb285682fc64d5dda4a1bdfe31e55f6355 Author: Ingo Molnar fix warning in fs/coda/sysctl.c commit b5a7c2b9e1a1b4d80da5d66b330545fdeafe1dad Author: Ingo Molnar fix warning in net/netfilter/nf_conntrack_proto_tcp.c commit 8317adfb7d80904a06ba51af0bc4c3e233d7d7c9 Author: Ingo Molnar fix warning in drivers/media/dvb/dvb-usb/anysee.c commit 822c18db871bc88b2a60d7a9618ec79a8b5e1ef5 Author: Ingo Molnar fix warning in drivers/net/wireless/iwlwifi/iwl-scan.c commit 45fb8a50a3536e0bf811369443565313095402b1 Author: Ingo Molnar fix warning in drivers/watchdog/w83697ug_wdt.c commit c3e97efa937cebb9a9e32075eb6bb362df900695 Author: Ingo Molnar fix warning in drivers/mfd/ucb1400_core.c commit b04559787d8aa72c15ab1907255bf572ab229410 Author: Ingo Molnar fix warning in drivers/scsi/dtc.c commit 956d4cf94a74758971702cd728875f5061a0a140 Author: Ingo Molnar fix warning in drivers/isdn/sc/timer.c commit 2fb401494968a2dd2164477318b1933ec4d83a8a Author: Ingo Molnar fix warning in drivers/isdn/sc/ioctl.c commit 69f38f617c3f832e088be9d35242d929aa623fd4 Author: Ingo Molnar fix warning in drivers/net/depca.c commit 557073e3dac7b8479df69c140a5fd2b8f4a9cfad Author: Ingo Molnar fix warning in drivers/net/3c523.c commit d8aa4eeed2bcc8752cddfc9d33a922b7ba83ef19 Author: Ingo Molnar fix warning in drivers/scsi/g_NCR5380.c commit d03e2aa0661d5778368290e9a4e554bab0f65e86 Author: Ingo Molnar fix warning in drivers/isdn/sc/shmem.c commit 3c4a05f6154d6264dda050eb08b91c273503fc70 Author: Ingo Molnar fix warning in drivers/mca/mca-legacy.c commit 71480d36510fa11ec463b8a146dd81af1b6d820c Author: Ingo Molnar fix warning in drivers/isdn/icn/icn.c commit ae96b7d1bef6e28e71c883e47df87aca81ee36bb Author: Ingo Molnar fix warning in drivers/infiniband/hw/amso1100/c2_vq.c commit 62c055d5c0a24925c207944f6125ec4c32f5dd7f Author: Ingo Molnar fix warning in drivers/input/touchscreen/htcpen.c commit b462f1c14c6ccc30b8ad0bb884aea07600dc9c0a Author: Ingo Molnar fix warning in drivers/isdn/sc/init.c commit c7aaa6c683abf73346cb71e5045fd6541c85959f Author: Ingo Molnar fix warning in drivers/watchdog/i6300esb.c commit 2d04a7415600832cb55402b9b41ffb27bec6df4f Author: Ingo Molnar fix warning in kernel/power/main.c commit 2478b56002be505fca34caee9203d981feb1faa6 Author: Ingo Molnar fix warning in fs/compat_binfmt_elf.c commit 62b413610b9fbe934f4c30df1cc89664d85d6b6c Author: Ingo Molnar fix warning in drivers/pci/search.c commit b7594e4e9c9ef3d73c360df61b45078eac3ae7b2 Author: Ingo Molnar fix warning in drivers/isdn/hardware/eicon/message.c commit 5337bc2e9544216638e3b08918fcd1d0ad511273 Author: David Howells warnings: disable i2o on 64bit commit 72614bf4fe68ee1e00867b29ccaee6870ee5163b Author: David Howells warnings: fix xfs posix acl commit 85e7c217b8b07013b1b96a62bcb2a7f18bf6820c Author: Ingo Molnar dvb/usb: disable commit 9ecc4dfd2c5e0c5f1725f3ce7220f603ec026d64 Author: Ken Chen proc: add /proc/*/stack commit 5fb36522dce0dab809feff62205aed3bf89d521c Author: Takashi Iwai kernel crash commit df0639431b9f9408346d92de6c967ac6dd2f1f8c Author: Ingo Molnar Revert "ACPI suspend: fix build warning when CONFIG_ACPI_SLEEP=n" commit eadb4fba1c02d41e12d0001178221942fcc96090 Author: Ingo Molnar whci: disable commit c309917164172b9908eb12ee68f428b42bb42455 Author: Ingo Molnar Revert "mm fix: Re: unable to handle kernel NULL pointer derefence at 00000000" commit d32bc2c696f0edf5a96ec0ef5028180080a7ca89 Author: Fenghua Yu pci/iommu: fix build failure at x86/kernel/pci-dma.c with !CONFIG_PCI commit d93edaf9b06f7e949d1d6007903a88e67836dbd2 Author: Jens Axboe fix: 2.6.28-rc1 (2fca5c): libata: kernel cant boot commit 106f281ace78a0339bb460dd409d74801521a778 Author: Zhao, Yu pci: fix ARI commit afed66317accd2fdfeb57061102c20796fb9ff66 Author: Suresh Siddha saa7134: fix resource map sanity check conflict commit 50f971ad73ea9550b1d8e34006bd11c7e108b24f Author: Ingo Molnar qa: disable jffs2 for now commit fca45353be469acb7f961fd3b2b244f400098a7d Author: Vegard Nossum kmemcheck: document the shadow member of struct page commit 50987b4becd23c0716631602c36a1be5ed74576c Author: Vegard Nossum kmemcheck: update Kconfig help text commit f899dff87c5f03c8fc9145a9472b7e7f7173bbaa Author: Vegard Nossum kmemcheck: update documentation commit af3f8f7ec6d1a35c9a99a50e4faafdc18249412c Author: Vegard Nossum kmemcheck: fix mis-merge in sysctl table commit b6ec630b689e5f4694d8ea1f38798926a960dc2e Author: Ingo Molnar net9p: work around build breakage commit ae4038719e87e6cf2f815aa735909b615abd9121 Author: Li Zefan mm fix: Re: unable to handle kernel NULL pointer derefence at 00000000 commit 8422ac179506d38eb3f432809e806dd012581270 Author: Greg KH staging: fix p80211wext_event_associated() build failure commit d9c32f25101f22574aa861cb7f3fe58ebdf52232 Author: Ingo Molnar qa: cx88: disable for now commit e63003c9ec406578631c6322346ca0e326d99d46 Author: Ingo Molnar qa: always-enable CONFIG_FILE_LOCKING commit 0be9b16320ac42f968245e55383a5dd9238b9c39 Author: Kenji Kaneshige pci: fix: BUG: unable to handle kernel NULL pointer dereference, IP: pci_create_slot+0x28/0x170 commit d4d92fcc681f2a9b788fe228df1f9da3ef0cc111 Author: Ingo Molnar dvb: disable dm1105 commit b56b096cb3b258eebc63ce36ba9ee332a1427d79 Author: Ingo Molnar mfd: disable another driver commit 892cff77716a359fc2f6e159d846893d07bf11f4 Author: Ingo Molnar drivers/mfd/Kconfig: turn off broken driver commit 93e60b49d3df9f8bab5079e9e796bce3c604e3ed Author: Vegard Nossum security: initialize skb->sk_security by default commit 3cdfa5c3b0e1d60925497ced0cf908a2f078732c Author: Ingo Molnar rtx2x00: disable for now commit c8d7def4258375d88f0b6f06cc6f10c3a514a285 Author: Vegard Nossum drm: fix leak of uninitialized data to userspace commit 17bc3f7bf083e754e5c6210eab7af9ce7ed02ebc Author: Ingo Molnar Revert "Revert parts of "x86: update mptable"" commit ac2716510df12c6fa0e6b99ebb4aa68584a1a751 Author: Bjorn Helgaas pnp: Huge number of "io resource overlap" messages commit ced6e773aa88b80b0c6b519a84f1e85ff15e3416 Author: Yinghai Lu acpi: don't load acpi_cpufreq if acpi=off commit f6d62717fa9c6572f257720abac383a7ae5fdb62 Author: Ingo Molnar wd.c: work around broken build commit 1327b0cc9ad75c246f6e4198cf9c1731afda4146 Author: Ingo Molnar net, wd.c: fix undefined reference to `NS8390p_init' commit 75acfc78aa1a3ac46f473e39b8b294309f8a80c9 Author: Ingo Molnar misdn: work around build bug commit 81ba9c8488248a766f7151eba1664e9d93f49701 Author: Ingo Molnar hp-plus.c: work around build failure commit 70027001c8e97565fad148f371505f022eb1e779 Author: Ingo Molnar USB: work around crash commit 985d392693af6bbd6bdabcad65d24edb3b64c4ed Author: Ingo Molnar work around build breakage commit 18eed0ffd132f50660e7c1c16c48ec2af312de00 Author: Ingo Molnar i2c: work around boot crash in amd756_s4882_init() commit 32347630cbf94685c4eaae6d645ba720a8b31d2b Author: Ingo Molnar i2c workaround: turn off I2C_NFORCE2_S4985 for now commit 7120b52e90e1837e09bb4621f105022f940b856a Author: Ingo Molnar work around this crash for now: commit 3966803bcaa7a7b82ac05959c66ce12ea5953111 Author: Vegard Nossum ACPI: don't walk tables if ACPI was disabled commit 3ac23f215a2b1710ae7b4ee5569ddfe303386a4f Author: Zhao Yakui ACPI, x86: disable the C2C3_FFH access mode if MWAIT is unsupported commit 1d8d02e53965633d7465e4d3881365d5f114cfd9 Author: cking x86: enable speedstep for Intel Pentium M processor 7x0 [1.6-2.26 GHz] (Sonoma) processors commit 899b5030558b8dc21a171e2e8129e0a93fb08860 Author: Ingo Molnar init: root mount fix commit 6894676b3486f75d8e0c0c777fa9d8bf883eec70 Author: Yinghai Lu net: use numa_node in net_devcice->dev instead of parent commit da684332e2dc25966ac39d0c57f21715db0eb80e Author: Ingo Molnar tip: add -tip tag commit 54b1d646d442289d8d49e04bc2f10ba122ff6aa4 Author: Ingo Molnar sound/soc/codecs/tlv320aic23.c: remove unused variable commit 0be735b3ff71e13e24b82420f23a1b3b0a207ffb Author: Ingo Molnar net/mac80211/rc80211_minstrel_debugfs.c: fix return type commit 04271505e03535e1fd085c96085fcee41e7c415f Author: Ingo Molnar [vfs] fs.h: fops_get()/fops_put(): use pointer comparison commit f81ee5ca545020daf0ddfff3744199b87bbd8c70 Author: Ingo Molnar include/linux/fs.h: improve type checking of __mandatory_lock() commit 5baf34fc63c31ef676e0a764415b10e5cc1c7a4b Author: Ingo Molnar net/netlabel/netlabel_addrlist.c: add type checking to audit_log_format() commit d58cbf52cb25e215c0e34048bda8ec481bdce4af Author: Ingo Molnar fs/afs/dir.c: fix uninitialized variable use commit 19be5d76a014ce0e743848a42cbb3b579c0ad8d7 Author: Ingo Molnar drivers/video/cirrusfb.c: remove unused variables commit d138e44e2f8d0f26e04b0386d328d9cc7e33d82e Author: Ingo Molnar drivers/net/wireless/b43/phy_g.c: type check debug printouts commit f11adf3c65aff25074d5d3a90d72cdfc40d66b50 Author: Ingo Molnar drivers/ide/pci/hpt366.c: remove unused variable commit ecd05381e26b9a61e49fa485baea1595bd3d1b40 Author: Ingo Molnar x86: fix default_spin_lock_flags() prototype commit a3541ac22119f416daf96c4466388a43017be07e Author: Vegard Nossum x86: fix mis-merge commit 760932c8607b736504a134ed6feec25e90e089ac Author: Vegard Nossum kmemcheck: (finally) use 4k pages for identity mapping commit 558d96106fc99a49d76e5396ef29f52c35f9e499 Author: Ingo Molnar fix warning in sound/soc/codecs/wm8903.c commit 787c26feea837942629ef776e9183fcb242c3b93 Author: Ingo Molnar fix warning in block/cfq-iosched.c commit 03350a07f2c74db87bf8e4865dbfb361400978ec Author: Ingo Molnar fix warning in fs/nfs/client.c commit 7e4f7889aca92f2cf95ba31e005fc1368c1cbc5a Author: Ingo Molnar fix warning in drivers/net/sky2.c commit db37e088053c398d7cf00b12292cc035a02ae38c Author: Ingo Molnar fix warning in drivers/memstick/core/mspro_block.c commit e8c5e979a2a6d68637a0276eef1e333b7d44dfe3 Author: Ingo Molnar fix warning in fs/udf/truncate.c commit deb797f96d920083ba8a0bcfa6f57b19fc593571 Author: Ingo Molnar fix warning in net/sunrpc/svcauth_unix.c commit e2dc1093c350458370f66bb24a2b2aaf1c5874ed Author: Ingo Molnar fix warning in drivers/ata/pata_atiixp.c commit 830eace8fcc91dc386accdfb905926525012a50b Author: Ingo Molnar fix warning in drivers/hwmon/i5k_amb.c commit 923a5a960577dcc5189b6113300a122c0212b292 Author: Ingo Molnar fix warning in security/selinux/netnode.c commit bf8174b84e9a853be805daac80f15d5c1e732bb8 Author: Ingo Molnar fix warning in arch/x86/kernel/genx2apic_uv_x.c commit eab6d8939dee88cb8173269363b5b57e76c67f71 Author: Ingo Molnar fix warning in mm/mempolicy.c commit c62cda5dfaf7630edefe097a3e23af7732060b08 Author: Ingo Molnar fix warning in net/packet/af_packet.c commit 0c1e5af1b3c6aae8ad1e76f2ee50328ff77b9102 Author: Ingo Molnar fix warning in kernel/audit.c commit e2218720cbaf341a4ca569894fe7f14417b85ac4 Author: Ingo Molnar fix warning in kernel/power/snapshot.c commit d581867031ebe3c6f4e018ea32ed8b9ee5141ead Author: Ingo Molnar fix warning in net/rfkill/rfkill.c commit 1d7a079e04b64b88f7c64a90ab495e8e0e15996a Author: Ingo Molnar fix warning in drivers/hwmon/adt7473.c commit 8a75edd101e7e558b4ae0fe037ff5451599a8a1f Author: Ingo Molnar fix warning in fs/dcache.c commit bbd9fb80d59c14e3b1e3bfa0c6af939b51c72aef Author: Ingo Molnar include/asm-generic/bug.h - fix warning in mm/bootmem.c commit 5fcf07bd90b93df641512f96eebe2334b7b6eecf Author: Ingo Molnar include/asm-generic/bug.h - fix warning in net/sched/sch_generic.c commit f2d5bcd8284c28cf559f06dc0d12472648c33878 Author: Vegard Nossum kmemcheck: tag warning printks commit c1f93ec18664295caea7aa2f2ceda021a25b96bc Author: Vegard Nossum kmemcheck: fix crash in PnP BIOS calls commit c9f1cb5d7507c67cc53c8c9932b2c79343228c8c Author: Vegard Nossum kmemcheck: use set_memory_4k() on x86_64 only commit 9f24b3ed3058f022dad24f8304b9ad53adf5aa71 Author: Vegard Nossum x86: use REP MOVS instruction for memcpy if kmemcheck is enabled commit a7fff94fffaa0cecb923d6c1bb9b7691f608b49a Author: Vegard Nossum Revert "kmemcheck: use set_memory_4k() instead of disabling PSE" commit f5e7e97f133e8295be0d049d811914c111b1775c Author: Vegard Nossum kmemcheck: lazy checking for MOVS instructions commit 9228010f12bdbabef9393ed202653da9611acc66 Author: Vegard Nossum kmemcheck: hide/show pages in each iteration of a REP instruction #2 commit 4b7f562ea9736b8b111ffeb60a7311075ce76849 Author: Ingo Molnar kmemcheck: build fix commit 6c580f8230aa435a06c9051cfce023321665fcfe Author: Vegard Nossum kmemcheck: rip out SMP code commit 2c364c7a32f85ca76732278591c495a8d89614a0 Author: Vegard Nossum kmemcheck: rip out the optimized memset() commit 6189ce7dbf3bba7984be375b97f3319b24639197 Author: Vegard Nossum kmemcheck: hide/show pages in each iteration of a REP instruction commit db4b0f1e8ae7c9ffde8bef2eb3dcd4fad5988ac1 Author: Vegard Nossum kmemcheck: implement REP MOVS/STOS emulation commit c29fc328e8d56c755ca2daa7558ac9940dd7e892 Author: Vegard Nossum kmemcheck: save memory contents on use of uninitialized memory commit 69fc3b188186260679d76870ec7e63fd8abaf305 Author: Vegard Nossum kmemcheck: add some comments commit 7d9ed050ae80b40117a42c3c1541cd7662c89746 Author: Vegard Nossum kmemcheck: add some more documentation commit 86b5b776c5d0d3fb2513aca9fb7f4a04cf2289d9 Author: Vegard Nossum kmemcheck: allow memory accesses that cross page boundaries commit 1a3eac722554186437a3c3f86145a97f8b2baf19 Author: Vegard Nossum kmemcheck: work with sizes in terms of bytes instead of bits commit 19dd5283c3b1f3f8abab705c23658403910dfe23 Author: Vegard Nossum kmemcheck: add DMA hooks commit 12f50da2e1ad0cda2fb5754298bd03b3b02eb78b Author: Randy Dunlap kmemcheck: include module.h to prevent warnings commit 6409b3d382f8ec99c1ab312dd1e42f833465b9e6 Author: Ingo Molnar kmemcheck: export kmemcheck_mark_initialized commit d31ec1c47b10e268794e7b739b2009ac6a19eb8b Author: Ingo Molnar poison-pointers: clean up, add comments commit d23db9bbd91baaa1b22e7839e1e932bc6ae0582b Author: Ingo Molnar x86: change LIST_POISON to 0xdead000000000000 commit 4f962d4d65923d7b722192e729840cfb79af0a5a Author: Ingo Molnar stackprotector: remove self-test commit af9ff7868f0f76d3364351b1641b9dfa99588e77 Author: Arjan van de Ven x86: simplify stackprotector self-check commit d537cd48bde7d2c6f505fde5bf2cf27d45779227 Author: Vegard Nossum kmemcheck: remove unnecessary tests in the slab allocator commit a3ffadbe796c8b251ec602b621206f980eb1f0dd Author: Vegard Nossum kmemcheck: use capital Y/N in kconfig help-texts commit 16984967d4849a3a850b52033df75d790a7b1ee9 Author: Vegard Nossum kmemcheck: mark SMP support BROKEN commit 872d08e2995ec8badd8eadc2b04967ba1bf9ed75 Author: Vegard Nossum kmemcheck: constrain tracking to non-debugged caches commit fbd013adab160d9ee596647d41d7298a61e3f44d Author: Vegard Nossum kmemcheck: fix use of uninitialized spinlock commit aa92db14270b79f0f91a9060b547a46f9e2639da Author: Arjan van de Ven stackprotector: better self-test commit ee53ed996bb2b50ed36471c160be2c9547f95052 Author: Vegard Nossum kmemcheck: use the proper comment style commit 9ae6ef1ca46de6bfc35c7414b14efeac6c95c5e3 Author: Vegard Nossum softirq: raise the right softirq commit 1e85e220bd9cb79d9956ce71d5c197b260b3500a Author: Vegard Nossum kmemcheck: fix sparse warnings commit 233784e4a3a8f3a584787764dae677342138b31e Author: Vegard Nossum kmemcheck: enable in the x86 Kconfig commit 30532cb3c49a2a9fed94127aab26003c52398a51 Author: Pekka Enberg slab: add hooks for kmemcheck commit 18fd427debcf37c06917b55295df682fd05fee76 Author: Vegard Nossum slub: add hooks for kmemcheck commit e6df1035b1b488cafde1e69f1a25f2706c3ac1f7 Author: Vegard Nossum kmemcheck: add mm functions commit 862849a36e6087faac6349de0b1bcc66ff98411b Author: Pekka Enberg x86: add hooks for kmemcheck on x86_64 commit 787ecfaa503dc63ff1831ddc74b15dad49bace1d Author: Vegard Nossum x86: add hooks for kmemcheck commit 385e31b9eae0528bada07d16a189f3f40df23961 Author: Vegard Nossum kmemcheck: add the kmemcheck core commit 3994d3f08b618f9c40af1d402c3e4ecec946b5dc Author: Pekka Enberg kmemcheck: add Vegard and Pekka to MAINTAINERS commit 4b34d433198f97523756b267a236c803b13f3ae0 Author: Vegard Nossum tasklets: new tasklet scheduling function commit c9506812f317bca0edcbc717c8fdabdd1d0a264b Author: Pekka Enberg slab: move struct kmem_cache to headers commit a2d8c355cab2599bd369aa30746442990b73d3f4 Author: Vegard Nossum stacktrace: add forward-declaration struct task_struct commit 5995e9b7ec563126bb93eec05cfca7b8d58f26d5 Author: Vegard Nossum x86: add save_stack_trace_bp() for tracing from a specific stack frame commit afdb7023b849cffda679fcec324ff592d7b24a51 Author: Pekka Enberg x86: __show_registers() and __show_regs() API unification commit 7c9f8861e6c9c839f913e49b98c3854daca18f27 Author: Eric Sandeen stackprotector: use canary at end of stack to indicate overruns at oops time commit b40a4392a3c262e0d1b5379b4e142a8eefa63439 Author: Arjan van de Ven stackprotector: turn not having the right gcc into a #warning commit b719ac56c0032bc1602914c6ea70b0f1581b08c7 Author: Daniel Walker panic.c: fix whitespace additions commit 54371a43a66f4477889769b4fa00df936855dc8f Author: Arjan van de Ven x86: add CONFIG_CC_STACKPROTECTOR self-test commit 113c5413cf9051cc50b88befdc42e3402bb92115 Author: Ingo Molnar x86: unify stackprotector features commit 960a672bd9f1ec06e8f197cf81a50fd07ea02e7f Author: Ingo Molnar x86: stackprotector: mix TSC to the boot canary commit 420594296838fdc9a674470d710cda7d1487f9f4 Author: Ingo Molnar x86: fix the stackprotector canary of the boot CPU commit 18aa8bb12dcb10adc3d7c9d69714d53667c0ab7f Author: Ingo Molnar stackprotector: add boot_init_stack_canary() commit 9b5609fd773e6ac0b1d6d6e1bf68f32cca64e06b Author: Ingo Molnar stackprotector: include files commit 72370f2a5b227bd3817593a6b15ea3f53f51dfcb Author: Ingo Molnar x86: if stackprotector is enabled, thn use stack-protector-all by default commit 5cb273013e182a35e7db614d3e20a144cba71e53 Author: Ingo Molnar panic: print out stacktrace if DEBUG_BUGVERBOSE commit 517a92c4e19fcea815332d3155e9fb7723251274 Author: Ingo Molnar panic: print more informative messages on stackprotect failure commit 7e09b2a02dae4616a5a26000169964b32f86cd35 Author: Ingo Molnar x86: fix canary of the boot CPU's idle task commit ce22bd92cba0958e052cb1ce0f89f1d3a02b60a7 Author: Arjan van de Ven x86: setup stack canary for the idle threads commit e00320875d0cc5f8099a7227b2f25fbb3231268d Author: Ingo Molnar x86: fix stackprotector canary updates during context switches commit 4c7f8900f1d8a0e464e7092f132a7e93f7c20f2f Author: Ingo Molnar x86: stackprotector & PARAVIRT fix commit 948f984df52511bb0efa5c026813b0c34de43aa0 Author: Avi Kivity core, x86: make LIST_POISON less deadly patches/irq-mask-fix.patch0000664000076400007640000000661311160752235014576 0ustar tglxtglxSubject: genirq: fix simple and fasteoi irq handlers From: Jarek Poplawski After the "genirq: do not mask interrupts by default" patch interrupts should be disabled not immediately upon request, but after they happen. But, handle_simple_irq() and handle_fasteoi_irq() can skip this once or more if an irq is just serviced (IRQ_INPROGRESS), possibly disrupting a driver's work. The main reason of problems here, pointing the broken patch and making the first patch which can fix this was done by Marcin Slusarz. Additional test patches of Thomas Gleixner and Ingo Molnar tested by Marcin Slusarz helped to narrow possible reasons even more. Thanks. PS: this patch fixes only one evident error here, but there could be more places affected by above-mentioned change in irq handling. PS 2: After rethinking, IMHO, there are two most probable scenarios here: 1. After hw resend there could be a conflict between retriggered edge type irq and the next level type one: e.g. if this level type irq (io_apic is enabled then) is triggered while retriggered irq is serviced (IRQ_INPROGRESS) there is goto out with eoi, and probably the next such levels are triggered and looping, so probably kind of flood in io_apic until this retriggered edge service has ended. 2. There is something wrong with ioapic_retrigger_irq (less probable because this should be probably seen with 'normal' edge retriggers, but on the other hand, they could be less common). So, if there is #1, this fixed patch should work. But, since level types don't need this retriggers too much I think this "don't mask interrupts by default" idea should be rethinked: is there enough gain to risk such hard to diagnose errors? So, IMHO, there should be at least possibility to turn this off for level types in config (it should be a visible option, so people could find & try this before writing for help or changing a network card). Signed-off-by: Jarek Poplawski Signed-off-by: Ingo Molnar --- kernel/irq/chip.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) Index: linux-2.6-tip/kernel/irq/chip.c =================================================================== --- linux-2.6-tip.orig/kernel/irq/chip.c +++ linux-2.6-tip/kernel/irq/chip.c @@ -345,6 +345,8 @@ handle_simple_irq(unsigned int irq, stru spin_lock(&desc->lock); desc->status &= ~IRQ_INPROGRESS; + if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask) + desc->chip->unmask(irq); out_unlock: spin_unlock(&desc->lock); } @@ -423,18 +425,16 @@ handle_fasteoi_irq(unsigned int irq, str spin_lock(&desc->lock); - if (unlikely(desc->status & IRQ_INPROGRESS)) - goto out; - desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); kstat_incr_irqs_this_cpu(irq, desc); /* - * If its disabled or no action available + * If it's running, disabled or no action available * then mask it and get out of here: */ action = desc->action; - if (unlikely(!action || (desc->status & IRQ_DISABLED))) { + if (unlikely(!action || (desc->status & (IRQ_INPROGRESS | + IRQ_DISABLED)))) { desc->status |= IRQ_PENDING; if (desc->chip->mask) desc->chip->mask(irq); @@ -460,6 +460,8 @@ handle_fasteoi_irq(unsigned int irq, str spin_lock(&desc->lock); desc->status &= ~IRQ_INPROGRESS; + if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask) + desc->chip->unmask(irq); out: desc->chip->eoi(irq); desc = irq_remap_to_desc(irq, desc); patches/preempt-realtime-rawlocks.patch0000664000076400007640000001273211160752235017364 0ustar tglxtglxSubject: preempt: realtime rawlocks From: Ingo Molnar Date: Wed Feb 04 00:02:48 CET 2009 Signed-off-by: Ingo Molnar --- drivers/oprofile/oprofilefs.c | 2 +- drivers/pci/access.c | 2 +- drivers/video/console/vgacon.c | 2 +- include/linux/kprobes.h | 2 +- include/linux/oprofile.h | 2 +- include/linux/percpu_counter.h | 2 +- kernel/kprobes.c | 12 ++++++------ kernel/softlockup.c | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) Index: linux-2.6-tip/drivers/oprofile/oprofilefs.c =================================================================== --- linux-2.6-tip.orig/drivers/oprofile/oprofilefs.c +++ linux-2.6-tip/drivers/oprofile/oprofilefs.c @@ -21,7 +21,7 @@ #define OPROFILEFS_MAGIC 0x6f70726f -DEFINE_SPINLOCK(oprofilefs_lock); +DEFINE_RAW_SPINLOCK(oprofilefs_lock); static struct inode *oprofilefs_get_inode(struct super_block *sb, int mode) { Index: linux-2.6-tip/drivers/pci/access.c =================================================================== --- linux-2.6-tip.orig/drivers/pci/access.c +++ linux-2.6-tip/drivers/pci/access.c @@ -12,7 +12,7 @@ * configuration space. */ -static DEFINE_SPINLOCK(pci_lock); +static DEFINE_RAW_SPINLOCK(pci_lock); /* * Wrappers for all PCI configuration access functions. They just check Index: linux-2.6-tip/drivers/video/console/vgacon.c =================================================================== --- linux-2.6-tip.orig/drivers/video/console/vgacon.c +++ linux-2.6-tip/drivers/video/console/vgacon.c @@ -51,7 +51,7 @@ #include