Skip to content

Commit

Permalink
Merge branches 'core/debugobjects', 'core/iommu', 'core/locking', 'co…
Browse files Browse the repository at this point in the history
…re/printk', 'core/rcu', 'core/resources', 'core/softirq' and 'core/stacktrace' into core/core
  • Loading branch information
Ingo Molnar committed Dec 25, 2008
9 parents cc37d3d + 3ae7020 + a086366 + 00ef9f7 + 26cc271 + 12d79ba + 3ac5266 + 8b752e3 + 9212ddb commit 6638101
Show file tree
Hide file tree
Showing 34 changed files with 3,058 additions and 173 deletions.
2 changes: 2 additions & 0 deletions Documentation/RCU/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
413 changes: 413 additions & 0 deletions Documentation/RCU/trace.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions arch/powerpc/platforms/pseries/rtasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions arch/x86/include/asm/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions arch/x86/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/x86/include/asm/pci_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
13 changes: 4 additions & 9 deletions arch/x86/kernel/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
{
Expand Down
29 changes: 29 additions & 0 deletions arch/x86/kernel/pci-swiotlb_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions arch/x86/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion include/linux/bottom_half.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define _LINUX_BH_H

extern 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);
Expand Down
14 changes: 8 additions & 6 deletions include/linux/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(); \
Expand All @@ -153,15 +156,14 @@ extern void irq_enter(void);
trace_hardirq_exit(); \
account_system_vtime(current); \
sub_preempt_count(HARDIRQ_OFFSET); \
rcu_irq_exit(); \
} while (0)

/*
* Exit irq context and process softirqs if needed:
*/
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 */
12 changes: 10 additions & 2 deletions include/linux/lockdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,15 @@ extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
extern void lock_release(struct lockdep_map *lock, int nested,
unsigned long ip);

extern void lock_set_subclass(struct lockdep_map *lock, unsigned int subclass,
unsigned long ip);
extern void lock_set_class(struct lockdep_map *lock, const char *name,
struct lock_class_key *key, unsigned int subclass,
unsigned long ip);

static inline void lock_set_subclass(struct lockdep_map *lock,
unsigned int subclass, unsigned long ip)
{
lock_set_class(lock, lock->name, lock->key, subclass, ip);
}

# define INIT_LOCKDEP .lockdep_recursion = 0,

Expand All @@ -333,6 +340,7 @@ static inline void lockdep_on(void)

# define lock_acquire(l, s, t, r, c, n, i) do { } while (0)
# define lock_release(l, n, i) do { } while (0)
# define lock_set_class(l, n, k, s, i) do { } while (0)
# define lock_set_subclass(l, s, i) do { } while (0)
# define lockdep_init() do { } while (0)
# define lockdep_info() do { } while (0)
Expand Down
10 changes: 7 additions & 3 deletions include/linux/rcupdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 6638101

Please sign in to comment.