Skip to content

Commit 58329c4

Browse files
committed
padata: Disable BH when taking works lock on MT path
As the old padata code can execute in softirq context, disable softirqs for the new padata_do_mutithreaded code too as otherwise lockdep will get antsy. Reported-by: [email protected] Signed-off-by: Herbert Xu <[email protected]> Acked-by: Daniel Jordan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 42c2d7d commit 58329c4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernel/padata.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static int __init padata_work_alloc_mt(int nworks, void *data,
106106
{
107107
int i;
108108

109-
spin_lock(&padata_works_lock);
109+
spin_lock_bh(&padata_works_lock);
110110
/* Start at 1 because the current task participates in the job. */
111111
for (i = 1; i < nworks; ++i) {
112112
struct padata_work *pw = padata_work_alloc();
@@ -116,7 +116,7 @@ static int __init padata_work_alloc_mt(int nworks, void *data,
116116
padata_work_init(pw, padata_mt_helper, data, 0);
117117
list_add(&pw->pw_list, head);
118118
}
119-
spin_unlock(&padata_works_lock);
119+
spin_unlock_bh(&padata_works_lock);
120120

121121
return i;
122122
}
@@ -134,12 +134,12 @@ static void __init padata_works_free(struct list_head *works)
134134
if (list_empty(works))
135135
return;
136136

137-
spin_lock(&padata_works_lock);
137+
spin_lock_bh(&padata_works_lock);
138138
list_for_each_entry_safe(cur, next, works, pw_list) {
139139
list_del(&cur->pw_list);
140140
padata_work_free(cur);
141141
}
142-
spin_unlock(&padata_works_lock);
142+
spin_unlock_bh(&padata_works_lock);
143143
}
144144

145145
static void padata_parallel_worker(struct work_struct *parallel_work)

0 commit comments

Comments
 (0)