diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/cpufreq.h | 4 | ||||
| -rw-r--r-- | include/linux/hugetlb.h | 1 | ||||
| -rw-r--r-- | include/linux/libata.h | 1 | ||||
| -rw-r--r-- | include/linux/mlx4/device.h | 4 | ||||
| -rw-r--r-- | include/linux/mutex.h | 4 | ||||
| -rw-r--r-- | include/linux/of_fdt.h | 3 | ||||
| -rw-r--r-- | include/linux/of_mdio.h | 8 | ||||
| -rw-r--r-- | include/linux/osq_lock.h | 27 | ||||
| -rw-r--r-- | include/linux/pagemap.h | 12 | ||||
| -rw-r--r-- | include/linux/rcupdate.h | 46 | ||||
| -rw-r--r-- | include/linux/rwsem-spinlock.h | 8 | ||||
| -rw-r--r-- | include/linux/rwsem.h | 34 | ||||
| -rw-r--r-- | include/linux/sched.h | 8 |
13 files changed, 84 insertions, 76 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index ec4112d257bc..8f8ae95c6e27 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -482,8 +482,8 @@ extern struct cpufreq_governor cpufreq_gov_conservative; | |||
| 482 | *********************************************************************/ | 482 | *********************************************************************/ |
| 483 | 483 | ||
| 484 | /* Special Values of .frequency field */ | 484 | /* Special Values of .frequency field */ |
| 485 | #define CPUFREQ_ENTRY_INVALID ~0 | 485 | #define CPUFREQ_ENTRY_INVALID ~0u |
| 486 | #define CPUFREQ_TABLE_END ~1 | 486 | #define CPUFREQ_TABLE_END ~1u |
| 487 | /* Special Values of .flags field */ | 487 | /* Special Values of .flags field */ |
| 488 | #define CPUFREQ_BOOST_FREQ (1 << 0) | 488 | #define CPUFREQ_BOOST_FREQ (1 << 0) |
| 489 | 489 | ||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 255cd5cc0754..a23c096b3080 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -80,6 +80,7 @@ int dequeue_hwpoisoned_huge_page(struct page *page); | |||
| 80 | bool isolate_huge_page(struct page *page, struct list_head *list); | 80 | bool isolate_huge_page(struct page *page, struct list_head *list); |
| 81 | void putback_active_hugepage(struct page *page); | 81 | void putback_active_hugepage(struct page *page); |
| 82 | bool is_hugepage_active(struct page *page); | 82 | bool is_hugepage_active(struct page *page); |
| 83 | void free_huge_page(struct page *page); | ||
| 83 | 84 | ||
| 84 | #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE | 85 | #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE |
| 85 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); | 86 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 5ab4e3a76721..92abb497ab14 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -593,6 +593,7 @@ struct ata_host { | |||
| 593 | struct device *dev; | 593 | struct device *dev; |
| 594 | void __iomem * const *iomap; | 594 | void __iomem * const *iomap; |
| 595 | unsigned int n_ports; | 595 | unsigned int n_ports; |
| 596 | unsigned int n_tags; /* nr of NCQ tags */ | ||
| 596 | void *private_data; | 597 | void *private_data; |
| 597 | struct ata_port_operations *ops; | 598 | struct ata_port_operations *ops; |
| 598 | unsigned long flags; | 599 | unsigned long flags; |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index b12f4bbd064c..35b51e7af886 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -578,8 +578,6 @@ struct mlx4_cq { | |||
| 578 | u32 cons_index; | 578 | u32 cons_index; |
| 579 | 579 | ||
| 580 | u16 irq; | 580 | u16 irq; |
| 581 | bool irq_affinity_change; | ||
| 582 | |||
| 583 | __be32 *set_ci_db; | 581 | __be32 *set_ci_db; |
| 584 | __be32 *arm_db; | 582 | __be32 *arm_db; |
| 585 | int arm_sn; | 583 | int arm_sn; |
| @@ -1167,6 +1165,8 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap, | |||
| 1167 | int *vector); | 1165 | int *vector); |
| 1168 | void mlx4_release_eq(struct mlx4_dev *dev, int vec); | 1166 | void mlx4_release_eq(struct mlx4_dev *dev, int vec); |
| 1169 | 1167 | ||
| 1168 | int mlx4_eq_get_irq(struct mlx4_dev *dev, int vec); | ||
| 1169 | |||
| 1170 | int mlx4_get_phys_port_id(struct mlx4_dev *dev); | 1170 | int mlx4_get_phys_port_id(struct mlx4_dev *dev); |
| 1171 | int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); | 1171 | int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); |
| 1172 | int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); | 1172 | int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 11692dea18aa..42aa9b9ecd5f 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/lockdep.h> | 17 | #include <linux/lockdep.h> |
| 18 | #include <linux/atomic.h> | 18 | #include <linux/atomic.h> |
| 19 | #include <asm/processor.h> | 19 | #include <asm/processor.h> |
| 20 | #include <linux/osq_lock.h> | ||
| 20 | 21 | ||
| 21 | /* | 22 | /* |
| 22 | * Simple, straightforward mutexes with strict semantics: | 23 | * Simple, straightforward mutexes with strict semantics: |
| @@ -46,7 +47,6 @@ | |||
| 46 | * - detects multi-task circular deadlocks and prints out all affected | 47 | * - detects multi-task circular deadlocks and prints out all affected |
| 47 | * locks and tasks (and only those tasks) | 48 | * locks and tasks (and only those tasks) |
| 48 | */ | 49 | */ |
| 49 | struct optimistic_spin_queue; | ||
| 50 | struct mutex { | 50 | struct mutex { |
| 51 | /* 1: unlocked, 0: locked, negative: locked, possible waiters */ | 51 | /* 1: unlocked, 0: locked, negative: locked, possible waiters */ |
| 52 | atomic_t count; | 52 | atomic_t count; |
| @@ -56,7 +56,7 @@ struct mutex { | |||
| 56 | struct task_struct *owner; | 56 | struct task_struct *owner; |
| 57 | #endif | 57 | #endif |
| 58 | #ifdef CONFIG_MUTEX_SPIN_ON_OWNER | 58 | #ifdef CONFIG_MUTEX_SPIN_ON_OWNER |
| 59 | struct optimistic_spin_queue *osq; /* Spinner MCS lock */ | 59 | struct optimistic_spin_queue osq; /* Spinner MCS lock */ |
| 60 | #endif | 60 | #endif |
| 61 | #ifdef CONFIG_DEBUG_MUTEXES | 61 | #ifdef CONFIG_DEBUG_MUTEXES |
| 62 | const char *name; | 62 | const char *name; |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 05117899fcb4..0ff360d5b3b3 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
| @@ -73,6 +73,8 @@ extern int early_init_dt_scan_root(unsigned long node, const char *uname, | |||
| 73 | int depth, void *data); | 73 | int depth, void *data); |
| 74 | 74 | ||
| 75 | extern bool early_init_dt_scan(void *params); | 75 | extern bool early_init_dt_scan(void *params); |
| 76 | extern bool early_init_dt_verify(void *params); | ||
| 77 | extern void early_init_dt_scan_nodes(void); | ||
| 76 | 78 | ||
| 77 | extern const char *of_flat_dt_get_machine_name(void); | 79 | extern const char *of_flat_dt_get_machine_name(void); |
| 78 | extern const void *of_flat_dt_match_machine(const void *default_match, | 80 | extern const void *of_flat_dt_match_machine(const void *default_match, |
| @@ -84,6 +86,7 @@ extern void unflatten_and_copy_device_tree(void); | |||
| 84 | extern void early_init_devtree(void *); | 86 | extern void early_init_devtree(void *); |
| 85 | extern void early_get_first_memblock_info(void *, phys_addr_t *); | 87 | extern void early_get_first_memblock_info(void *, phys_addr_t *); |
| 86 | extern u64 fdt_translate_address(const void *blob, int node_offset); | 88 | extern u64 fdt_translate_address(const void *blob, int node_offset); |
| 89 | extern void of_fdt_limit_memory(int limit); | ||
| 87 | #else /* CONFIG_OF_FLATTREE */ | 90 | #else /* CONFIG_OF_FLATTREE */ |
| 88 | static inline void early_init_fdt_scan_reserved_mem(void) {} | 91 | static inline void early_init_fdt_scan_reserved_mem(void) {} |
| 89 | static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } | 92 | static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } |
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h index a70c9493d55a..d449018d0726 100644 --- a/include/linux/of_mdio.h +++ b/include/linux/of_mdio.h | |||
| @@ -25,9 +25,6 @@ struct phy_device *of_phy_attach(struct net_device *dev, | |||
| 25 | 25 | ||
| 26 | extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); | 26 | extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); |
| 27 | 27 | ||
| 28 | extern void of_mdiobus_link_phydev(struct mii_bus *mdio, | ||
| 29 | struct phy_device *phydev); | ||
| 30 | |||
| 31 | #else /* CONFIG_OF */ | 28 | #else /* CONFIG_OF */ |
| 32 | static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) | 29 | static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) |
| 33 | { | 30 | { |
| @@ -63,11 +60,6 @@ static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np) | |||
| 63 | { | 60 | { |
| 64 | return NULL; | 61 | return NULL; |
| 65 | } | 62 | } |
| 66 | |||
| 67 | static inline void of_mdiobus_link_phydev(struct mii_bus *mdio, | ||
| 68 | struct phy_device *phydev) | ||
| 69 | { | ||
| 70 | } | ||
| 71 | #endif /* CONFIG_OF */ | 63 | #endif /* CONFIG_OF */ |
| 72 | 64 | ||
| 73 | #if defined(CONFIG_OF) && defined(CONFIG_FIXED_PHY) | 65 | #if defined(CONFIG_OF) && defined(CONFIG_FIXED_PHY) |
diff --git a/include/linux/osq_lock.h b/include/linux/osq_lock.h new file mode 100644 index 000000000000..90230d5811c5 --- /dev/null +++ b/include/linux/osq_lock.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #ifndef __LINUX_OSQ_LOCK_H | ||
| 2 | #define __LINUX_OSQ_LOCK_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * An MCS like lock especially tailored for optimistic spinning for sleeping | ||
| 6 | * lock implementations (mutex, rwsem, etc). | ||
| 7 | */ | ||
| 8 | |||
| 9 | #define OSQ_UNLOCKED_VAL (0) | ||
| 10 | |||
| 11 | struct optimistic_spin_queue { | ||
| 12 | /* | ||
| 13 | * Stores an encoded value of the CPU # of the tail node in the queue. | ||
| 14 | * If the queue is empty, then it's set to OSQ_UNLOCKED_VAL. | ||
| 15 | */ | ||
| 16 | atomic_t tail; | ||
| 17 | }; | ||
| 18 | |||
| 19 | /* Init macro and function. */ | ||
| 20 | #define OSQ_LOCK_UNLOCKED { ATOMIC_INIT(OSQ_UNLOCKED_VAL) } | ||
| 21 | |||
| 22 | static inline void osq_lock_init(struct optimistic_spin_queue *lock) | ||
| 23 | { | ||
| 24 | atomic_set(&lock->tail, OSQ_UNLOCKED_VAL); | ||
| 25 | } | ||
| 26 | |||
| 27 | #endif | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 0a97b583ee8d..e1474ae18c88 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -399,6 +399,18 @@ static inline struct page *read_mapping_page(struct address_space *mapping, | |||
| 399 | } | 399 | } |
| 400 | 400 | ||
| 401 | /* | 401 | /* |
| 402 | * Get the offset in PAGE_SIZE. | ||
| 403 | * (TODO: hugepage should have ->index in PAGE_SIZE) | ||
| 404 | */ | ||
| 405 | static inline pgoff_t page_to_pgoff(struct page *page) | ||
| 406 | { | ||
| 407 | if (unlikely(PageHeadHuge(page))) | ||
| 408 | return page->index << compound_order(page); | ||
| 409 | else | ||
| 410 | return page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); | ||
| 411 | } | ||
| 412 | |||
| 413 | /* | ||
| 402 | * Return byte-offset into filesystem object for page. | 414 | * Return byte-offset into filesystem object for page. |
| 403 | */ | 415 | */ |
| 404 | static inline loff_t page_offset(struct page *page) | 416 | static inline loff_t page_offset(struct page *page) |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 5a75d19aa661..6a94cc8b1ca0 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -44,7 +44,6 @@ | |||
| 44 | #include <linux/debugobjects.h> | 44 | #include <linux/debugobjects.h> |
| 45 | #include <linux/bug.h> | 45 | #include <linux/bug.h> |
| 46 | #include <linux/compiler.h> | 46 | #include <linux/compiler.h> |
| 47 | #include <linux/percpu.h> | ||
| 48 | #include <asm/barrier.h> | 47 | #include <asm/barrier.h> |
| 49 | 48 | ||
| 50 | extern int rcu_expedited; /* for sysctl */ | 49 | extern int rcu_expedited; /* for sysctl */ |
| @@ -300,41 +299,6 @@ bool __rcu_is_watching(void); | |||
| 300 | #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ | 299 | #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ |
| 301 | 300 | ||
| 302 | /* | 301 | /* |
| 303 | * Hooks for cond_resched() and friends to avoid RCU CPU stall warnings. | ||
| 304 | */ | ||
| 305 | |||
| 306 | #define RCU_COND_RESCHED_LIM 256 /* ms vs. 100s of ms. */ | ||
| 307 | DECLARE_PER_CPU(int, rcu_cond_resched_count); | ||
| 308 | void rcu_resched(void); | ||
| 309 | |||
| 310 | /* | ||
| 311 | * Is it time to report RCU quiescent states? | ||
| 312 | * | ||
| 313 | * Note unsynchronized access to rcu_cond_resched_count. Yes, we might | ||
| 314 | * increment some random CPU's count, and possibly also load the result from | ||
| 315 | * yet another CPU's count. We might even clobber some other CPU's attempt | ||
| 316 | * to zero its counter. This is all OK because the goal is not precision, | ||
| 317 | * but rather reasonable amortization of rcu_note_context_switch() overhead | ||
| 318 | * and extremely high probability of avoiding RCU CPU stall warnings. | ||
| 319 | * Note that this function has to be preempted in just the wrong place, | ||
| 320 | * many thousands of times in a row, for anything bad to happen. | ||
| 321 | */ | ||
| 322 | static inline bool rcu_should_resched(void) | ||
| 323 | { | ||
| 324 | return raw_cpu_inc_return(rcu_cond_resched_count) >= | ||
| 325 | RCU_COND_RESCHED_LIM; | ||
| 326 | } | ||
| 327 | |||
| 328 | /* | ||
| 329 | * Report quiscent states to RCU if it is time to do so. | ||
| 330 | */ | ||
| 331 | static inline void rcu_cond_resched(void) | ||
| 332 | { | ||
| 333 | if (unlikely(rcu_should_resched())) | ||
| 334 | rcu_resched(); | ||
| 335 | } | ||
| 336 | |||
| 337 | /* | ||
| 338 | * Infrastructure to implement the synchronize_() primitives in | 302 | * Infrastructure to implement the synchronize_() primitives in |
| 339 | * TREE_RCU and rcu_barrier_() primitives in TINY_RCU. | 303 | * TREE_RCU and rcu_barrier_() primitives in TINY_RCU. |
| 340 | */ | 304 | */ |
| @@ -358,9 +322,19 @@ void wait_rcu_gp(call_rcu_func_t crf); | |||
| 358 | * initialization. | 322 | * initialization. |
| 359 | */ | 323 | */ |
| 360 | #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD | 324 | #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD |
| 325 | void init_rcu_head(struct rcu_head *head); | ||
| 326 | void destroy_rcu_head(struct rcu_head *head); | ||
| 361 | void init_rcu_head_on_stack(struct rcu_head *head); | 327 | void init_rcu_head_on_stack(struct rcu_head *head); |
| 362 | void destroy_rcu_head_on_stack(struct rcu_head *head); | 328 | void destroy_rcu_head_on_stack(struct rcu_head *head); |
| 363 | #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ | 329 | #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ |
| 330 | static inline void init_rcu_head(struct rcu_head *head) | ||
| 331 | { | ||
| 332 | } | ||
| 333 | |||
| 334 | static inline void destroy_rcu_head(struct rcu_head *head) | ||
| 335 | { | ||
| 336 | } | ||
| 337 | |||
| 364 | static inline void init_rcu_head_on_stack(struct rcu_head *head) | 338 | static inline void init_rcu_head_on_stack(struct rcu_head *head) |
| 365 | { | 339 | { |
| 366 | } | 340 | } |
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h index d5b13bc07a0b..561e8615528d 100644 --- a/include/linux/rwsem-spinlock.h +++ b/include/linux/rwsem-spinlock.h | |||
| @@ -15,13 +15,13 @@ | |||
| 15 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
| 16 | /* | 16 | /* |
| 17 | * the rw-semaphore definition | 17 | * the rw-semaphore definition |
| 18 | * - if activity is 0 then there are no active readers or writers | 18 | * - if count is 0 then there are no active readers or writers |
| 19 | * - if activity is +ve then that is the number of active readers | 19 | * - if count is +ve then that is the number of active readers |
| 20 | * - if activity is -1 then there is one active writer | 20 | * - if count is -1 then there is one active writer |
| 21 | * - if wait_list is not empty, then there are processes waiting for the semaphore | 21 | * - if wait_list is not empty, then there are processes waiting for the semaphore |
| 22 | */ | 22 | */ |
| 23 | struct rw_semaphore { | 23 | struct rw_semaphore { |
| 24 | __s32 activity; | 24 | __s32 count; |
| 25 | raw_spinlock_t wait_lock; | 25 | raw_spinlock_t wait_lock; |
| 26 | struct list_head wait_list; | 26 | struct list_head wait_list; |
| 27 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 27 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 8d79708146aa..035d3c57fc8a 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h | |||
| @@ -13,10 +13,11 @@ | |||
| 13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
| 15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
| 16 | |||
| 17 | #include <linux/atomic.h> | 16 | #include <linux/atomic.h> |
| 17 | #ifdef CONFIG_RWSEM_SPIN_ON_OWNER | ||
| 18 | #include <linux/osq_lock.h> | ||
| 19 | #endif | ||
| 18 | 20 | ||
| 19 | struct optimistic_spin_queue; | ||
| 20 | struct rw_semaphore; | 21 | struct rw_semaphore; |
| 21 | 22 | ||
| 22 | #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK | 23 | #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK |
| @@ -25,15 +26,15 @@ struct rw_semaphore; | |||
| 25 | /* All arch specific implementations share the same struct */ | 26 | /* All arch specific implementations share the same struct */ |
| 26 | struct rw_semaphore { | 27 | struct rw_semaphore { |
| 27 | long count; | 28 | long count; |
| 28 | raw_spinlock_t wait_lock; | ||
| 29 | struct list_head wait_list; | 29 | struct list_head wait_list; |
| 30 | #ifdef CONFIG_SMP | 30 | raw_spinlock_t wait_lock; |
| 31 | #ifdef CONFIG_RWSEM_SPIN_ON_OWNER | ||
| 32 | struct optimistic_spin_queue osq; /* spinner MCS lock */ | ||
| 31 | /* | 33 | /* |
| 32 | * Write owner. Used as a speculative check to see | 34 | * Write owner. Used as a speculative check to see |
| 33 | * if the owner is running on the cpu. | 35 | * if the owner is running on the cpu. |
| 34 | */ | 36 | */ |
| 35 | struct task_struct *owner; | 37 | struct task_struct *owner; |
| 36 | struct optimistic_spin_queue *osq; /* spinner MCS lock */ | ||
| 37 | #endif | 38 | #endif |
| 38 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 39 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 39 | struct lockdep_map dep_map; | 40 | struct lockdep_map dep_map; |
| @@ -64,22 +65,19 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) | |||
| 64 | # define __RWSEM_DEP_MAP_INIT(lockname) | 65 | # define __RWSEM_DEP_MAP_INIT(lockname) |
| 65 | #endif | 66 | #endif |
| 66 | 67 | ||
| 67 | #if defined(CONFIG_SMP) && !defined(CONFIG_RWSEM_GENERIC_SPINLOCK) | 68 | #ifdef CONFIG_RWSEM_SPIN_ON_OWNER |
| 68 | #define __RWSEM_INITIALIZER(name) \ | 69 | #define __RWSEM_OPT_INIT(lockname) , .osq = OSQ_LOCK_UNLOCKED, .owner = NULL |
| 69 | { RWSEM_UNLOCKED_VALUE, \ | ||
| 70 | __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \ | ||
| 71 | LIST_HEAD_INIT((name).wait_list), \ | ||
| 72 | NULL, /* owner */ \ | ||
| 73 | NULL /* mcs lock */ \ | ||
| 74 | __RWSEM_DEP_MAP_INIT(name) } | ||
| 75 | #else | 70 | #else |
| 76 | #define __RWSEM_INITIALIZER(name) \ | 71 | #define __RWSEM_OPT_INIT(lockname) |
| 77 | { RWSEM_UNLOCKED_VALUE, \ | ||
| 78 | __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \ | ||
| 79 | LIST_HEAD_INIT((name).wait_list) \ | ||
| 80 | __RWSEM_DEP_MAP_INIT(name) } | ||
| 81 | #endif | 72 | #endif |
| 82 | 73 | ||
| 74 | #define __RWSEM_INITIALIZER(name) \ | ||
| 75 | { .count = RWSEM_UNLOCKED_VALUE, \ | ||
| 76 | .wait_list = LIST_HEAD_INIT((name).wait_list), \ | ||
| 77 | .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock) \ | ||
| 78 | __RWSEM_OPT_INIT(name) \ | ||
| 79 | __RWSEM_DEP_MAP_INIT(name) } | ||
| 80 | |||
| 83 | #define DECLARE_RWSEM(name) \ | 81 | #define DECLARE_RWSEM(name) \ |
| 84 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 82 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
| 85 | 83 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 0fd19055bb64..45cec6b70eaf 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -872,21 +872,21 @@ enum cpu_idle_type { | |||
| 872 | #define SD_NUMA 0x4000 /* cross-node balancing */ | 872 | #define SD_NUMA 0x4000 /* cross-node balancing */ |
| 873 | 873 | ||
| 874 | #ifdef CONFIG_SCHED_SMT | 874 | #ifdef CONFIG_SCHED_SMT |
| 875 | static inline const int cpu_smt_flags(void) | 875 | static inline int cpu_smt_flags(void) |
| 876 | { | 876 | { |
| 877 | return SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES; | 877 | return SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES; |
| 878 | } | 878 | } |
| 879 | #endif | 879 | #endif |
| 880 | 880 | ||
| 881 | #ifdef CONFIG_SCHED_MC | 881 | #ifdef CONFIG_SCHED_MC |
| 882 | static inline const int cpu_core_flags(void) | 882 | static inline int cpu_core_flags(void) |
| 883 | { | 883 | { |
| 884 | return SD_SHARE_PKG_RESOURCES; | 884 | return SD_SHARE_PKG_RESOURCES; |
| 885 | } | 885 | } |
| 886 | #endif | 886 | #endif |
| 887 | 887 | ||
| 888 | #ifdef CONFIG_NUMA | 888 | #ifdef CONFIG_NUMA |
| 889 | static inline const int cpu_numa_flags(void) | 889 | static inline int cpu_numa_flags(void) |
| 890 | { | 890 | { |
| 891 | return SD_NUMA; | 891 | return SD_NUMA; |
| 892 | } | 892 | } |
| @@ -999,7 +999,7 @@ void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms); | |||
| 999 | bool cpus_share_cache(int this_cpu, int that_cpu); | 999 | bool cpus_share_cache(int this_cpu, int that_cpu); |
| 1000 | 1000 | ||
| 1001 | typedef const struct cpumask *(*sched_domain_mask_f)(int cpu); | 1001 | typedef const struct cpumask *(*sched_domain_mask_f)(int cpu); |
| 1002 | typedef const int (*sched_domain_flags_f)(void); | 1002 | typedef int (*sched_domain_flags_f)(void); |
| 1003 | 1003 | ||
| 1004 | #define SDTL_OVERLAP 0x01 | 1004 | #define SDTL_OVERLAP 0x01 |
| 1005 | 1005 | ||
