diff options
-rw-r--r-- | include/linux/mutex.h | 2 | ||||
-rw-r--r-- | include/linux/plist.h | 55 | ||||
-rw-r--r-- | include/linux/rtmutex.h | 4 | ||||
-rw-r--r-- | kernel/fork.c | 2 | ||||
-rw-r--r-- | kernel/futex.c | 2 | ||||
-rw-r--r-- | kernel/lockdep.c | 3 | ||||
-rw-r--r-- | kernel/pm_qos_params.c | 6 | ||||
-rw-r--r-- | kernel/rtmutex.c | 2 | ||||
-rw-r--r-- | kernel/sched.c | 4 | ||||
-rw-r--r-- | lib/Kconfig.debug | 4 | ||||
-rw-r--r-- | lib/plist.c | 7 |
11 files changed, 20 insertions, 71 deletions
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index a940fe435aca..7f87217e9d1f 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -92,7 +92,7 @@ do { \ | |||
92 | \ | 92 | \ |
93 | __mutex_init((mutex), #mutex, &__key); \ | 93 | __mutex_init((mutex), #mutex, &__key); \ |
94 | } while (0) | 94 | } while (0) |
95 | # define mutex_destroy(mutex) do { } while (0) | 95 | static inline void mutex_destroy(struct mutex *lock) {} |
96 | #endif | 96 | #endif |
97 | 97 | ||
98 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 98 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
diff --git a/include/linux/plist.h b/include/linux/plist.h index c9b9f322c8d8..aa0fb390bd29 100644 --- a/include/linux/plist.h +++ b/include/linux/plist.h | |||
@@ -77,14 +77,9 @@ | |||
77 | 77 | ||
78 | #include <linux/kernel.h> | 78 | #include <linux/kernel.h> |
79 | #include <linux/list.h> | 79 | #include <linux/list.h> |
80 | #include <linux/spinlock_types.h> | ||
81 | 80 | ||
82 | struct plist_head { | 81 | struct plist_head { |
83 | struct list_head node_list; | 82 | struct list_head node_list; |
84 | #ifdef CONFIG_DEBUG_PI_LIST | ||
85 | raw_spinlock_t *rawlock; | ||
86 | spinlock_t *spinlock; | ||
87 | #endif | ||
88 | }; | 83 | }; |
89 | 84 | ||
90 | struct plist_node { | 85 | struct plist_node { |
@@ -93,37 +88,13 @@ struct plist_node { | |||
93 | struct list_head node_list; | 88 | struct list_head node_list; |
94 | }; | 89 | }; |
95 | 90 | ||
96 | #ifdef CONFIG_DEBUG_PI_LIST | ||
97 | # define PLIST_HEAD_LOCK_INIT(_lock) .spinlock = _lock | ||
98 | # define PLIST_HEAD_LOCK_INIT_RAW(_lock) .rawlock = _lock | ||
99 | #else | ||
100 | # define PLIST_HEAD_LOCK_INIT(_lock) | ||
101 | # define PLIST_HEAD_LOCK_INIT_RAW(_lock) | ||
102 | #endif | ||
103 | |||
104 | #define _PLIST_HEAD_INIT(head) \ | ||
105 | .node_list = LIST_HEAD_INIT((head).node_list) | ||
106 | |||
107 | /** | 91 | /** |
108 | * PLIST_HEAD_INIT - static struct plist_head initializer | 92 | * PLIST_HEAD_INIT - static struct plist_head initializer |
109 | * @head: struct plist_head variable name | 93 | * @head: struct plist_head variable name |
110 | * @_lock: lock to initialize for this list | ||
111 | */ | ||
112 | #define PLIST_HEAD_INIT(head, _lock) \ | ||
113 | { \ | ||
114 | _PLIST_HEAD_INIT(head), \ | ||
115 | PLIST_HEAD_LOCK_INIT(&(_lock)) \ | ||
116 | } | ||
117 | |||
118 | /** | ||
119 | * PLIST_HEAD_INIT_RAW - static struct plist_head initializer | ||
120 | * @head: struct plist_head variable name | ||
121 | * @_lock: lock to initialize for this list | ||
122 | */ | 94 | */ |
123 | #define PLIST_HEAD_INIT_RAW(head, _lock) \ | 95 | #define PLIST_HEAD_INIT(head) \ |
124 | { \ | 96 | { \ |
125 | _PLIST_HEAD_INIT(head), \ | 97 | .node_list = LIST_HEAD_INIT((head).node_list) \ |
126 | PLIST_HEAD_LOCK_INIT_RAW(&(_lock)) \ | ||
127 | } | 98 | } |
128 | 99 | ||
129 | /** | 100 | /** |
@@ -141,31 +112,11 @@ struct plist_node { | |||
141 | /** | 112 | /** |
142 | * plist_head_init - dynamic struct plist_head initializer | 113 | * plist_head_init - dynamic struct plist_head initializer |
143 | * @head: &struct plist_head pointer | 114 | * @head: &struct plist_head pointer |
144 | * @lock: spinlock protecting the list (debugging) | ||
145 | */ | 115 | */ |
146 | static inline void | 116 | static inline void |
147 | plist_head_init(struct plist_head *head, spinlock_t *lock) | 117 | plist_head_init(struct plist_head *head) |
148 | { | 118 | { |
149 | INIT_LIST_HEAD(&head->node_list); | 119 | INIT_LIST_HEAD(&head->node_list); |
150 | #ifdef CONFIG_DEBUG_PI_LIST | ||
151 | head->spinlock = lock; | ||
152 | head->rawlock = NULL; | ||
153 | #endif | ||
154 | } | ||
155 | |||
156 | /** | ||
157 | * plist_head_init_raw - dynamic struct plist_head initializer | ||
158 | * @head: &struct plist_head pointer | ||
159 | * @lock: raw_spinlock protecting the list (debugging) | ||
160 | */ | ||
161 | static inline void | ||
162 | plist_head_init_raw(struct plist_head *head, raw_spinlock_t *lock) | ||
163 | { | ||
164 | INIT_LIST_HEAD(&head->node_list); | ||
165 | #ifdef CONFIG_DEBUG_PI_LIST | ||
166 | head->rawlock = lock; | ||
167 | head->spinlock = NULL; | ||
168 | #endif | ||
169 | } | 120 | } |
170 | 121 | ||
171 | /** | 122 | /** |
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index 8d522ffeda33..de17134244f3 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h | |||
@@ -66,7 +66,7 @@ struct hrtimer_sleeper; | |||
66 | 66 | ||
67 | #define __RT_MUTEX_INITIALIZER(mutexname) \ | 67 | #define __RT_MUTEX_INITIALIZER(mutexname) \ |
68 | { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ | 68 | { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ |
69 | , .wait_list = PLIST_HEAD_INIT_RAW(mutexname.wait_list, mutexname.wait_lock) \ | 69 | , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list) \ |
70 | , .owner = NULL \ | 70 | , .owner = NULL \ |
71 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} | 71 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} |
72 | 72 | ||
@@ -100,7 +100,7 @@ extern void rt_mutex_unlock(struct rt_mutex *lock); | |||
100 | 100 | ||
101 | #ifdef CONFIG_RT_MUTEXES | 101 | #ifdef CONFIG_RT_MUTEXES |
102 | # define INIT_RT_MUTEXES(tsk) \ | 102 | # define INIT_RT_MUTEXES(tsk) \ |
103 | .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \ | 103 | .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters), \ |
104 | INIT_RT_MUTEX_DEBUG(tsk) | 104 | INIT_RT_MUTEX_DEBUG(tsk) |
105 | #else | 105 | #else |
106 | # define INIT_RT_MUTEXES(tsk) | 106 | # define INIT_RT_MUTEXES(tsk) |
diff --git a/kernel/fork.c b/kernel/fork.c index 4d4117e01504..ca339c5c5819 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1012,7 +1012,7 @@ static void rt_mutex_init_task(struct task_struct *p) | |||
1012 | { | 1012 | { |
1013 | raw_spin_lock_init(&p->pi_lock); | 1013 | raw_spin_lock_init(&p->pi_lock); |
1014 | #ifdef CONFIG_RT_MUTEXES | 1014 | #ifdef CONFIG_RT_MUTEXES |
1015 | plist_head_init_raw(&p->pi_waiters, &p->pi_lock); | 1015 | plist_head_init(&p->pi_waiters); |
1016 | p->pi_blocked_on = NULL; | 1016 | p->pi_blocked_on = NULL; |
1017 | #endif | 1017 | #endif |
1018 | } | 1018 | } |
diff --git a/kernel/futex.c b/kernel/futex.c index fe28dc282eae..3fbc76cbb9aa 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -2697,7 +2697,7 @@ static int __init futex_init(void) | |||
2697 | futex_cmpxchg_enabled = 1; | 2697 | futex_cmpxchg_enabled = 1; |
2698 | 2698 | ||
2699 | for (i = 0; i < ARRAY_SIZE(futex_queues); i++) { | 2699 | for (i = 0; i < ARRAY_SIZE(futex_queues); i++) { |
2700 | plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock); | 2700 | plist_head_init(&futex_queues[i].chain); |
2701 | spin_lock_init(&futex_queues[i].lock); | 2701 | spin_lock_init(&futex_queues[i].lock); |
2702 | } | 2702 | } |
2703 | 2703 | ||
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 298c9276dfdb..628276d05915 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -2468,6 +2468,9 @@ mark_held_locks(struct task_struct *curr, enum mark_type mark) | |||
2468 | 2468 | ||
2469 | BUG_ON(usage_bit >= LOCK_USAGE_STATES); | 2469 | BUG_ON(usage_bit >= LOCK_USAGE_STATES); |
2470 | 2470 | ||
2471 | if (hlock_class(hlock)->key == &__lockdep_no_validate__) | ||
2472 | continue; | ||
2473 | |||
2471 | if (!mark_lock(curr, hlock, usage_bit)) | 2474 | if (!mark_lock(curr, hlock, usage_bit)) |
2472 | return 0; | 2475 | return 0; |
2473 | } | 2476 | } |
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c index 6824ca7d4d0c..37f05d0f0793 100644 --- a/kernel/pm_qos_params.c +++ b/kernel/pm_qos_params.c | |||
@@ -74,7 +74,7 @@ static DEFINE_SPINLOCK(pm_qos_lock); | |||
74 | static struct pm_qos_object null_pm_qos; | 74 | static struct pm_qos_object null_pm_qos; |
75 | static BLOCKING_NOTIFIER_HEAD(cpu_dma_lat_notifier); | 75 | static BLOCKING_NOTIFIER_HEAD(cpu_dma_lat_notifier); |
76 | static struct pm_qos_object cpu_dma_pm_qos = { | 76 | static struct pm_qos_object cpu_dma_pm_qos = { |
77 | .requests = PLIST_HEAD_INIT(cpu_dma_pm_qos.requests, pm_qos_lock), | 77 | .requests = PLIST_HEAD_INIT(cpu_dma_pm_qos.requests), |
78 | .notifiers = &cpu_dma_lat_notifier, | 78 | .notifiers = &cpu_dma_lat_notifier, |
79 | .name = "cpu_dma_latency", | 79 | .name = "cpu_dma_latency", |
80 | .target_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE, | 80 | .target_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE, |
@@ -84,7 +84,7 @@ static struct pm_qos_object cpu_dma_pm_qos = { | |||
84 | 84 | ||
85 | static BLOCKING_NOTIFIER_HEAD(network_lat_notifier); | 85 | static BLOCKING_NOTIFIER_HEAD(network_lat_notifier); |
86 | static struct pm_qos_object network_lat_pm_qos = { | 86 | static struct pm_qos_object network_lat_pm_qos = { |
87 | .requests = PLIST_HEAD_INIT(network_lat_pm_qos.requests, pm_qos_lock), | 87 | .requests = PLIST_HEAD_INIT(network_lat_pm_qos.requests), |
88 | .notifiers = &network_lat_notifier, | 88 | .notifiers = &network_lat_notifier, |
89 | .name = "network_latency", | 89 | .name = "network_latency", |
90 | .target_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE, | 90 | .target_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE, |
@@ -95,7 +95,7 @@ static struct pm_qos_object network_lat_pm_qos = { | |||
95 | 95 | ||
96 | static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier); | 96 | static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier); |
97 | static struct pm_qos_object network_throughput_pm_qos = { | 97 | static struct pm_qos_object network_throughput_pm_qos = { |
98 | .requests = PLIST_HEAD_INIT(network_throughput_pm_qos.requests, pm_qos_lock), | 98 | .requests = PLIST_HEAD_INIT(network_throughput_pm_qos.requests), |
99 | .notifiers = &network_throughput_notifier, | 99 | .notifiers = &network_throughput_notifier, |
100 | .name = "network_throughput", | 100 | .name = "network_throughput", |
101 | .target_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE, | 101 | .target_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE, |
diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c index ab449117aaf2..255e1662acdb 100644 --- a/kernel/rtmutex.c +++ b/kernel/rtmutex.c | |||
@@ -890,7 +890,7 @@ void __rt_mutex_init(struct rt_mutex *lock, const char *name) | |||
890 | { | 890 | { |
891 | lock->owner = NULL; | 891 | lock->owner = NULL; |
892 | raw_spin_lock_init(&lock->wait_lock); | 892 | raw_spin_lock_init(&lock->wait_lock); |
893 | plist_head_init_raw(&lock->wait_list, &lock->wait_lock); | 893 | plist_head_init(&lock->wait_list); |
894 | 894 | ||
895 | debug_rt_mutex_init(lock, name); | 895 | debug_rt_mutex_init(lock, name); |
896 | } | 896 | } |
diff --git a/kernel/sched.c b/kernel/sched.c index fde6ff903525..c518b05fd062 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -7937,7 +7937,7 @@ static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq) | |||
7937 | #ifdef CONFIG_SMP | 7937 | #ifdef CONFIG_SMP |
7938 | rt_rq->rt_nr_migratory = 0; | 7938 | rt_rq->rt_nr_migratory = 0; |
7939 | rt_rq->overloaded = 0; | 7939 | rt_rq->overloaded = 0; |
7940 | plist_head_init_raw(&rt_rq->pushable_tasks, &rq->lock); | 7940 | plist_head_init(&rt_rq->pushable_tasks); |
7941 | #endif | 7941 | #endif |
7942 | 7942 | ||
7943 | rt_rq->rt_time = 0; | 7943 | rt_rq->rt_time = 0; |
@@ -8142,7 +8142,7 @@ void __init sched_init(void) | |||
8142 | #endif | 8142 | #endif |
8143 | 8143 | ||
8144 | #ifdef CONFIG_RT_MUTEXES | 8144 | #ifdef CONFIG_RT_MUTEXES |
8145 | plist_head_init_raw(&init_task.pi_waiters, &init_task.pi_lock); | 8145 | plist_head_init(&init_task.pi_waiters); |
8146 | #endif | 8146 | #endif |
8147 | 8147 | ||
8148 | /* | 8148 | /* |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index dd373c8ee943..9c28fa4202f8 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -227,7 +227,7 @@ config BOOTPARAM_SOFTLOCKUP_PANIC_VALUE | |||
227 | config DETECT_HUNG_TASK | 227 | config DETECT_HUNG_TASK |
228 | bool "Detect Hung Tasks" | 228 | bool "Detect Hung Tasks" |
229 | depends on DEBUG_KERNEL | 229 | depends on DEBUG_KERNEL |
230 | default DETECT_SOFTLOCKUP | 230 | default LOCKUP_DETECTOR |
231 | help | 231 | help |
232 | Say Y here to enable the kernel to detect "hung tasks", | 232 | Say Y here to enable the kernel to detect "hung tasks", |
233 | which are bugs that cause the task to be stuck in | 233 | which are bugs that cause the task to be stuck in |
@@ -866,7 +866,7 @@ config BOOT_PRINTK_DELAY | |||
866 | system, and then set "lpj=M" before setting "boot_delay=N". | 866 | system, and then set "lpj=M" before setting "boot_delay=N". |
867 | NOTE: Using this option may adversely affect SMP systems. | 867 | NOTE: Using this option may adversely affect SMP systems. |
868 | I.e., processors other than the first one may not boot up. | 868 | I.e., processors other than the first one may not boot up. |
869 | BOOT_PRINTK_DELAY also may cause DETECT_SOFTLOCKUP to detect | 869 | BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect |
870 | what it believes to be lockup conditions. | 870 | what it believes to be lockup conditions. |
871 | 871 | ||
872 | config RCU_TORTURE_TEST | 872 | config RCU_TORTURE_TEST |
diff --git a/lib/plist.c b/lib/plist.c index 0ae7e6431726..a0a4da489c22 100644 --- a/lib/plist.c +++ b/lib/plist.c | |||
@@ -56,11 +56,6 @@ static void plist_check_list(struct list_head *top) | |||
56 | 56 | ||
57 | static void plist_check_head(struct plist_head *head) | 57 | static void plist_check_head(struct plist_head *head) |
58 | { | 58 | { |
59 | WARN_ON(head != &test_head && !head->rawlock && !head->spinlock); | ||
60 | if (head->rawlock) | ||
61 | WARN_ON_SMP(!raw_spin_is_locked(head->rawlock)); | ||
62 | if (head->spinlock) | ||
63 | WARN_ON_SMP(!spin_is_locked(head->spinlock)); | ||
64 | if (!plist_head_empty(head)) | 59 | if (!plist_head_empty(head)) |
65 | plist_check_list(&plist_first(head)->prio_list); | 60 | plist_check_list(&plist_first(head)->prio_list); |
66 | plist_check_list(&head->node_list); | 61 | plist_check_list(&head->node_list); |
@@ -180,7 +175,7 @@ static int __init plist_test(void) | |||
180 | unsigned int r = local_clock(); | 175 | unsigned int r = local_clock(); |
181 | 176 | ||
182 | printk(KERN_INFO "start plist test\n"); | 177 | printk(KERN_INFO "start plist test\n"); |
183 | plist_head_init(&test_head, NULL); | 178 | plist_head_init(&test_head); |
184 | for (i = 0; i < ARRAY_SIZE(test_node); i++) | 179 | for (i = 0; i < ARRAY_SIZE(test_node); i++) |
185 | plist_node_init(test_node + i, 0); | 180 | plist_node_init(test_node + i, 0); |
186 | 181 | ||