core kernel updates for v2.6.29
Subsystems (15)
Linus,
Please pull the latest core-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git core-for-linus
12 topics were active in this cycle:
core/debug core/debugobjects core/futexes core/iommu core/locking core/printk core/rcu core/resources core/signal core/softirq core/stacktrace core/xen
Notable changes are the RCU-Tree implementation from Paul (which was long in the making, and which is to replace RCU-classic in the next cycle if all goes well), 'speculative' lockdep rules added by Nick to catch might_sleep() bugs, swiotlb extensions to make it available to 32-bit platforms - and more.
[ Note, this tree will generate conflicts if pulled after the x86,
tracing and scheduler trees - i'll follow up with this mail with a conflict resolution commit. ]
Thanks,
Ingo
------------------>
Andrew Morton (1):
lock debug: sit tight when we are already in a panic
Arjan van de Ven (6):
debug: add notifier chain debugging
debug: add notifier chain debugging, v2
mutex: improve header comment to be actually informative about the API debug warnings: consolidate warn_slowpath and warn_on_slowpath debug warnings: print the DMI board info name in a WARN/WARN_ON
resources: skip sanity check of busy resources
Darren Hart (2):
futex: rename field in futex_q to clarify single waiter semantics
futex: clean up futex_(un)lock_pi fault handling
David Brownell (1):
genirq: warn when IRQF_DISABLED may be ignored
Hiroshi Shimamoto (2):
uaccess: fix parameters inversion for __copy_from_user_inatomic()
printk: fix discarding message when recursion_bug
Ian Campbell (7):
swiotlb: move some definitions to header
swiotlb: add comment where we handle the overflow of a dma mask on 32 bit
swiotlb: allow architectures to override phys<->bus<->phys conversions
swiotlb: add arch hook to force mapping
swiotlb: consolidate swiotlb info message printing x86/swiotlb: add default phys<->bus conversion
x86/swiotlb: add default swiotlb_arch_range_needs_mapping
Ingo Molnar (10):
softlockup: increase hung tasks check from 2 minutes to 8 minutes
x86: some lock annotations for user copy paths, v3
Revert "lockdep: fix compilation when CONFIG_TRACE_IRQFLAGS_SUPPORT is not set"
rcu: make rcu-stall debug printout more standard
lockdep: include/linux/lockdep.h - fix warning in net/bluetooth/af_bluetooth.c
lockdep: fix unused function warning in kernel/lockdep.c
debugobjects: add boot parameter default value
debug warnings: eliminate warn_on_slowpath()
rcu: provide RCU options on non-preempt architectures too
stacktrace: provide save_stack_trace_tsk() weak alias
Isaku Yamahata (3):
xen: portability clean up and some minor clean up for xencomm.c
xen: compilation fix fo xen CPU hotplugging
xen: compilation fix of drivers/xen/events.c on IA64
Jeremy Fitzhardinge (7):
xen: don't reload cr3 on suspend
x86: remove unused iommu_nr_pages
swiotlb: allow architectures to override swiotlb pool allocation
swiotlb: factor out copy to/from device
swiotlb: support bouncing of HighMem pages
x86: add swiotlb allocation functions
x86: unify pci iommu setup and allow swiotlb to compile for 32 bit
Liming Wang (1):
softirq: remove useless function __local_bh_enable
Nick Piggin (3):
x86: some lock annotations for user copy paths
x86: some lock annotations for user copy paths, v2
sched: improve preempt debugging
Oleg Nesterov (3):
account_steal_time: kill the unneeded account_group_system_time()
thread_group_cputime: kill the bogus ->signal != NULL check
thread_group_cputime: move a couple of callsites outside of ->siglockPaul E. McKenney (3):
rcu: increase RCU stall-check timeouts
rcu: fix rcutorture behavior during reboot "Tree RCU": scalable classic RCU implementation
Peter Zijlstra (10):
lockstat: documentation update
lockdep: add might_lock() / might_lock_read()
lockstat: fixup signed division
futex: rely on get_user_pages() for shared futexes
futex: reduce mmap_sem usage
futex: use fast_gup()
futex: cleanup fshared
futex: fixup get_futex_key() for private futexes
lockstat: contend with points
lockdep: change a held lock's class
Rui Sousa (2):
lockdep: fix compilation when CONFIG_TRACE_IRQFLAGS_SUPPORT is not set lockdep, UML: fix compilation when CONFIG_TRACE_IRQFLAGS_SUPPORT is not set
Thomas Gleixner (1):
futex: make clock selectable for FUTEX_WAIT_BITSET
Török Edwin (1):
mutex: __used is needed for function referenced only from inline asm
Documentation/RCU/00-INDEX | 2 + Documentation/RCU/trace.txt | 413 +++++++++ Documentation/lockstat.txt | 51 +- arch/powerpc/platforms/pseries/rtasd.c | 4 + arch/um/include/asm/system.h | 14 +- arch/x86/include/asm/dma-mapping.h | 2 +- arch/x86/include/asm/iommu.h | 2 - arch/x86/include/asm/pci.h | 2 + arch/x86/include/asm/pci_64.h | 1 - arch/x86/include/asm/uaccess.h | 2 + arch/x86/include/asm/uaccess_32.h | 8 +- arch/x86/include/asm/uaccess_64.h | 6 + arch/x86/kernel/Makefile | 3 +- arch/x86/kernel/pci-dma.c | 13 +- arch/x86/kernel/pci-swiotlb_64.c | 29 + arch/x86/lib/usercopy_32.c | 8 +- arch/x86/lib/usercopy_64.c | 4 +- arch/x86/mm/init_32.c | 3 + include/asm-generic/bug.h | 7 +- include/linux/bottom_half.h | 1 - include/linux/debug_locks.h | 2 +- include/linux/futex.h | 5 +- include/linux/hardirq.h | 14 +- include/linux/kernel.h | 11 + include/linux/lockdep.h | 43 +- include/linux/mutex.h | 2 + include/linux/rcuclassic.h | 2 +- include/linux/rcupdate.h | 10 +- include/linux/rcutree.h | 329 +++++++ include/linux/swiotlb.h | 22 + include/linux/uaccess.h | 2 +- init/Kconfig | 86 ++- kernel/Kconfig.preempt | 25 - kernel/Makefile | 6 +- kernel/exit.c | 2 +- kernel/extable.c | 16 + kernel/futex.c | 351 +++----- kernel/irq/manage.c | 12 + kernel/lockdep.c | 60 +- kernel/lockdep_proc.c | 28 +- kernel/mutex.c | 10 +- kernel/notifier.c | 8 + kernel/panic.c | 32 +- kernel/posix-cpu-timers.c | 10 +- kernel/printk.c | 2 +- kernel/rcuclassic.c | 4 +- kernel/rcupreempt.c | 10 + kernel/rcupreempt_trace.c | 10 +- kernel/rcutorture.c | 66 ++- kernel/rcutree.c | 1535 ++++++++++++++++++++++++++++++++ kernel/rcutree_trace.c | 271 ++++++ kernel/resource.c | 9 + kernel/sched.c | 3 +- kernel/softirq.c | 19 +- kernel/softlockup.c | 2 +- kernel/stacktrace.c | 11 + kernel/sys.c | 2 +- lib/Kconfig.debug | 31 + lib/debugobjects.c | 4 +- lib/swiotlb.c | 255 ++++-- mm/memory.c | 15 + 61 files changed, 3423 insertions(+), 489 deletions(-) create mode 100644 Documentation/RCU/trace.txt create mode 100644 include/linux/rcutree.h create mode 100644 kernel/rcutree.c create mode 100644 kernel/rcutree_trace.c
Documentation/RCU/00-INDEX +2 -0
@@ -16,6 +16,8 @@ RTFP.txt - List of RCU papers (bibliography) going back to 1980. torture.txt - RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST) +trace.txt + - CONFIG_RCU_TRACE debugfs files and formats UP.txt - RCU on Uniprocessor Systems whatisRCU.txt
Documentation/RCU/trace.txt new file +413 -0
413 lines not on this page · raw message
Documentation/lockstat.txt +33 -18
68 lines not on this page · raw message
arch/powerpc/platforms/pseries/rtasd.c +4 -0
@@ -208,6 +208,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)break ;case ERR_TYPE_KERNEL_PANIC :default : +WARN_ON_ONCE (!irqs_disabled ());/* @@@ DEBUG @@@ */ spin_unlock_irqrestore (&rtasd_log_lock, s);return ; }
@@ -227,6 +228,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)/* Check to see if we need to or have stopped logging */ if (fatal || !logging_enabled) { logging_enabled =0 ; +WARN_ON_ONCE (!irqs_disabled ());/* @@@ DEBUG @@@ */ spin_unlock_irqrestore (&rtasd_log_lock, s);return ; }
@@ -249,11 +251,13 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)else rtas_log_start +=1 ; +WARN_ON_ONCE (!irqs_disabled ());/* @@@ DEBUG @@@ */ spin_unlock_irqrestore (&rtasd_log_lock, s);wake_up_interruptible (&rtas_log_wait);break ;case ERR_TYPE_KERNEL_PANIC :default : +WARN_ON_ONCE (!irqs_disabled ());/* @@@ DEBUG @@@ */ spin_unlock_irqrestore (&rtasd_log_lock, s);return ; }
arch/um/include/asm/system.h +7 -7
@@ -11,21 +11,21 @@ extern int get_signals(void);extern void block_signals (void );extern void unblock_signals (void ); -#define local_save_flags (flags) do { typecheck(unsigned long, flags); \ +#define raw_local_save_flags (flags) do { typecheck(unsigned long, flags); \ (flags) = get_signals(); } while(0) -#define local_irq_restore (flags) do { typecheck(unsigned long, flags); \ +#define raw_local_irq_restore (flags) do { typecheck(unsigned long, flags); \ set_signals(flags); } while(0) -#define local_irq_save (flags) do { local_save_flags(flags); \ - local_irq_disable(); } while(0) +#define raw_local_irq_save (flags) do { raw_local_save_flags(flags); \ + raw_local_irq_disable(); } while(0) -#define local_irq_enable () unblock_signals() -#define local_irq_disable () block_signals() +#define raw_local_irq_enable () unblock_signals() +#define raw_local_irq_disable () block_signals()#define irqs_disabled () \ ({ \ unsigned long flags; \ - local_save_flags(flags); \ + raw_local_save_flags(flags); \ (flags == 0); \ })
arch/x86/include/asm/dma-mapping.h +1 -1
@@ -65,7 +65,7 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)return dma_ops; else return dev->archdata.dma_ops; -#endif /* _ASM_X86_DMA_MAPPING_H */ +#endif }/* Make sure we keep the same behaviour */
arch/x86/include/asm/iommu.h +0 -2
@@ -7,8 +7,6 @@ extern struct dma_mapping_ops nommu_dma_ops;extern int force_iommu, no_iommu;extern int iommu_detected; -extern unsigned long iommu_nr_pages (unsigned long addr,unsigned long len); -/* 10 seconds */ #define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000)
arch/x86/include/asm/pci.h +2 -0
@@ -82,6 +82,8 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,static inline void early_quirks (void ) { }#endif +extern void pci_iommu_alloc (void ); +#endif /* __KERNEL__ */ #ifdef CONFIG_X86_32
arch/x86/include/asm/pci_64.h +0 -1
@@ -23,7 +23,6 @@ extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);extern void dma32_reserve_bootmem (void ); -extern void pci_iommu_alloc (void );/* The PCI address space does equal the physical memory * address space. The networking and block device layers use
arch/x86/include/asm/uaccess.h +2 -0
@@ -157,6 +157,7 @@ extern int __get_user_bad(void);int __ret_gu; \unsigned long __val_gu; \__chk_user_ptr (ptr); \ +might_fault (); \switch (sizeof (*(ptr))) { \case 1 : \__get_user_x (1 , __ret_gu, __val_gu, ptr); \
@@ -241,6 +242,7 @@ extern void __put_user_8(void);int __ret_pu; \ __typeof__(*(ptr)) __pu_val; \__chk_user_ptr (ptr); \ +might_fault (); \ __pu_val = x; \switch (sizeof (*(ptr))) { \case 1 : \
arch/x86/include/asm/uaccess_32.h +4 -4
@@ -82,8 +82,8 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)static __always_inline unsigned long __must_check __copy_to_user (void __user *to,const void *from,unsigned long n) { -might_sleep (); -return __copy_to_user_inatomic (to, from, n); +might_fault (); +return __copy_to_user_inatomic (to, from, n); } static __always_inline unsigned long
@@ -137,7 +137,7 @@ __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)static __always_inline unsigned long __copy_from_user (void *to,const void __user *from,unsigned long n) { -might_sleep (); +might_fault ();if (__builtin_constant_p (n)) {unsigned long ret;
@@ -159,7 +159,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)static __always_inline unsigned long __copy_from_user_nocache (void *to,const void __user *from,unsigned long n) { -might_sleep (); +might_fault ();if (__builtin_constant_p (n)) {unsigned long ret;
arch/x86/include/asm/uaccess_64.h +6 -0
@@ -29,6 +29,8 @@ static __always_inline __must_checkint __copy_from_user (void *dst,const void __user *src,unsigned size) {int ret =0 ; + +might_fault ();if (!__builtin_constant_p (size))return copy_user_generic (dst, (__force void *)src, size);switch (size) {
@@ -71,6 +73,8 @@ static __always_inline __must_checkint __copy_to_user (void __user *dst,const void *src,unsigned size) {int ret =0 ; + +might_fault ();if (!__builtin_constant_p (size))return copy_user_generic ((__force void *)dst, src, size);switch (size) {
@@ -113,6 +117,8 @@ static __always_inline __must_checkint __copy_in_user (void __user *dst,const void __user *src,unsigned size) {int ret =0 ; + +might_fault ();if (!__builtin_constant_p (size))return copy_user_generic ((__force void *)dst, (__force void *)src, size);
arch/x86/kernel/Makefile +2 -1
@@ -105,6 +105,8 @@ microcode-$(CONFIG_MICROCODE_INTEL) += microcode_intel.o microcode-$(CONFIG_MICROCODE_AMD) += microcode_amd.o obj-$(CONFIG_MICROCODE) += microcode.o +obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o # NB rename without _64 + ### # 64 bit specific files ifeq ($(CONFIG_X86_64),y)
@@ -118,7 +120,6 @@ ifeq ($(CONFIG_X86_64),y) obj-$(CONFIG_GART_IOMMU) += pci-gart_64.o aperture_64.o obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary_64.o tce_64.o obj-$(CONFIG_AMD_IOMMU) += amd_iommu_init.o amd_iommu.o - obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o endif
arch/x86/kernel/pci-dma.c +4 -9
@@ -105,11 +105,15 @@ static void __init dma32_free_bootmem(void) dma32_bootmem_ptr =NULL ; dma32_bootmem_size = 0; } +#endif void __init pci_iommu_alloc (void ) { +#ifdef CONFIG_X86_64 /* free the range so iommu could get some range less than 4G */ dma32_free_bootmem (); +#endif +/* * The order of these functions is important for * fall-back/fail-over reasons
@@ -125,15 +129,6 @@ void __init pci_iommu_alloc(void)pci_swiotlb_init (); } -unsigned long iommu_nr_pages (unsigned long addr,unsigned long len) -{ -unsigned long size =roundup ((addr & ~PAGE_MASK ) + len,PAGE_SIZE ); - -return size >>PAGE_SHIFT ; -} -EXPORT_SYMBOL (iommu_nr_pages); -#endif -void *dma_generic_alloc_coherent (struct device *dev,size_t size,dma_addr_t *dma_addr,gfp_t flag) {
arch/x86/kernel/pci-swiotlb_64.c +29 -0
@@ -3,6 +3,8 @@#include <linux/pci.h> #include <linux/cache.h> #include <linux/module.h> +#include <linux/swiotlb.h> +#include <linux/bootmem.h> #include <linux/dma-mapping.h> #include <asm/iommu.h>
@@ -11,6 +13,31 @@int swiotlb__read_mostly ; +void *swiotlb_alloc_boot (size_t size,unsigned long nslabs) +{ +return alloc_bootmem_low_pages (size); +} + +void *swiotlb_alloc (unsigned order,unsigned long nslabs) +{ +return (void *)__get_free_pages (GFP_DMA | __GFP_NOWARN, order); +} + +dma_addr_t swiotlb_phys_to_bus (phys_addr_t paddr) +{ +return paddr; +} + +phys_addr_t swiotlb_bus_to_phys (dma_addr_t baddr) +{ +return baddr; +} + +int __weak swiotlb_arch_range_needs_mapping (void *ptr,size_t size) +{ +return 0 ; +} +static dma_addr_t swiotlb_map_single_phys (struct device *hwdev,phys_addr_t paddr,size_t size,int direction)
@@ -50,8 +77,10 @@ struct dma_mapping_ops swiotlb_dma_ops = {void __init pci_swiotlb_init (void ) {/* don't initialize swiotlb if iommu=off (no_iommu=1) */ +#ifdef CONFIG_X86_64 if (!iommu_detected && !no_iommu && max_pfn >MAX_DMA32_PFN ) swiotlb =1 ; +#endif if (swiotlb_force) swiotlb =1 ;if (swiotlb) {
arch/x86/lib/usercopy_32.c +4 -4
@@ -39,7 +39,7 @@ static inline int __movsl_is_ok(unsigned long a1, unsigned long a2, unsigned lon#define __do_strncpy_from_user (dst, src, count, res) \ do { \ int __d0, __d1, __d2; \ - might_sleep(); \ + might_fault(); \ __asm__ __volatile__( \ " testl %1,%1\n" \ " jz 2f\n" \
@@ -126,7 +126,7 @@ EXPORT_SYMBOL(strncpy_from_user);#define __do_clear_user (addr,size) \ do { \ int __d0; \ - might_sleep(); \ + might_fault(); \ __asm__ __volatile__( \ "0: rep; stosl\n" \ " movl %2,%0\n" \
@@ -155,7 +155,7 @@ do { \unsigned long clear_user (void __user *to,unsigned long n) { -might_sleep (); +might_fault ();if (access_ok (VERIFY_WRITE , to, n))__do_clear_user (to, n);return n;
@@ -197,7 +197,7 @@ long strnlen_user(const char __user *s, long n)unsigned long mask = -__addr_ok (s);unsigned long res, tmp; -might_sleep (); +might_fault (); __asm__ __volatile__( " testl %0, %0\n"
arch/x86/lib/usercopy_64.c +2 -2
@@ -15,7 +15,7 @@#define __do_strncpy_from_user (dst,src,count,res) \ do { \ long __d0, __d1, __d2; \ - might_sleep(); \ + might_fault(); \ __asm__ __volatile__( \ " testq %1,%1\n" \ " jz 2f\n" \
@@ -64,7 +64,7 @@ EXPORT_SYMBOL(strncpy_from_user);unsigned long __clear_user (void __user *addr,unsigned long size) {long __d0; -might_sleep (); +might_fault ();/* no memory constraint because it doesn't change any memory gcc knows about */ asm volatile(
arch/x86/mm/init_32.c +3 -0
@@ -21,6 +21,7 @@#include <linux/init.h> #include <linux/highmem.h> #include <linux/pagemap.h> +#include <linux/pci.h> #include <linux/pfn.h> #include <linux/poison.h> #include <linux/bootmem.h>
@@ -971,6 +972,8 @@ void __init mem_init(void)start_periodic_check_for_corruption (); +pci_iommu_alloc (); +#ifdef CONFIG_FLATMEM BUG_ON (!mem_map);#endif
include/asm-generic/bug.h +3 -4
@@ -33,15 +33,14 @@ struct bug_entry {#ifndef __WARN#ifndef __ASSEMBLY__ -extern void warn_on_slowpath (const char *file,const int line);extern void warn_slowpath (const char *file,const int line,const char *fmt, ...) __attribute__((format (printf,3 ,4 )));#define WANT_WARN_ON_SLOWPATH #endif -#define __WARN () warn_on_slowpath(__FILE__, __LINE__) -#define __WARN_printf(arg...) warn_slowpath(__FILE__, __LINE__, arg) +#define __WARN () warn_slowpath(__FILE__, __LINE__, NULL) +#define __WARN_printf(arg...) warn_slowpath(__FILE__, __LINE__, arg)#else -#define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0) +#define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0)#endif #ifndef WARN_ON
include/linux/bottom_half.h +0 -1
@@ -2,7 +2,6 @@#define _LINUX_BH_Hextern void local_bh_disable (void ); -extern void __local_bh_enable (void );extern void _local_bh_enable (void );extern void local_bh_enable (void );extern void local_bh_enable_ip (unsigned long ip);
include/linux/debug_locks.h +1 -1
@@ -17,7 +17,7 @@ extern int debug_locks_off(void); ({ \ int __ret = 0; \ \ - if (unlikely(c)) { \ + if (!oops_in_progress && unlikely(c)) { \ if (debug_locks_off() && !debug_locks_silent) \ WARN_ON(1); \ __ret = 1; \
include/linux/futex.h +4 -1
@@ -25,7 +25,8 @@ union ktime;#define FUTEX_WAKE_BITSET 10#define FUTEX_PRIVATE_FLAG 128 -#define FUTEX_CMD_MASK ~FUTEX_PRIVATE_FLAG +#define FUTEX_CLOCK_REALTIME 256 +#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)#define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
@@ -164,6 +165,8 @@ union futex_key { } both; }; +#define FUTEX_KEY_INIT (union futex_key) { .both = { .ptr = NULL } } +#ifdef CONFIG_FUTEX extern void exit_robust_list (struct task_struct *curr);extern void exit_pi_state_list (struct task_struct *curr);
include/linux/hardirq.h +8 -6
@@ -118,13 +118,17 @@ static inline void account_system_vtime(struct task_struct *tsk) }#endif -#if defined(CONFIG_PREEMPT_RCU ) && defined(CONFIG_NO_HZ ) +#if defined(CONFIG_NO_HZ ) && !defined(CONFIG_CLASSIC_RCU )extern void rcu_irq_enter (void );extern void rcu_irq_exit (void ); +extern void rcu_nmi_enter (void ); +extern void rcu_nmi_exit (void );#else # define rcu_irq_enter () do { } while (0)# define rcu_irq_exit () do { } while (0) -#endif /* CONFIG_PREEMPT_RCU */ +# define rcu_nmi_enter () do { } while (0) +# define rcu_nmi_exit () do { } while (0) +#endif /* #if defined(CONFIG_NO_HZ) && !defined(CONFIG_CLASSIC_RCU) */ /* * It is safe to do non-atomic ops on ->hardirq_context,
@@ -134,7 +138,6 @@ extern void rcu_irq_exit(void);*/ #define __irq_enter () \ do { \ - rcu_irq_enter(); \ account_system_vtime(current); \ add_preempt_count(HARDIRQ_OFFSET); \ trace_hardirq_enter(); \
@@ -153,7 +156,6 @@ extern void irq_enter(void);trace_hardirq_exit (); \account_system_vtime (current); \sub_preempt_count (HARDIRQ_OFFSET ); \ -rcu_irq_exit (); \ }while (0 )/*
@@ -161,7 +163,7 @@ extern void irq_enter(void);*/ extern void irq_exit (void ); -#define nmi_enter () do { lockdep_off(); __irq_enter(); } while (0) -#define nmi_exit () do { __irq_exit(); lockdep_on(); } while (0) +#define nmi_enter () do { lockdep_off(); rcu_nmi_enter(); __irq_enter(); } while (0) +#define nmi_exit () do { __irq_exit(); rcu_nmi_exit(); lockdep_on(); } while (0)#endif /* LINUX_HARDIRQ_H */
include/linux/kernel.h +11 -0
@@ -141,6 +141,15 @@ extern int _cond_resched(void); (__x <0 ) ? -__x : __x; \ }) +#ifdef CONFIG_PROVE_LOCKING +void might_fault (void ); +#else +static inline void might_fault (void ) +{ +might_sleep (); +} +#endif +extern struct atomic_notifier_head panic_notifier_list;extern long (*panic_blink)(long time); NORET_TYPE void panic(const char * fmt, ...)
@@ -188,6 +197,8 @@ extern unsigned long long memparse(const char *ptr, char **retptr);extern int core_kernel_text (unsigned long addr);extern int __kernel_text_address (unsigned long addr);extern int kernel_text_address (unsigned long addr); +extern int func_ptr_is_kernel_text (void *ptr); +struct pid ;extern struct pid *session_of_pgrp (struct pid *pgrp);
include/linux/lockdep.h +37 -6
100 lines not on this page · raw message
include/linux/mutex.h +2 -0
@@ -144,6 +144,8 @@ extern int __must_check mutex_lock_killable(struct mutex *lock);/* * NOTE: mutex_trylock() follows the spin_trylock() convention, * not the down_trylock() convention! +* +* Returns 1 if the mutex has been acquired successfully, and 0 on contention. */ extern int mutex_trylock (struct mutex *lock);extern void mutex_unlock (struct mutex *lock);
include/linux/rcuclassic.h +1 -1
@@ -41,7 +41,7 @@#include <linux/seqlock.h> #ifdef CONFIG_RCU_CPU_STALL_DETECTOR -#define RCU_SECONDS_TILL_STALL_CHECK ( 3 * HZ)/* for rcp->jiffies_stall */ +#define RCU_SECONDS_TILL_STALL_CHECK (10 * HZ)/* for rcp->jiffies_stall */ #define RCU_SECONDS_TILL_STALL_RECHECK (30 * HZ)/* for rcp->jiffies_stall */ #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
include/linux/rcupdate.h +7 -3
@@ -52,11 +52,15 @@ struct rcu_head {void (*func)(struct rcu_head *head); }; -#ifdef CONFIG_CLASSIC_RCU +#if defined(CONFIG_CLASSIC_RCU )#include <linux/rcuclassic.h> -#else /* #ifdef CONFIG_CLASSIC_RCU */ +#elif defined(CONFIG_TREE_RCU ) +#include <linux/rcutree.h> +#elif defined(CONFIG_PREEMPT_RCU )#include <linux/rcupreempt.h> -#endif /* #else #ifdef CONFIG_CLASSIC_RCU */ +#else +#error "Unknown RCU implementation specified to kernel configuration" +#endif /* #else #if defined(CONFIG_CLASSIC_RCU) */ #define RCU_HEAD_INIT { .next = NULL, .func = NULL }#define RCU_HEAD (head) struct rcu_head head = RCU_HEAD_INIT
include/linux/rcutree.h new file +329 -0
329 lines not on this page · raw message
include/linux/swiotlb.h +22 -0
@@ -7,9 +7,31 @@ struct device;struct dma_attrs ;struct scatterlist ; +/* +* Maximum allowable number of contiguous slabs to map, +* must be a power of 2. What is the appropriate value ? +* The complexity of {map,unmap}_single is linearly dependent on this value. +*/ +#define IO_TLB_SEGSIZE 128 + + +/* +* log of the size of each IO TLB slab. The number of slabs is command line +* controllable. +*/ +#define IO_TLB_SHIFT 11 +extern void swiotlb_init (void ); +extern void *swiotlb_alloc_boot (size_t bytes,unsigned long nslabs); +extern void *swiotlb_alloc (unsigned order,unsigned long nslabs); + +extern dma_addr_t swiotlb_phys_to_bus (phys_addr_t address); +extern phys_addr_t swiotlb_bus_to_phys (dma_addr_t address); + +extern int swiotlb_arch_range_needs_mapping (void *ptr,size_t size); +extern void *swiotlb_alloc_coherent (struct device *hwdev,size_t size,dma_addr_t *dma_handle,gfp_t flags);
include/linux/uaccess.h +1 -1
@@ -78,7 +78,7 @@ static inline unsigned long __copy_from_user_nocache(void *to, \set_fs (KERNEL_DS ); \pagefault_disable (); \ - ret = __get_user(retval, (__force typeof(retval) __user *)(addr)); \ + ret = __copy_from_user_inatomic(&(retval), (__force typeof(retval) __user *)(addr), sizeof(retval)); \pagefault_enable (); \set_fs (old_fs); \ ret; \
init/Kconfig +83 -3
93 lines not on this page · raw message
kernel/Kconfig.preempt +0 -25
@@ -52,28 +52,3 @@ config PREEMPT endchoice -config PREEMPT_RCU - bool "Preemptible RCU" - depends on PREEMPT - default n - help - This option reduces the latency of the kernel by making certain - RCU sections preemptible. Normally RCU code is non-preemptible, if - this option is selected then read-only RCU sections become - preemptible. This helps latency, but may expose bugs due to - now-naive assumptions about each RCU read-side critical section - remaining on a given CPU through its execution. - - Say N if you are unsure. - -config RCU_TRACE - bool "Enable tracing for RCU - currently stats in debugfs" - depends on PREEMPT_RCU - select DEBUG_FS - default y - help - This option provides tracing in RCU which presents stats - in debugfs for debugging RCU implementation. - - Say Y here if you want to enable RCU tracing - Say N if you are unsure.
kernel/Makefile +3 -3
@@ -74,10 +74,10 @@ obj-$(CONFIG_GENERIC_HARDIRQS) += irq/ obj-$(CONFIG_SECCOMP) += seccomp.o obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o obj-$(CONFIG_CLASSIC_RCU) += rcuclassic.o +obj-$(CONFIG_TREE_RCU) += rcutree.o obj-$(CONFIG_PREEMPT_RCU) += rcupreempt.o -ifeq ($(CONFIG_PREEMPT_RCU),y) -obj-$(CONFIG_RCU_TRACE) += rcupreempt_trace.o -endif +obj-$(CONFIG_TREE_RCU_TRACE) += rcutree_trace.o +obj-$(CONFIG_PREEMPT_RCU_TRACE) += rcupreempt_trace.o obj-$(CONFIG_RELAY) += relay.o obj-$(CONFIG_SYSCTL) += utsname_sysctl.o obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
kernel/exit.c +1 -1
@@ -1321,10 +1321,10 @@ static int wait_task_zombie(struct task_struct *p, int options,* group, which consolidates times for all threads in the * group including the group leader. */ +thread_group_cputime (p, &cputime);spin_lock_irq (&p->parent->sighand->siglock); psig = p->parent->signal; sig = p->signal; -thread_group_cputime (p, &cputime); psig->cutime = cputime_add(psig->cutime, cputime_add(cputime.utime,
kernel/extable.c +16 -0
@@ -66,3 +66,19 @@ int kernel_text_address(unsigned long addr)return 1 ;return module_text_address (addr) !=NULL ; } + +/* +* On some architectures (PPC64, IA64) function pointers +* are actually only tokens to some data that then holds the +* real function address. As a result, to find if a function +* pointer is part of the kernel text, we need to do some +* special dereferencing first. +*/ +int func_ptr_is_kernel_text (void *ptr) +{ +unsigned long addr; + addr = (unsigned long )dereference_function_descriptor (ptr); +if (core_kernel_text (addr)) +return 1 ; +return module_text_address (addr) !=NULL ; +}
kernel/futex.c +136 -215
718 lines not on this page · raw message
kernel/irq/manage.c +12 -0
@@ -673,6 +673,18 @@ int request_irq(unsigned int irq, irq_handler_t handler,struct irq_desc *desc;int retval; +/* +* handle_IRQ_event() always ignores IRQF_DISABLED except for +* the _first_ irqaction (sigh). That can cause oopsing, but +* the behavior is classified as "will not fix" so we need to +* start nudging drivers away from using that idiom. +*/ +if ((irqflags & (IRQF_SHARED |IRQF_DISABLED )) + == (IRQF_SHARED |IRQF_DISABLED )) +pr_warning ("IRQ %d/%s: IRQF_DISABLED is not " +"guaranteed on shared IRQs\n" , + irq, devname); +#ifdef CONFIG_LOCKDEP /* * Lockdep wants atomic interrupt handlers:
kernel/lockdep.c +32 -28
197 lines not on this page · raw message
kernel/lockdep_proc.c +23 -5
@@ -470,11 +470,12 @@ static void seq_line(struct seq_file *m, char c, int offset, int length)static void snprint_time (char *buf,size_t bufsiz,s64 nr) { -unsigned long rem; +s64 div; +s32 rem; nr +=5 ;/* for display rounding */ - rem =do_div (nr,1000 );/* XXX: do_div_signed */ -snprintf (buf, bufsiz,"%lld.%02d" , (long long )nr, (int )rem/10 ); + div =div_s64_rem (nr,1000 , &rem); +snprintf (buf, bufsiz,"%lld.%02d" , (long long )div, (int )rem/10 ); }static void seq_time (struct seq_file *m,s64 time)
@@ -556,7 +557,7 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data)if (stats->read_holdtime.nr) namelen +=2 ; -for (i =0 ; i <ARRAY_SIZE (class->contention_point); i++) { +for (i =0 ; i <LOCKSTAT_POINTS ; i++) {char sym[KSYM_SYMBOL_LEN ];char ip[32 ];
@@ -573,6 +574,23 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data) stats->contention_point[i], ip, sym); } +for (i =0 ; i <LOCKSTAT_POINTS ; i++) { +char sym[KSYM_SYMBOL_LEN ]; +char ip[32 ]; + +if (class->contending_point[i] ==0 ) +break ; + +if (!i) +seq_line (m,'-' ,40 -namelen, namelen); + +sprint_symbol (sym, class->contending_point[i]); +snprintf (ip,sizeof (ip),"[<%p>]" , + (void *)class->contending_point[i]); +seq_printf (m,"%40s %14lu %29s %s\n" , name, + stats->contending_point[i], + ip, sym); + }if (i) {seq_puts (m,"\n" );seq_line (m,'.' ,0 ,40 +1 +10 * (14 +1 ));
@@ -582,7 +600,7 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data)static void seq_header (struct seq_file *m) { -seq_printf (m,"lock_stat version 0.2\n" ); +seq_printf (m,"lock_stat version 0.3\n" );seq_line (m,'-' ,0 ,40 +1 +10 * (14 +1 )); seq_printf(m, "%40s %14s %14s %14s %14s %14s %14s %14s %14s " "%14s %14s\n",
kernel/mutex.c +5 -5
@@ -59,7 +59,7 @@ EXPORT_SYMBOL(__mutex_init);* We also put the fastpath first in the kernel image, to make sure the * branch is predicted by the CPU as default-untaken. */ -static void noinline __sched +static __used noinline void __sched__mutex_lock_slowpath (atomic_t *lock_count);/***
@@ -96,7 +96,7 @@ void inline __sched mutex_lock(struct mutex *lock)EXPORT_SYMBOL (mutex_lock);#endif -static noinline void __sched __mutex_unlock_slowpath(atomic_t *lock_count); +static __used noinline void __sched __mutex_unlock_slowpath(atomic_t *lock_count);/*** * mutex_unlock - release the mutex
@@ -184,7 +184,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, } done: -lock_acquired (&lock->dep_map); +lock_acquired (&lock->dep_map, ip);/* got the lock - rejoice! */ mutex_remove_waiter (lock, &waiter,task_thread_info (task));debug_mutex_set_owner (lock,task_thread_info (task));
@@ -268,7 +268,7 @@ __mutex_unlock_common_slowpath(atomic_t *lock_count, int nested)/* * Release the lock, slowpath: */ -static noinline void +static __used noinline void__mutex_unlock_slowpath (atomic_t *lock_count) {__mutex_unlock_common_slowpath (lock_count,1 );
@@ -313,7 +313,7 @@ int __sched mutex_lock_killable(struct mutex *lock) }EXPORT_SYMBOL (mutex_lock_killable); -static noinline void __sched +static __used noinline void __sched__mutex_lock_slowpath (atomic_t *lock_count) { struct mutex *lock = container_of(lock_count, struct mutex, count);
kernel/notifier.c +8 -0
@@ -82,6 +82,14 @@ static int __kprobes notifier_call_chain(struct notifier_block **nl,while (nb && nr_to_call) { next_nb =rcu_dereference (nb->next); + +#ifdef CONFIG_DEBUG_NOTIFIERS +if (unlikely (!func_ptr_is_kernel_text (nb->notifier_call))) { +WARN (1 ,"Invalid notifier called!" ); + nb = next_nb; +continue ; + } +#endif ret = nb->notifier_call (nb, val, v);if (nr_calls)
kernel/panic.c +12 -20
@@ -21,6 +21,7 @@#include <linux/debug_locks.h> #include <linux/random.h> #include <linux/kallsyms.h> +#include <linux/dmi.h> int panic_on_oops;static unsigned long tainted_mask;
@@ -321,36 +322,27 @@ void oops_exit(void) }#ifdef WANT_WARN_ON_SLOWPATH -void warn_on_slowpath (const char *file,int line) -{ -char function[KSYM_SYMBOL_LEN ]; -unsigned long caller = (unsigned long )__builtin_return_address (0 ); -sprint_symbol (function, caller); - -printk (KERN_WARNING "------------[ cut here ]------------\n" ); -printk (KERN_WARNING "WARNING: at %s:%d %s()\n" , file, - line, function); -print_modules (); -dump_stack (); -print_oops_end_marker (); -add_taint (TAINT_WARN ); -} -EXPORT_SYMBOL (warn_on_slowpath); - -void warn_slowpath (const char *file,int line,const char *fmt, ...) {va_list args;char function[KSYM_SYMBOL_LEN ];unsigned long caller = (unsigned long )__builtin_return_address (0 ); +const char *board; +sprint_symbol (function, caller);printk (KERN_WARNING "------------[ cut here ]------------\n" );printk (KERN_WARNING "WARNING: at %s:%d %s()\n" , file, line, function); -va_start (args, fmt); -vprintk (fmt, args); -va_end (args); + board =dmi_get_system_info (DMI_PRODUCT_NAME ); +if (board) +printk (KERN_WARNING "Hardware name: %s\n" , board); + +if (fmt) { +va_start (args, fmt); +vprintk (fmt, args); +va_end (args); + }print_modules ();dump_stack ();
kernel/posix-cpu-timers.c +5 -5
@@ -58,21 +58,21 @@ void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times) { - struct signal_struct *sig; + struct task_cputime *totals, *tot;int i; -struct task_cputime *tot; - sig = tsk->signal; -if (unlikely (!sig) || !sig->cputime.totals) { + totals = tsk->signal->cputime.totals; +if (!totals) { times->utime = tsk->utime; times->stime = tsk->stime; times->sum_exec_runtime = tsk->se.sum_exec_runtime;return ; } + times->stime = times->utime = cputime_zero; times->sum_exec_runtime =0 ;for_each_possible_cpu (i) { - tot =per_cpu_ptr (tsk->signal->cputime.totals, i); + tot =per_cpu_ptr (totals, i); times->utime =cputime_add (times->utime, tot->utime); times->stime =cputime_add (times->stime, tot->stime); times->sum_exec_runtime += tot->sum_exec_runtime;
kernel/printk.c +1 -1
@@ -662,7 +662,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)if (recursion_bug) { recursion_bug =0 ;strcpy (printk_buf, recursion_bug_msg); - printed_len =sizeof (recursion_bug_msg); + printed_len =strlen (recursion_bug_msg); }/* Emit the output into the temporary buffer */ printed_len += vscnprintf(printk_buf + printed_len,
kernel/rcuclassic.c +2 -2
@@ -191,7 +191,7 @@ static void print_other_cpu_stall(struct rcu_ctrlblk *rcp)/* OK, time to rat on our buddy... */ -printk (KERN_ERR "RCU detected CPU stalls:" ); +printk (KERN_ERR "INFO: RCU detected CPU stalls:" );for_each_possible_cpu (cpu) {if (cpu_isset (cpu, rcp->cpumask))printk (" %d" , cpu);
@@ -204,7 +204,7 @@ static void print_cpu_stall(struct rcu_ctrlblk *rcp) {unsigned long flags; -printk (KERN_ERR "RCU detected CPU %d stall (t=%lu/%lu jiffies)\n" , +printk (KERN_ERR "INFO: RCU detected CPU %d stall (t=%lu/%lu jiffies)\n" ,smp_processor_id (), jiffies, jiffies - rcp->gp_start);dump_stack ();
kernel/rcupreempt.c +10 -0
@@ -551,6 +551,16 @@ void rcu_irq_exit(void) } } +void rcu_nmi_enter (void ) +{ +rcu_irq_enter (); +} + +void rcu_nmi_exit (void ) +{ +rcu_irq_exit (); +} +static void dyntick_save_progress_counter (int cpu) {struct rcu_dyntick_sched *rdssp = &per_cpu (rcu_dyntick_sched, cpu);
kernel/rcupreempt_trace.c +5 -5
@@ -149,12 +149,12 @@ static void rcupreempt_trace_sum(struct rcupreempt_trace *sp) sp->done_length += cp->done_length; sp->done_add += cp->done_add; sp->done_remove += cp->done_remove; -atomic_set (&sp->done_invoked,atomic_read (&cp->done_invoked)); +atomic_add (atomic_read (&cp->done_invoked), &sp->done_invoked); sp->rcu_check_callbacks += cp->rcu_check_callbacks; -atomic_set (&sp->rcu_try_flip_1, -atomic_read (&cp->rcu_try_flip_1)); -atomic_set (&sp->rcu_try_flip_e1, -atomic_read (&cp->rcu_try_flip_e1)); +atomic_add (atomic_read (&cp->rcu_try_flip_1), + &sp->rcu_try_flip_1); +atomic_add (atomic_read (&cp->rcu_try_flip_e1), + &sp->rcu_try_flip_e1); sp->rcu_try_flip_i1 += cp->rcu_try_flip_i1; sp->rcu_try_flip_ie1 += cp->rcu_try_flip_ie1; sp->rcu_try_flip_g1 += cp->rcu_try_flip_g1;
kernel/rcutorture.c +56 -10
164 lines not on this page · raw message
kernel/rcutree.c new file +1535 -0
81 lines not on this page · raw message
kernel/rcutree_trace.c new file +271 -0
271 lines not on this page · raw message
lib/swiotlb.c +188 -67
255 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 3 lines · Ingo Molnar
[ Note, this tree will generate conflicts if pulled after the x86,
tracing and scheduler trees - i'll follow up with this mail with a conflict resolution commit. ]
the conflict resolutions i have cached for this are attached below - all the conflicts are contextual.
( Have not found a Git way to export this resolution in plain patch format
that could be applied in a raw form when the conflicts come up after the pull - git-show uses the git-diff-tree --cc interdiff format. )
Ingo
------------->
commit 75c8fc6a491d5bbf20be8ce3fb140d0daa2b32dc
Merge: 65890e7... 6638101...
Author: Ingo Molnar <[email protected]>
Date: Thu Dec 25 14:11:46 2008 +0100
Merge branch 'core-for-linus' into tmp.tmp
Conflicts:
arch/x86/kernel/Makefile
arch/x86/mm/init_32.c
include/linux/hardirq.h
arch/x86/kernel/Makefile +0 -0
@@@ -107,8 -105,8 +107,10 @@@ microcode-$(CONFIG_MICROCODE_INTEL) += microcode-$(CONFIG_MICROCODE_AMD) += microcode_amd.o obj-$(CONFIG_MICROCODE) += microcode.o + obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o # NB rename without _64 + +obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o + ### # 64 bit specific files ifeq ($(CONFIG_X86_64),y)
arch/x86/mm/init_32.c +0 -0
@@@ -967,6 -970,10 +968,8 @@@ void __init mem_init(voidint codesize, reservedpages, datasize, initsize;int tmp; -start_periodic_check_for_corruption (); - +pci_iommu_alloc (); +#ifdef CONFIG_FLATMEM BUG_ON (!mem_map);#endif
include/linux/hardirq.h +0 -0
@@@ -162,17 -163,7 +164,20 @@@ extern void irq_enter(void)*/ extern void irq_exit (void ); -#define nmi_enter() do { lockdep_off(); rcu_nmi_enter(); __irq_enter(); } while (0) -#define nmi_exit() do { __irq_exit(); rcu_nmi_exit(); lockdep_on(); } while (0) +#define nmi_enter() \ + do { \ + ftrace_nmi_enter(); \ + lockdep_off(); \ ++ rcu_nmi_enter(); \ + __irq_enter(); \ + } while (0) ++ +#define nmi_exit() \ + do { \ + __irq_exit(); \ ++ rcu_nmi_exit(); \ + lockdep_on(); \ + ftrace_nmi_exit(); \ + } while (0)#endif /* LINUX_HARDIRQ_H */
[git pull] core kernel updates for v2.6.29, #2
In reply to Ingo MolnarQuoted 19 lines · Ingo Molnar
Linus,
Please pull the latest core-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.gitcore-for-linus12 topics were active in this cycle:
core/debug core/debugobjects core/futexes core/iommu core/locking core/printk core/rcu core/resources core/signal core/softirq core/stacktrace core/xenNotable changes are the RCU-Tree implementation from Paul (which was long in the making, and which is to replace RCU-classic in the next cycle if all goes well), 'speculative' lockdep rules added by Nick to catch
might_sleep()bugs, swiotlb extensions to make it available to 32-bit platforms - and more.
Quoted 3 lines
[ Note, this tree will generate conflicts if pulled after the x86,
tracing and scheduler trees - i'll follow up with this mail with a conflict resolution commit. ]
there's 3 conflicts now against your latest tree - i've pushed out a second branch that has the conflicts resolved [the two trees can be pulled in any order]:
Please pull the latest core-for-linus-2 git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git core-for-linus-2
Thanks,
Ingo
------------------>
Andrew Morton (1):
lock debug: sit tight when we are already in a panic
Arjan van de Ven (6):
debug: add notifier chain debugging
debug: add notifier chain debugging, v2
mutex: improve header comment to be actually informative about the API debug warnings: consolidate warn_slowpath and warn_on_slowpath debug warnings: print the DMI board info name in a WARN/WARN_ON
resources: skip sanity check of busy resources
Darren Hart (2):
futex: rename field in futex_q to clarify single waiter semantics
futex: clean up futex_(un)lock_pi fault handling
David Brownell (1):
genirq: warn when IRQF_DISABLED may be ignored
Hiroshi Shimamoto (2):
uaccess: fix parameters inversion for __copy_from_user_inatomic()
printk: fix discarding message when recursion_bug
Ian Campbell (7):
swiotlb: move some definitions to header
swiotlb: add comment where we handle the overflow of a dma mask on 32 bit
swiotlb: allow architectures to override phys<->bus<->phys conversions
swiotlb: add arch hook to force mapping
swiotlb: consolidate swiotlb info message printing x86/swiotlb: add default phys<->bus conversion
x86/swiotlb: add default swiotlb_arch_range_needs_mapping
Ingo Molnar (10):
softlockup: increase hung tasks check from 2 minutes to 8 minutes
x86: some lock annotations for user copy paths, v3
Revert "lockdep: fix compilation when CONFIG_TRACE_IRQFLAGS_SUPPORT is not set"
rcu: make rcu-stall debug printout more standard
lockdep: include/linux/lockdep.h - fix warning in net/bluetooth/af_bluetooth.c
lockdep: fix unused function warning in kernel/lockdep.c
debugobjects: add boot parameter default value
debug warnings: eliminate warn_on_slowpath()
rcu: provide RCU options on non-preempt architectures too
stacktrace: provide save_stack_trace_tsk() weak alias
Isaku Yamahata (3):
xen: portability clean up and some minor clean up for xencomm.c
xen: compilation fix fo xen CPU hotplugging
xen: compilation fix of drivers/xen/events.c on IA64
Jeremy Fitzhardinge (7):
xen: don't reload cr3 on suspend
x86: remove unused iommu_nr_pages
swiotlb: allow architectures to override swiotlb pool allocation
swiotlb: factor out copy to/from device
swiotlb: support bouncing of HighMem pages
x86: add swiotlb allocation functions
x86: unify pci iommu setup and allow swiotlb to compile for 32 bit
Liming Wang (1):
softirq: remove useless function __local_bh_enable
Nick Piggin (3):
x86: some lock annotations for user copy paths
x86: some lock annotations for user copy paths, v2
sched: improve preempt debugging
Oleg Nesterov (3):
account_steal_time: kill the unneeded account_group_system_time()
thread_group_cputime: kill the bogus ->signal != NULL check
thread_group_cputime: move a couple of callsites outside of ->siglockPaul E. McKenney (3):
rcu: increase RCU stall-check timeouts
rcu: fix rcutorture behavior during reboot "Tree RCU": scalable classic RCU implementation
Peter Zijlstra (10):
lockstat: documentation update
lockdep: add might_lock() / might_lock_read()
lockstat: fixup signed division
futex: rely on get_user_pages() for shared futexes
futex: reduce mmap_sem usage
futex: use fast_gup()
futex: cleanup fshared
futex: fixup get_futex_key() for private futexes
lockstat: contend with points
lockdep: change a held lock's class
Rui Sousa (2):
lockdep: fix compilation when CONFIG_TRACE_IRQFLAGS_SUPPORT is not set lockdep, UML: fix compilation when CONFIG_TRACE_IRQFLAGS_SUPPORT is not set
Thomas Gleixner (1):
futex: make clock selectable for FUTEX_WAIT_BITSET
Török Edwin (1):
mutex: __used is needed for function referenced only from inline asm
Documentation/RCU/00-INDEX | 2 + Documentation/RCU/trace.txt | 413 +++++++++ Documentation/lockstat.txt | 51 +- arch/powerpc/platforms/pseries/rtasd.c | 4 + arch/um/include/asm/system.h | 14 +- arch/x86/include/asm/dma-mapping.h | 2 +- arch/x86/include/asm/iommu.h | 2 - arch/x86/include/asm/pci.h | 2 + arch/x86/include/asm/pci_64.h | 1 - arch/x86/include/asm/uaccess.h | 2 + arch/x86/include/asm/uaccess_32.h | 8 +- arch/x86/include/asm/uaccess_64.h | 6 + arch/x86/kernel/Makefile | 3 +- arch/x86/kernel/pci-dma.c | 13 +- arch/x86/kernel/pci-swiotlb_64.c | 29 + arch/x86/lib/usercopy_32.c | 8 +- arch/x86/lib/usercopy_64.c | 4 +- arch/x86/mm/init_32.c | 3 + include/asm-generic/bug.h | 7 +- include/linux/bottom_half.h | 1 - include/linux/debug_locks.h | 2 +- include/linux/futex.h | 5 +- include/linux/hardirq.h | 13 +- include/linux/kernel.h | 11 + include/linux/lockdep.h | 43 +- include/linux/mutex.h | 2 + include/linux/rcuclassic.h | 2 +- include/linux/rcupdate.h | 10 +- include/linux/rcutree.h | 329 +++++++ include/linux/swiotlb.h | 22 + include/linux/uaccess.h | 2 +- init/Kconfig | 86 ++- kernel/Kconfig.preempt | 25 - kernel/Makefile | 6 +- kernel/exit.c | 2 +- kernel/extable.c | 16 + kernel/futex.c | 351 +++----- kernel/irq/manage.c | 12 + kernel/lockdep.c | 60 +- kernel/lockdep_proc.c | 28 +- kernel/mutex.c | 10 +- kernel/notifier.c | 8 + kernel/panic.c | 32 +- kernel/posix-cpu-timers.c | 10 +- kernel/printk.c | 2 +- kernel/rcuclassic.c | 4 +- kernel/rcupreempt.c | 10 + kernel/rcupreempt_trace.c | 10 +- kernel/rcutorture.c | 66 ++- kernel/rcutree.c | 1535 ++++++++++++++++++++++++++++++++ kernel/rcutree_trace.c | 271 ++++++ kernel/resource.c | 9 + kernel/sched.c | 3 +- kernel/softirq.c | 19 +- kernel/softlockup.c | 2 +- kernel/stacktrace.c | 11 + kernel/sys.c | 2 +- lib/Kconfig.debug | 31 + lib/debugobjects.c | 4 +- lib/swiotlb.c | 255 ++++-- mm/memory.c | 15 + 61 files changed, 3424 insertions(+), 487 deletions(-) create mode 100644 Documentation/RCU/trace.txt create mode 100644 include/linux/rcutree.h create mode 100644 kernel/rcutree.c create mode 100644 kernel/rcutree_trace.c
Documentation/RCU/00-INDEX +2 -0
@@ -16,6 +16,8 @@ RTFP.txt - List of RCU papers (bibliography) going back to 1980. torture.txt - RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST) +trace.txt + - CONFIG_RCU_TRACE debugfs files and formats UP.txt - RCU on Uniprocessor Systems whatisRCU.txt
Documentation/RCU/trace.txt new file +413 -0
413 lines not on this page · raw message
Documentation/lockstat.txt +33 -18
68 lines not on this page · raw message
arch/powerpc/platforms/pseries/rtasd.c +4 -0
@@ -208,6 +208,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)break ;case ERR_TYPE_KERNEL_PANIC :default : +WARN_ON_ONCE (!irqs_disabled ());/* @@@ DEBUG @@@ */ spin_unlock_irqrestore (&rtasd_log_lock, s);return ; }
@@ -227,6 +228,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)/* Check to see if we need to or have stopped logging */ if (fatal || !logging_enabled) { logging_enabled =0 ; +WARN_ON_ONCE (!irqs_disabled ());/* @@@ DEBUG @@@ */ spin_unlock_irqrestore (&rtasd_log_lock, s);return ; }
@@ -249,11 +251,13 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)else rtas_log_start +=1 ; +WARN_ON_ONCE (!irqs_disabled ());/* @@@ DEBUG @@@ */ spin_unlock_irqrestore (&rtasd_log_lock, s);wake_up_interruptible (&rtas_log_wait);break ;case ERR_TYPE_KERNEL_PANIC :default : +WARN_ON_ONCE (!irqs_disabled ());/* @@@ DEBUG @@@ */ spin_unlock_irqrestore (&rtasd_log_lock, s);return ; }
arch/um/include/asm/system.h +7 -7
@@ -11,21 +11,21 @@ extern int get_signals(void);extern void block_signals (void );extern void unblock_signals (void ); -#define local_save_flags (flags) do { typecheck(unsigned long, flags); \ +#define raw_local_save_flags (flags) do { typecheck(unsigned long, flags); \ (flags) = get_signals(); } while(0) -#define local_irq_restore (flags) do { typecheck(unsigned long, flags); \ +#define raw_local_irq_restore (flags) do { typecheck(unsigned long, flags); \ set_signals(flags); } while(0) -#define local_irq_save (flags) do { local_save_flags(flags); \ - local_irq_disable(); } while(0) +#define raw_local_irq_save (flags) do { raw_local_save_flags(flags); \ + raw_local_irq_disable(); } while(0) -#define local_irq_enable () unblock_signals() -#define local_irq_disable () block_signals() +#define raw_local_irq_enable () unblock_signals() +#define raw_local_irq_disable () block_signals()#define irqs_disabled () \ ({ \ unsigned long flags; \ - local_save_flags(flags); \ + raw_local_save_flags(flags); \ (flags == 0); \ })
arch/x86/include/asm/dma-mapping.h +1 -1
@@ -65,7 +65,7 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)return dma_ops; else return dev->archdata.dma_ops; -#endif /* _ASM_X86_DMA_MAPPING_H */ +#endif }/* Make sure we keep the same behaviour */
arch/x86/include/asm/iommu.h +0 -2
@@ -7,8 +7,6 @@ extern struct dma_mapping_ops nommu_dma_ops;extern int force_iommu, no_iommu;extern int iommu_detected; -extern unsigned long iommu_nr_pages (unsigned long addr,unsigned long len); -/* 10 seconds */ #define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000)
arch/x86/include/asm/pci.h +2 -0
@@ -84,6 +84,8 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,static inline void early_quirks (void ) { }#endif +extern void pci_iommu_alloc (void ); +#endif /* __KERNEL__ */ #ifdef CONFIG_X86_32
arch/x86/include/asm/pci_64.h +0 -1
@@ -23,7 +23,6 @@ extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);extern void dma32_reserve_bootmem (void ); -extern void pci_iommu_alloc (void );/* The PCI address space does equal the physical memory * address space. The networking and block device layers use
arch/x86/include/asm/uaccess.h +2 -0
@@ -157,6 +157,7 @@ extern int __get_user_bad(void);int __ret_gu; \unsigned long __val_gu; \__chk_user_ptr (ptr); \ +might_fault (); \switch (sizeof (*(ptr))) { \case 1 : \__get_user_x (1 , __ret_gu, __val_gu, ptr); \
@@ -241,6 +242,7 @@ extern void __put_user_8(void);int __ret_pu; \ __typeof__(*(ptr)) __pu_val; \__chk_user_ptr (ptr); \ +might_fault (); \ __pu_val = x; \switch (sizeof (*(ptr))) { \case 1 : \
arch/x86/include/asm/uaccess_32.h +4 -4
@@ -82,8 +82,8 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)static __always_inline unsigned long __must_check __copy_to_user (void __user *to,const void *from,unsigned long n) { -might_sleep (); -return __copy_to_user_inatomic (to, from, n); +might_fault (); +return __copy_to_user_inatomic (to, from, n); } static __always_inline unsigned long
@@ -137,7 +137,7 @@ __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)static __always_inline unsigned long __copy_from_user (void *to,const void __user *from,unsigned long n) { -might_sleep (); +might_fault ();if (__builtin_constant_p (n)) {unsigned long ret;
@@ -159,7 +159,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)static __always_inline unsigned long __copy_from_user_nocache (void *to,const void __user *from,unsigned long n) { -might_sleep (); +might_fault ();if (__builtin_constant_p (n)) {unsigned long ret;
arch/x86/include/asm/uaccess_64.h +6 -0
@@ -29,6 +29,8 @@ static __always_inline __must_checkint __copy_from_user (void *dst,const void __user *src,unsigned size) {int ret =0 ; + +might_fault ();if (!__builtin_constant_p (size))return copy_user_generic (dst, (__force void *)src, size);switch (size) {
@@ -71,6 +73,8 @@ static __always_inline __must_checkint __copy_to_user (void __user *dst,const void *src,unsigned size) {int ret =0 ; + +might_fault ();if (!__builtin_constant_p (size))return copy_user_generic ((__force void *)dst, src, size);switch (size) {
@@ -113,6 +117,8 @@ static __always_inline __must_checkint __copy_in_user (void __user *dst,const void __user *src,unsigned size) {int ret =0 ; + +might_fault ();if (!__builtin_constant_p (size))return copy_user_generic ((__force void *)dst, (__force void *)src, size);
arch/x86/kernel/Makefile +2 -1
@@ -107,6 +107,8 @@ microcode-$(CONFIG_MICROCODE_INTEL) += microcode_intel.o microcode-$(CONFIG_MICROCODE_AMD) += microcode_amd.o obj-$(CONFIG_MICROCODE) += microcode.o +obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o # NB rename without _64 + obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o ###
@@ -122,7 +124,6 @@ ifeq ($(CONFIG_X86_64),y) obj-$(CONFIG_GART_IOMMU) += pci-gart_64.o aperture_64.o obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary_64.o tce_64.o obj-$(CONFIG_AMD_IOMMU) += amd_iommu_init.o amd_iommu.o - obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o endif
arch/x86/kernel/pci-dma.c +4 -9
@@ -101,11 +101,15 @@ static void __init dma32_free_bootmem(void) dma32_bootmem_ptr =NULL ; dma32_bootmem_size = 0; } +#endif void __init pci_iommu_alloc (void ) { +#ifdef CONFIG_X86_64 /* free the range so iommu could get some range less than 4G */ dma32_free_bootmem (); +#endif +/* * The order of these functions is important for * fall-back/fail-over reasons
@@ -121,15 +125,6 @@ void __init pci_iommu_alloc(void)pci_swiotlb_init (); } -unsigned long iommu_nr_pages (unsigned long addr,unsigned long len) -{ -unsigned long size =roundup ((addr & ~PAGE_MASK ) + len,PAGE_SIZE ); - -return size >>PAGE_SHIFT ; -} -EXPORT_SYMBOL (iommu_nr_pages); -#endif -void *dma_generic_alloc_coherent (struct device *dev,size_t size,dma_addr_t *dma_addr,gfp_t flag) {
arch/x86/kernel/pci-swiotlb_64.c +29 -0
@@ -3,6 +3,8 @@#include <linux/pci.h> #include <linux/cache.h> #include <linux/module.h> +#include <linux/swiotlb.h> +#include <linux/bootmem.h> #include <linux/dma-mapping.h> #include <asm/iommu.h>
@@ -11,6 +13,31 @@int swiotlb__read_mostly ; +void *swiotlb_alloc_boot (size_t size,unsigned long nslabs) +{ +return alloc_bootmem_low_pages (size); +} + +void *swiotlb_alloc (unsigned order,unsigned long nslabs) +{ +return (void *)__get_free_pages (GFP_DMA | __GFP_NOWARN, order); +} + +dma_addr_t swiotlb_phys_to_bus (phys_addr_t paddr) +{ +return paddr; +} + +phys_addr_t swiotlb_bus_to_phys (dma_addr_t baddr) +{ +return baddr; +} + +int __weak swiotlb_arch_range_needs_mapping (void *ptr,size_t size) +{ +return 0 ; +} +static dma_addr_t swiotlb_map_single_phys (struct device *hwdev,phys_addr_t paddr,size_t size,int direction)
@@ -50,8 +77,10 @@ struct dma_mapping_ops swiotlb_dma_ops = {void __init pci_swiotlb_init (void ) {/* don't initialize swiotlb if iommu=off (no_iommu=1) */ +#ifdef CONFIG_X86_64 if (!iommu_detected && !no_iommu && max_pfn >MAX_DMA32_PFN ) swiotlb =1 ; +#endif if (swiotlb_force) swiotlb =1 ;if (swiotlb) {
arch/x86/lib/usercopy_32.c +4 -4
@@ -39,7 +39,7 @@ static inline int __movsl_is_ok(unsigned long a1, unsigned long a2, unsigned lon#define __do_strncpy_from_user (dst, src, count, res) \ do { \ int __d0, __d1, __d2; \ - might_sleep(); \ + might_fault(); \ __asm__ __volatile__( \ " testl %1,%1\n" \ " jz 2f\n" \
@@ -126,7 +126,7 @@ EXPORT_SYMBOL(strncpy_from_user);#define __do_clear_user (addr,size) \ do { \ int __d0; \ - might_sleep(); \ + might_fault(); \ __asm__ __volatile__( \ "0: rep; stosl\n" \ " movl %2,%0\n" \
@@ -155,7 +155,7 @@ do { \unsigned long clear_user (void __user *to,unsigned long n) { -might_sleep (); +might_fault ();if (access_ok (VERIFY_WRITE , to, n))__do_clear_user (to, n);return n;
@@ -197,7 +197,7 @@ long strnlen_user(const char __user *s, long n)unsigned long mask = -__addr_ok (s);unsigned long res, tmp; -might_sleep (); +might_fault (); __asm__ __volatile__( " testl %0, %0\n"
arch/x86/lib/usercopy_64.c +2 -2
@@ -15,7 +15,7 @@#define __do_strncpy_from_user (dst,src,count,res) \ do { \ long __d0, __d1, __d2; \ - might_sleep(); \ + might_fault(); \ __asm__ __volatile__( \ " testq %1,%1\n" \ " jz 2f\n" \
@@ -64,7 +64,7 @@ EXPORT_SYMBOL(strncpy_from_user);unsigned long __clear_user (void __user *addr,unsigned long size) {long __d0; -might_sleep (); +might_fault ();/* no memory constraint because it doesn't change any memory gcc knows about */ asm volatile(
arch/x86/mm/init_32.c +3 -0
@@ -21,6 +21,7 @@#include <linux/init.h> #include <linux/highmem.h> #include <linux/pagemap.h> +#include <linux/pci.h> #include <linux/pfn.h> #include <linux/poison.h> #include <linux/bootmem.h>
@@ -967,6 +968,8 @@ void __init mem_init(void)int codesize, reservedpages, datasize, initsize;int tmp; +pci_iommu_alloc (); +#ifdef CONFIG_FLATMEM BUG_ON (!mem_map);#endif
include/asm-generic/bug.h +3 -4
@@ -41,15 +41,14 @@ struct bug_entry {#ifndef __WARN#ifndef __ASSEMBLY__ -extern void warn_on_slowpath (const char *file,const int line);extern void warn_slowpath (const char *file,const int line,const char *fmt, ...) __attribute__((format (printf,3 ,4 )));#define WANT_WARN_ON_SLOWPATH #endif -#define __WARN () warn_on_slowpath(__FILE__, __LINE__) -#define __WARN_printf(arg...) warn_slowpath(__FILE__, __LINE__, arg) +#define __WARN () warn_slowpath(__FILE__, __LINE__, NULL) +#define __WARN_printf(arg...) warn_slowpath(__FILE__, __LINE__, arg)#else -#define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0) +#define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0)#endif #ifndef WARN_ON
include/linux/bottom_half.h +0 -1
@@ -2,7 +2,6 @@#define _LINUX_BH_Hextern void local_bh_disable (void ); -extern void __local_bh_enable (void );extern void _local_bh_enable (void );extern void local_bh_enable (void );extern void local_bh_enable_ip (unsigned long ip);
include/linux/debug_locks.h +1 -1
@@ -17,7 +17,7 @@ extern int debug_locks_off(void); ({ \ int __ret = 0; \ \ - if (unlikely(c)) { \ + if (!oops_in_progress && unlikely(c)) { \ if (debug_locks_off() && !debug_locks_silent) \ WARN_ON(1); \ __ret = 1; \
include/linux/futex.h +4 -1
@@ -25,7 +25,8 @@ union ktime;#define FUTEX_WAKE_BITSET 10#define FUTEX_PRIVATE_FLAG 128 -#define FUTEX_CMD_MASK ~FUTEX_PRIVATE_FLAG +#define FUTEX_CLOCK_REALTIME 256 +#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)#define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
@@ -164,6 +165,8 @@ union futex_key { } both; }; +#define FUTEX_KEY_INIT (union futex_key) { .both = { .ptr = NULL } } +#ifdef CONFIG_FUTEX extern void exit_robust_list (struct task_struct *curr);extern void exit_pi_state_list (struct task_struct *curr);
include/linux/hardirq.h +9 -4
@@ -119,13 +119,17 @@ static inline void account_system_vtime(struct task_struct *tsk) }#endif -#if defined(CONFIG_PREEMPT_RCU ) && defined(CONFIG_NO_HZ ) +#if defined(CONFIG_NO_HZ ) && !defined(CONFIG_CLASSIC_RCU )extern void rcu_irq_enter (void );extern void rcu_irq_exit (void ); +extern void rcu_nmi_enter (void ); +extern void rcu_nmi_exit (void );#else # define rcu_irq_enter () do { } while (0)# define rcu_irq_exit () do { } while (0) -#endif /* CONFIG_PREEMPT_RCU */ +# define rcu_nmi_enter () do { } while (0) +# define rcu_nmi_exit () do { } while (0) +#endif /* #if defined(CONFIG_NO_HZ) && !defined(CONFIG_CLASSIC_RCU) */ /* * It is safe to do non-atomic ops on ->hardirq_context,
@@ -135,7 +139,6 @@ extern void rcu_irq_exit(void);*/ #define __irq_enter () \ do { \ - rcu_irq_enter(); \ account_system_vtime(current); \ add_preempt_count(HARDIRQ_OFFSET); \ trace_hardirq_enter(); \
@@ -154,7 +157,6 @@ extern void irq_enter(void);trace_hardirq_exit (); \account_system_vtime (current); \sub_preempt_count (HARDIRQ_OFFSET ); \ -rcu_irq_exit (); \ }while (0 )/*
@@ -166,11 +168,14 @@ extern void irq_exit(void);do { \ftrace_nmi_enter (); \lockdep_off (); \ +rcu_nmi_enter (); \__irq_enter (); \ } while (0) +#define nmi_exit () \ do { \ __irq_exit(); \ + rcu_nmi_exit(); \ lockdep_on(); \ ftrace_nmi_exit(); \ } while (0)
include/linux/kernel.h +11 -0
@@ -141,6 +141,15 @@ extern int _cond_resched(void); (__x <0 ) ? -__x : __x; \ }) +#ifdef CONFIG_PROVE_LOCKING +void might_fault (void ); +#else +static inline void might_fault (void ) +{ +might_sleep (); +} +#endif +extern struct atomic_notifier_head panic_notifier_list;extern long (*panic_blink)(long time); NORET_TYPE void panic(const char * fmt, ...)
@@ -188,6 +197,8 @@ extern unsigned long long memparse(const char *ptr, char **retptr);extern int core_kernel_text (unsigned long addr);extern int __kernel_text_address (unsigned long addr);extern int kernel_text_address (unsigned long addr); +extern int func_ptr_is_kernel_text (void *ptr); +struct pid ;extern struct pid *session_of_pgrp (struct pid *pgrp);
include/linux/lockdep.h +37 -6
100 lines not on this page · raw message
include/linux/mutex.h +2 -0
@@ -144,6 +144,8 @@ extern int __must_check mutex_lock_killable(struct mutex *lock);/* * NOTE: mutex_trylock() follows the spin_trylock() convention, * not the down_trylock() convention! +* +* Returns 1 if the mutex has been acquired successfully, and 0 on contention. */ extern int mutex_trylock (struct mutex *lock);extern void mutex_unlock (struct mutex *lock);
include/linux/rcuclassic.h +1 -1
@@ -41,7 +41,7 @@#include <linux/seqlock.h> #ifdef CONFIG_RCU_CPU_STALL_DETECTOR -#define RCU_SECONDS_TILL_STALL_CHECK ( 3 * HZ)/* for rcp->jiffies_stall */ +#define RCU_SECONDS_TILL_STALL_CHECK (10 * HZ)/* for rcp->jiffies_stall */ #define RCU_SECONDS_TILL_STALL_RECHECK (30 * HZ)/* for rcp->jiffies_stall */ #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
include/linux/rcupdate.h +7 -3
@@ -52,11 +52,15 @@ struct rcu_head {void (*func)(struct rcu_head *head); }; -#ifdef CONFIG_CLASSIC_RCU +#if defined(CONFIG_CLASSIC_RCU )#include <linux/rcuclassic.h> -#else /* #ifdef CONFIG_CLASSIC_RCU */ +#elif defined(CONFIG_TREE_RCU ) +#include <linux/rcutree.h> +#elif defined(CONFIG_PREEMPT_RCU )#include <linux/rcupreempt.h> -#endif /* #else #ifdef CONFIG_CLASSIC_RCU */ +#else +#error "Unknown RCU implementation specified to kernel configuration" +#endif /* #else #if defined(CONFIG_CLASSIC_RCU) */ #define RCU_HEAD_INIT { .next = NULL, .func = NULL }#define RCU_HEAD (head) struct rcu_head head = RCU_HEAD_INIT
include/linux/rcutree.h new file +329 -0
329 lines not on this page · raw message
include/linux/swiotlb.h +22 -0
@@ -7,9 +7,31 @@ struct device;struct dma_attrs ;struct scatterlist ; +/* +* Maximum allowable number of contiguous slabs to map, +* must be a power of 2. What is the appropriate value ? +* The complexity of {map,unmap}_single is linearly dependent on this value. +*/ +#define IO_TLB_SEGSIZE 128 + + +/* +* log of the size of each IO TLB slab. The number of slabs is command line +* controllable. +*/ +#define IO_TLB_SHIFT 11 +extern void swiotlb_init (void ); +extern void *swiotlb_alloc_boot (size_t bytes,unsigned long nslabs); +extern void *swiotlb_alloc (unsigned order,unsigned long nslabs); + +extern dma_addr_t swiotlb_phys_to_bus (phys_addr_t address); +extern phys_addr_t swiotlb_bus_to_phys (dma_addr_t address); + +extern int swiotlb_arch_range_needs_mapping (void *ptr,size_t size); +extern void *swiotlb_alloc_coherent (struct device *hwdev,size_t size,dma_addr_t *dma_handle,gfp_t flags);
include/linux/uaccess.h +1 -1
@@ -78,7 +78,7 @@ static inline unsigned long __copy_from_user_nocache(void *to, \set_fs (KERNEL_DS ); \pagefault_disable (); \ - ret = __get_user(retval, (__force typeof(retval) __user *)(addr)); \ + ret = __copy_from_user_inatomic(&(retval), (__force typeof(retval) __user *)(addr), sizeof(retval)); \pagefault_enable (); \set_fs (old_fs); \ ret; \
init/Kconfig +83 -3
93 lines not on this page · raw message
kernel/Kconfig.preempt +0 -25
@@ -52,28 +52,3 @@ config PREEMPT endchoice -config PREEMPT_RCU - bool "Preemptible RCU" - depends on PREEMPT - default n - help - This option reduces the latency of the kernel by making certain - RCU sections preemptible. Normally RCU code is non-preemptible, if - this option is selected then read-only RCU sections become - preemptible. This helps latency, but may expose bugs due to - now-naive assumptions about each RCU read-side critical section - remaining on a given CPU through its execution. - - Say N if you are unsure. - -config RCU_TRACE - bool "Enable tracing for RCU - currently stats in debugfs" - depends on PREEMPT_RCU - select DEBUG_FS - default y - help - This option provides tracing in RCU which presents stats - in debugfs for debugging RCU implementation. - - Say Y here if you want to enable RCU tracing - Say N if you are unsure.
kernel/Makefile +3 -3
@@ -73,10 +73,10 @@ obj-$(CONFIG_GENERIC_HARDIRQS) += irq/ obj-$(CONFIG_SECCOMP) += seccomp.o obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o obj-$(CONFIG_CLASSIC_RCU) += rcuclassic.o +obj-$(CONFIG_TREE_RCU) += rcutree.o obj-$(CONFIG_PREEMPT_RCU) += rcupreempt.o -ifeq ($(CONFIG_PREEMPT_RCU),y) -obj-$(CONFIG_RCU_TRACE) += rcupreempt_trace.o -endif +obj-$(CONFIG_TREE_RCU_TRACE) += rcutree_trace.o +obj-$(CONFIG_PREEMPT_RCU_TRACE) += rcupreempt_trace.o obj-$(CONFIG_RELAY) += relay.o obj-$(CONFIG_SYSCTL) += utsname_sysctl.o obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
kernel/exit.c +1 -1
@@ -1328,10 +1328,10 @@ static int wait_task_zombie(struct task_struct *p, int options,* group, which consolidates times for all threads in the * group including the group leader. */ +thread_group_cputime (p, &cputime);spin_lock_irq (&p->parent->sighand->siglock); psig = p->parent->signal; sig = p->signal; -thread_group_cputime (p, &cputime); psig->cutime = cputime_add(psig->cutime, cputime_add(cputime.utime,
kernel/extable.c +16 -0
@@ -67,3 +67,19 @@ int kernel_text_address(unsigned long addr)return 1 ;return module_text_address (addr) !=NULL ; } + +/* +* On some architectures (PPC64, IA64) function pointers +* are actually only tokens to some data that then holds the +* real function address. As a result, to find if a function +* pointer is part of the kernel text, we need to do some +* special dereferencing first. +*/ +int func_ptr_is_kernel_text (void *ptr) +{ +unsigned long addr; + addr = (unsigned long )dereference_function_descriptor (ptr); +if (core_kernel_text (addr)) +return 1 ; +return module_text_address (addr) !=NULL ; +}
kernel/futex.c +136 -215
718 lines not on this page · raw message
kernel/irq/manage.c +12 -0
@@ -673,6 +673,18 @@ int request_irq(unsigned int irq, irq_handler_t handler,struct irq_desc *desc;int retval; +/* +* handle_IRQ_event() always ignores IRQF_DISABLED except for +* the _first_ irqaction (sigh). That can cause oopsing, but +* the behavior is classified as "will not fix" so we need to +* start nudging drivers away from using that idiom. +*/ +if ((irqflags & (IRQF_SHARED |IRQF_DISABLED )) + == (IRQF_SHARED |IRQF_DISABLED )) +pr_warning ("IRQ %d/%s: IRQF_DISABLED is not " +"guaranteed on shared IRQs\n" , + irq, devname); +#ifdef CONFIG_LOCKDEP /* * Lockdep wants atomic interrupt handlers:
kernel/lockdep.c +32 -28
197 lines not on this page · raw message
kernel/lockdep_proc.c +23 -5
@@ -470,11 +470,12 @@ static void seq_line(struct seq_file *m, char c, int offset, int length)static void snprint_time (char *buf,size_t bufsiz,s64 nr) { -unsigned long rem; +s64 div; +s32 rem; nr +=5 ;/* for display rounding */ - rem =do_div (nr,1000 );/* XXX: do_div_signed */ -snprintf (buf, bufsiz,"%lld.%02d" , (long long )nr, (int )rem/10 ); + div =div_s64_rem (nr,1000 , &rem); +snprintf (buf, bufsiz,"%lld.%02d" , (long long )div, (int )rem/10 ); }static void seq_time (struct seq_file *m,s64 time)
@@ -556,7 +557,7 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data)if (stats->read_holdtime.nr) namelen +=2 ; -for (i =0 ; i <ARRAY_SIZE (class->contention_point); i++) { +for (i =0 ; i <LOCKSTAT_POINTS ; i++) {char sym[KSYM_SYMBOL_LEN ];char ip[32 ];
@@ -573,6 +574,23 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data) stats->contention_point[i], ip, sym); } +for (i =0 ; i <LOCKSTAT_POINTS ; i++) { +char sym[KSYM_SYMBOL_LEN ]; +char ip[32 ]; + +if (class->contending_point[i] ==0 ) +break ; + +if (!i) +seq_line (m,'-' ,40 -namelen, namelen); + +sprint_symbol (sym, class->contending_point[i]); +snprintf (ip,sizeof (ip),"[<%p>]" , + (void *)class->contending_point[i]); +seq_printf (m,"%40s %14lu %29s %s\n" , name, + stats->contending_point[i], + ip, sym); + }if (i) {seq_puts (m,"\n" );seq_line (m,'.' ,0 ,40 +1 +10 * (14 +1 ));
@@ -582,7 +600,7 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data)static void seq_header (struct seq_file *m) { -seq_printf (m,"lock_stat version 0.2\n" ); +seq_printf (m,"lock_stat version 0.3\n" );seq_line (m,'-' ,0 ,40 +1 +10 * (14 +1 )); seq_printf(m, "%40s %14s %14s %14s %14s %14s %14s %14s %14s " "%14s %14s\n",
kernel/mutex.c +5 -5
@@ -59,7 +59,7 @@ EXPORT_SYMBOL(__mutex_init);* We also put the fastpath first in the kernel image, to make sure the * branch is predicted by the CPU as default-untaken. */ -static void noinline __sched +static __used noinline void __sched__mutex_lock_slowpath (atomic_t *lock_count);/***
@@ -96,7 +96,7 @@ void inline __sched mutex_lock(struct mutex *lock)EXPORT_SYMBOL (mutex_lock);#endif -static noinline void __sched __mutex_unlock_slowpath(atomic_t *lock_count); +static __used noinline void __sched __mutex_unlock_slowpath(atomic_t *lock_count);/*** * mutex_unlock - release the mutex
@@ -184,7 +184,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, } done: -lock_acquired (&lock->dep_map); +lock_acquired (&lock->dep_map, ip);/* got the lock - rejoice! */ mutex_remove_waiter (lock, &waiter,task_thread_info (task));debug_mutex_set_owner (lock,task_thread_info (task));
@@ -268,7 +268,7 @@ __mutex_unlock_common_slowpath(atomic_t *lock_count, int nested)/* * Release the lock, slowpath: */ -static noinline void +static __used noinline void__mutex_unlock_slowpath (atomic_t *lock_count) {__mutex_unlock_common_slowpath (lock_count,1 );
@@ -313,7 +313,7 @@ int __sched mutex_lock_killable(struct mutex *lock) }EXPORT_SYMBOL (mutex_lock_killable); -static noinline void __sched +static __used noinline void __sched__mutex_lock_slowpath (atomic_t *lock_count) { struct mutex *lock = container_of(lock_count, struct mutex, count);
kernel/notifier.c +8 -0
@@ -82,6 +82,14 @@ static int __kprobes notifier_call_chain(struct notifier_block **nl,while (nb && nr_to_call) { next_nb =rcu_dereference (nb->next); + +#ifdef CONFIG_DEBUG_NOTIFIERS +if (unlikely (!func_ptr_is_kernel_text (nb->notifier_call))) { +WARN (1 ,"Invalid notifier called!" ); + nb = next_nb; +continue ; + } +#endif ret = nb->notifier_call (nb, val, v);if (nr_calls)
kernel/panic.c +12 -20
@@ -21,6 +21,7 @@#include <linux/debug_locks.h> #include <linux/random.h> #include <linux/kallsyms.h> +#include <linux/dmi.h> int panic_on_oops;static unsigned long tainted_mask;
@@ -321,36 +322,27 @@ void oops_exit(void) }#ifdef WANT_WARN_ON_SLOWPATH -void warn_on_slowpath (const char *file,int line) -{ -char function[KSYM_SYMBOL_LEN ]; -unsigned long caller = (unsigned long )__builtin_return_address (0 ); -sprint_symbol (function, caller); - -printk (KERN_WARNING "------------[ cut here ]------------\n" ); -printk (KERN_WARNING "WARNING: at %s:%d %s()\n" , file, - line, function); -print_modules (); -dump_stack (); -print_oops_end_marker (); -add_taint (TAINT_WARN ); -} -EXPORT_SYMBOL (warn_on_slowpath); - -void warn_slowpath (const char *file,int line,const char *fmt, ...) {va_list args;char function[KSYM_SYMBOL_LEN ];unsigned long caller = (unsigned long )__builtin_return_address (0 ); +const char *board; +sprint_symbol (function, caller);printk (KERN_WARNING "------------[ cut here ]------------\n" );printk (KERN_WARNING "WARNING: at %s:%d %s()\n" , file, line, function); -va_start (args, fmt); -vprintk (fmt, args); -va_end (args); + board =dmi_get_system_info (DMI_PRODUCT_NAME ); +if (board) +printk (KERN_WARNING "Hardware name: %s\n" , board); + +if (fmt) { +va_start (args, fmt); +vprintk (fmt, args); +va_end (args); + }print_modules ();dump_stack ();
kernel/posix-cpu-timers.c +5 -5
@@ -58,21 +58,21 @@ void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times) { - struct signal_struct *sig; + struct task_cputime *totals, *tot;int i; -struct task_cputime *tot; - sig = tsk->signal; -if (unlikely (!sig) || !sig->cputime.totals) { + totals = tsk->signal->cputime.totals; +if (!totals) { times->utime = tsk->utime; times->stime = tsk->stime; times->sum_exec_runtime = tsk->se.sum_exec_runtime;return ; } + times->stime = times->utime = cputime_zero; times->sum_exec_runtime =0 ;for_each_possible_cpu (i) { - tot =per_cpu_ptr (tsk->signal->cputime.totals, i); + tot =per_cpu_ptr (totals, i); times->utime =cputime_add (times->utime, tot->utime); times->stime =cputime_add (times->stime, tot->stime); times->sum_exec_runtime += tot->sum_exec_runtime;
kernel/printk.c +1 -1
@@ -662,7 +662,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)if (recursion_bug) { recursion_bug =0 ;strcpy (printk_buf, recursion_bug_msg); - printed_len =sizeof (recursion_bug_msg); + printed_len =strlen (recursion_bug_msg); }/* Emit the output into the temporary buffer */ printed_len += vscnprintf(printk_buf + printed_len,
kernel/rcuclassic.c +2 -2
@@ -191,7 +191,7 @@ static void print_other_cpu_stall(struct rcu_ctrlblk *rcp)/* OK, time to rat on our buddy... */ -printk (KERN_ERR "RCU detected CPU stalls:" ); +printk (KERN_ERR "INFO: RCU detected CPU stalls:" );for_each_possible_cpu (cpu) {if (cpu_isset (cpu, rcp->cpumask))printk (" %d" , cpu);
@@ -204,7 +204,7 @@ static void print_cpu_stall(struct rcu_ctrlblk *rcp) {unsigned long flags; -printk (KERN_ERR "RCU detected CPU %d stall (t=%lu/%lu jiffies)\n" , +printk (KERN_ERR "INFO: RCU detected CPU %d stall (t=%lu/%lu jiffies)\n" ,smp_processor_id (), jiffies, jiffies - rcp->gp_start);dump_stack ();
kernel/rcupreempt.c +10 -0
@@ -551,6 +551,16 @@ void rcu_irq_exit(void) } } +void rcu_nmi_enter (void ) +{ +rcu_irq_enter (); +} + +void rcu_nmi_exit (void ) +{ +rcu_irq_exit (); +} +static void dyntick_save_progress_counter (int cpu) {struct rcu_dyntick_sched *rdssp = &per_cpu (rcu_dyntick_sched, cpu);
kernel/rcupreempt_trace.c +5 -5
@@ -149,12 +149,12 @@ static void rcupreempt_trace_sum(struct rcupreempt_trace *sp) sp->done_length += cp->done_length; sp->done_add += cp->done_add; sp->done_remove += cp->done_remove; -atomic_set (&sp->done_invoked,atomic_read (&cp->done_invoked)); +atomic_add (atomic_read (&cp->done_invoked), &sp->done_invoked); sp->rcu_check_callbacks += cp->rcu_check_callbacks; -atomic_set (&sp->rcu_try_flip_1, -atomic_read (&cp->rcu_try_flip_1)); -atomic_set (&sp->rcu_try_flip_e1, -atomic_read (&cp->rcu_try_flip_e1)); +atomic_add (atomic_read (&cp->rcu_try_flip_1), + &sp->rcu_try_flip_1); +atomic_add (atomic_read (&cp->rcu_try_flip_e1), + &sp->rcu_try_flip_e1); sp->rcu_try_flip_i1 += cp->rcu_try_flip_i1; sp->rcu_try_flip_ie1 += cp->rcu_try_flip_ie1; sp->rcu_try_flip_g1 += cp->rcu_try_flip_g1;
kernel/rcutorture.c +56 -10
164 lines not on this page · raw message
kernel/rcutree.c new file +1535 -0
76 lines not on this page · raw message
kernel/rcutree_trace.c new file +271 -0
271 lines not on this page · raw message
lib/swiotlb.c +188 -67
255 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.