From 258029907f0c4b72f47d332c0c6c61a31214d486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 8 Feb 2012 21:25:53 +0000 Subject: [PATCH] [amd64] Update rt featureset to 3.2.5-rt12 svn path=/dists/trunk/linux-2.6/; revision=18670 --- debian/changelog | 3 + .../rt/acpi-make-ec-lock-raw-as-well.patch | 38 ++--- .../all/rt/arm-disable-highmem-on-rt.patch | 2 +- .../rt/arm-mark-pmu-interupt-no-thread.patch | 2 +- ...k-shorten-interrupt-disabled-regions.patch | 10 +- .../all/rt/cond-resched-lock-rt-tweak.patch | 2 +- .../all/rt/cond-resched-softirq-rt.patch | 6 +- ...ivers-net-ehea-mark-rx-irq-no-thread.patch | 2 +- .../all/rt/early-printk-consolidate.patch | 4 +- .../features/all/rt/filemap-fix-up.patch | 2 +- .../all/rt/fix-rt-int3-x86_32-3.2-rt.patch | 110 +++++++++++++ .../all/rt/futex-requeue-pi-fix.patch | 116 +++++++++++++ .../all/rt/genirq-disable-irqpoll-on-rt.patch | 4 +- ...q-handle-pending-irqs-in-irq-startup.patch | 107 ++++++++++++ ...neshot-irqs-when-thread-is-not-woken.patch | 64 ++++++++ ...ivate-aid-was-re-announce-3-0-6-rt17.patch | 2 +- .../rt/hrtimer-fix-reprogram-madness.patch | 6 +- .../rt/hrtimers-prepare-full-preemption.patch | 6 +- .../infiniband-mellanox-ib-use-nort-irq.patch | 4 +- ...irq-processing-in-irq-thread-context.patch | 154 ++++++++++++++++++ .../all/rt/kgb-serial-hackaround.patch | 2 +- .../features/all/rt/latency-hist.patch | 6 +- .../patches/features/all/rt/lglocks-rt.patch | 11 +- .../features/all/rt/localversion.patch | 2 +- .../lockdep-no-softirq-accounting-on-rt.patch | 4 +- .../all/rt/locking-various-init-fixes.patch | 2 +- .../md-raid5-percpu-handling-rt-aware.patch | 2 +- ...e_alloc-reduce-lock-sections-further.patch | 2 +- ...page_alloc-rt-friendly-per-cpu-pages.patch | 4 +- .../mm-prepare-pf-disable-discoupling.patch | 2 +- .../mm-shrink-the-page-frame-to-rt-size.patch | 2 +- .../all/rt/mm-slab-move-debug-out.patch | 4 +- .../all/rt/net-flip-lock-dep-thingy.patch | 2 +- .../net-ipv4-route-use-locks-on-up-rt.patch | 2 +- .../rt/net-netif_rx_ni-migrate-disable.patch | 2 +- .../net-tx-action-avoid-livelock-on-rt.patch | 4 +- .../all/rt/net-wireless-warn-nort.patch | 2 +- .../all/rt/of-convert-devtree-lock.patch | 4 +- .../features/all/rt/oleg-signal-rt-fix.patch | 150 +++++++++++++++++ .../pci-access-use-__wake_up_all_locked.patch | 12 +- .../all/rt/peter_zijlstra-frob-hrtimer.patch | 2 +- ...eter_zijlstra-frob-migrate_disable-2.patch | 10 +- .../peter_zijlstra-frob-migrate_disable.patch | 8 +- ...eter_zijlstra-frob-pagefault_disable.patch | 4 +- .../all/rt/peter_zijlstra-re-_3_0-rt4.patch | 2 +- ...timers-thread-posix-cpu-timers-on-rt.patch | 2 +- ...pt-mark-legitimated-no-resched-sites.patch | 2 +- ...able-migration-instead-of-preemption.patch | 4 +- ...l-arm-coredump-fails-for-cpu-3e-3d-4.patch | 2 +- ...mutex-add-sleeping-spinlocks-support.patch | 2 +- .../features/all/rt/rt-rcutree-warn-fix.patch | 12 +- ...o-not-compare-cpu-masks-in-scheduler.patch | 2 +- ...grate_disable-ignore-bounded-threads.patch | 6 +- ...actual-migration-disalbe-to-schedule.patch | 8 +- .../features/all/rt/rt-serial-warn-fix.patch | 10 +- ...o_drain-to-use-the-right-array-cache.patch | 2 +- .../all/rt/rtmutex-futex-prepare-rt.patch | 10 +- .../features/all/rt/sched-cond-resched.patch | 2 +- .../all/rt/sched-delay-put-task.patch | 8 +- ...gle-worker-accounting-from-rq-3elock.patch | 10 +- ...ep-period-timer-alive-when-throttled.patch | 6 +- ...-load-balance-break-on-rq-contention.patch | 4 +- ...might-sleep-do-not-account-rcu-depth.patch | 2 +- .../all/rt/sched-migrate-disable.patch | 10 +- .../all/rt/sched-mmdrop-delayed.patch | 12 +- .../rt/sched-no-work-when-pi-blocked.patch | 2 +- ...hed-prevent-boosting-from-throttling.patch | 2 +- .../all/rt/sched-prevent-idle-boost.patch | 4 +- .../sched-rt-fix-migrate_enable-thinko.patch | 2 +- .../all/rt/sched-rt-mutex-wakeup.patch | 2 +- ...igrate_disable-about-atomic-contexts.patch | 4 +- ...twu-ensure-success-return-is-correct.patch | 2 +- .../sched-use-schedule-preempt-disabled.patch | 2 +- .../features/all/rt/scsi-fcoe-rt-aware.patch | 19 +-- debian/patches/features/all/rt/series | 13 +- ...t-tasks-to-cache-one-sigqueue-struct.patch | 2 +- .../features/all/rt/skbufhead-raw-lock.patch | 10 +- ...oftirq-disable-softirq-stacks-for-rt.patch | 4 +- .../all/rt/softirq-fix-unplug-deadlock.patch | 4 +- .../features/all/rt/softirq-local-lock.patch | 2 +- .../features/all/rt/softirq-make-fifo.patch | 6 +- .../all/rt/softirq-thread-do-softirq.patch | 2 +- .../stomp-machine-mark-stomper-thread.patch | 2 +- .../suspend-prevernt-might-sleep-splats.patch | 12 +- ...-from-going-into-infinite-spin-in-rt.patch | 12 +- .../all/rt/timekeeping-covert-xtimelock.patch | 26 +-- .../all/rt/timer-fd-avoid-live-lock.patch | 29 ++++ .../all/rt/tty-use-local-irq-nort.patch | 4 +- ...fix-mouse-problem-copying-large-data.patch | 2 +- .../wait-provide-__wake_up_all_locked.patch | 19 ++- .../all/rt/x86-io-apic-migra-no-unmask.patch | 2 +- .../rt/x86-kvm-require-const-tsc-for-rt.patch | 2 +- .../all/rt/x86-mce-timer-hrtimer.patch | 8 +- .../rt/x86_64-patch-for-idle-notifiers.patch | 8 +- debian/patches/series/base-extra | 7 + 95 files changed, 985 insertions(+), 237 deletions(-) create mode 100644 debian/patches/features/all/rt/fix-rt-int3-x86_32-3.2-rt.patch create mode 100644 debian/patches/features/all/rt/futex-requeue-pi-fix.patch create mode 100644 debian/patches/features/all/rt/genirq-handle-pending-irqs-in-irq-startup.patch create mode 100644 debian/patches/features/all/rt/genirq-unmask-oneshot-irqs-when-thread-is-not-woken.patch create mode 100644 debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch create mode 100644 debian/patches/features/all/rt/oleg-signal-rt-fix.patch create mode 100644 debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch diff --git a/debian/changelog b/debian/changelog index d0ff367b0..0fb4a38a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,9 @@ linux-2.6 (3.2.4-2) UNRELEASED; urgency=low [ Aurelien Jarno ] * hwmon: backport IT8728F support for linux 3.3. + [ Uwe Kleine-König ] + * [amd64] Update rt featureset to 3.2.5-rt12 + -- Bastian Blank Mon, 06 Feb 2012 11:22:07 +0100 linux-2.6 (3.2.4-1) unstable; urgency=low diff --git a/debian/patches/features/all/rt/acpi-make-ec-lock-raw-as-well.patch b/debian/patches/features/all/rt/acpi-make-ec-lock-raw-as-well.patch index e0229ba67..fb01294a2 100644 --- a/debian/patches/features/all/rt/acpi-make-ec-lock-raw-as-well.patch +++ b/debian/patches/features/all/rt/acpi-make-ec-lock-raw-as-well.patch @@ -11,11 +11,16 @@ Signed-off-by: Clark Williams Link: http://lkml.kernel.org/r/20111203093537.7d805f64@redhat.com Signed-off-by: Thomas Gleixner Cc: stable-rt@vger.kernel.org -diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c -index b19a18d..5812e01 100644 ---- a/drivers/acpi/ec.c -+++ b/drivers/acpi/ec.c -@@ -152,10 +152,10 @@ static int ec_transaction_done(struct acpi_ec *ec) +--- + drivers/acpi/ec.c | 22 +++++++++++----------- + drivers/acpi/internal.h | 2 +- + 2 files changed, 12 insertions(+), 12 deletions(-) + +Index: linux-3.2/drivers/acpi/ec.c +=================================================================== +--- linux-3.2.orig/drivers/acpi/ec.c ++++ linux-3.2/drivers/acpi/ec.c +@@ -152,10 +152,10 @@ static int ec_transaction_done(struct ac { unsigned long flags; int ret = 0; @@ -28,7 +33,7 @@ index b19a18d..5812e01 100644 return ret; } -@@ -169,7 +169,7 @@ static void start_transaction(struct acpi_ec *ec) +@@ -169,7 +169,7 @@ static void start_transaction(struct acp static void advance_transaction(struct acpi_ec *ec, u8 status) { unsigned long flags; @@ -58,7 +63,7 @@ index b19a18d..5812e01 100644 } return -ETIME; } -@@ -247,17 +247,17 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, +@@ -247,17 +247,17 @@ static int acpi_ec_transaction_unlocked( if (EC_FLAGS_MSI) udelay(ACPI_EC_MSI_UDELAY); /* start transaction */ @@ -80,7 +85,7 @@ index b19a18d..5812e01 100644 return ret; } -@@ -678,7 +678,7 @@ static struct acpi_ec *make_acpi_ec(void) +@@ -678,7 +678,7 @@ static struct acpi_ec *make_acpi_ec(void mutex_init(&ec->lock); init_waitqueue_head(&ec->wait); INIT_LIST_HEAD(&ec->list); @@ -89,10 +94,10 @@ index b19a18d..5812e01 100644 return ec; } -diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h -index ca75b9c..68ed95f 100644 ---- a/drivers/acpi/internal.h -+++ b/drivers/acpi/internal.h +Index: linux-3.2/drivers/acpi/internal.h +=================================================================== +--- linux-3.2.orig/drivers/acpi/internal.h ++++ linux-3.2/drivers/acpi/internal.h @@ -62,7 +62,7 @@ struct acpi_ec { wait_queue_head_t wait; struct list_head list; @@ -102,12 +107,3 @@ index ca75b9c..68ed95f 100644 }; extern struct acpi_ec *first_ec; - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.18 (GNU/Linux) - -iEYEARECAAYFAk7aQc0ACgkQHyuj/+TTEp1wdQCdGi7huqfZZYwMBW91bICU9zew -FZcAoM6leP805J/d5rruxEvbU1nNPQ6Z -=+fyw ------END PGP SIGNATURE----- - diff --git a/debian/patches/features/all/rt/arm-disable-highmem-on-rt.patch b/debian/patches/features/all/rt/arm-disable-highmem-on-rt.patch index 0dba73ce4..05a00c67d 100644 --- a/debian/patches/features/all/rt/arm-disable-highmem-on-rt.patch +++ b/debian/patches/features/all/rt/arm-disable-highmem-on-rt.patch @@ -11,7 +11,7 @@ Index: linux-3.2/arch/arm/Kconfig =================================================================== --- linux-3.2.orig/arch/arm/Kconfig +++ linux-3.2/arch/arm/Kconfig -@@ -1655,7 +1655,7 @@ config HAVE_ARCH_PFN_VALID +@@ -1668,7 +1668,7 @@ config HAVE_ARCH_PFN_VALID config HIGHMEM bool "High Memory Support" diff --git a/debian/patches/features/all/rt/arm-mark-pmu-interupt-no-thread.patch b/debian/patches/features/all/rt/arm-mark-pmu-interupt-no-thread.patch index 224eb340d..bb7302043 100644 --- a/debian/patches/features/all/rt/arm-mark-pmu-interupt-no-thread.patch +++ b/debian/patches/features/all/rt/arm-mark-pmu-interupt-no-thread.patch @@ -14,7 +14,7 @@ Index: linux-3.2/arch/arm/kernel/perf_event.c =================================================================== --- linux-3.2.orig/arch/arm/kernel/perf_event.c +++ linux-3.2/arch/arm/kernel/perf_event.c -@@ -432,7 +432,7 @@ armpmu_reserve_hardware(struct arm_pmu * +@@ -441,7 +441,7 @@ armpmu_reserve_hardware(struct arm_pmu * } err = request_irq(irq, handle_irq, diff --git a/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch b/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch index f289bd020..82b187bbb 100644 --- a/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch +++ b/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch @@ -63,7 +63,7 @@ Index: linux-3.2/block/blk-core.c q->request_fn(q); } EXPORT_SYMBOL(__blk_run_queue); -@@ -2742,11 +2746,11 @@ static void queue_unplugged(struct reque +@@ -2745,11 +2749,11 @@ static void queue_unplugged(struct reque * this lock). */ if (from_schedule) { @@ -77,7 +77,7 @@ Index: linux-3.2/block/blk-core.c } } -@@ -2772,7 +2776,6 @@ static void flush_plug_callbacks(struct +@@ -2775,7 +2779,6 @@ static void flush_plug_callbacks(struct void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) { struct request_queue *q; @@ -85,7 +85,7 @@ Index: linux-3.2/block/blk-core.c struct request *rq; LIST_HEAD(list); unsigned int depth; -@@ -2793,11 +2796,6 @@ void blk_flush_plug_list(struct blk_plug +@@ -2796,11 +2799,6 @@ void blk_flush_plug_list(struct blk_plug q = NULL; depth = 0; @@ -97,7 +97,7 @@ Index: linux-3.2/block/blk-core.c while (!list_empty(&list)) { rq = list_entry_rq(list.next); list_del_init(&rq->queuelist); -@@ -2810,7 +2808,7 @@ void blk_flush_plug_list(struct blk_plug +@@ -2813,7 +2811,7 @@ void blk_flush_plug_list(struct blk_plug queue_unplugged(q, depth, from_schedule); q = rq->q; depth = 0; @@ -106,7 +106,7 @@ Index: linux-3.2/block/blk-core.c } /* * rq is already accounted, so use raw insert -@@ -2828,8 +2826,6 @@ void blk_flush_plug_list(struct blk_plug +@@ -2831,8 +2829,6 @@ void blk_flush_plug_list(struct blk_plug */ if (q) queue_unplugged(q, depth, from_schedule); diff --git a/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch b/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch index d2a4116fd..e3b161056 100644 --- a/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch +++ b/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch @@ -11,7 +11,7 @@ Index: linux-3.2/include/linux/sched.h =================================================================== --- linux-3.2.orig/include/linux/sched.h +++ linux-3.2/include/linux/sched.h -@@ -2596,7 +2596,7 @@ extern int _cond_resched(void); +@@ -2595,7 +2595,7 @@ extern int _cond_resched(void); extern int __cond_resched_lock(spinlock_t *lock); diff --git a/debian/patches/features/all/rt/cond-resched-softirq-rt.patch b/debian/patches/features/all/rt/cond-resched-softirq-rt.patch index cec29d477..bd43058a9 100644 --- a/debian/patches/features/all/rt/cond-resched-softirq-rt.patch +++ b/debian/patches/features/all/rt/cond-resched-softirq-rt.patch @@ -12,7 +12,7 @@ Index: linux-3.2/include/linux/sched.h =================================================================== --- linux-3.2.orig/include/linux/sched.h +++ linux-3.2/include/linux/sched.h -@@ -2599,12 +2599,16 @@ extern int __cond_resched_lock(spinlock_ +@@ -2598,12 +2598,16 @@ extern int __cond_resched_lock(spinlock_ __cond_resched_lock(lock); \ }) @@ -33,7 +33,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -5813,6 +5813,7 @@ int __cond_resched_lock(spinlock_t *lock +@@ -5826,6 +5826,7 @@ int __cond_resched_lock(spinlock_t *lock } EXPORT_SYMBOL(__cond_resched_lock); @@ -41,7 +41,7 @@ Index: linux-3.2/kernel/sched.c int __sched __cond_resched_softirq(void) { BUG_ON(!in_softirq()); -@@ -5826,6 +5827,7 @@ int __sched __cond_resched_softirq(void) +@@ -5839,6 +5840,7 @@ int __sched __cond_resched_softirq(void) return 0; } EXPORT_SYMBOL(__cond_resched_softirq); diff --git a/debian/patches/features/all/rt/drivers-net-ehea-mark-rx-irq-no-thread.patch b/debian/patches/features/all/rt/drivers-net-ehea-mark-rx-irq-no-thread.patch index b0f05b8e5..3b17b48ea 100644 --- a/debian/patches/features/all/rt/drivers-net-ehea-mark-rx-irq-no-thread.patch +++ b/debian/patches/features/all/rt/drivers-net-ehea-mark-rx-irq-no-thread.patch @@ -42,7 +42,7 @@ Index: linux-3.2/drivers/net/ethernet/ibm/ehea/ehea_main.c =================================================================== --- linux-3.2.orig/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ linux-3.2/drivers/net/ethernet/ibm/ehea/ehea_main.c -@@ -1303,7 +1303,7 @@ static int ehea_reg_interrupts(struct ne +@@ -1304,7 +1304,7 @@ static int ehea_reg_interrupts(struct ne "%s-queue%d", dev->name, i); ret = ibmebus_request_irq(pr->eq->attr.ist1, ehea_recv_irq_handler, diff --git a/debian/patches/features/all/rt/early-printk-consolidate.patch b/debian/patches/features/all/rt/early-printk-consolidate.patch index 53d3a757a..903ce818c 100644 --- a/debian/patches/features/all/rt/early-printk-consolidate.patch +++ b/debian/patches/features/all/rt/early-printk-consolidate.patch @@ -228,7 +228,7 @@ Index: linux-3.2/arch/sparc/kernel/setup_64.c =================================================================== --- linux-3.2.orig/arch/sparc/kernel/setup_64.c +++ linux-3.2/arch/sparc/kernel/setup_64.c -@@ -477,6 +477,12 @@ static void __init init_sparc64_elf_hwca +@@ -487,6 +487,12 @@ static void __init init_sparc64_elf_hwca popc_patch(); } @@ -241,7 +241,7 @@ Index: linux-3.2/arch/sparc/kernel/setup_64.c void __init setup_arch(char **cmdline_p) { /* Initialize PROM console and command line. */ -@@ -488,7 +494,7 @@ void __init setup_arch(char **cmdline_p) +@@ -498,7 +504,7 @@ void __init setup_arch(char **cmdline_p) #ifdef CONFIG_EARLYFB if (btext_find_display()) #endif diff --git a/debian/patches/features/all/rt/filemap-fix-up.patch b/debian/patches/features/all/rt/filemap-fix-up.patch index 85ae2bd6e..525243471 100644 --- a/debian/patches/features/all/rt/filemap-fix-up.patch +++ b/debian/patches/features/all/rt/filemap-fix-up.patch @@ -13,7 +13,7 @@ Index: linux-3.2/mm/filemap.c =================================================================== --- linux-3.2.orig/mm/filemap.c +++ linux-3.2/mm/filemap.c -@@ -2061,7 +2061,7 @@ size_t iov_iter_copy_from_user_atomic(st +@@ -2058,7 +2058,7 @@ size_t iov_iter_copy_from_user_atomic(st char *kaddr; size_t copied; diff --git a/debian/patches/features/all/rt/fix-rt-int3-x86_32-3.2-rt.patch b/debian/patches/features/all/rt/fix-rt-int3-x86_32-3.2-rt.patch new file mode 100644 index 000000000..beb49aca5 --- /dev/null +++ b/debian/patches/features/all/rt/fix-rt-int3-x86_32-3.2-rt.patch @@ -0,0 +1,110 @@ +Subject: x86: Do not disable preemption in int3 on 32bit +From: Steven Rostedt + +Preemption must be disabled before enabling interrupts in do_trap +on x86_64 because the stack in use for int3 and debug is a per CPU +stack set by th IST. But 32bit does not have an IST and the stack +still belongs to the current task and there is no problem in scheduling +out the task. + +Keep preemption enabled on X86_32 when enabling interrupts for +do_trap(). + +The name of the function is changed from preempt_conditional_sti/cli() +to conditional_sti/cli_ist(), to annotate that this function is used +when the stack is on the IST. + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Steven Rostedt +Signed-off-by: Thomas Gleixner + +Index: linux-rt.git/arch/x86/kernel/traps.c +=================================================================== +--- linux-rt.git.orig/arch/x86/kernel/traps.c ++++ linux-rt.git/arch/x86/kernel/traps.c +@@ -87,9 +87,21 @@ static inline void conditional_sti(struc + local_irq_enable(); + } + +-static inline void preempt_conditional_sti(struct pt_regs *regs) ++static inline void conditional_sti_ist(struct pt_regs *regs) + { ++#ifdef CONFIG_X86_64 ++ /* ++ * X86_64 uses a per CPU stack on the IST for certain traps ++ * like int3. The task can not be preempted when using one ++ * of these stacks, thus preemption must be disabled, otherwise ++ * the stack can be corrupted if the task is scheduled out, ++ * and another task comes in and uses this stack. ++ * ++ * On x86_32 the task keeps its own stack and it is OK if the ++ * task schedules out. ++ */ + inc_preempt_count(); ++#endif + if (regs->flags & X86_EFLAGS_IF) + local_irq_enable(); + } +@@ -100,11 +112,13 @@ static inline void conditional_cli(struc + local_irq_disable(); + } + +-static inline void preempt_conditional_cli(struct pt_regs *regs) ++static inline void conditional_cli_ist(struct pt_regs *regs) + { + if (regs->flags & X86_EFLAGS_IF) + local_irq_disable(); ++#ifdef CONFIG_X86_64 + dec_preempt_count(); ++#endif + } + + static void __kprobes +@@ -222,9 +236,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); ++ conditional_sti_ist(regs); + do_trap(12, SIGBUS, "stack segment", regs, error_code, NULL); +- preempt_conditional_cli(regs); ++ conditional_cli_ist(regs); + } + + dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code) +@@ -316,9 +330,9 @@ dotraplinkage void __kprobes do_int3(str + return; + #endif + +- preempt_conditional_sti(regs); ++ conditional_sti_ist(regs); + do_trap(3, SIGTRAP, "int3", regs, error_code, NULL); +- preempt_conditional_cli(regs); ++ conditional_cli_ist(regs); + } + + #ifdef CONFIG_X86_64 +@@ -412,12 +426,12 @@ dotraplinkage void __kprobes do_debug(st + return; + + /* It's safe to allow irq's after DR6 has been saved */ +- preempt_conditional_sti(regs); ++ conditional_sti_ist(regs); + + if (regs->flags & X86_VM_MASK) { + handle_vm86_trap((struct kernel_vm86_regs *) regs, + error_code, 1); +- preempt_conditional_cli(regs); ++ conditional_cli_ist(regs); + return; + } + +@@ -436,7 +450,7 @@ dotraplinkage void __kprobes do_debug(st + si_code = get_si_code(tsk->thread.debugreg6); + if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp) + send_sigtrap(tsk, regs, error_code, si_code); +- preempt_conditional_cli(regs); ++ conditional_cli_ist(regs); + + return; + } diff --git a/debian/patches/features/all/rt/futex-requeue-pi-fix.patch b/debian/patches/features/all/rt/futex-requeue-pi-fix.patch new file mode 100644 index 000000000..285174989 --- /dev/null +++ b/debian/patches/features/all/rt/futex-requeue-pi-fix.patch @@ -0,0 +1,116 @@ +Subject: futex: Fix bug on when a requeued RT task times out +From: Steven Rostedt + +Requeue with timeout causes a bug with PREEMPT_RT_FULL. + +The bug comes from a timed out condition. + + + TASK 1 TASK 2 + ------ ------ + futex_wait_requeue_pi() + futex_wait_queue_me() + + + double_lock_hb(); + + raw_spin_lock(pi_lock); + if (current->pi_blocked_on) { + } else { + current->pi_blocked_on = PI_WAKE_INPROGRESS; + run_spin_unlock(pi_lock); + spin_lock(hb->lock); <-- blocked! + + + plist_for_each_entry_safe(this) { + rt_mutex_start_proxy_lock(); + task_blocks_on_rt_mutex(); + BUG_ON(task->pi_blocked_on)!!!! + +The BUG_ON() actually has a check for PI_WAKE_INPROGRESS, but the +problem is that, after TASK 1 sets PI_WAKE_INPROGRESS, it then tries to +grab the hb->lock, which it fails to do so. As the hb->lock is a mutex, +it will block and set the "pi_blocked_on" to the hb->lock. + +When TASK 2 goes to requeue it, the check for PI_WAKE_INPROGESS fails +because the task1's pi_blocked_on is no longer set to that, but instead, +set to the hb->lock. + +The fix: + +When calling rt_mutex_start_proxy_lock() a check is made to see +if the proxy tasks pi_blocked_on is set. If so, exit out early. +Otherwise set it to a new flag PI_REQUEUE_INPROGRESS, which notifies +the proxy task that it is being requeued, and will handle things +appropriately. + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Steven Rostedt +Signed-off-by: Thomas Gleixner + + +diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c +index 991bc7f..9850dc0 100644 +--- a/kernel/rtmutex.c ++++ b/kernel/rtmutex.c +@@ -75,7 +75,8 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock) + + static int rt_mutex_real_waiter(struct rt_mutex_waiter *waiter) + { +- return waiter && waiter != PI_WAKEUP_INPROGRESS; ++ return waiter && waiter != PI_WAKEUP_INPROGRESS && ++ waiter != PI_REQUEUE_INPROGRESS; + } + + /* +@@ -1353,6 +1354,35 @@ int rt_mutex_start_proxy_lock(struct rt_mutex *lock, + return 1; + } + ++#ifdef CONFIG_PREEMPT_RT_FULL ++ /* ++ * In PREEMPT_RT there's an added race. ++ * If the task, that we are about to requeue, times out, ++ * it can set the PI_WAKEUP_INPROGRESS. This tells the requeue ++ * to skip this task. But right after the task sets ++ * its pi_blocked_on to PI_WAKEUP_INPROGRESS it can then ++ * block on the spin_lock(&hb->lock), which in RT is an rtmutex. ++ * This will replace the PI_WAKEUP_INPROGRESS with the actual ++ * lock that it blocks on. We *must not* place this task ++ * on this proxy lock in that case. ++ * ++ * To prevent this race, we first take the task's pi_lock ++ * and check if it has updated its pi_blocked_on. If it has, ++ * we assume that it woke up and we return -EAGAIN. ++ * Otherwise, we set the task's pi_blocked_on to ++ * PI_REQUEUE_INPROGRESS, so that if the task is waking up ++ * it will know that we are in the process of requeuing it. ++ */ ++ raw_spin_lock(&task->pi_lock); ++ if (task->pi_blocked_on) { ++ raw_spin_unlock(&task->pi_lock); ++ raw_spin_unlock(&lock->wait_lock); ++ return -EAGAIN; ++ } ++ task->pi_blocked_on = PI_REQUEUE_INPROGRESS; ++ raw_spin_unlock(&task->pi_lock); ++#endif ++ + ret = task_blocks_on_rt_mutex(lock, waiter, task, detect_deadlock); + + if (ret && !rt_mutex_owner(lock)) { +diff --git a/kernel/rtmutex_common.h b/kernel/rtmutex_common.h +index a688a29..6ec3dc1 100644 +--- a/kernel/rtmutex_common.h ++++ b/kernel/rtmutex_common.h +@@ -105,6 +105,7 @@ static inline struct task_struct *rt_mutex_owner(struct rt_mutex *lock) + * PI-futex support (proxy locking functions, etc.): + */ + #define PI_WAKEUP_INPROGRESS ((struct rt_mutex_waiter *) 1) ++#define PI_REQUEUE_INPROGRESS ((struct rt_mutex_waiter *) 2) + + extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock); + extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, + + + diff --git a/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch b/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch index c531cce75..ec454ae3b 100644 --- a/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch +++ b/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch @@ -15,7 +15,7 @@ Index: linux-3.2/kernel/irq/spurious.c =================================================================== --- linux-3.2.orig/kernel/irq/spurious.c +++ linux-3.2/kernel/irq/spurious.c -@@ -339,6 +339,11 @@ MODULE_PARM_DESC(noirqdebug, "Disable ir +@@ -341,6 +341,11 @@ MODULE_PARM_DESC(noirqdebug, "Disable ir static int __init irqfixup_setup(char *str) { @@ -27,7 +27,7 @@ Index: linux-3.2/kernel/irq/spurious.c irqfixup = 1; printk(KERN_WARNING "Misrouted IRQ fixup support enabled.\n"); printk(KERN_WARNING "This may impact system performance.\n"); -@@ -351,6 +356,11 @@ module_param(irqfixup, int, 0644); +@@ -353,6 +358,11 @@ module_param(irqfixup, int, 0644); static int __init irqpoll_setup(char *str) { diff --git a/debian/patches/features/all/rt/genirq-handle-pending-irqs-in-irq-startup.patch b/debian/patches/features/all/rt/genirq-handle-pending-irqs-in-irq-startup.patch new file mode 100644 index 000000000..b28118723 --- /dev/null +++ b/debian/patches/features/all/rt/genirq-handle-pending-irqs-in-irq-startup.patch @@ -0,0 +1,107 @@ +Subject: genirq: Handle pending irqs in irq_startup() +From: Thomas Gleixner +Date: Wed, 08 Feb 2012 11:57:52 +0100 + +Irqs might be pending when irq_startup() is called. Call the resend +function in irq_startup() otherwise the irq line might be blocked +forever. + +Reported-and-tested-by: Russell King +Signed-off-by: Thomas Gleixner +--- + kernel/irq/autoprobe.c | 4 ++-- + kernel/irq/chip.c | 17 ++++++++++------- + kernel/irq/internals.h | 2 +- + kernel/irq/manage.c | 2 +- + 4 files changed, 14 insertions(+), 11 deletions(-) + +Index: linux-3.2/kernel/irq/autoprobe.c +=================================================================== +--- linux-3.2.orig/kernel/irq/autoprobe.c ++++ linux-3.2/kernel/irq/autoprobe.c +@@ -53,7 +53,7 @@ unsigned long probe_irq_on(void) + if (desc->irq_data.chip->irq_set_type) + desc->irq_data.chip->irq_set_type(&desc->irq_data, + IRQ_TYPE_PROBE); +- irq_startup(desc); ++ irq_startup(desc, false); + } + raw_spin_unlock_irq(&desc->lock); + } +@@ -70,7 +70,7 @@ unsigned long probe_irq_on(void) + raw_spin_lock_irq(&desc->lock); + if (!desc->action && irq_settings_can_probe(desc)) { + desc->istate |= IRQS_AUTODETECT | IRQS_WAITING; +- if (irq_startup(desc)) ++ if (irq_startup(desc, false)) + desc->istate |= IRQS_PENDING; + } + raw_spin_unlock_irq(&desc->lock); +Index: linux-3.2/kernel/irq/chip.c +=================================================================== +--- linux-3.2.orig/kernel/irq/chip.c ++++ linux-3.2/kernel/irq/chip.c +@@ -157,19 +157,22 @@ static void irq_state_set_masked(struct + irqd_set(&desc->irq_data, IRQD_IRQ_MASKED); + } + +-int irq_startup(struct irq_desc *desc) ++int irq_startup(struct irq_desc *desc, bool resend) + { ++ int ret = 0; ++ + irq_state_clr_disabled(desc); + desc->depth = 0; + + if (desc->irq_data.chip->irq_startup) { +- int ret = desc->irq_data.chip->irq_startup(&desc->irq_data); ++ ret = desc->irq_data.chip->irq_startup(&desc->irq_data); + irq_state_clr_masked(desc); +- return ret; ++ } else { ++ irq_enable(desc); + } +- +- irq_enable(desc); +- return 0; ++ if (resend) ++ check_irq_resend(desc, desc->irq_data.irq); ++ return ret; + } + + void irq_shutdown(struct irq_desc *desc) +@@ -646,7 +649,7 @@ __irq_set_handler(unsigned int irq, irq_ + irq_settings_set_noprobe(desc); + irq_settings_set_norequest(desc); + irq_settings_set_nothread(desc); +- irq_startup(desc); ++ irq_startup(desc, true); + } + out: + irq_put_desc_busunlock(desc, flags); +Index: linux-3.2/kernel/irq/internals.h +=================================================================== +--- linux-3.2.orig/kernel/irq/internals.h ++++ linux-3.2/kernel/irq/internals.h +@@ -67,7 +67,7 @@ extern int __irq_set_trigger(struct irq_ + extern void __disable_irq(struct irq_desc *desc, unsigned int irq, bool susp); + extern void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume); + +-extern int irq_startup(struct irq_desc *desc); ++extern int irq_startup(struct irq_desc *desc, bool resend); + extern void irq_shutdown(struct irq_desc *desc); + extern void irq_enable(struct irq_desc *desc); + extern void irq_disable(struct irq_desc *desc); +Index: linux-3.2/kernel/irq/manage.c +=================================================================== +--- linux-3.2.orig/kernel/irq/manage.c ++++ linux-3.2/kernel/irq/manage.c +@@ -1029,7 +1029,7 @@ __setup_irq(unsigned int irq, struct irq + desc->istate |= IRQS_ONESHOT; + + if (irq_settings_can_autoenable(desc)) +- irq_startup(desc); ++ irq_startup(desc, true); + else + /* Undo nested disables: */ + desc->depth = 1; diff --git a/debian/patches/features/all/rt/genirq-unmask-oneshot-irqs-when-thread-is-not-woken.patch b/debian/patches/features/all/rt/genirq-unmask-oneshot-irqs-when-thread-is-not-woken.patch new file mode 100644 index 000000000..379e39ecb --- /dev/null +++ b/debian/patches/features/all/rt/genirq-unmask-oneshot-irqs-when-thread-is-not-woken.patch @@ -0,0 +1,64 @@ +Subject: genirq: Unmask oneshot irqs when thread was not woken +From: Thomas Gleixner +Date: Tue, 07 Feb 2012 17:58:03 +0100 + +When the primary handler of an interrupt which is marked IRQ_ONESHOT +does not wake the thread (e.g. due to a spurious interrupt) then +nothing ever unmasks the interrupt line again. Handle it gracefully. + +Reported-by: Lothar Wassmann +Signed-off-by: Thomas Gleixner +--- + kernel/irq/chip.c | 25 +++++++++++++++++++++++-- + 1 file changed, 23 insertions(+), 2 deletions(-) + +Index: linux-3.2/kernel/irq/chip.c +=================================================================== +--- linux-3.2.orig/kernel/irq/chip.c ++++ linux-3.2/kernel/irq/chip.c +@@ -330,6 +330,24 @@ out_unlock: + } + EXPORT_SYMBOL_GPL(handle_simple_irq); + ++/* ++ * Called unconditionally from handle_level_irq() and only for oneshot ++ * interrupts from handle_fasteoi_irq() ++ */ ++static void cond_unmask_irq(struct irq_desc *desc) ++{ ++ /* ++ * We need to unmask in the following cases: ++ * - Standard level irq (IRQF_ONESHOT is not set) ++ * - Oneshot irq which did not wake the thread (caused by a ++ * spurious interrupt or a primary handler handling it ++ * completely). ++ */ ++ if (!irqd_irq_disabled(&desc->irq_data) && ++ irqd_irq_masked(&desc->irq_data) && !desc->threads_oneshot) ++ unmask_irq(desc); ++} ++ + /** + * handle_level_irq - Level type irq handler + * @irq: the interrupt number +@@ -362,8 +380,8 @@ handle_level_irq(unsigned int irq, struc + + handle_irq_event(desc); + +- if (!irqd_irq_disabled(&desc->irq_data) && !(desc->istate & IRQS_ONESHOT)) +- unmask_irq(desc); ++ cond_unmask_irq(desc); ++ + out_unlock: + raw_spin_unlock(&desc->lock); + } +@@ -417,6 +435,9 @@ handle_fasteoi_irq(unsigned int irq, str + preflow_handler(desc); + handle_irq_event(desc); + ++ if (desc->istate & IRQS_ONESHOT) ++ cond_unmask_irq(desc); ++ + out_eoi: + desc->irq_data.chip->irq_eoi(&desc->irq_data); + out_unlock: diff --git a/debian/patches/features/all/rt/hrtimer-add-missing-debug_activate-aid-was-re-announce-3-0-6-rt17.patch b/debian/patches/features/all/rt/hrtimer-add-missing-debug_activate-aid-was-re-announce-3-0-6-rt17.patch index 36c1a44e1..20d081e21 100644 --- a/debian/patches/features/all/rt/hrtimer-add-missing-debug_activate-aid-was-re-announce-3-0-6-rt17.patch +++ b/debian/patches/features/all/rt/hrtimer-add-missing-debug_activate-aid-was-re-announce-3-0-6-rt17.patch @@ -60,7 +60,7 @@ Index: linux-3.2/kernel/hrtimer.c =================================================================== --- linux-3.2.orig/kernel/hrtimer.c +++ linux-3.2/kernel/hrtimer.c -@@ -1040,6 +1040,7 @@ int __hrtimer_start_range_ns(struct hrti +@@ -1042,6 +1042,7 @@ int __hrtimer_start_range_ns(struct hrti * remove it again and report a failure. This avoids * stale base->first entries. */ diff --git a/debian/patches/features/all/rt/hrtimer-fix-reprogram-madness.patch b/debian/patches/features/all/rt/hrtimer-fix-reprogram-madness.patch index 1c760072c..1fe2d31de 100644 --- a/debian/patches/features/all/rt/hrtimer-fix-reprogram-madness.patch +++ b/debian/patches/features/all/rt/hrtimer-fix-reprogram-madness.patch @@ -11,7 +11,7 @@ Index: linux-3.2/kernel/hrtimer.c =================================================================== --- linux-3.2.orig/kernel/hrtimer.c +++ linux-3.2/kernel/hrtimer.c -@@ -1315,7 +1315,11 @@ static void hrtimer_rt_reprogram(int res +@@ -1317,7 +1317,11 @@ static void hrtimer_rt_reprogram(int res if (!enqueue_hrtimer(timer, base)) return; @@ -24,7 +24,7 @@ Index: linux-3.2/kernel/hrtimer.c goto requeue; } else if (hrtimer_active(timer)) { -@@ -1324,6 +1328,7 @@ static void hrtimer_rt_reprogram(int res +@@ -1326,6 +1330,7 @@ static void hrtimer_rt_reprogram(int res * the event device. */ if (&timer->node == base->active.next && @@ -32,7 +32,7 @@ Index: linux-3.2/kernel/hrtimer.c hrtimer_reprogram(timer, base)) goto requeue; } -@@ -1336,6 +1341,7 @@ requeue: +@@ -1338,6 +1343,7 @@ requeue: */ __remove_hrtimer(timer, base, timer->state, 0); list_add_tail(&timer->cb_entry, &base->expired); diff --git a/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch b/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch index e9862f1c8..64c74a5af 100644 --- a/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch +++ b/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch @@ -80,7 +80,7 @@ Index: linux-3.2/kernel/hrtimer.c /* * enqueue_hrtimer - internal function to (re)start a timer * -@@ -1071,7 +1097,7 @@ int hrtimer_cancel(struct hrtimer *timer +@@ -1073,7 +1099,7 @@ int hrtimer_cancel(struct hrtimer *timer if (ret >= 0) return ret; @@ -89,7 +89,7 @@ Index: linux-3.2/kernel/hrtimer.c } } EXPORT_SYMBOL_GPL(hrtimer_cancel); -@@ -1474,6 +1500,8 @@ void hrtimer_run_queues(void) +@@ -1476,6 +1502,8 @@ void hrtimer_run_queues(void) } raw_spin_unlock(&cpu_base->lock); } @@ -98,7 +98,7 @@ Index: linux-3.2/kernel/hrtimer.c } /* -@@ -1636,6 +1664,9 @@ static void __cpuinit init_hrtimers_cpu( +@@ -1638,6 +1666,9 @@ static void __cpuinit init_hrtimers_cpu( } hrtimer_init_hres(cpu_base); diff --git a/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch b/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch index f5a27a5fc..88e2cb1e2 100644 --- a/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch +++ b/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch @@ -22,7 +22,7 @@ Index: linux-3.2/drivers/infiniband/ulp/ipoib/ipoib_multicast.c =================================================================== --- linux-3.2.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ linux-3.2/drivers/infiniband/ulp/ipoib/ipoib_multicast.c -@@ -801,7 +801,7 @@ void ipoib_mcast_restart_task(struct wor +@@ -806,7 +806,7 @@ void ipoib_mcast_restart_task(struct wor ipoib_mcast_stop_thread(dev, 0); @@ -31,7 +31,7 @@ Index: linux-3.2/drivers/infiniband/ulp/ipoib/ipoib_multicast.c netif_addr_lock(dev); spin_lock(&priv->lock); -@@ -883,7 +883,7 @@ void ipoib_mcast_restart_task(struct wor +@@ -888,7 +888,7 @@ void ipoib_mcast_restart_task(struct wor spin_unlock(&priv->lock); netif_addr_unlock(dev); diff --git a/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch b/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch new file mode 100644 index 000000000..ceccfe4df --- /dev/null +++ b/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch @@ -0,0 +1,154 @@ +Subject: genirq: Allow disabling of softirq processing in irq thread context +From: Thomas Gleixner +Date: Tue, 31 Jan 2012 13:01:27 +0100 + +The processing of softirqs in irq thread context is a performance gain +for the non-rt workloads of a system, but it's counterproductive for +interrupts which are explicitely related to the realtime +workload. Allow such interrupts to prevent softirq processing in their +thread context. + +Signed-off-by: Thomas Gleixner +Cc: stable-rt@vger.kernel.org +--- + include/linux/interrupt.h | 2 ++ + include/linux/irq.h | 5 ++++- + kernel/irq/manage.c | 13 ++++++++++++- + kernel/irq/settings.h | 12 ++++++++++++ + kernel/softirq.c | 7 +++++++ + 5 files changed, 37 insertions(+), 2 deletions(-) + +Index: linux-3.2/include/linux/interrupt.h +=================================================================== +--- linux-3.2.orig/include/linux/interrupt.h ++++ linux-3.2/include/linux/interrupt.h +@@ -61,6 +61,7 @@ + * IRQF_NO_THREAD - Interrupt cannot be threaded + * IRQF_EARLY_RESUME - Resume IRQ early during syscore instead of at device + * resume time. ++ * IRQF_NO_SOFTIRQ_CALL - Do not process softirqs in the irq thread context (RT) + */ + #define IRQF_DISABLED 0x00000020 + #define IRQF_SAMPLE_RANDOM 0x00000040 +@@ -75,6 +76,7 @@ + #define IRQF_FORCE_RESUME 0x00008000 + #define IRQF_NO_THREAD 0x00010000 + #define IRQF_EARLY_RESUME 0x00020000 ++#define IRQF_NO_SOFTIRQ_CALL 0x00040000 + + #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD) + +Index: linux-3.2/include/linux/irq.h +=================================================================== +--- linux-3.2.orig/include/linux/irq.h ++++ linux-3.2/include/linux/irq.h +@@ -67,6 +67,7 @@ typedef void (*irq_preflow_handler_t)(st + * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context + * IRQ_NESTED_TRHEAD - Interrupt nests into another thread + * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable ++ * IRQ_NO_SOFTIRQ_CALL - No softirq processing in the irq thread context (RT) + */ + enum { + IRQ_TYPE_NONE = 0x00000000, +@@ -90,12 +91,14 @@ enum { + IRQ_NESTED_THREAD = (1 << 15), + IRQ_NOTHREAD = (1 << 16), + IRQ_PER_CPU_DEVID = (1 << 17), ++ IRQ_NO_SOFTIRQ_CALL = (1 << 18), + }; + + #define IRQF_MODIFY_MASK \ + (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ + IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ +- IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID) ++ IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID | \ ++ IRQ_NO_SOFTIRQ_CALL) + + #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) + +Index: linux-3.2/kernel/irq/manage.c +=================================================================== +--- linux-3.2.orig/kernel/irq/manage.c ++++ linux-3.2/kernel/irq/manage.c +@@ -742,7 +742,15 @@ irq_forced_thread_fn(struct irq_desc *de + local_bh_disable(); + ret = action->thread_fn(action->irq, action->dev_id); + irq_finalize_oneshot(desc, action, false); +- local_bh_enable(); ++ /* ++ * Interrupts which have real time requirements can be set up ++ * to avoid softirq processing in the thread handler. This is ++ * safe as these interrupts do not raise soft interrupts. ++ */ ++ if (irq_settings_no_softirq_call(desc)) ++ _local_bh_enable(); ++ else ++ local_bh_enable(); + return ret; + } + +@@ -1040,6 +1048,9 @@ __setup_irq(unsigned int irq, struct irq + irqd_set(&desc->irq_data, IRQD_NO_BALANCING); + } + ++ if (new->flags & IRQF_NO_SOFTIRQ_CALL) ++ irq_settings_set_no_softirq_call(desc); ++ + /* Set default affinity mask once everything is setup */ + setup_affinity(irq, desc, mask); + +Index: linux-3.2/kernel/irq/settings.h +=================================================================== +--- linux-3.2.orig/kernel/irq/settings.h ++++ linux-3.2/kernel/irq/settings.h +@@ -14,6 +14,7 @@ enum { + _IRQ_NO_BALANCING = IRQ_NO_BALANCING, + _IRQ_NESTED_THREAD = IRQ_NESTED_THREAD, + _IRQ_PER_CPU_DEVID = IRQ_PER_CPU_DEVID, ++ _IRQ_NO_SOFTIRQ_CALL = IRQ_NO_SOFTIRQ_CALL, + _IRQF_MODIFY_MASK = IRQF_MODIFY_MASK, + }; + +@@ -26,6 +27,7 @@ enum { + #define IRQ_NOAUTOEN GOT_YOU_MORON + #define IRQ_NESTED_THREAD GOT_YOU_MORON + #define IRQ_PER_CPU_DEVID GOT_YOU_MORON ++#define IRQ_NO_SOFTIRQ_CALL GOT_YOU_MORON + #undef IRQF_MODIFY_MASK + #define IRQF_MODIFY_MASK GOT_YOU_MORON + +@@ -36,6 +38,16 @@ irq_settings_clr_and_set(struct irq_desc + desc->status_use_accessors |= (set & _IRQF_MODIFY_MASK); + } + ++static inline bool irq_settings_no_softirq_call(struct irq_desc *desc) ++{ ++ return desc->status_use_accessors & _IRQ_NO_SOFTIRQ_CALL; ++} ++ ++static inline void irq_settings_set_no_softirq_call(struct irq_desc *desc) ++{ ++ desc->status_use_accessors |= _IRQ_NO_SOFTIRQ_CALL; ++} ++ + static inline bool irq_settings_is_per_cpu(struct irq_desc *desc) + { + return desc->status_use_accessors & _IRQ_PER_CPU; +Index: linux-3.2/kernel/softirq.c +=================================================================== +--- linux-3.2.orig/kernel/softirq.c ++++ linux-3.2/kernel/softirq.c +@@ -431,6 +431,13 @@ void local_bh_enable_ip(unsigned long ip + } + EXPORT_SYMBOL(local_bh_enable_ip); + ++void _local_bh_enable(void) ++{ ++ current->softirq_nestcnt--; ++ migrate_enable(); ++} ++EXPORT_SYMBOL(_local_bh_enable); ++ + /* For tracing */ + int notrace __in_softirq(void) + { diff --git a/debian/patches/features/all/rt/kgb-serial-hackaround.patch b/debian/patches/features/all/rt/kgb-serial-hackaround.patch index 70320f975..f62e2c941 100644 --- a/debian/patches/features/all/rt/kgb-serial-hackaround.patch +++ b/debian/patches/features/all/rt/kgb-serial-hackaround.patch @@ -35,7 +35,7 @@ Index: linux-3.2/drivers/tty/serial/8250.c #include #include -@@ -2848,10 +2849,14 @@ serial8250_console_write(struct console +@@ -2855,10 +2856,14 @@ serial8250_console_write(struct console touch_nmi_watchdog(); diff --git a/debian/patches/features/all/rt/latency-hist.patch b/debian/patches/features/all/rt/latency-hist.patch index a217940c6..8612be5d1 100644 --- a/debian/patches/features/all/rt/latency-hist.patch +++ b/debian/patches/features/all/rt/latency-hist.patch @@ -219,7 +219,7 @@ Index: linux-3.2/include/linux/sched.h =================================================================== --- linux-3.2.orig/include/linux/sched.h +++ linux-3.2/include/linux/sched.h -@@ -1567,6 +1567,12 @@ struct task_struct { +@@ -1566,6 +1566,12 @@ struct task_struct { unsigned long trace; /* bitmask and counter of trace recursion */ unsigned long trace_recursion; @@ -353,7 +353,7 @@ Index: linux-3.2/kernel/hrtimer.c /* * The timer bases: -@@ -1234,6 +1235,8 @@ static void __run_hrtimer(struct hrtimer +@@ -1236,6 +1237,8 @@ static void __run_hrtimer(struct hrtimer #ifdef CONFIG_HIGH_RES_TIMERS @@ -362,7 +362,7 @@ Index: linux-3.2/kernel/hrtimer.c /* * High resolution timer interrupt * Called with interrupts disabled -@@ -1278,6 +1281,14 @@ retry: +@@ -1280,6 +1283,14 @@ retry: timer = container_of(node, struct hrtimer, node); diff --git a/debian/patches/features/all/rt/lglocks-rt.patch b/debian/patches/features/all/rt/lglocks-rt.patch index 828064daf..41e885985 100644 --- a/debian/patches/features/all/rt/lglocks-rt.patch +++ b/debian/patches/features/all/rt/lglocks-rt.patch @@ -4,24 +4,23 @@ Date: Wed, 15 Jun 2011 11:02:21 +0200 Signed-off-by: Thomas Gleixner --- - include/linux/lglock.h | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 100 insertions(+) + include/linux/lglock.h | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 99 insertions(+) Index: linux-3.2/include/linux/lglock.h =================================================================== --- linux-3.2.orig/include/linux/lglock.h +++ linux-3.2/include/linux/lglock.h -@@ -70,6 +70,9 @@ +@@ -71,6 +71,8 @@ extern void name##_global_lock_online(void); \ extern void name##_global_unlock_online(void); \ -+ +#ifndef CONFIG_PREEMPT_RT_FULL + #define DEFINE_LGLOCK(name) \ \ - DEFINE_PER_CPU(arch_spinlock_t, name##_lock); \ -@@ -169,4 +172,101 @@ + DEFINE_SPINLOCK(name##_cpu_lock); \ +@@ -197,4 +199,101 @@ preempt_enable(); \ } \ EXPORT_SYMBOL(name##_global_unlock); diff --git a/debian/patches/features/all/rt/localversion.patch b/debian/patches/features/all/rt/localversion.patch index b09519687..c6b56985b 100644 --- a/debian/patches/features/all/rt/localversion.patch +++ b/debian/patches/features/all/rt/localversion.patch @@ -14,4 +14,4 @@ Index: linux-3.2/localversion-rt --- /dev/null +++ linux-3.2/localversion-rt @@ -0,0 +1 @@ -+-rt8 ++-rt12 diff --git a/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch b/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch index e09c9399d..9430a0d20 100644 --- a/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch +++ b/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch @@ -42,7 +42,7 @@ Index: linux-3.2/kernel/lockdep.c =================================================================== --- linux-3.2.orig/kernel/lockdep.c +++ linux-3.2/kernel/lockdep.c -@@ -3488,6 +3488,7 @@ static void check_flags(unsigned long fl +@@ -3494,6 +3494,7 @@ static void check_flags(unsigned long fl } } @@ -50,7 +50,7 @@ Index: linux-3.2/kernel/lockdep.c /* * We dont accurately track softirq state in e.g. * hardirq contexts (such as on 4KSTACKS), so only -@@ -3502,6 +3503,7 @@ static void check_flags(unsigned long fl +@@ -3508,6 +3509,7 @@ static void check_flags(unsigned long fl DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled); } } diff --git a/debian/patches/features/all/rt/locking-various-init-fixes.patch b/debian/patches/features/all/rt/locking-various-init-fixes.patch index b5893763f..7128da0f9 100644 --- a/debian/patches/features/all/rt/locking-various-init-fixes.patch +++ b/debian/patches/features/all/rt/locking-various-init-fixes.patch @@ -46,7 +46,7 @@ Index: linux-3.2/drivers/usb/gadget/ci13xxx_udc.c =================================================================== --- linux-3.2.orig/drivers/usb/gadget/ci13xxx_udc.c +++ linux-3.2/drivers/usb/gadget/ci13xxx_udc.c -@@ -816,7 +816,7 @@ static struct { +@@ -819,7 +819,7 @@ static struct { } dbg_data = { .idx = 0, .tty = 0, diff --git a/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch b/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch index 795a5e0e3..d4f2998e0 100644 --- a/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch +++ b/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch @@ -43,7 +43,7 @@ Index: linux-3.2/drivers/md/raid5.c } #ifdef CONFIG_MULTICORE_RAID456 -@@ -4531,6 +4533,7 @@ static int raid5_alloc_percpu(struct r5c +@@ -4539,6 +4541,7 @@ static int raid5_alloc_percpu(struct r5c break; } per_cpu_ptr(conf->percpu, cpu)->scribble = scribble; diff --git a/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch b/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch index 45f51d025..ac62cbeaa 100644 --- a/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch +++ b/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch @@ -174,7 +174,7 @@ Index: linux-3.2/mm/page_alloc.c } out: -@@ -3696,12 +3733,14 @@ static int __zone_pcp_update(void *data) +@@ -3702,12 +3739,14 @@ static int __zone_pcp_update(void *data) for_each_possible_cpu(cpu) { struct per_cpu_pageset *pset; struct per_cpu_pages *pcp; diff --git a/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch b/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch index d7f38658a..ffe799b1a 100644 --- a/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch +++ b/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch @@ -173,7 +173,7 @@ Index: linux-3.2/mm/page_alloc.c return NULL; } -@@ -3678,10 +3700,10 @@ static int __zone_pcp_update(void *data) +@@ -3684,10 +3706,10 @@ static int __zone_pcp_update(void *data) pset = per_cpu_ptr(zone->pageset, cpu); pcp = &pset->pcp; @@ -186,7 +186,7 @@ Index: linux-3.2/mm/page_alloc.c } return 0; } -@@ -5047,6 +5069,7 @@ static int page_alloc_cpu_notify(struct +@@ -5053,6 +5075,7 @@ static int page_alloc_cpu_notify(struct void __init page_alloc_init(void) { hotcpu_notifier(page_alloc_cpu_notify, 0); diff --git a/debian/patches/features/all/rt/mm-prepare-pf-disable-discoupling.patch b/debian/patches/features/all/rt/mm-prepare-pf-disable-discoupling.patch index dd3866d59..c7f6366ab 100644 --- a/debian/patches/features/all/rt/mm-prepare-pf-disable-discoupling.patch +++ b/debian/patches/features/all/rt/mm-prepare-pf-disable-discoupling.patch @@ -76,7 +76,7 @@ Index: linux-3.2/kernel/fork.c =================================================================== --- linux-3.2.orig/kernel/fork.c +++ linux-3.2/kernel/fork.c -@@ -1198,6 +1198,7 @@ static struct task_struct *copy_process( +@@ -1193,6 +1193,7 @@ static struct task_struct *copy_process( p->hardirq_context = 0; p->softirq_context = 0; #endif diff --git a/debian/patches/features/all/rt/mm-shrink-the-page-frame-to-rt-size.patch b/debian/patches/features/all/rt/mm-shrink-the-page-frame-to-rt-size.patch index c8458ef88..25530d898 100644 --- a/debian/patches/features/all/rt/mm-shrink-the-page-frame-to-rt-size.patch +++ b/debian/patches/features/all/rt/mm-shrink-the-page-frame-to-rt-size.patch @@ -21,7 +21,7 @@ Index: linux-3.2/include/linux/mm.h =================================================================== --- linux-3.2.orig/include/linux/mm.h +++ linux-3.2/include/linux/mm.h -@@ -1194,27 +1194,59 @@ static inline pmd_t *pmd_alloc(struct mm +@@ -1195,27 +1195,59 @@ static inline pmd_t *pmd_alloc(struct mm * overflow into the next struct page (as it might with DEBUG_SPINLOCK). * When freeing, reset page->mapping so free_pages_check won't complain. */ diff --git a/debian/patches/features/all/rt/mm-slab-move-debug-out.patch b/debian/patches/features/all/rt/mm-slab-move-debug-out.patch index d56d615e7..460e6847b 100644 --- a/debian/patches/features/all/rt/mm-slab-move-debug-out.patch +++ b/debian/patches/features/all/rt/mm-slab-move-debug-out.patch @@ -11,7 +11,7 @@ Index: linux-3.2/mm/slab.c =================================================================== --- linux-3.2.orig/mm/slab.c +++ linux-3.2/mm/slab.c -@@ -3844,10 +3844,10 @@ void kmem_cache_free(struct kmem_cache * +@@ -3851,10 +3851,10 @@ void kmem_cache_free(struct kmem_cache * { unsigned long flags; @@ -23,7 +23,7 @@ Index: linux-3.2/mm/slab.c __cache_free(cachep, objp, __builtin_return_address(0)); local_irq_restore(flags); -@@ -3873,11 +3873,11 @@ void kfree(const void *objp) +@@ -3880,11 +3880,11 @@ void kfree(const void *objp) if (unlikely(ZERO_OR_NULL_PTR(objp))) return; diff --git a/debian/patches/features/all/rt/net-flip-lock-dep-thingy.patch b/debian/patches/features/all/rt/net-flip-lock-dep-thingy.patch index 6970a19f2..2e0d4efb4 100644 --- a/debian/patches/features/all/rt/net-flip-lock-dep-thingy.patch +++ b/debian/patches/features/all/rt/net-flip-lock-dep-thingy.patch @@ -97,7 +97,7 @@ Index: linux-3.2/net/core/sock.c =================================================================== --- linux-3.2.orig/net/core/sock.c +++ linux-3.2/net/core/sock.c -@@ -2035,12 +2035,11 @@ void lock_sock_nested(struct sock *sk, i +@@ -2031,12 +2031,11 @@ void lock_sock_nested(struct sock *sk, i if (sk->sk_lock.owned) __lock_sock(sk); sk->sk_lock.owned = 1; diff --git a/debian/patches/features/all/rt/net-ipv4-route-use-locks-on-up-rt.patch b/debian/patches/features/all/rt/net-ipv4-route-use-locks-on-up-rt.patch index 5911b4c24..7c1c4d260 100644 --- a/debian/patches/features/all/rt/net-ipv4-route-use-locks-on-up-rt.patch +++ b/debian/patches/features/all/rt/net-ipv4-route-use-locks-on-up-rt.patch @@ -11,7 +11,7 @@ Index: linux-3.2/net/ipv4/route.c =================================================================== --- linux-3.2.orig/net/ipv4/route.c +++ linux-3.2/net/ipv4/route.c -@@ -245,7 +245,7 @@ struct rt_hash_bucket { +@@ -251,7 +251,7 @@ struct rt_hash_bucket { }; #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || \ diff --git a/debian/patches/features/all/rt/net-netif_rx_ni-migrate-disable.patch b/debian/patches/features/all/rt/net-netif_rx_ni-migrate-disable.patch index 56c2ee6cf..b0e77c08b 100644 --- a/debian/patches/features/all/rt/net-netif_rx_ni-migrate-disable.patch +++ b/debian/patches/features/all/rt/net-netif_rx_ni-migrate-disable.patch @@ -11,7 +11,7 @@ Index: linux-3.2/net/core/dev.c =================================================================== --- linux-3.2.orig/net/core/dev.c +++ linux-3.2/net/core/dev.c -@@ -3033,11 +3033,11 @@ int netif_rx_ni(struct sk_buff *skb) +@@ -3034,11 +3034,11 @@ int netif_rx_ni(struct sk_buff *skb) { int err; diff --git a/debian/patches/features/all/rt/net-tx-action-avoid-livelock-on-rt.patch b/debian/patches/features/all/rt/net-tx-action-avoid-livelock-on-rt.patch index 4340bdb4e..a556e428f 100644 --- a/debian/patches/features/all/rt/net-tx-action-avoid-livelock-on-rt.patch +++ b/debian/patches/features/all/rt/net-tx-action-avoid-livelock-on-rt.patch @@ -46,7 +46,7 @@ Index: linux-3.2/net/core/dev.c =================================================================== --- linux-3.2.orig/net/core/dev.c +++ linux-3.2/net/core/dev.c -@@ -3043,6 +3043,36 @@ int netif_rx_ni(struct sk_buff *skb) +@@ -3044,6 +3044,36 @@ int netif_rx_ni(struct sk_buff *skb) } EXPORT_SYMBOL(netif_rx_ni); @@ -83,7 +83,7 @@ Index: linux-3.2/net/core/dev.c static void net_tx_action(struct softirq_action *h) { struct softnet_data *sd = &__get_cpu_var(softnet_data); -@@ -3081,7 +3111,7 @@ static void net_tx_action(struct softirq +@@ -3082,7 +3112,7 @@ static void net_tx_action(struct softirq head = head->next_sched; root_lock = qdisc_lock(q); diff --git a/debian/patches/features/all/rt/net-wireless-warn-nort.patch b/debian/patches/features/all/rt/net-wireless-warn-nort.patch index ab7e824a9..d7b90766b 100644 --- a/debian/patches/features/all/rt/net-wireless-warn-nort.patch +++ b/debian/patches/features/all/rt/net-wireless-warn-nort.patch @@ -11,7 +11,7 @@ Index: linux-3.2/net/mac80211/rx.c =================================================================== --- linux-3.2.orig/net/mac80211/rx.c +++ linux-3.2/net/mac80211/rx.c -@@ -2949,7 +2949,7 @@ void ieee80211_rx(struct ieee80211_hw *h +@@ -2952,7 +2952,7 @@ void ieee80211_rx(struct ieee80211_hw *h struct ieee80211_supported_band *sband; struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); diff --git a/debian/patches/features/all/rt/of-convert-devtree-lock.patch b/debian/patches/features/all/rt/of-convert-devtree-lock.patch index 4f53930f4..7172474fb 100644 --- a/debian/patches/features/all/rt/of-convert-devtree-lock.patch +++ b/debian/patches/features/all/rt/of-convert-devtree-lock.patch @@ -13,7 +13,7 @@ Index: linux-3.2/arch/sparc/kernel/prom_common.c =================================================================== --- linux-3.2.orig/arch/sparc/kernel/prom_common.c +++ linux-3.2/arch/sparc/kernel/prom_common.c -@@ -67,7 +67,7 @@ int of_set_property(struct device_node * +@@ -65,7 +65,7 @@ int of_set_property(struct device_node * err = -ENODEV; mutex_lock(&of_set_property_mutex); @@ -22,7 +22,7 @@ Index: linux-3.2/arch/sparc/kernel/prom_common.c prevp = &dp->properties; while (*prevp) { struct property *prop = *prevp; -@@ -94,7 +94,7 @@ int of_set_property(struct device_node * +@@ -92,7 +92,7 @@ int of_set_property(struct device_node * } prevp = &(*prevp)->next; } diff --git a/debian/patches/features/all/rt/oleg-signal-rt-fix.patch b/debian/patches/features/all/rt/oleg-signal-rt-fix.patch new file mode 100644 index 000000000..d52ce80f3 --- /dev/null +++ b/debian/patches/features/all/rt/oleg-signal-rt-fix.patch @@ -0,0 +1,150 @@ +Subject: signal/x86: Delay calling signals in atomic +From: Oleg Nesterov + +On x86_64 we must disable preemption before we enable interrupts +for stack faults, int3 and debugging, because the current task is using +a per CPU debug stack defined by the IST. If we schedule out, another task +can come in and use the same stack and cause the stack to be corrupted +and crash the kernel on return. + +When CONFIG_PREEMPT_RT_FULL is enabled, spin_locks become mutexes, and +one of these is the spin lock used in signal handling. + +Some of the debug code (int3) causes do_trap() to send a signal. +This function calls a spin lock that has been converted to a mutex +and has the possibility to sleep. If this happens, the above issues with +the corrupted stack is possible. + +Instead of calling the signal right away, for PREEMPT_RT and x86_64, +the signal information is stored on the stacks task_struct and +TIF_NOTIFY_RESUME is set. Then on exit of the trap, the signal resume +code will send the signal when preemption is enabled. + +[ rostedt: Switched from #ifdef CONFIG_PREEMPT_RT_FULL to + ARCH_RT_DELAYS_SIGNAL_SEND and added comments to the code. ] + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Oleg Nesterov +Signed-off-by: Steven Rostedt +Signed-off-by: Thomas Gleixner +--- + + arch/x86/kernel/signal.c | 9 +++++++++ + include/linux/sched.h | 4 ++++ + kernel/signal.c | 31 +++++++++++++++++++++++++++++-- + 3 files changed, 42 insertions(+), 2 deletions(-) + +Index: linux-rt.git/arch/x86/kernel/signal.c +=================================================================== +--- linux-rt.git.orig/arch/x86/kernel/signal.c ++++ linux-rt.git/arch/x86/kernel/signal.c +@@ -820,6 +820,15 @@ do_notify_resume(struct pt_regs *regs, v + mce_notify_process(); + #endif /* CONFIG_X86_64 && CONFIG_X86_MCE */ + ++#ifdef ARCH_RT_DELAYS_SIGNAL_SEND ++ if (unlikely(current->forced_info.si_signo)) { ++ struct task_struct *t = current; ++ force_sig_info(t->forced_info.si_signo, ++ &t->forced_info, t); ++ t->forced_info.si_signo = 0; ++ } ++#endif ++ + /* deal with pending signal delivery */ + if (thread_info_flags & _TIF_SIGPENDING) + do_signal(regs); +Index: linux-rt.git/include/linux/sched.h +=================================================================== +--- linux-rt.git.orig/include/linux/sched.h ++++ linux-rt.git/include/linux/sched.h +@@ -1405,6 +1405,10 @@ struct task_struct { + sigset_t blocked, real_blocked; + sigset_t saved_sigmask; /* restored if set_restore_sigmask() was used */ + struct sigpending pending; ++#ifdef CONFIG_PREEMPT_RT_FULL ++ /* TODO: move me into ->restart_block ? */ ++ struct siginfo forced_info; ++#endif + + unsigned long sas_ss_sp; + size_t sas_ss_size; +Index: linux-rt.git/kernel/signal.c +=================================================================== +--- linux-rt.git.orig/kernel/signal.c ++++ linux-rt.git/kernel/signal.c +@@ -1273,8 +1273,8 @@ int do_send_sig_info(int sig, struct sig + * We don't want to have recursive SIGSEGV's etc, for example, + * that is why we also clear SIGNAL_UNKILLABLE. + */ +-int +-force_sig_info(int sig, struct siginfo *info, struct task_struct *t) ++static int ++do_force_sig_info(int sig, struct siginfo *info, struct task_struct *t) + { + unsigned long int flags; + int ret, blocked, ignored; +@@ -1299,6 +1299,39 @@ force_sig_info(int sig, struct siginfo * + return ret; + } + ++int force_sig_info(int sig, struct siginfo *info, struct task_struct *t) ++{ ++/* ++ * On some archs, PREEMPT_RT has to delay sending a signal from a trap ++ * since it can not enable preemption, and the signal code's spin_locks ++ * turn into mutexes. Instead, it must set TIF_NOTIFY_RESUME which will ++ * send the signal on exit of the trap. ++ */ ++#ifdef ARCH_RT_DELAYS_SIGNAL_SEND ++ if (in_atomic()) { ++ if (WARN_ON_ONCE(t != current)) ++ return 0; ++ if (WARN_ON_ONCE(t->forced_info.si_signo)) ++ return 0; ++ ++ if (is_si_special(info)) { ++ WARN_ON_ONCE(info != SEND_SIG_PRIV); ++ t->forced_info.si_signo = sig; ++ t->forced_info.si_errno = 0; ++ t->forced_info.si_code = SI_KERNEL; ++ t->forced_info.si_pid = 0; ++ t->forced_info.si_uid = 0; ++ } else { ++ t->forced_info = *info; ++ } ++ ++ set_tsk_thread_flag(t, TIF_NOTIFY_RESUME); ++ return 0; ++ } ++#endif ++ return do_force_sig_info(sig, info, t); ++} ++ + /* + * Nuke all other threads in the group. + */ +Index: linux-rt.git/arch/x86/include/asm/signal.h +=================================================================== +--- linux-rt.git.orig/arch/x86/include/asm/signal.h ++++ linux-rt.git/arch/x86/include/asm/signal.h +@@ -31,6 +31,19 @@ typedef struct { + unsigned long sig[_NSIG_WORDS]; + } sigset_t; + ++/* ++ * Because some traps use the IST stack, we must keep ++ * preemption disabled while calling do_trap(), but do_trap() ++ * may call force_sig_info() which will grab the signal spin_locks ++ * for the task, which in PREEMPT_RT_FULL are mutexes. ++ * By defining ARCH_RT_DELAYS_SIGNAL_SEND the force_sig_info() will ++ * set TIF_NOTIFY_RESUME and set up the signal to be sent on exit ++ * of the trap. ++ */ ++#if defined(CONFIG_PREEMPT_RT_FULL) && defined(CONFIG_X86_64) ++#define ARCH_RT_DELAYS_SIGNAL_SEND ++#endif ++ + #else + /* Here we must cater to libcs that poke about in kernel headers. */ + diff --git a/debian/patches/features/all/rt/pci-access-use-__wake_up_all_locked.patch b/debian/patches/features/all/rt/pci-access-use-__wake_up_all_locked.patch index dd52a663f..ccf700534 100644 --- a/debian/patches/features/all/rt/pci-access-use-__wake_up_all_locked.patch +++ b/debian/patches/features/all/rt/pci-access-use-__wake_up_all_locked.patch @@ -8,11 +8,15 @@ might_sleep()/scheduling while atomic problem on RT Signed-off-by: Thomas Gleixner Cc: stable-rt@vger.kernel.org -Index: linux-rt/drivers/pci/access.c +--- + drivers/pci/access.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: linux-3.2/drivers/pci/access.c =================================================================== ---- linux-rt.orig/drivers/pci/access.c -+++ linux-rt/drivers/pci/access.c -@@ -441,7 +441,7 @@ void pci_unblock_user_cfg_access(struct +--- linux-3.2.orig/drivers/pci/access.c ++++ linux-3.2/drivers/pci/access.c +@@ -441,7 +441,7 @@ void pci_unblock_user_cfg_access(struct WARN_ON(!dev->block_ucfg_access); dev->block_ucfg_access = 0; diff --git a/debian/patches/features/all/rt/peter_zijlstra-frob-hrtimer.patch b/debian/patches/features/all/rt/peter_zijlstra-frob-hrtimer.patch index 43168dd99..d18881644 100644 --- a/debian/patches/features/all/rt/peter_zijlstra-frob-hrtimer.patch +++ b/debian/patches/features/all/rt/peter_zijlstra-frob-hrtimer.patch @@ -82,7 +82,7 @@ Index: linux-3.2/kernel/hrtimer.c } return 0; -@@ -1044,8 +1031,19 @@ int __hrtimer_start_range_ns(struct hrti +@@ -1046,8 +1033,19 @@ int __hrtimer_start_range_ns(struct hrti * * XXX send_remote_softirq() ? */ diff --git a/debian/patches/features/all/rt/peter_zijlstra-frob-migrate_disable-2.patch b/debian/patches/features/all/rt/peter_zijlstra-frob-migrate_disable-2.patch index c1b409026..b6894ac92 100644 --- a/debian/patches/features/all/rt/peter_zijlstra-frob-migrate_disable-2.patch +++ b/debian/patches/features/all/rt/peter_zijlstra-frob-migrate_disable-2.patch @@ -77,7 +77,7 @@ Index: linux-3.2/include/linux/sched.h cpumask_t cpus_allowed; #ifdef CONFIG_PREEMPT_RCU -@@ -2678,11 +2680,22 @@ static inline void set_task_cpu(struct t +@@ -2677,11 +2679,22 @@ static inline void set_task_cpu(struct t #endif /* CONFIG_SMP */ @@ -124,7 +124,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -6209,7 +6209,7 @@ static inline void sched_init_granularit +@@ -6224,7 +6224,7 @@ static inline void sched_init_granularit #ifdef CONFIG_SMP void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) { @@ -133,7 +133,7 @@ Index: linux-3.2/kernel/sched.c if (p->sched_class && p->sched_class->set_cpus_allowed) p->sched_class->set_cpus_allowed(p, new_mask); p->rt.nr_cpus_allowed = cpumask_weight(new_mask); -@@ -6265,7 +6265,7 @@ int set_cpus_allowed_ptr(struct task_str +@@ -6280,7 +6280,7 @@ int set_cpus_allowed_ptr(struct task_str do_set_cpus_allowed(p, new_mask); /* Can the task run on the task's current CPU? If so, we're done */ @@ -142,7 +142,7 @@ Index: linux-3.2/kernel/sched.c goto out; dest_cpu = cpumask_any_and(cpu_active_mask, new_mask); -@@ -6284,6 +6284,7 @@ out: +@@ -6299,6 +6299,7 @@ out: } EXPORT_SYMBOL_GPL(set_cpus_allowed_ptr); @@ -150,7 +150,7 @@ Index: linux-3.2/kernel/sched.c void migrate_disable(void) { struct task_struct *p = current; -@@ -6376,6 +6377,7 @@ void migrate_enable(void) +@@ -6391,6 +6392,7 @@ void migrate_enable(void) preempt_enable(); } EXPORT_SYMBOL_GPL(migrate_enable); diff --git a/debian/patches/features/all/rt/peter_zijlstra-frob-migrate_disable.patch b/debian/patches/features/all/rt/peter_zijlstra-frob-migrate_disable.patch index 0cfbb7cdd..18c5b7e78 100644 --- a/debian/patches/features/all/rt/peter_zijlstra-frob-migrate_disable.patch +++ b/debian/patches/features/all/rt/peter_zijlstra-frob-migrate_disable.patch @@ -15,7 +15,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -6304,7 +6304,19 @@ void migrate_disable(void) +@@ -6319,7 +6319,19 @@ void migrate_disable(void) preempt_enable(); return; } @@ -36,7 +36,7 @@ Index: linux-3.2/kernel/sched.c p->migrate_disable = 1; mask = tsk_cpus_allowed(p); -@@ -6315,7 +6327,7 @@ void migrate_disable(void) +@@ -6330,7 +6342,7 @@ void migrate_disable(void) p->sched_class->set_cpus_allowed(p, mask); p->rt.nr_cpus_allowed = cpumask_weight(mask); } @@ -45,7 +45,7 @@ Index: linux-3.2/kernel/sched.c preempt_enable(); } EXPORT_SYMBOL_GPL(migrate_disable); -@@ -6343,7 +6355,11 @@ void migrate_enable(void) +@@ -6358,7 +6370,11 @@ void migrate_enable(void) return; } @@ -58,7 +58,7 @@ Index: linux-3.2/kernel/sched.c p->migrate_disable = 0; mask = tsk_cpus_allowed(p); -@@ -6355,7 +6371,7 @@ void migrate_enable(void) +@@ -6370,7 +6386,7 @@ void migrate_enable(void) p->rt.nr_cpus_allowed = cpumask_weight(mask); } diff --git a/debian/patches/features/all/rt/peter_zijlstra-frob-pagefault_disable.patch b/debian/patches/features/all/rt/peter_zijlstra-frob-pagefault_disable.patch index 7a0e4fc37..3a77a4621 100644 --- a/debian/patches/features/all/rt/peter_zijlstra-frob-pagefault_disable.patch +++ b/debian/patches/features/all/rt/peter_zijlstra-frob-pagefault_disable.patch @@ -356,7 +356,7 @@ Index: linux-3.2/include/linux/sched.h #ifdef CONFIG_TRACE_IRQFLAGS unsigned int irq_events; unsigned long hardirq_enable_ip; -@@ -1581,6 +1584,17 @@ struct task_struct { +@@ -1580,6 +1583,17 @@ struct task_struct { /* Future-safe accessor for struct task_struct's cpus_allowed. */ #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed) @@ -378,7 +378,7 @@ Index: linux-3.2/kernel/fork.c =================================================================== --- linux-3.2.orig/kernel/fork.c +++ linux-3.2/kernel/fork.c -@@ -1198,7 +1198,9 @@ static struct task_struct *copy_process( +@@ -1193,7 +1193,9 @@ static struct task_struct *copy_process( p->hardirq_context = 0; p->softirq_context = 0; #endif diff --git a/debian/patches/features/all/rt/peter_zijlstra-re-_3_0-rt4.patch b/debian/patches/features/all/rt/peter_zijlstra-re-_3_0-rt4.patch index a705f96a6..79a764664 100644 --- a/debian/patches/features/all/rt/peter_zijlstra-re-_3_0-rt4.patch +++ b/debian/patches/features/all/rt/peter_zijlstra-re-_3_0-rt4.patch @@ -86,7 +86,7 @@ Index: linux-3.2/include/linux/sched.h #include #include #include -@@ -1600,6 +1601,10 @@ struct task_struct { +@@ -1599,6 +1600,10 @@ struct task_struct { struct rcu_head put_rcu; int softirq_nestcnt; #endif diff --git a/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch b/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch index da7febca9..68976f5df 100644 --- a/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch +++ b/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch @@ -73,7 +73,7 @@ Index: linux-3.2/kernel/fork.c =================================================================== --- linux-3.2.orig/kernel/fork.c +++ linux-3.2/kernel/fork.c -@@ -1028,6 +1028,9 @@ void mm_init_owner(struct mm_struct *mm, +@@ -1023,6 +1023,9 @@ void mm_init_owner(struct mm_struct *mm, */ static void posix_cpu_timers_init(struct task_struct *tsk) { diff --git a/debian/patches/features/all/rt/preempt-mark-legitimated-no-resched-sites.patch b/debian/patches/features/all/rt/preempt-mark-legitimated-no-resched-sites.patch index 117f2131c..47aeea646 100644 --- a/debian/patches/features/all/rt/preempt-mark-legitimated-no-resched-sites.patch +++ b/debian/patches/features/all/rt/preempt-mark-legitimated-no-resched-sites.patch @@ -87,7 +87,7 @@ Index: linux-3.2/kernel/sched.c schedule(); preempt_disable(); } -@@ -5692,7 +5692,7 @@ SYSCALL_DEFINE0(sched_yield) +@@ -5705,7 +5705,7 @@ SYSCALL_DEFINE0(sched_yield) __release(rq->lock); spin_release(&rq->lock.dep_map, 1, _THIS_IP_); do_raw_spin_unlock(&rq->lock); diff --git a/debian/patches/features/all/rt/printk-disable-migration-instead-of-preemption.patch b/debian/patches/features/all/rt/printk-disable-migration-instead-of-preemption.patch index 5d6eed6dd..c974b1d24 100644 --- a/debian/patches/features/all/rt/printk-disable-migration-instead-of-preemption.patch +++ b/debian/patches/features/all/rt/printk-disable-migration-instead-of-preemption.patch @@ -40,7 +40,7 @@ Index: linux-3.2/kernel/printk.c =================================================================== --- linux-3.2.orig/kernel/printk.c +++ linux-3.2/kernel/printk.c -@@ -902,7 +902,7 @@ asmlinkage int vprintk(const char *fmt, +@@ -901,7 +901,7 @@ asmlinkage int vprintk(const char *fmt, boot_delay_msec(); printk_delay(); @@ -49,7 +49,7 @@ Index: linux-3.2/kernel/printk.c /* This stops the holder of console_sem just where we want him */ raw_local_irq_save(flags); this_cpu = smp_processor_id(); -@@ -1033,7 +1033,7 @@ asmlinkage int vprintk(const char *fmt, +@@ -1032,7 +1032,7 @@ asmlinkage int vprintk(const char *fmt, out_restore_irqs: raw_local_irq_restore(flags); diff --git a/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch b/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch index b2972cc7a..a6b0f3a87 100644 --- a/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch +++ b/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch @@ -37,7 +37,7 @@ Index: linux-3.2/arch/arm/kernel/process.c =================================================================== --- linux-3.2.orig/arch/arm/kernel/process.c +++ linux-3.2/arch/arm/kernel/process.c -@@ -486,6 +486,31 @@ unsigned long arch_randomize_brk(struct +@@ -489,6 +489,31 @@ unsigned long arch_randomize_brk(struct } #ifdef CONFIG_MMU diff --git a/debian/patches/features/all/rt/rt-mutex-add-sleeping-spinlocks-support.patch b/debian/patches/features/all/rt/rt-mutex-add-sleeping-spinlocks-support.patch index 703fdddc3..bd5e3143d 100644 --- a/debian/patches/features/all/rt/rt-mutex-add-sleeping-spinlocks-support.patch +++ b/debian/patches/features/all/rt/rt-mutex-add-sleeping-spinlocks-support.patch @@ -76,7 +76,7 @@ Index: linux-3.2/kernel/futex.c =================================================================== --- linux-3.2.orig/kernel/futex.c +++ linux-3.2/kernel/futex.c -@@ -2286,8 +2286,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -2298,8 +2298,7 @@ static int futex_wait_requeue_pi(u32 __u * The waiter is allocated on our stack, manipulated by the requeue * code while we sleep on uaddr. */ diff --git a/debian/patches/features/all/rt/rt-rcutree-warn-fix.patch b/debian/patches/features/all/rt/rt-rcutree-warn-fix.patch index 0ab0c2637..bbdec5299 100644 --- a/debian/patches/features/all/rt/rt-rcutree-warn-fix.patch +++ b/debian/patches/features/all/rt/rt-rcutree-warn-fix.patch @@ -17,10 +17,10 @@ Signed-off-by: Thomas Gleixner kernel/rcutree.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) -Index: tip/kernel/rcutree.c +Index: linux-3.2/kernel/rcutree.c =================================================================== ---- tip.orig/kernel/rcutree.c -+++ tip/kernel/rcutree.c +--- linux-3.2.orig/kernel/rcutree.c ++++ linux-3.2/kernel/rcutree.c @@ -171,6 +171,8 @@ void rcu_sched_qs(int cpu) } @@ -30,10 +30,10 @@ Index: tip/kernel/rcutree.c void rcu_bh_qs(int cpu) { rcu_preempt_qs(cpu); -Index: tip/kernel/rcutree.h +Index: linux-3.2/kernel/rcutree.h =================================================================== ---- tip.orig/kernel/rcutree.h -+++ tip/kernel/rcutree.h +--- linux-3.2.orig/kernel/rcutree.h ++++ linux-3.2/kernel/rcutree.h @@ -430,7 +430,6 @@ DECLARE_PER_CPU(char, rcu_cpu_has_work); /* Forward declarations for rcutree_plugin.h */ static void rcu_bootup_announce(void); diff --git a/debian/patches/features/all/rt/rt-sched-do-not-compare-cpu-masks-in-scheduler.patch b/debian/patches/features/all/rt/rt-sched-do-not-compare-cpu-masks-in-scheduler.patch index d5dda4832..abeceb6e4 100644 --- a/debian/patches/features/all/rt/rt-sched-do-not-compare-cpu-masks-in-scheduler.patch +++ b/debian/patches/features/all/rt/rt-sched-do-not-compare-cpu-masks-in-scheduler.patch @@ -16,7 +16,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -4383,16 +4383,12 @@ static inline void update_migrate_disabl +@@ -4385,16 +4385,12 @@ static inline void update_migrate_disabl */ mask = tsk_cpus_allowed(p); diff --git a/debian/patches/features/all/rt/rt-sched-have-migrate_disable-ignore-bounded-threads.patch b/debian/patches/features/all/rt/rt-sched-have-migrate_disable-ignore-bounded-threads.patch index a39b953eb..fc924b81b 100644 --- a/debian/patches/features/all/rt/rt-sched-have-migrate_disable-ignore-bounded-threads.patch +++ b/debian/patches/features/all/rt/rt-sched-have-migrate_disable-ignore-bounded-threads.patch @@ -16,7 +16,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -4395,7 +4395,7 @@ void migrate_disable(void) +@@ -4397,7 +4397,7 @@ void migrate_disable(void) { struct task_struct *p = current; @@ -25,7 +25,7 @@ Index: linux-3.2/kernel/sched.c #ifdef CONFIG_SCHED_DEBUG p->migrate_disable_atomic++; #endif -@@ -4426,7 +4426,7 @@ void migrate_enable(void) +@@ -4428,7 +4428,7 @@ void migrate_enable(void) unsigned long flags; struct rq *rq; @@ -34,7 +34,7 @@ Index: linux-3.2/kernel/sched.c #ifdef CONFIG_SCHED_DEBUG p->migrate_disable_atomic--; #endif -@@ -4447,26 +4447,21 @@ void migrate_enable(void) +@@ -4449,26 +4449,21 @@ void migrate_enable(void) if (unlikely(migrate_disabled_updated(p))) { /* diff --git a/debian/patches/features/all/rt/rt-sched-postpone-actual-migration-disalbe-to-schedule.patch b/debian/patches/features/all/rt/rt-sched-postpone-actual-migration-disalbe-to-schedule.patch index 31ac21cb9..0a1639795 100644 --- a/debian/patches/features/all/rt/rt-sched-postpone-actual-migration-disalbe-to-schedule.patch +++ b/debian/patches/features/all/rt/rt-sched-postpone-actual-migration-disalbe-to-schedule.patch @@ -26,7 +26,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -4355,6 +4355,135 @@ static inline void schedule_debug(struct +@@ -4357,6 +4357,135 @@ static inline void schedule_debug(struct schedstat_inc(this_rq(), sched_count); } @@ -162,7 +162,7 @@ Index: linux-3.2/kernel/sched.c static void put_prev_task(struct rq *rq, struct task_struct *prev) { if (prev->on_rq || rq->skip_clock_update < 0) -@@ -4414,6 +4543,8 @@ need_resched: +@@ -4416,6 +4545,8 @@ need_resched: raw_spin_lock_irq(&rq->lock); @@ -171,7 +171,7 @@ Index: linux-3.2/kernel/sched.c switch_count = &prev->nivcsw; if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) { if (unlikely(signal_pending_state(prev->state, prev))) { -@@ -6209,7 +6340,7 @@ static inline void sched_init_granularit +@@ -6224,7 +6355,7 @@ static inline void sched_init_granularit #ifdef CONFIG_SMP void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) { @@ -180,7 +180,7 @@ Index: linux-3.2/kernel/sched.c if (p->sched_class && p->sched_class->set_cpus_allowed) p->sched_class->set_cpus_allowed(p, new_mask); p->rt.nr_cpus_allowed = cpumask_weight(new_mask); -@@ -6284,124 +6415,6 @@ out: +@@ -6299,124 +6430,6 @@ out: } EXPORT_SYMBOL_GPL(set_cpus_allowed_ptr); diff --git a/debian/patches/features/all/rt/rt-serial-warn-fix.patch b/debian/patches/features/all/rt/rt-serial-warn-fix.patch index 39b4264bf..38b8d4005 100644 --- a/debian/patches/features/all/rt/rt-serial-warn-fix.patch +++ b/debian/patches/features/all/rt/rt-serial-warn-fix.patch @@ -15,11 +15,11 @@ Signed-off-by: Thomas Gleixner drivers/tty/serial/8250.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) -Index: tip/drivers/tty/serial/8250.c +Index: linux-3.2/drivers/tty/serial/8250.c =================================================================== ---- tip.orig/drivers/tty/serial/8250.c -+++ tip/drivers/tty/serial/8250.c -@@ -82,7 +82,16 @@ static unsigned int skip_txen_test; /* f +--- linux-3.2.orig/drivers/tty/serial/8250.c ++++ linux-3.2/drivers/tty/serial/8250.c +@@ -81,7 +81,16 @@ static unsigned int skip_txen_test; /* f #define DEBUG_INTR(fmt...) do { } while (0) #endif @@ -37,7 +37,7 @@ Index: tip/drivers/tty/serial/8250.c #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) -@@ -1632,14 +1641,12 @@ static irqreturn_t serial8250_interrupt( +@@ -1631,14 +1640,12 @@ static irqreturn_t serial8250_interrupt( l = l->next; diff --git a/debian/patches/features/all/rt/rt-slab-fix-__do_drain-to-use-the-right-array-cache.patch b/debian/patches/features/all/rt/rt-slab-fix-__do_drain-to-use-the-right-array-cache.patch index 237badf7b..fe2efdd7e 100644 --- a/debian/patches/features/all/rt/rt-slab-fix-__do_drain-to-use-the-right-array-cache.patch +++ b/debian/patches/features/all/rt/rt-slab-fix-__do_drain-to-use-the-right-array-cache.patch @@ -42,7 +42,7 @@ Index: linux-3.2/mm/slab.c =================================================================== --- linux-3.2.orig/mm/slab.c +++ linux-3.2/mm/slab.c -@@ -2566,7 +2566,7 @@ static void __do_drain(void *arg, unsign +@@ -2573,7 +2573,7 @@ static void __do_drain(void *arg, unsign struct array_cache *ac; int node = cpu_to_mem(cpu); diff --git a/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch b/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch index 8806816c4..bef9a87fc 100644 --- a/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch +++ b/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch @@ -13,7 +13,7 @@ Index: linux-3.2/kernel/futex.c =================================================================== --- linux-3.2.orig/kernel/futex.c +++ linux-3.2/kernel/futex.c -@@ -1410,6 +1410,16 @@ retry_private: +@@ -1422,6 +1422,16 @@ retry_private: requeue_pi_wake_futex(this, &key2, hb2); drop_count++; continue; @@ -30,7 +30,7 @@ Index: linux-3.2/kernel/futex.c } else if (ret) { /* -EDEADLK */ this->pi_state = NULL; -@@ -2254,7 +2264,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -2266,7 +2276,7 @@ static int futex_wait_requeue_pi(u32 __u struct hrtimer_sleeper timeout, *to = NULL; struct rt_mutex_waiter rt_waiter; struct rt_mutex *pi_mutex = NULL; @@ -39,7 +39,7 @@ Index: linux-3.2/kernel/futex.c union futex_key key2 = FUTEX_KEY_INIT; struct futex_q q = futex_q_init; int res, ret; -@@ -2298,20 +2308,55 @@ static int futex_wait_requeue_pi(u32 __u +@@ -2310,20 +2320,55 @@ static int futex_wait_requeue_pi(u32 __u /* Queue the futex_q, drop the hb lock, wait for wakeup. */ futex_wait_queue_me(hb, &q, to); @@ -106,7 +106,7 @@ Index: linux-3.2/kernel/futex.c /* Check if the requeue code acquired the second futex for us. */ if (!q.rt_waiter) { -@@ -2320,9 +2365,10 @@ static int futex_wait_requeue_pi(u32 __u +@@ -2332,9 +2377,10 @@ static int futex_wait_requeue_pi(u32 __u * did a lock-steal - fix up the PI-state in that case. */ if (q.pi_state && (q.pi_state->owner != current)) { @@ -119,7 +119,7 @@ Index: linux-3.2/kernel/futex.c } } else { /* -@@ -2335,7 +2381,8 @@ static int futex_wait_requeue_pi(u32 __u +@@ -2347,7 +2393,8 @@ static int futex_wait_requeue_pi(u32 __u ret = rt_mutex_finish_proxy_lock(pi_mutex, to, &rt_waiter, 1); debug_rt_mutex_free_waiter(&rt_waiter); diff --git a/debian/patches/features/all/rt/sched-cond-resched.patch b/debian/patches/features/all/rt/sched-cond-resched.patch index beee6024a..71b55ac25 100644 --- a/debian/patches/features/all/rt/sched-cond-resched.patch +++ b/debian/patches/features/all/rt/sched-cond-resched.patch @@ -11,7 +11,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -5762,9 +5762,17 @@ static inline int should_resched(void) +@@ -5775,9 +5775,17 @@ static inline int should_resched(void) static void __cond_resched(void) { diff --git a/debian/patches/features/all/rt/sched-delay-put-task.patch b/debian/patches/features/all/rt/sched-delay-put-task.patch index 507c11b1e..58147ce74 100644 --- a/debian/patches/features/all/rt/sched-delay-put-task.patch +++ b/debian/patches/features/all/rt/sched-delay-put-task.patch @@ -12,7 +12,7 @@ Index: linux-3.2/include/linux/sched.h =================================================================== --- linux-3.2.orig/include/linux/sched.h +++ linux-3.2/include/linux/sched.h -@@ -1588,6 +1588,9 @@ struct task_struct { +@@ -1587,6 +1587,9 @@ struct task_struct { #ifdef CONFIG_HAVE_HW_BREAKPOINT atomic_t ptrace_bp_refcnt; #endif @@ -22,7 +22,7 @@ Index: linux-3.2/include/linux/sched.h }; /* Future-safe accessor for struct task_struct's cpus_allowed. */ -@@ -1772,6 +1775,15 @@ extern struct pid *cad_pid; +@@ -1771,6 +1774,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) @@ -38,7 +38,7 @@ Index: linux-3.2/include/linux/sched.h extern void __put_task_struct(struct task_struct *t); static inline void put_task_struct(struct task_struct *t) -@@ -1779,6 +1791,7 @@ static inline void put_task_struct(struc +@@ -1778,6 +1790,7 @@ static inline void put_task_struct(struc if (atomic_dec_and_test(&t->usage)) __put_task_struct(t); } @@ -50,7 +50,7 @@ Index: linux-3.2/kernel/fork.c =================================================================== --- linux-3.2.orig/kernel/fork.c +++ linux-3.2/kernel/fork.c -@@ -197,7 +197,18 @@ void __put_task_struct(struct task_struc +@@ -196,7 +196,18 @@ void __put_task_struct(struct task_struc if (!profile_handoff_task(tsk)) free_task(tsk); } diff --git a/debian/patches/features/all/rt/sched-distangle-worker-accounting-from-rq-3elock.patch b/debian/patches/features/all/rt/sched-distangle-worker-accounting-from-rq-3elock.patch index 203f34e8c..982e8a7cb 100644 --- a/debian/patches/features/all/rt/sched-distangle-worker-accounting-from-rq-3elock.patch +++ b/debian/patches/features/all/rt/sched-distangle-worker-accounting-from-rq-3elock.patch @@ -32,7 +32,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -2643,10 +2643,6 @@ static void ttwu_activate(struct rq *rq, +@@ -2644,10 +2644,6 @@ static void ttwu_activate(struct rq *rq, { activate_task(rq, p, en_flags); p->on_rq = 1; @@ -43,7 +43,7 @@ Index: linux-3.2/kernel/sched.c } /* -@@ -2881,40 +2877,6 @@ out: +@@ -2882,40 +2878,6 @@ out: } /** @@ -84,7 +84,7 @@ Index: linux-3.2/kernel/sched.c * wake_up_process - Wake up a specific process * @p: The process to be woken up. * -@@ -4419,19 +4381,6 @@ need_resched: +@@ -4420,19 +4382,6 @@ need_resched: } else { deactivate_task(rq, prev, DEQUEUE_SLEEP); prev->on_rq = 0; @@ -104,7 +104,7 @@ Index: linux-3.2/kernel/sched.c } switch_count = &prev->nvcsw; } -@@ -4474,6 +4423,14 @@ static inline void sched_submit_work(str +@@ -4475,6 +4424,14 @@ static inline void sched_submit_work(str { if (!tsk->state) return; @@ -119,7 +119,7 @@ Index: linux-3.2/kernel/sched.c /* * If we are going to sleep and we have plugged IO queued, * make sure to submit it to avoid deadlocks. -@@ -4482,12 +4439,19 @@ static inline void sched_submit_work(str +@@ -4483,12 +4440,19 @@ static inline void sched_submit_work(str blk_schedule_flush_plug(tsk); } diff --git a/debian/patches/features/all/rt/sched-keep-period-timer-alive-when-throttled.patch b/debian/patches/features/all/rt/sched-keep-period-timer-alive-when-throttled.patch index 9aa8708e7..d2e7ba043 100644 --- a/debian/patches/features/all/rt/sched-keep-period-timer-alive-when-throttled.patch +++ b/debian/patches/features/all/rt/sched-keep-period-timer-alive-when-throttled.patch @@ -19,7 +19,7 @@ Index: linux-3.2/kernel/sched_rt.c =================================================================== --- linux-3.2.orig/kernel/sched_rt.c +++ linux-3.2/kernel/sched_rt.c -@@ -577,12 +577,9 @@ static inline int balance_runtime(struct +@@ -580,12 +580,9 @@ static inline int balance_runtime(struct static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun) { @@ -33,7 +33,7 @@ Index: linux-3.2/kernel/sched_rt.c span = sched_rt_period_mask(); for_each_cpu(i, span) { int enqueue = 0; -@@ -617,12 +614,17 @@ static int do_sched_rt_period_timer(stru +@@ -620,12 +617,17 @@ static int do_sched_rt_period_timer(stru if (!rt_rq_throttled(rt_rq)) enqueue = 1; } @@ -51,7 +51,7 @@ Index: linux-3.2/kernel/sched_rt.c return idle; } -@@ -683,7 +685,8 @@ static void update_curr_rt(struct rq *rq +@@ -686,7 +688,8 @@ static void update_curr_rt(struct rq *rq if (unlikely((s64)delta_exec < 0)) delta_exec = 0; diff --git a/debian/patches/features/all/rt/sched-load-balance-break-on-rq-contention.patch b/debian/patches/features/all/rt/sched-load-balance-break-on-rq-contention.patch index e8deeccf2..acc98897e 100644 --- a/debian/patches/features/all/rt/sched-load-balance-break-on-rq-contention.patch +++ b/debian/patches/features/all/rt/sched-load-balance-break-on-rq-contention.patch @@ -15,7 +15,7 @@ Index: linux-3.2/kernel/sched_fair.c =================================================================== --- linux-3.2.orig/kernel/sched_fair.c +++ linux-3.2/kernel/sched_fair.c -@@ -2806,6 +2806,10 @@ balance_tasks(struct rq *this_rq, int th +@@ -2899,6 +2899,10 @@ balance_tasks(struct rq *this_rq, int th */ if (idle == CPU_NEWLY_IDLE) break; @@ -26,7 +26,7 @@ Index: linux-3.2/kernel/sched_fair.c #endif /* -@@ -2946,6 +2950,20 @@ load_balance_fair(struct rq *this_rq, in +@@ -3039,6 +3043,20 @@ load_balance_fair(struct rq *this_rq, in rem_load_move -= moved_load; if (rem_load_move < 0) break; diff --git a/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch b/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch index f72d10698..b53032f7b 100644 --- a/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch +++ b/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch @@ -37,7 +37,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -8416,7 +8416,8 @@ void __init sched_init(void) +@@ -8429,7 +8429,8 @@ void __init sched_init(void) #ifdef CONFIG_DEBUG_ATOMIC_SLEEP static inline int preempt_count_equals(int preempt_offset) { diff --git a/debian/patches/features/all/rt/sched-migrate-disable.patch b/debian/patches/features/all/rt/sched-migrate-disable.patch index 244fd4a71..5ba185cff 100644 --- a/debian/patches/features/all/rt/sched-migrate-disable.patch +++ b/debian/patches/features/all/rt/sched-migrate-disable.patch @@ -42,7 +42,7 @@ Index: linux-3.2/include/linux/sched.h cpumask_t cpus_allowed; #ifdef CONFIG_PREEMPT_RCU -@@ -1595,9 +1596,6 @@ struct task_struct { +@@ -1594,9 +1595,6 @@ struct task_struct { #endif }; @@ -52,7 +52,7 @@ Index: linux-3.2/include/linux/sched.h #ifdef CONFIG_PREEMPT_RT_FULL static inline bool cur_pf_disabled(void) { return current->pagefault_disabled; } #else -@@ -2680,6 +2678,15 @@ static inline void set_task_cpu(struct t +@@ -2679,6 +2677,15 @@ static inline void set_task_cpu(struct t #endif /* CONFIG_SMP */ @@ -84,7 +84,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -6209,11 +6209,12 @@ static inline void sched_init_granularit +@@ -6224,11 +6224,12 @@ static inline void sched_init_granularit #ifdef CONFIG_SMP void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) { @@ -101,7 +101,7 @@ Index: linux-3.2/kernel/sched.c } /* -@@ -6264,7 +6265,7 @@ int set_cpus_allowed_ptr(struct task_str +@@ -6279,7 +6280,7 @@ int set_cpus_allowed_ptr(struct task_str do_set_cpus_allowed(p, new_mask); /* Can the task run on the task's current CPU? If so, we're done */ @@ -110,7 +110,7 @@ Index: linux-3.2/kernel/sched.c goto out; dest_cpu = cpumask_any_and(cpu_active_mask, new_mask); -@@ -6283,6 +6284,83 @@ out: +@@ -6298,6 +6299,83 @@ out: } EXPORT_SYMBOL_GPL(set_cpus_allowed_ptr); diff --git a/debian/patches/features/all/rt/sched-mmdrop-delayed.patch b/debian/patches/features/all/rt/sched-mmdrop-delayed.patch index a6aa4765f..55fd9250c 100644 --- a/debian/patches/features/all/rt/sched-mmdrop-delayed.patch +++ b/debian/patches/features/all/rt/sched-mmdrop-delayed.patch @@ -39,7 +39,7 @@ Index: linux-3.2/include/linux/sched.h =================================================================== --- linux-3.2.orig/include/linux/sched.h +++ linux-3.2/include/linux/sched.h -@@ -2265,12 +2265,24 @@ extern struct mm_struct * mm_alloc(void) +@@ -2264,12 +2264,24 @@ extern struct mm_struct * mm_alloc(void) /* mmdrop drops the mm and the page tables */ extern void __mmdrop(struct mm_struct *); @@ -68,7 +68,7 @@ Index: linux-3.2/kernel/fork.c =================================================================== --- linux-3.2.orig/kernel/fork.c +++ linux-3.2/kernel/fork.c -@@ -202,7 +202,7 @@ EXPORT_SYMBOL_GPL(__put_task_struct); +@@ -201,7 +201,7 @@ EXPORT_SYMBOL_GPL(__put_task_struct); #else void __put_task_struct_cb(struct rcu_head *rhp) { @@ -77,7 +77,7 @@ Index: linux-3.2/kernel/fork.c __put_task_struct(tsk); -@@ -557,6 +557,19 @@ void __mmdrop(struct mm_struct *mm) +@@ -552,6 +552,19 @@ void __mmdrop(struct mm_struct *mm) } EXPORT_SYMBOL_GPL(__mmdrop); @@ -115,7 +115,7 @@ Index: linux-3.2/kernel/sched.c if (unlikely(prev_state == TASK_DEAD)) { /* * Remove function-return probe instances associated with this -@@ -6290,6 +6294,8 @@ static int migration_cpu_stop(void *data +@@ -6303,6 +6307,8 @@ static int migration_cpu_stop(void *data #ifdef CONFIG_HOTPLUG_CPU @@ -124,7 +124,7 @@ Index: linux-3.2/kernel/sched.c /* * Ensures that the idle task is using init_mm right before its cpu goes * offline. -@@ -6302,7 +6308,12 @@ void idle_task_exit(void) +@@ -6315,7 +6321,12 @@ void idle_task_exit(void) if (mm != &init_mm) switch_mm(mm, &init_mm, current); @@ -138,7 +138,7 @@ Index: linux-3.2/kernel/sched.c } /* -@@ -6647,6 +6658,12 @@ migration_call(struct notifier_block *nf +@@ -6660,6 +6671,12 @@ migration_call(struct notifier_block *nf migrate_nr_uninterruptible(rq); calc_global_load_remove(rq); break; diff --git a/debian/patches/features/all/rt/sched-no-work-when-pi-blocked.patch b/debian/patches/features/all/rt/sched-no-work-when-pi-blocked.patch index 7db34697c..be56766e0 100644 --- a/debian/patches/features/all/rt/sched-no-work-when-pi-blocked.patch +++ b/debian/patches/features/all/rt/sched-no-work-when-pi-blocked.patch @@ -12,7 +12,7 @@ Index: linux-3.2/include/linux/sched.h =================================================================== --- linux-3.2.orig/include/linux/sched.h +++ linux-3.2/include/linux/sched.h -@@ -2092,12 +2092,20 @@ extern unsigned int sysctl_sched_cfs_ban +@@ -2091,12 +2091,20 @@ extern unsigned int sysctl_sched_cfs_ban extern int rt_mutex_getprio(struct task_struct *p); extern void rt_mutex_setprio(struct task_struct *p, int prio); extern void rt_mutex_adjust_pi(struct task_struct *p); diff --git a/debian/patches/features/all/rt/sched-prevent-boosting-from-throttling.patch b/debian/patches/features/all/rt/sched-prevent-boosting-from-throttling.patch index b8a75f09f..4af3e4afd 100644 --- a/debian/patches/features/all/rt/sched-prevent-boosting-from-throttling.patch +++ b/debian/patches/features/all/rt/sched-prevent-boosting-from-throttling.patch @@ -19,7 +19,7 @@ Index: linux-3.2/kernel/sched_rt.c =================================================================== --- linux-3.2.orig/kernel/sched_rt.c +++ linux-3.2/kernel/sched_rt.c -@@ -656,8 +656,24 @@ static int sched_rt_runtime_exceeded(str +@@ -659,8 +659,24 @@ static int sched_rt_runtime_exceeded(str return 0; if (rt_rq->rt_time > runtime) { diff --git a/debian/patches/features/all/rt/sched-prevent-idle-boost.patch b/debian/patches/features/all/rt/sched-prevent-idle-boost.patch index 9615fa207..923c8244f 100644 --- a/debian/patches/features/all/rt/sched-prevent-idle-boost.patch +++ b/debian/patches/features/all/rt/sched-prevent-idle-boost.patch @@ -11,7 +11,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -5024,6 +5024,24 @@ void rt_mutex_setprio(struct task_struct +@@ -5037,6 +5037,24 @@ void rt_mutex_setprio(struct task_struct rq = __task_rq_lock(p); @@ -36,7 +36,7 @@ Index: linux-3.2/kernel/sched.c trace_sched_pi_setprio(p, prio); oldprio = p->prio; prev_class = p->sched_class; -@@ -5047,11 +5065,10 @@ void rt_mutex_setprio(struct task_struct +@@ -5060,11 +5078,10 @@ void rt_mutex_setprio(struct task_struct enqueue_task(rq, p, oldprio < prio ? ENQUEUE_HEAD : 0); check_class_changed(rq, p, prev_class, oldprio); diff --git a/debian/patches/features/all/rt/sched-rt-fix-migrate_enable-thinko.patch b/debian/patches/features/all/rt/sched-rt-fix-migrate_enable-thinko.patch index 5e0328b71..1f46b5822 100644 --- a/debian/patches/features/all/rt/sched-rt-fix-migrate_enable-thinko.patch +++ b/debian/patches/features/all/rt/sched-rt-fix-migrate_enable-thinko.patch @@ -24,7 +24,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -6361,12 +6361,14 @@ void migrate_enable(void) +@@ -6376,12 +6376,14 @@ void migrate_enable(void) */ rq = this_rq(); raw_spin_lock_irqsave(&rq->lock, flags); diff --git a/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch b/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch index 7e860afe0..e63c3defb 100644 --- a/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch +++ b/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch @@ -28,7 +28,7 @@ Index: linux-3.2/include/linux/sched.h void *stack; atomic_t usage; unsigned int flags; /* per process flags, defined below */ -@@ -2175,6 +2177,7 @@ extern void xtime_update(unsigned long t +@@ -2174,6 +2176,7 @@ extern void xtime_update(unsigned long t extern int wake_up_state(struct task_struct *tsk, unsigned int state); extern int wake_up_process(struct task_struct *tsk); diff --git a/debian/patches/features/all/rt/sched-teach-migrate_disable-about-atomic-contexts.patch b/debian/patches/features/all/rt/sched-teach-migrate_disable-about-atomic-contexts.patch index ded6e40aa..c996add89 100644 --- a/debian/patches/features/all/rt/sched-teach-migrate_disable-about-atomic-contexts.patch +++ b/debian/patches/features/all/rt/sched-teach-migrate_disable-about-atomic-contexts.patch @@ -55,7 +55,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -6292,6 +6292,17 @@ void migrate_disable(void) +@@ -6307,6 +6307,17 @@ void migrate_disable(void) unsigned long flags; struct rq *rq; @@ -73,7 +73,7 @@ Index: linux-3.2/kernel/sched.c preempt_disable(); if (p->migrate_disable) { p->migrate_disable++; -@@ -6340,6 +6351,16 @@ void migrate_enable(void) +@@ -6355,6 +6366,16 @@ void migrate_enable(void) unsigned long flags; struct rq *rq; diff --git a/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch b/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch index 5649f5aaa..ee320a6be 100644 --- a/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch +++ b/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch @@ -22,7 +22,7 @@ Index: linux-3.2/kernel/sched.c =================================================================== --- linux-3.2.orig/kernel/sched.c +++ linux-3.2/kernel/sched.c -@@ -2839,8 +2839,10 @@ try_to_wake_up(struct task_struct *p, un +@@ -2834,8 +2834,10 @@ try_to_wake_up(struct task_struct *p, un * if the wakeup condition is true. */ if (!(wake_flags & WF_LOCK_SLEEPER)) { diff --git a/debian/patches/features/all/rt/sched-use-schedule-preempt-disabled.patch b/debian/patches/features/all/rt/sched-use-schedule-preempt-disabled.patch index dc766c456..9f97140de 100644 --- a/debian/patches/features/all/rt/sched-use-schedule-preempt-disabled.patch +++ b/debian/patches/features/all/rt/sched-use-schedule-preempt-disabled.patch @@ -40,7 +40,7 @@ Index: linux-3.2/arch/arm/kernel/process.c =================================================================== --- linux-3.2.orig/arch/arm/kernel/process.c +++ linux-3.2/arch/arm/kernel/process.c -@@ -211,9 +211,7 @@ void cpu_idle(void) +@@ -214,9 +214,7 @@ void cpu_idle(void) } leds_event(led_idle_end); tick_nohz_restart_sched_tick(); diff --git a/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch b/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch index 1f453225e..8d9eee6d4 100644 --- a/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch +++ b/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch @@ -3,18 +3,17 @@ From: Thomas Gleixner Date: Sat, 12 Nov 2011 14:00:48 +0100 Signed-off-by: Thomas Gleixner -[bwh: Drop hunk applied in commit 7e1e7ead88dff75b11b86ee0d5232c4591be1326] --- - drivers/scsi/fcoe/fcoe.c | 17 +++++++++-------- + drivers/scsi/fcoe/fcoe.c | 16 ++++++++-------- drivers/scsi/fcoe/fcoe_ctlr.c | 4 ++-- drivers/scsi/libfc/fc_exch.c | 4 ++-- - 3 files changed, 13 insertions(+), 12 deletions(-) + 3 files changed, 12 insertions(+), 12 deletions(-) Index: linux-3.2/drivers/scsi/fcoe/fcoe.c =================================================================== --- linux-3.2.orig/drivers/scsi/fcoe/fcoe.c +++ linux-3.2/drivers/scsi/fcoe/fcoe.c -@@ -1147,7 +1147,7 @@ static void fcoe_percpu_thread_destroy(u +@@ -1156,7 +1156,7 @@ static void fcoe_percpu_thread_destroy(u struct sk_buff *skb; #ifdef CONFIG_SMP struct fcoe_percpu_s *p0; @@ -23,7 +22,7 @@ Index: linux-3.2/drivers/scsi/fcoe/fcoe.c #endif /* CONFIG_SMP */ FCOE_DBG("Destroying receive thread for CPU %d\n", cpu); -@@ -1203,7 +1203,7 @@ static void fcoe_percpu_thread_destroy(u +@@ -1212,7 +1212,7 @@ static void fcoe_percpu_thread_destroy(u kfree_skb(skb); spin_unlock_bh(&p->fcoe_rx_list.lock); } @@ -32,7 +31,7 @@ Index: linux-3.2/drivers/scsi/fcoe/fcoe.c #else /* * This a non-SMP scenario where the singular Rx thread is -@@ -1426,11 +1426,11 @@ err2: +@@ -1435,11 +1435,11 @@ err2: static int fcoe_alloc_paged_crc_eof(struct sk_buff *skb, int tlen) { struct fcoe_percpu_s *fps; @@ -47,7 +46,7 @@ Index: linux-3.2/drivers/scsi/fcoe/fcoe.c return rc; } -@@ -1668,7 +1669,7 @@ static void fcoe_recv_frame(struct sk_bu +@@ -1680,7 +1680,7 @@ static void fcoe_recv_frame(struct sk_bu */ hp = (struct fcoe_hdr *) skb_network_header(skb); @@ -56,7 +55,7 @@ Index: linux-3.2/drivers/scsi/fcoe/fcoe.c if (unlikely(FC_FCOE_DECAPS_VER(hp) != FC_FCOE_VER)) { if (stats->ErrorFrames < 5) printk(KERN_WARNING "fcoe: FCoE version " -@@ -1700,13 +1701,13 @@ static void fcoe_recv_frame(struct sk_bu +@@ -1712,13 +1712,13 @@ static void fcoe_recv_frame(struct sk_bu goto drop; if (!fcoe_filter_frames(lport, fp)) { @@ -76,7 +75,7 @@ Index: linux-3.2/drivers/scsi/fcoe/fcoe_ctlr.c =================================================================== --- linux-3.2.orig/drivers/scsi/fcoe/fcoe_ctlr.c +++ linux-3.2/drivers/scsi/fcoe/fcoe_ctlr.c -@@ -716,7 +716,7 @@ static unsigned long fcoe_ctlr_age_fcfs( +@@ -719,7 +719,7 @@ static unsigned long fcoe_ctlr_age_fcfs( unsigned long sel_time = 0; struct fcoe_dev_stats *stats; @@ -85,7 +84,7 @@ Index: linux-3.2/drivers/scsi/fcoe/fcoe_ctlr.c list_for_each_entry_safe(fcf, next, &fip->fcfs, list) { deadline = fcf->time + fcf->fka_period + fcf->fka_period / 2; -@@ -749,7 +749,7 @@ static unsigned long fcoe_ctlr_age_fcfs( +@@ -752,7 +752,7 @@ static unsigned long fcoe_ctlr_age_fcfs( sel_time = fcf->time; } } diff --git a/debian/patches/features/all/rt/series b/debian/patches/features/all/rt/series index 7d7b9a23c..6cfedc6ea 100644 --- a/debian/patches/features/all/rt/series +++ b/debian/patches/features/all/rt/series @@ -1,9 +1,9 @@ ########################################################### -# DELTA against a known Linus release (3.0.4) +# DELTA against a known Linus release (3.2.5) ########################################################### ############################################################ -# UPSTREAM changes queued for 3.2 or in 3.1 +# UPSTREAM changes queued for 3.3 or 3.2 ############################################################ x86_64-patch-for-idle-notifiers.patch re-possible-slab-deadlock-while-doing-ifenslave-1.patch @@ -16,7 +16,8 @@ re-possible-slab-deadlock-while-doing-ifenslave-1.patch # rtc-deal-with-errors-correctly.patch -- 3.0.1 # rtc-fix-hrtimer-deadlock.patch -- 3.0.1 # rtc-limit-frequency.patch -- 3.0.1 - +genirq-unmask-oneshot-irqs-when-thread-is-not-woken.patch +genirq-handle-pending-irqs-in-irq-startup.patch # Some variant of this is in 3.1 @@ -122,6 +123,7 @@ sched-use-schedule-preempt-disabled.patch signals-do-not-wake-self.patch posix-timers-no-broadcast.patch signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch +oleg-signal-rt-fix.patch # SCHED @@ -185,6 +187,7 @@ softirq-split-out-code.patch # X86 x86-io-apic-migra-no-unmask.patch x86-32-fix-signal-crap.patch +fix-rt-int3-x86_32-3.2-rt.patch # RCU rcu-reduce-lock-section.patch @@ -353,6 +356,7 @@ hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch peter_zijlstra-frob-hrtimer.patch hrtimer-add-missing-debug_activate-aid-was-re-announce-3-0-6-rt17.patch hrtimer-fix-reprogram-madness.patch +timer-fd-avoid-live-lock.patch # POSIX-CPU-TIMERS posix-timers-thread-posix-cpu-timers-on-rt.patch @@ -422,8 +426,8 @@ harirq-h-define-softirq_count-as-oul-to-kill-build-warning.patch softirq-fix-unplug-deadlock.patch softirq-disable-softirq-stacks-for-rt.patch softirq-make-fifo.patch - tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch +irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch # LOCAL VARS and GETCPU STUFF local-vars-migrate-disable.patch @@ -436,6 +440,7 @@ rtmutex-lock-killable.patch # FUTEX/RTMUTEX rtmutex-futex-prepare-rt.patch +futex-requeue-pi-fix.patch # RTMUTEX rt-mutex-add-sleeping-spinlocks-support.patch diff --git a/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch index a927683b7..510b16b5c 100644 --- a/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch +++ b/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch @@ -56,7 +56,7 @@ Index: linux-3.2/kernel/fork.c =================================================================== --- linux-3.2.orig/kernel/fork.c +++ linux-3.2/kernel/fork.c -@@ -1136,6 +1136,7 @@ static struct task_struct *copy_process( +@@ -1131,6 +1131,7 @@ static struct task_struct *copy_process( spin_lock_init(&p->alloc_lock); init_sigpending(&p->pending); diff --git a/debian/patches/features/all/rt/skbufhead-raw-lock.patch b/debian/patches/features/all/rt/skbufhead-raw-lock.patch index 30ee00cb4..b0816a5e6 100644 --- a/debian/patches/features/all/rt/skbufhead-raw-lock.patch +++ b/debian/patches/features/all/rt/skbufhead-raw-lock.patch @@ -67,7 +67,7 @@ Index: linux-3.2/net/core/dev.c #endif } -@@ -3406,7 +3406,7 @@ static void flush_backlog(void *arg) +@@ -3407,7 +3407,7 @@ static void flush_backlog(void *arg) skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) { if (skb->dev == dev) { __skb_unlink(skb, &sd->input_pkt_queue); @@ -76,7 +76,7 @@ Index: linux-3.2/net/core/dev.c input_queue_head_incr(sd); } } -@@ -3415,10 +3415,13 @@ static void flush_backlog(void *arg) +@@ -3416,10 +3416,13 @@ static void flush_backlog(void *arg) skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev == dev) { __skb_unlink(skb, &sd->process_queue); @@ -91,7 +91,7 @@ Index: linux-3.2/net/core/dev.c } static int napi_gro_complete(struct sk_buff *skb) -@@ -3895,10 +3898,17 @@ static void net_rx_action(struct softirq +@@ -3896,10 +3899,17 @@ static void net_rx_action(struct softirq struct softnet_data *sd = &__get_cpu_var(softnet_data); unsigned long time_limit = jiffies + 2; int budget = netdev_budget; @@ -109,7 +109,7 @@ Index: linux-3.2/net/core/dev.c while (!list_empty(&sd->poll_list)) { struct napi_struct *n; int work, weight; -@@ -6358,6 +6368,9 @@ static int dev_cpu_callback(struct notif +@@ -6365,6 +6375,9 @@ static int dev_cpu_callback(struct notif netif_rx(skb); input_queue_head_incr(oldsd); } @@ -119,7 +119,7 @@ Index: linux-3.2/net/core/dev.c return NOTIFY_OK; } -@@ -6624,8 +6637,9 @@ static int __init net_dev_init(void) +@@ -6631,8 +6644,9 @@ static int __init net_dev_init(void) struct softnet_data *sd = &per_cpu(softnet_data, i); memset(sd, 0, sizeof(*sd)); diff --git a/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch b/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch index 5c81be77e..8c5b87b7d 100644 --- a/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch +++ b/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch @@ -160,7 +160,7 @@ Index: linux-3.2/arch/x86/kernel/irq_64.c =================================================================== --- linux-3.2.orig/arch/x86/kernel/irq_64.c +++ linux-3.2/arch/x86/kernel/irq_64.c -@@ -62,7 +62,7 @@ bool handle_irq(unsigned irq, struct pt_ +@@ -65,7 +65,7 @@ bool handle_irq(unsigned irq, struct pt_ return true; } @@ -169,7 +169,7 @@ Index: linux-3.2/arch/x86/kernel/irq_64.c extern void call_softirq(void); asmlinkage void do_softirq(void) -@@ -82,3 +82,4 @@ asmlinkage void do_softirq(void) +@@ -85,3 +85,4 @@ asmlinkage void do_softirq(void) } local_irq_restore(flags); } diff --git a/debian/patches/features/all/rt/softirq-fix-unplug-deadlock.patch b/debian/patches/features/all/rt/softirq-fix-unplug-deadlock.patch index 0230ad684..986a5605b 100644 --- a/debian/patches/features/all/rt/softirq-fix-unplug-deadlock.patch +++ b/debian/patches/features/all/rt/softirq-fix-unplug-deadlock.patch @@ -34,7 +34,7 @@ Index: linux-3.2/kernel/softirq.c =================================================================== --- linux-3.2.orig/kernel/softirq.c +++ linux-3.2/kernel/softirq.c -@@ -1085,9 +1085,8 @@ static int __cpuinit cpu_callback(struct +@@ -1086,9 +1086,8 @@ static int __cpuinit cpu_callback(struct int hotcpu = (unsigned long)hcpu; struct task_struct *p; @@ -45,7 +45,7 @@ Index: linux-3.2/kernel/softirq.c p = kthread_create_on_node(run_ksoftirqd, hcpu, cpu_to_node(hotcpu), -@@ -1100,19 +1099,16 @@ static int __cpuinit cpu_callback(struct +@@ -1101,19 +1100,16 @@ static int __cpuinit cpu_callback(struct per_cpu(ksoftirqd, hotcpu) = p; break; case CPU_ONLINE: diff --git a/debian/patches/features/all/rt/softirq-local-lock.patch b/debian/patches/features/all/rt/softirq-local-lock.patch index d1eb4fa6a..1c070e50a 100644 --- a/debian/patches/features/all/rt/softirq-local-lock.patch +++ b/debian/patches/features/all/rt/softirq-local-lock.patch @@ -89,7 +89,7 @@ Index: linux-3.2/include/linux/sched.h =================================================================== --- linux-3.2.orig/include/linux/sched.h +++ linux-3.2/include/linux/sched.h -@@ -1598,6 +1598,7 @@ struct task_struct { +@@ -1597,6 +1597,7 @@ struct task_struct { #endif #ifdef CONFIG_PREEMPT_RT_BASE struct rcu_head put_rcu; diff --git a/debian/patches/features/all/rt/softirq-make-fifo.patch b/debian/patches/features/all/rt/softirq-make-fifo.patch index 8760dbf72..a11cb407a 100644 --- a/debian/patches/features/all/rt/softirq-make-fifo.patch +++ b/debian/patches/features/all/rt/softirq-make-fifo.patch @@ -20,7 +20,7 @@ Index: linux-3.2/kernel/softirq.c #else /* !PREEMPT_RT_FULL */ -@@ -525,6 +527,20 @@ static int ksoftirqd_do_softirq(int cpu) +@@ -526,6 +528,20 @@ static int ksoftirqd_do_softirq(int cpu) static inline void local_bh_disable_nort(void) { } static inline void _local_bh_enable_nort(void) { } @@ -41,7 +41,7 @@ Index: linux-3.2/kernel/softirq.c #endif /* PREEMPT_RT_FULL */ /* * Enter an interrupt context. -@@ -984,6 +1000,8 @@ void __init softirq_init(void) +@@ -985,6 +1001,8 @@ void __init softirq_init(void) static int run_ksoftirqd(void * __bind_cpu) { @@ -50,7 +50,7 @@ Index: linux-3.2/kernel/softirq.c set_current_state(TASK_INTERRUPTIBLE); while (!kthread_should_stop()) { -@@ -1009,6 +1027,7 @@ static int run_ksoftirqd(void * __bind_c +@@ -1010,6 +1028,7 @@ static int run_ksoftirqd(void * __bind_c wait_to_die: preempt_enable(); diff --git a/debian/patches/features/all/rt/softirq-thread-do-softirq.patch b/debian/patches/features/all/rt/softirq-thread-do-softirq.patch index b035a7d1a..a82b4954c 100644 --- a/debian/patches/features/all/rt/softirq-thread-do-softirq.patch +++ b/debian/patches/features/all/rt/softirq-thread-do-softirq.patch @@ -25,7 +25,7 @@ Index: linux-3.2/net/core/dev.c =================================================================== --- linux-3.2.orig/net/core/dev.c +++ linux-3.2/net/core/dev.c -@@ -3036,7 +3036,7 @@ int netif_rx_ni(struct sk_buff *skb) +@@ -3037,7 +3037,7 @@ int netif_rx_ni(struct sk_buff *skb) preempt_disable(); err = netif_rx(skb); if (local_softirq_pending()) diff --git a/debian/patches/features/all/rt/stomp-machine-mark-stomper-thread.patch b/debian/patches/features/all/rt/stomp-machine-mark-stomper-thread.patch index dd8a59d05..31ed43b85 100644 --- a/debian/patches/features/all/rt/stomp-machine-mark-stomper-thread.patch +++ b/debian/patches/features/all/rt/stomp-machine-mark-stomper-thread.patch @@ -12,7 +12,7 @@ Index: linux-3.2/include/linux/sched.h =================================================================== --- linux-3.2.orig/include/linux/sched.h +++ linux-3.2/include/linux/sched.h -@@ -1819,6 +1819,7 @@ extern void thread_group_times(struct ta +@@ -1818,6 +1818,7 @@ extern void thread_group_times(struct ta #define PF_FROZEN 0x00010000 /* frozen for system suspend */ #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ #define PF_KSWAPD 0x00040000 /* I am kswapd */ diff --git a/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch b/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch index 739ab4130..46d96a272 100644 --- a/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch +++ b/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch @@ -40,7 +40,7 @@ Index: linux-3.2/kernel/power/hibernate.c =================================================================== --- linux-3.2.orig/kernel/power/hibernate.c +++ linux-3.2/kernel/power/hibernate.c -@@ -282,6 +282,8 @@ static int create_image(int platform_mod +@@ -284,6 +284,8 @@ static int create_image(int platform_mod local_irq_disable(); @@ -49,7 +49,7 @@ Index: linux-3.2/kernel/power/hibernate.c error = syscore_suspend(); if (error) { printk(KERN_ERR "PM: Some system devices failed to power down, " -@@ -309,6 +311,7 @@ static int create_image(int platform_mod +@@ -311,6 +313,7 @@ static int create_image(int platform_mod syscore_resume(); Enable_irqs: @@ -57,7 +57,7 @@ Index: linux-3.2/kernel/power/hibernate.c local_irq_enable(); Enable_cpus: -@@ -420,6 +423,7 @@ static int resume_target_kernel(bool pla +@@ -437,6 +440,7 @@ static int resume_target_kernel(bool pla goto Enable_cpus; local_irq_disable(); @@ -65,7 +65,7 @@ Index: linux-3.2/kernel/power/hibernate.c error = syscore_suspend(); if (error) -@@ -453,6 +457,7 @@ static int resume_target_kernel(bool pla +@@ -470,6 +474,7 @@ static int resume_target_kernel(bool pla syscore_resume(); Enable_irqs: @@ -73,7 +73,7 @@ Index: linux-3.2/kernel/power/hibernate.c local_irq_enable(); Enable_cpus: -@@ -532,6 +537,7 @@ int hibernation_platform_enter(void) +@@ -549,6 +554,7 @@ int hibernation_platform_enter(void) goto Platform_finish; local_irq_disable(); @@ -81,7 +81,7 @@ Index: linux-3.2/kernel/power/hibernate.c syscore_suspend(); if (pm_wakeup_pending()) { error = -EAGAIN; -@@ -544,6 +550,7 @@ int hibernation_platform_enter(void) +@@ -561,6 +567,7 @@ int hibernation_platform_enter(void) Power_up: syscore_resume(); diff --git a/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch b/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch index dff74b528..475ef02b0 100644 --- a/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch +++ b/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch @@ -132,7 +132,7 @@ Index: linux-3.2/kernel/softirq.c #include #include #include -@@ -670,15 +671,45 @@ struct tasklet_head +@@ -664,15 +665,45 @@ struct tasklet_head static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec); static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec); @@ -182,7 +182,7 @@ Index: linux-3.2/kernel/softirq.c local_irq_restore(flags); } -@@ -689,10 +720,7 @@ void __tasklet_hi_schedule(struct taskle +@@ -683,10 +714,7 @@ void __tasklet_hi_schedule(struct taskle unsigned long flags; local_irq_save(flags); @@ -194,7 +194,7 @@ Index: linux-3.2/kernel/softirq.c local_irq_restore(flags); } -@@ -700,50 +728,119 @@ EXPORT_SYMBOL(__tasklet_hi_schedule); +@@ -694,50 +722,119 @@ EXPORT_SYMBOL(__tasklet_hi_schedule); void __tasklet_hi_schedule_first(struct tasklet_struct *t) { @@ -340,7 +340,7 @@ Index: linux-3.2/kernel/softirq.c static void tasklet_hi_action(struct softirq_action *a) { struct tasklet_struct *list; -@@ -754,29 +851,7 @@ static void tasklet_hi_action(struct sof +@@ -748,29 +845,7 @@ static void tasklet_hi_action(struct sof __this_cpu_write(tasklet_hi_vec.tail, &__get_cpu_var(tasklet_hi_vec).head); local_irq_enable(); @@ -371,7 +371,7 @@ Index: linux-3.2/kernel/softirq.c } -@@ -799,7 +874,7 @@ void tasklet_kill(struct tasklet_struct +@@ -793,7 +868,7 @@ void tasklet_kill(struct tasklet_struct while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { do { @@ -380,7 +380,7 @@ Index: linux-3.2/kernel/softirq.c } while (test_bit(TASKLET_STATE_SCHED, &t->state)); } tasklet_unlock_wait(t); -@@ -1005,6 +1080,23 @@ void __init softirq_init(void) +@@ -999,6 +1074,23 @@ void __init softirq_init(void) open_softirq(HI_SOFTIRQ, tasklet_hi_action); } diff --git a/debian/patches/features/all/rt/timekeeping-covert-xtimelock.patch b/debian/patches/features/all/rt/timekeeping-covert-xtimelock.patch index 3af6e80a6..60de1120a 100644 --- a/debian/patches/features/all/rt/timekeeping-covert-xtimelock.patch +++ b/debian/patches/features/all/rt/timekeeping-covert-xtimelock.patch @@ -261,7 +261,7 @@ Index: linux-3.2/kernel/time/timekeeping.c /* * The current time -@@ -361,7 +360,7 @@ int do_settimeofday(const struct timespe +@@ -365,7 +364,7 @@ int do_settimeofday(const struct timespe if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) return -EINVAL; @@ -270,7 +270,7 @@ Index: linux-3.2/kernel/time/timekeeping.c timekeeping_forward_now(); -@@ -377,7 +376,7 @@ int do_settimeofday(const struct timespe +@@ -381,7 +380,7 @@ int do_settimeofday(const struct timespe update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, timekeeper.mult); @@ -279,7 +279,7 @@ Index: linux-3.2/kernel/time/timekeeping.c /* signal hrtimers about time change */ clock_was_set(); -@@ -401,7 +400,7 @@ int timekeeping_inject_offset(struct tim +@@ -405,7 +404,7 @@ int timekeeping_inject_offset(struct tim if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC) return -EINVAL; @@ -288,7 +288,7 @@ Index: linux-3.2/kernel/time/timekeeping.c timekeeping_forward_now(); -@@ -414,7 +413,7 @@ int timekeeping_inject_offset(struct tim +@@ -418,7 +417,7 @@ int timekeeping_inject_offset(struct tim update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, timekeeper.mult); @@ -297,7 +297,7 @@ Index: linux-3.2/kernel/time/timekeeping.c /* signal hrtimers about time change */ clock_was_set(); -@@ -568,7 +567,7 @@ void __init timekeeping_init(void) +@@ -572,7 +571,7 @@ void __init timekeeping_init(void) read_persistent_clock(&now); read_boot_clock(&boot); @@ -306,7 +306,7 @@ Index: linux-3.2/kernel/time/timekeeping.c ntp_init(); -@@ -589,7 +588,7 @@ void __init timekeeping_init(void) +@@ -593,7 +592,7 @@ void __init timekeeping_init(void) -boot.tv_sec, -boot.tv_nsec); total_sleep_time.tv_sec = 0; total_sleep_time.tv_nsec = 0; @@ -315,7 +315,7 @@ Index: linux-3.2/kernel/time/timekeeping.c } /* time in seconds when suspend began */ -@@ -636,7 +635,7 @@ void timekeeping_inject_sleeptime(struct +@@ -640,7 +639,7 @@ void timekeeping_inject_sleeptime(struct if (!(ts.tv_sec == 0 && ts.tv_nsec == 0)) return; @@ -324,7 +324,7 @@ Index: linux-3.2/kernel/time/timekeeping.c timekeeping_forward_now(); __timekeeping_inject_sleeptime(delta); -@@ -646,7 +645,7 @@ void timekeeping_inject_sleeptime(struct +@@ -650,7 +649,7 @@ void timekeeping_inject_sleeptime(struct update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, timekeeper.mult); @@ -333,7 +333,7 @@ Index: linux-3.2/kernel/time/timekeeping.c /* signal hrtimers about time change */ clock_was_set(); -@@ -669,7 +668,7 @@ static void timekeeping_resume(void) +@@ -673,7 +672,7 @@ static void timekeeping_resume(void) clocksource_resume(); @@ -342,7 +342,7 @@ Index: linux-3.2/kernel/time/timekeeping.c if (timespec_compare(&ts, &timekeeping_suspend_time) > 0) { ts = timespec_sub(ts, timekeeping_suspend_time); -@@ -679,7 +678,7 @@ static void timekeeping_resume(void) +@@ -683,7 +682,7 @@ static void timekeeping_resume(void) timekeeper.clock->cycle_last = timekeeper.clock->read(timekeeper.clock); timekeeper.ntp_error = 0; timekeeping_suspended = 0; @@ -351,7 +351,7 @@ Index: linux-3.2/kernel/time/timekeeping.c touch_softlockup_watchdog(); -@@ -697,7 +696,7 @@ static int timekeeping_suspend(void) +@@ -701,7 +700,7 @@ static int timekeeping_suspend(void) read_persistent_clock(&timekeeping_suspend_time); @@ -360,7 +360,7 @@ Index: linux-3.2/kernel/time/timekeeping.c timekeeping_forward_now(); timekeeping_suspended = 1; -@@ -720,7 +719,7 @@ static int timekeeping_suspend(void) +@@ -724,7 +723,7 @@ static int timekeeping_suspend(void) timekeeping_suspend_time = timespec_add(timekeeping_suspend_time, delta_delta); } @@ -369,7 +369,7 @@ Index: linux-3.2/kernel/time/timekeeping.c clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL); clocksource_suspend(); -@@ -1149,7 +1148,7 @@ ktime_t ktime_get_monotonic_offset(void) +@@ -1239,7 +1238,7 @@ ktime_t ktime_get_monotonic_offset(void) */ void xtime_update(unsigned long ticks) { diff --git a/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch b/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch new file mode 100644 index 000000000..e53edfa50 --- /dev/null +++ b/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch @@ -0,0 +1,29 @@ +Subject: timer-fd: Prevent live lock +From: Thomas Gleixner +Date: Wed, 25 Jan 2012 11:08:40 +0100 + +If hrtimer_try_to_cancel() requires a retry, then depending on the +priority setting te retry loop might prevent timer callback completion +on RT. Prevent that by waiting for completion on RT, no change for a +non RT kernel. + +Reported-by: Sankara Muthukrishnan +Signed-off-by: Thomas Gleixner +Cc: stable-rt@vger.kernel.org +--- + fs/timerfd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: linux-3.2/fs/timerfd.c +=================================================================== +--- linux-3.2.orig/fs/timerfd.c ++++ linux-3.2/fs/timerfd.c +@@ -313,7 +313,7 @@ SYSCALL_DEFINE4(timerfd_settime, int, uf + if (hrtimer_try_to_cancel(&ctx->tmr) >= 0) + break; + spin_unlock_irq(&ctx->wqh.lock); +- cpu_relax(); ++ hrtimer_wait_for_timer(&ctx->tmr); + } + + /* diff --git a/debian/patches/features/all/rt/tty-use-local-irq-nort.patch b/debian/patches/features/all/rt/tty-use-local-irq-nort.patch index 328d269c9..46e53784f 100644 --- a/debian/patches/features/all/rt/tty-use-local-irq-nort.patch +++ b/debian/patches/features/all/rt/tty-use-local-irq-nort.patch @@ -29,7 +29,7 @@ Index: linux-3.2/drivers/tty/tty_ldisc.c =================================================================== --- linux-3.2.orig/drivers/tty/tty_ldisc.c +++ linux-3.2/drivers/tty/tty_ldisc.c -@@ -70,7 +70,7 @@ static void put_ldisc(struct tty_ldisc * +@@ -71,7 +71,7 @@ static void put_ldisc(struct tty_ldisc * * We really want an "atomic_dec_and_lock_irqsave()", * but we don't have it, so this does it by hand. */ @@ -38,7 +38,7 @@ Index: linux-3.2/drivers/tty/tty_ldisc.c if (atomic_dec_and_lock(&ld->users, &tty_ldisc_lock)) { struct tty_ldisc_ops *ldo = ld->ops; -@@ -81,7 +81,7 @@ static void put_ldisc(struct tty_ldisc * +@@ -82,7 +82,7 @@ static void put_ldisc(struct tty_ldisc * kfree(ld); return; } diff --git a/debian/patches/features/all/rt/usb-fix-mouse-problem-copying-large-data.patch b/debian/patches/features/all/rt/usb-fix-mouse-problem-copying-large-data.patch index 95fb4ea2e..36591d0d0 100644 --- a/debian/patches/features/all/rt/usb-fix-mouse-problem-copying-large-data.patch +++ b/debian/patches/features/all/rt/usb-fix-mouse-problem-copying-large-data.patch @@ -19,7 +19,7 @@ Index: linux-3.2/drivers/usb/host/ohci-hcd.c =================================================================== --- linux-3.2.orig/drivers/usb/host/ohci-hcd.c +++ linux-3.2/drivers/usb/host/ohci-hcd.c -@@ -833,9 +833,13 @@ static irqreturn_t ohci_irq (struct usb_ +@@ -830,9 +830,13 @@ static irqreturn_t ohci_irq (struct usb_ } if (ints & OHCI_INTR_WDH) { diff --git a/debian/patches/features/all/rt/wait-provide-__wake_up_all_locked.patch b/debian/patches/features/all/rt/wait-provide-__wake_up_all_locked.patch index 7e6920695..c3c2c67fe 100644 --- a/debian/patches/features/all/rt/wait-provide-__wake_up_all_locked.patch +++ b/debian/patches/features/all/rt/wait-provide-__wake_up_all_locked.patch @@ -8,10 +8,15 @@ __wake_up_all_locked. Signed-off-by: Thomas Gleixner Cc: stable-rt@vger.kernel.org -Index: linux-rt/include/linux/wait.h +--- + include/linux/wait.h | 5 +++-- + kernel/sched.c | 4 ++-- + 2 files changed, 5 insertions(+), 4 deletions(-) + +Index: linux-3.2/include/linux/wait.h =================================================================== ---- linux-rt.orig/include/linux/wait.h -+++ linux-rt/include/linux/wait.h +--- linux-3.2.orig/include/linux/wait.h ++++ linux-3.2/include/linux/wait.h @@ -157,7 +157,7 @@ void __wake_up(wait_queue_head_t *q, uns void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key); void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, @@ -31,11 +36,11 @@ Index: linux-rt/include/linux/wait.h #define wake_up_interruptible(x) __wake_up(x, TASK_INTERRUPTIBLE, 1, NULL) #define wake_up_interruptible_nr(x, nr) __wake_up(x, TASK_INTERRUPTIBLE, nr, NULL) -Index: linux-rt/kernel/sched.c +Index: linux-3.2/kernel/sched.c =================================================================== ---- linux-rt.orig/kernel/sched.c -+++ linux-rt/kernel/sched.c -@@ -4643,9 +4643,9 @@ EXPORT_SYMBOL(__wake_up); +--- linux-3.2.orig/kernel/sched.c ++++ linux-3.2/kernel/sched.c +@@ -4637,9 +4637,9 @@ EXPORT_SYMBOL(__wake_up); /* * Same as __wake_up but called with the spinlock in wait_queue_head_t held. */ diff --git a/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch b/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch index 8b1999c4d..429ebcba5 100644 --- a/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch +++ b/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch @@ -16,7 +16,7 @@ Index: linux-3.2/arch/x86/kernel/apic/io_apic.c =================================================================== --- linux-3.2.orig/arch/x86/kernel/apic/io_apic.c +++ linux-3.2/arch/x86/kernel/apic/io_apic.c -@@ -2518,7 +2518,8 @@ static void ack_apic_level(struct irq_da +@@ -2521,7 +2521,8 @@ static void ack_apic_level(struct irq_da irq_complete_move(cfg); #ifdef CONFIG_GENERIC_PENDING_IRQ /* If we are moving the irq we need to mask it */ diff --git a/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch b/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch index 087e6ffc3..9356ec750 100644 --- a/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch +++ b/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch @@ -11,7 +11,7 @@ Index: linux-3.2/arch/x86/kvm/x86.c =================================================================== --- linux-3.2.orig/arch/x86/kvm/x86.c +++ linux-3.2/arch/x86/kvm/x86.c -@@ -5185,6 +5185,13 @@ int kvm_arch_init(void *opaque) +@@ -5184,6 +5184,13 @@ int kvm_arch_init(void *opaque) goto out; } diff --git a/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch b/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch index 0dedad739..bc772acd4 100644 --- a/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch +++ b/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch @@ -103,7 +103,7 @@ Index: linux-3.2/arch/x86/kernel/cpu/mcheck/mce.c } /* Handle unconfigured int18 (should never happen) */ -@@ -2004,6 +2005,8 @@ static void __cpuinit mce_disable_cpu(vo +@@ -2023,6 +2024,8 @@ static void __cpuinit mce_disable_cpu(vo if (!mce_available(__this_cpu_ptr(&cpu_info))) return; @@ -112,7 +112,7 @@ Index: linux-3.2/arch/x86/kernel/cpu/mcheck/mce.c if (!(action & CPU_TASKS_FROZEN)) cmci_clear(); for (i = 0; i < banks; i++) { -@@ -2030,6 +2033,7 @@ static void __cpuinit mce_reenable_cpu(v +@@ -2049,6 +2052,7 @@ static void __cpuinit mce_reenable_cpu(v if (b->init) wrmsrl(MSR_IA32_MCx_CTL(i), b->ctl); } @@ -120,7 +120,7 @@ Index: linux-3.2/arch/x86/kernel/cpu/mcheck/mce.c } /* Get notified when a cpu comes on/off. Be hotplug friendly. */ -@@ -2037,7 +2041,6 @@ static int __cpuinit +@@ -2056,7 +2060,6 @@ static int __cpuinit mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; @@ -128,7 +128,7 @@ Index: linux-3.2/arch/x86/kernel/cpu/mcheck/mce.c switch (action) { case CPU_ONLINE: -@@ -2054,16 +2057,10 @@ mce_cpu_callback(struct notifier_block * +@@ -2073,16 +2076,10 @@ mce_cpu_callback(struct notifier_block * break; case CPU_DOWN_PREPARE: case CPU_DOWN_PREPARE_FROZEN: diff --git a/debian/patches/features/all/rt/x86_64-patch-for-idle-notifiers.patch b/debian/patches/features/all/rt/x86_64-patch-for-idle-notifiers.patch index d17d05749..999311bbe 100644 --- a/debian/patches/features/all/rt/x86_64-patch-for-idle-notifiers.patch +++ b/debian/patches/features/all/rt/x86_64-patch-for-idle-notifiers.patch @@ -51,7 +51,7 @@ Index: linux-3.2/arch/x86/kernel/apic/apic.c =================================================================== --- linux-3.2.orig/arch/x86/kernel/apic/apic.c +++ linux-3.2/arch/x86/kernel/apic/apic.c -@@ -857,8 +857,8 @@ void __irq_entry smp_apic_timer_interrup +@@ -876,8 +876,8 @@ void __irq_entry smp_apic_timer_interrup * Besides, if we don't timer interrupts ignore the global * interrupt lock, which is the WrongThing (tm) to do. */ @@ -61,7 +61,7 @@ Index: linux-3.2/arch/x86/kernel/apic/apic.c local_apic_timer_interrupt(); irq_exit(); -@@ -1790,8 +1790,8 @@ void smp_spurious_interrupt(struct pt_re +@@ -1809,8 +1809,8 @@ void smp_spurious_interrupt(struct pt_re { u32 v; @@ -71,7 +71,7 @@ Index: linux-3.2/arch/x86/kernel/apic/apic.c /* * Check if this really is a spurious interrupt and ACK it * if it is a vectored one. Just in case... -@@ -1827,8 +1827,8 @@ void smp_error_interrupt(struct pt_regs +@@ -1846,8 +1846,8 @@ void smp_error_interrupt(struct pt_regs "Illegal register address", /* APIC Error Bit 7 */ }; @@ -85,7 +85,7 @@ Index: linux-3.2/arch/x86/kernel/apic/io_apic.c =================================================================== --- linux-3.2.orig/arch/x86/kernel/apic/io_apic.c +++ linux-3.2/arch/x86/kernel/apic/io_apic.c -@@ -2418,8 +2418,8 @@ asmlinkage void smp_irq_move_cleanup_int +@@ -2421,8 +2421,8 @@ asmlinkage void smp_irq_move_cleanup_int unsigned vector, me; ack_APIC_irq(); diff --git a/debian/patches/series/base-extra b/debian/patches/series/base-extra index 696c9d28c..f922af93f 100644 --- a/debian/patches/series/base-extra +++ b/debian/patches/series/base-extra @@ -1,5 +1,7 @@ + features/all/rt/x86_64-patch-for-idle-notifiers.patch featureset=rt + features/all/rt/re-possible-slab-deadlock-while-doing-ifenslave-1.patch featureset=rt ++ features/all/rt/genirq-unmask-oneshot-irqs-when-thread-is-not-woken.patch featureset=rt ++ features/all/rt/genirq-handle-pending-irqs-in-irq-startup.patch featureset=rt + features/all/rt/x86-kprobes-remove-bogus-preempt-enable.patch featureset=rt + features/all/rt/x86-hpet-disable-msi-on-lenovo-w510.patch featureset=rt + features/all/rt/block-shorten-interrupt-disabled-regions.patch featureset=rt @@ -24,6 +26,7 @@ + features/all/rt/signals-do-not-wake-self.patch featureset=rt + features/all/rt/posix-timers-no-broadcast.patch featureset=rt + features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch featureset=rt ++ features/all/rt/oleg-signal-rt-fix.patch featureset=rt + features/all/rt/generic-cmpxchg-use-raw-local-irq.patch featureset=rt + features/all/rt/drivers-random-reduce-preempt-disabled-region.patch featureset=rt + features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch featureset=rt @@ -53,6 +56,7 @@ + features/all/rt/softirq-split-out-code.patch featureset=rt + features/all/rt/x86-io-apic-migra-no-unmask.patch featureset=rt + features/all/rt/x86-32-fix-signal-crap.patch featureset=rt ++ features/all/rt/fix-rt-int3-x86_32-3.2-rt.patch featureset=rt + features/all/rt/rcu-reduce-lock-section.patch featureset=rt + features/all/rt/locking-various-init-fixes.patch featureset=rt + features/all/rt/seqlock-remove-unused-functions.patch featureset=rt @@ -129,6 +133,7 @@ + features/all/rt/peter_zijlstra-frob-hrtimer.patch featureset=rt + features/all/rt/hrtimer-add-missing-debug_activate-aid-was-re-announce-3-0-6-rt17.patch featureset=rt + features/all/rt/hrtimer-fix-reprogram-madness.patch featureset=rt ++ features/all/rt/timer-fd-avoid-live-lock.patch featureset=rt + features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch featureset=rt + features/all/rt/posix-timers-shorten-cpu-timers-thread.patch featureset=rt + features/all/rt/posix-timers-avoid-wakeups-when-no-timers-are-active.patch featureset=rt @@ -179,10 +184,12 @@ + features/all/rt/softirq-disable-softirq-stacks-for-rt.patch featureset=rt + features/all/rt/softirq-make-fifo.patch featureset=rt + features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch featureset=rt ++ features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch featureset=rt + features/all/rt/local-vars-migrate-disable.patch featureset=rt + features/all/rt/md-raid5-percpu-handling-rt-aware.patch featureset=rt + features/all/rt/rtmutex-lock-killable.patch featureset=rt + features/all/rt/rtmutex-futex-prepare-rt.patch featureset=rt ++ features/all/rt/futex-requeue-pi-fix.patch featureset=rt + features/all/rt/rt-mutex-add-sleeping-spinlocks-support.patch featureset=rt + features/all/rt/spinlock-types-separate-raw.patch featureset=rt + features/all/rt/rtmutex-avoid-include-hell.patch featureset=rt