Skip to content

Commit 75b56ec

Browse files
committed
Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: lockdep: Fix lockdep_no_validate against IRQ states mutex: Make mutex_destroy() an inline function plist: Remove the need to supply locks to plist heads lockup detector: Fix reference to the non-existent CONFIG_DETECT_SOFTLOCKUP option
2 parents 6d16d6d + efbe2ee commit 75b56ec

11 files changed

Lines changed: 20 additions & 71 deletions

File tree

‎include/linux/mutex.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ do { \
9292
\
9393
__mutex_init((mutex), #mutex, &__key); \
9494
} while (0)
95-
# define mutex_destroy(mutex) do { } while (0)
95+
static inline void mutex_destroy(struct mutex *lock) {}
9696
#endif
9797

9898
#ifdef CONFIG_DEBUG_LOCK_ALLOC

‎include/linux/plist.h‎

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,9 @@
7777

7878
#include <linux/kernel.h>
7979
#include <linux/list.h>
80-
#include <linux/spinlock_types.h>
8180

8281
struct plist_head {
8382
struct list_head node_list;
84-
#ifdef CONFIG_DEBUG_PI_LIST
85-
raw_spinlock_t *rawlock;
86-
spinlock_t *spinlock;
87-
#endif
8883
};
8984

9085
struct plist_node {
@@ -93,37 +88,13 @@ struct plist_node {
9388
struct list_head node_list;
9489
};
9590

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-
10791
/**
10892
* PLIST_HEAD_INIT - static struct plist_head initializer
10993
* @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
12294
*/
123-
#define PLIST_HEAD_INIT_RAW(head, _lock) \
95+
#define PLIST_HEAD_INIT(head) \
12496
{ \
125-
_PLIST_HEAD_INIT(head), \
126-
PLIST_HEAD_LOCK_INIT_RAW(&(_lock)) \
97+
.node_list = LIST_HEAD_INIT((head).node_list) \
12798
}
12899

129100
/**
@@ -141,31 +112,11 @@ struct plist_node {
141112
/**
142113
* plist_head_init - dynamic struct plist_head initializer
143114
* @head: &struct plist_head pointer
144-
* @lock: spinlock protecting the list (debugging)
145115
*/
146116
static inline void
147-
plist_head_init(struct plist_head *head, spinlock_t *lock)
117+
plist_head_init(struct plist_head *head)
148118
{
149119
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
169120
}
170121

171122
/**

‎include/linux/rtmutex.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct hrtimer_sleeper;
6666

6767
#define __RT_MUTEX_INITIALIZER(mutexname) \
6868
{ .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) \
7070
, .owner = NULL \
7171
__DEBUG_RT_MUTEX_INITIALIZER(mutexname)}
7272

@@ -100,7 +100,7 @@ extern void rt_mutex_unlock(struct rt_mutex *lock);
100100

101101
#ifdef CONFIG_RT_MUTEXES
102102
# 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), \
104104
INIT_RT_MUTEX_DEBUG(tsk)
105105
#else
106106
# define INIT_RT_MUTEXES(tsk)

‎kernel/fork.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ static void rt_mutex_init_task(struct task_struct *p)
10121012
{
10131013
raw_spin_lock_init(&p->pi_lock);
10141014
#ifdef CONFIG_RT_MUTEXES
1015-
plist_head_init_raw(&p->pi_waiters, &p->pi_lock);
1015+
plist_head_init(&p->pi_waiters);
10161016
p->pi_blocked_on = NULL;
10171017
#endif
10181018
}

‎kernel/futex.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2697,7 +2697,7 @@ static int __init futex_init(void)
26972697
futex_cmpxchg_enabled = 1;
26982698

26992699
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);
27012701
spin_lock_init(&futex_queues[i].lock);
27022702
}
27032703

‎kernel/lockdep.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,6 +2468,9 @@ mark_held_locks(struct task_struct *curr, enum mark_type mark)
24682468

24692469
BUG_ON(usage_bit >= LOCK_USAGE_STATES);
24702470

2471+
if (hlock_class(hlock)->key == &__lockdep_no_validate__)
2472+
continue;
2473+
24712474
if (!mark_lock(curr, hlock, usage_bit))
24722475
return 0;
24732476
}

‎kernel/pm_qos_params.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static DEFINE_SPINLOCK(pm_qos_lock);
7474
static struct pm_qos_object null_pm_qos;
7575
static BLOCKING_NOTIFIER_HEAD(cpu_dma_lat_notifier);
7676
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),
7878
.notifiers = &cpu_dma_lat_notifier,
7979
.name = "cpu_dma_latency",
8080
.target_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE,
@@ -84,7 +84,7 @@ static struct pm_qos_object cpu_dma_pm_qos = {
8484

8585
static BLOCKING_NOTIFIER_HEAD(network_lat_notifier);
8686
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),
8888
.notifiers = &network_lat_notifier,
8989
.name = "network_latency",
9090
.target_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE,
@@ -95,7 +95,7 @@ static struct pm_qos_object network_lat_pm_qos = {
9595

9696
static BLOCKING_NOTIFIER_HEAD(network_throughput_notifier);
9797
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),
9999
.notifiers = &network_throughput_notifier,
100100
.name = "network_throughput",
101101
.target_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE,

‎kernel/rtmutex.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ void __rt_mutex_init(struct rt_mutex *lock, const char *name)
890890
{
891891
lock->owner = NULL;
892892
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);
894894

895895
debug_rt_mutex_init(lock, name);
896896
}

‎kernel/sched.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7937,7 +7937,7 @@ static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
79377937
#ifdef CONFIG_SMP
79387938
rt_rq->rt_nr_migratory = 0;
79397939
rt_rq->overloaded = 0;
7940-
plist_head_init_raw(&rt_rq->pushable_tasks, &rq->lock);
7940+
plist_head_init(&rt_rq->pushable_tasks);
79417941
#endif
79427942

79437943
rt_rq->rt_time = 0;
@@ -8142,7 +8142,7 @@ void __init sched_init(void)
81428142
#endif
81438143

81448144
#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);
81468146
#endif
81478147

81488148
/*

‎lib/Kconfig.debug‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ config BOOTPARAM_SOFTLOCKUP_PANIC_VALUE
227227
config DETECT_HUNG_TASK
228228
bool "Detect Hung Tasks"
229229
depends on DEBUG_KERNEL
230-
default DETECT_SOFTLOCKUP
230+
default LOCKUP_DETECTOR
231231
help
232232
Say Y here to enable the kernel to detect "hung tasks",
233233
which are bugs that cause the task to be stuck in
@@ -866,7 +866,7 @@ config BOOT_PRINTK_DELAY
866866
system, and then set "lpj=M" before setting "boot_delay=N".
867867
NOTE: Using this option may adversely affect SMP systems.
868868
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
870870
what it believes to be lockup conditions.
871871

872872
config RCU_TORTURE_TEST

0 commit comments

Comments
 (0)