History

cgroup: Disable IRQs while holding css_set_lock

While testing the deadline scheduler + cgroup setup I hit this warning. [ 132.612935] ------------[ cut here ]------------ [ 132.612951] WARNING: CPU: 5 PID: 0 at kernel/softirq.c:150 __local_bh_enable_ip+0x6b/0x80 [ 132.612952] Modules linked in: (a ton of modules...) [ 132.612981] CPU: 5 PID: 0 Comm: swapper/5 Not tainted 4.7.0-rc2 #2 [ 132.612981] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.2-20150714_191134- 04/01/2014 [ 132.612982] 0000000000000086 45c8bb5effdd088b ffff88013fd43da0 ffffffff813d229e [ 132.612984] 0000000000000000 0000000000000000 ffff88013fd43de0 ffffffff810a652b [ 132.612985] 00000096811387b5 0000000000000200 ffff8800bab29d80 ffff880034c54c00 [ 132.612986] Call Trace: [ 132.612987] <IRQ> [<ffffffff813d229e>] dump_stack+0x63/0x85 [ 132.612994] [<ffffffff810a652b>] __warn+0xcb/0xf0 [ 132.612997] [<ffffffff810e76a0>] ? push_dl_task.part.32+0x170/0x170 [ 132.612999] [<ffffffff810a665d>] warn_slowpath_null+0x1d/0x20 [ 132.613000] [<ffffffff810aba5b>] __local_bh_enable_ip+0x6b/0x80 [ 132.613008] [<ffffffff817d6c8a>] _raw_write_unlock_bh+0x1a/0x20 [ 132.613010] [<ffffffff817d6c9e>] _raw_spin_unlock_bh+0xe/0x10 [ 132.613015] [<ffffffff811388ac>] put_css_set+0x5c/0x60 [ 132.613016] [<ffffffff8113dc7f>] cgroup_free+0x7f/0xa0 [ 132.613017] [<ffffffff810a3912>] __put_task_struct+0x42/0x140 [ 132.613018] [<ffffffff810e776a>] dl_task_timer+0xca/0x250 [ 132.613027] [<ffffffff810e76a0>] ? push_dl_task.part.32+0x170/0x170 [ 132.613030] [<ffffffff8111371e>] __hrtimer_run_queues+0xee/0x270 [ 132.613031] [<ffffffff81113ec8>] hrtimer_interrupt+0xa8/0x190 [ 132.613034] [<ffffffff81051a58>] local_apic_timer_interrupt+0x38/0x60 [ 132.613035] [<ffffffff817d9b0d>] smp_apic_timer_interrupt+0x3d/0x50 [ 132.613037] [<ffffffff817d7c5c>] apic_timer_interrupt+0x8c/0xa0 [ 132.613038] <EOI> [<ffffffff81063466>] ? native_safe_halt+0x6/0x10 [ 132.613043] [<ffffffff81037a4e>] default_idle+0x1e/0xd0 [ 132.613044] [<ffffffff810381cf>] arch_cpu_idle+0xf/0x20 [ 132.613046] [<ffffffff810e8fda>] default_idle_call+0x2a/0x40 [ 132.613047] [<ffffffff810e92d7>] cpu_startup_entry+0x2e7/0x340 [ 132.613048] [<ffffffff81050235>] start_secondary+0x155/0x190 [ 132.613049] ---[ end trace f91934d162ce9977 ]--- The warn is the spin_(lock|unlock)_bh(&css_set_lock) in the interrupt context. Converting the spin_lock_bh to spin_lock_irq(save) to avoid this problem - and other problems of sharing a spinlock with an interrupt.

Daniel Bristot de Oliveira committed 10 years ago

Commit 82d64891 parent 8fa3b8d1 file · +74 −68Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/cgroup.c+74−68
@@ -837,6 +837,8 @@ static void put_css_set_locked(struct css_set *cset) · 836 unmodified lines
837837
838838 static void put_css_set(struct css_set *cset)
839839 {
840+ unsigned long flags;
841+
840842 /*
841843 * Ensure that the refcount doesn't hit zero while any readers
842844 * can see it. Similar to atomic_dec_and_lock(), but for an
@@ -845,9 +847,9 @@ static void put_css_set(struct css_set *cset) · 2 unmodified lines
845847 if (atomic_add_unless(&cset->refcount, -1, 1))
846848 return;
847849
848− spin_lock_bh(&css_set_lock);
850+ spin_lock_irqsave(&css_set_lock, flags);
849851 put_css_set_locked(cset);
850− spin_unlock_bh(&css_set_lock);
852+ spin_unlock_irqrestore(&css_set_lock, flags);
851853 }
852854
853855 /*
@@ -1070,11 +1072,11 @@ static struct css_set *find_css_set(struct css_set *old_cset, · 216 unmodified lines
10701072
10711073 /* First see if we already have a cgroup group that matches
10721074 * the desired set */
1073− spin_lock_bh(&css_set_lock);
1075+ spin_lock_irq(&css_set_lock);
10741076 cset = find_existing_css_set(old_cset, cgrp, template);
10751077 if (cset)
10761078 get_css_set(cset);
1077− spin_unlock_bh(&css_set_lock);
1079+ spin_unlock_irq(&css_set_lock);
10781080
10791081 if (cset)
10801082 return cset;
@@ -1102,7 +1104,7 @@ static struct css_set *find_css_set(struct css_set *old_cset, · 21 unmodified lines
11021104 * find_existing_css_set() */
11031105 memcpy(cset->subsys, template, sizeof(cset->subsys));
11041106
1105− spin_lock_bh(&css_set_lock);
1107+ spin_lock_irq(&css_set_lock);
11061108 /* Add reference counts and links from the new css_set. */
11071109 list_for_each_entry(link, &old_cset->cgrp_links, cgrp_link) {
11081110 struct cgroup *c = link->cgrp;
@@ -1128,7 +1130,7 @@ static struct css_set *find_css_set(struct css_set *old_cset, · 19 unmodified lines
11281130 css_get(css);
11291131 }
11301132
1131− spin_unlock_bh(&css_set_lock);
1133+ spin_unlock_irq(&css_set_lock);
11321134
11331135 return cset;
11341136 }
@@ -1192,7 +1194,7 @@ static void cgroup_destroy_root(struct cgroup_root *root) · 57 unmodified lines
11921194 * Release all the links from cset_links to this hierarchy's
11931195 * root cgroup
11941196 */
1195− spin_lock_bh(&css_set_lock);
1197+ spin_lock_irq(&css_set_lock);
11961198
11971199 list_for_each_entry_safe(link, tmp_link, &cgrp->cset_links, cset_link) {
11981200 list_del(&link->cset_link);
@@ -1200,7 +1202,7 @@ static void cgroup_destroy_root(struct cgroup_root *root) · 1 unmodified line
12001202 kfree(link);
12011203 }
12021204
1203− spin_unlock_bh(&css_set_lock);
1205+ spin_unlock_irq(&css_set_lock);
12041206
12051207 if (!list_empty(&root->root_list)) {
12061208 list_del(&root->root_list);
@@ -1600,11 +1602,11 @@ static int rebind_subsystems(struct cgroup_root *dst_root, u16 ss_mask) · 393 unmodified lines
16001602 ss->root = dst_root;
16011603 css->cgroup = dcgrp;
16021604
1603− spin_lock_bh(&css_set_lock);
1605+ spin_lock_irq(&css_set_lock);
16041606 hash_for_each(css_set_table, i, cset, hlist)
16051607 list_move_tail(&cset->e_cset_node[ss->id],
16061608 &dcgrp->e_csets[ss->id]);
1607− spin_unlock_bh(&css_set_lock);
1609+ spin_unlock_irq(&css_set_lock);
16081610
16091611 /* default hierarchy doesn't enable controllers by default */
16101612 dst_root->subsys_mask |= 1 << ssid;
@@ -1640,10 +1642,10 @@ static int cgroup_show_path(struct seq_file *sf, struct kernfs_node *kf_node, · 29 unmodified lines
16401642 if (!buf)
16411643 return -ENOMEM;
16421644
1643− spin_lock_bh(&css_set_lock);
1645+ spin_lock_irq(&css_set_lock);
16441646 ns_cgroup = current_cgns_cgroup_from_root(kf_cgroot);
16451647 len = kernfs_path_from_node(kf_node, ns_cgroup->kn, buf, PATH_MAX);
1646− spin_unlock_bh(&css_set_lock);
1648+ spin_unlock_irq(&css_set_lock);
16471649
16481650 if (len >= PATH_MAX)
16491651 len = -ERANGE;
@@ -1897,7 +1899,7 @@ static void cgroup_enable_task_cg_lists(void) · 247 unmodified lines
18971899 {
18981900 struct task_struct *p, *g;
18991901
1900− spin_lock_bh(&css_set_lock);
1902+ spin_lock_irq(&css_set_lock);
19011903
19021904 if (use_task_css_set_links)
19031905 goto out_unlock;
@@ -1922,8 +1924,12 @@ static void cgroup_enable_task_cg_lists(void) · 18 unmodified lines
19221924 * entry won't be deleted though the process has exited.
19231925 * Do it while holding siglock so that we don't end up
19241926 * racing against cgroup_exit().
1927+ *
1928+ * Interrupts were already disabled while acquiring
1929+ * the css_set_lock, so we do not need to disable it
1930+ * again when acquiring the sighand->siglock here.
19251931 */
1926− spin_lock_irq(&p->sighand->siglock);
1932+ spin_lock(&p->sighand->siglock);
19271933 if (!(p->flags & PF_EXITING)) {
19281934 struct css_set *cset = task_css_set(p);
19291935
@@ -1932,11 +1938,11 @@ static void cgroup_enable_task_cg_lists(void) · 2 unmodified lines
19321938 list_add_tail(&p->cg_list, &cset->tasks);
19331939 get_css_set(cset);
19341940 }
1935− spin_unlock_irq(&p->sighand->siglock);
1941+ spin_unlock(&p->sighand->siglock);
19361942 } while_each_thread(g, p);
19371943 read_unlock(&tasklist_lock);
19381944 out_unlock:
1939− spin_unlock_bh(&css_set_lock);
1945+ spin_unlock_irq(&css_set_lock);
19401946 }
19411947
19421948 static void init_cgroup_housekeeping(struct cgroup *cgrp)
@@ -2043,13 +2049,13 @@ static int cgroup_setup_root(struct cgroup_root *root, u16 ss_mask) · 100 unmodified lines
20432049 * Link the root cgroup in this hierarchy into all the css_set
20442050 * objects.
20452051 */
2046− spin_lock_bh(&css_set_lock);
2052+ spin_lock_irq(&css_set_lock);
20472053 hash_for_each(css_set_table, i, cset, hlist) {
20482054 link_css_set(&tmp_links, cset, root_cgrp);
20492055 if (css_set_populated(cset))
20502056 cgroup_update_populated(root_cgrp, true);
20512057 }
2052− spin_unlock_bh(&css_set_lock);
2058+ spin_unlock_irq(&css_set_lock);
20532059
20542060 BUG_ON(!list_empty(&root_cgrp->self.children));
20552061 BUG_ON(atomic_read(&root->nr_cgrps) != 1);
@@ -2256,11 +2262,11 @@ out_mount: · 200 unmodified lines
22562262 struct cgroup *cgrp;
22572263
22582264 mutex_lock(&cgroup_mutex);
2259− spin_lock_bh(&css_set_lock);
2265+ spin_lock_irq(&css_set_lock);
22602266
22612267 cgrp = cset_cgroup_from_root(ns->root_cset, root);
22622268
2263− spin_unlock_bh(&css_set_lock);
2269+ spin_unlock_irq(&css_set_lock);
22642270 mutex_unlock(&cgroup_mutex);
22652271
22662272 nsdentry = kernfs_node_dentry(cgrp->kn, dentry->d_sb);
@@ -2337,11 +2343,11 @@ char *cgroup_path_ns(struct cgroup *cgrp, char *buf, size_t buflen, · 70 unmodified lines
23372343 char *ret;
23382344
23392345 mutex_lock(&cgroup_mutex);
2340− spin_lock_bh(&css_set_lock);
2346+ spin_lock_irq(&css_set_lock);
23412347
23422348 ret = cgroup_path_ns_locked(cgrp, buf, buflen, ns);
23432349
2344− spin_unlock_bh(&css_set_lock);
2350+ spin_unlock_irq(&css_set_lock);
23452351 mutex_unlock(&cgroup_mutex);
23462352
23472353 return ret;
@@ -2369,7 +2375,7 @@ char *task_cgroup_path(struct task_struct *task, char *buf, size_t buflen) · 21 unmodified lines
23692375 char *path = NULL;
23702376
23712377 mutex_lock(&cgroup_mutex);
2372− spin_lock_bh(&css_set_lock);
2378+ spin_lock_irq(&css_set_lock);
23732379
23742380 root = idr_get_next(&cgroup_hierarchy_idr, &hierarchy_id);
23752381
@@ -2382,7 +2388,7 @@ char *task_cgroup_path(struct task_struct *task, char *buf, size_t buflen) · 6 unmodified lines
23822388 path = buf;
23832389 }
23842390
2385− spin_unlock_bh(&css_set_lock);
2391+ spin_unlock_irq(&css_set_lock);
23862392 mutex_unlock(&cgroup_mutex);
23872393 return path;
23882394 }
@@ -2557,7 +2563,7 @@ static int cgroup_taskset_migrate(struct cgroup_taskset *tset, · 168 unmodified lines
25572563 * the new cgroup. There are no failure cases after here, so this
25582564 * is the commit point.
25592565 */
2560− spin_lock_bh(&css_set_lock);
2566+ spin_lock_irq(&css_set_lock);
25612567 list_for_each_entry(cset, &tset->src_csets, mg_node) {
25622568 list_for_each_entry_safe(task, tmp_task, &cset->mg_tasks, cg_list) {
25632569 struct css_set *from_cset = task_css_set(task);
@@ -2568,7 +2574,7 @@ static int cgroup_taskset_migrate(struct cgroup_taskset *tset, · 4 unmodified lines
25682574 put_css_set_locked(from_cset);
25692575 }
25702576 }
2571− spin_unlock_bh(&css_set_lock);
2577+ spin_unlock_irq(&css_set_lock);
25722578
25732579 /*
25742580 * Migration is committed, all target tasks are now on dst_csets.
@@ -2597,13 +2603,13 @@ out_cancel_attach: · 22 unmodified lines
25972603 }
25982604 } while_each_subsys_mask();
25992605 out_release_tset:
2600− spin_lock_bh(&css_set_lock);
2606+ spin_lock_irq(&css_set_lock);
26012607 list_splice_init(&tset->dst_csets, &tset->src_csets);
26022608 list_for_each_entry_safe(cset, tmp_cset, &tset->src_csets, mg_node) {
26032609 list_splice_tail_init(&cset->mg_tasks, &cset->tasks);
26042610 list_del_init(&cset->mg_node);
26052611 }
2606− spin_unlock_bh(&css_set_lock);
2612+ spin_unlock_irq(&css_set_lock);
26072613 return ret;
26082614 }
26092615
@@ -2634,7 +2640,7 @@ static void cgroup_migrate_finish(struct list_head *preloaded_csets) · 24 unmodified lines
26342640
26352641 lockdep_assert_held(&cgroup_mutex);
26362642
2637− spin_lock_bh(&css_set_lock);
2643+ spin_lock_irq(&css_set_lock);
26382644 list_for_each_entry_safe(cset, tmp_cset, preloaded_csets, mg_preload_node) {
26392645 cset->mg_src_cgrp = NULL;
26402646 cset->mg_dst_cgrp = NULL;
@@ -2642,7 +2648,7 @@ static void cgroup_migrate_finish(struct list_head *preloaded_csets) · 1 unmodified line
26422648 list_del_init(&cset->mg_preload_node);
26432649 put_css_set_locked(cset);
26442650 }
2645− spin_unlock_bh(&css_set_lock);
2651+ spin_unlock_irq(&css_set_lock);
26462652 }
26472653
26482654 /**
@@ -2783,7 +2789,7 @@ static int cgroup_migrate(struct task_struct *leader, bool threadgroup, · 134 unmodified lines
27832789 * already PF_EXITING could be freed from underneath us unless we
27842790 * take an rcu_read_lock.
27852791 */
2786− spin_lock_bh(&css_set_lock);
2792+ spin_lock_irq(&css_set_lock);
27872793 rcu_read_lock();
27882794 task = leader;
27892795 do {
@@ -2792,7 +2798,7 @@ static int cgroup_migrate(struct task_struct *leader, bool threadgroup, · 2 unmodified lines
27922798 break;
27932799 } while_each_thread(leader, task);
27942800 rcu_read_unlock();
2795− spin_unlock_bh(&css_set_lock);
2801+ spin_unlock_irq(&css_set_lock);
27962802
27972803 return cgroup_taskset_migrate(&tset, root);
27982804 }
@@ -2816,7 +2822,7 @@ static int cgroup_attach_task(struct cgroup *dst_cgrp, · 17 unmodified lines
28162822 return -EBUSY;
28172823
28182824 /* look up all src csets */
2819− spin_lock_bh(&css_set_lock);
2825+ spin_lock_irq(&css_set_lock);
28202826 rcu_read_lock();
28212827 task = leader;
28222828 do {
@@ -2826,7 +2832,7 @@ static int cgroup_attach_task(struct cgroup *dst_cgrp, · 3 unmodified lines
28262832 break;
28272833 } while_each_thread(leader, task);
28282834 rcu_read_unlock();
2829− spin_unlock_bh(&css_set_lock);
2835+ spin_unlock_irq(&css_set_lock);
28302836
28312837 /* prepare dst csets and commit */
28322838 ret = cgroup_migrate_prepare_dst(&preloaded_csets);
@@ -2859,9 +2865,9 @@ static int cgroup_procs_write_permission(struct task_struct *task, · 26 unmodified lines
28592865 struct cgroup *cgrp;
28602866 struct inode *inode;
28612867
2862− spin_lock_bh(&css_set_lock);
2868+ spin_lock_irq(&css_set_lock);
28632869 cgrp = task_cgroup_from_root(task, &cgrp_dfl_root);
2864− spin_unlock_bh(&css_set_lock);
2870+ spin_unlock_irq(&css_set_lock);
28652871
28662872 while (!cgroup_is_descendant(dst_cgrp, cgrp))
28672873 cgrp = cgroup_parent(cgrp);
@@ -2962,9 +2968,9 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *tsk) · 94 unmodified lines
29622968 if (root == &cgrp_dfl_root)
29632969 continue;
29642970
2965− spin_lock_bh(&css_set_lock);
2971+ spin_lock_irq(&css_set_lock);
29662972 from_cgrp = task_cgroup_from_root(from, root);
2967− spin_unlock_bh(&css_set_lock);
2973+ spin_unlock_irq(&css_set_lock);
29682974
29692975 retval = cgroup_attach_task(from_cgrp, tsk, false);
29702976 if (retval)
@@ -3080,7 +3086,7 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) · 109 unmodified lines
30803086 percpu_down_write(&cgroup_threadgroup_rwsem);
30813087
30823088 /* look up all csses currently attached to @cgrp's subtree */
3083− spin_lock_bh(&css_set_lock);
3089+ spin_lock_irq(&css_set_lock);
30843090 cgroup_for_each_live_descendant_pre(dsct, d_css, cgrp) {
30853091 struct cgrp_cset_link *link;
30863092
@@ -3088,14 +3094,14 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) · 1 unmodified line
30883094 cgroup_migrate_add_src(link->cset, dsct,
30893095 &preloaded_csets);
30903096 }
3091− spin_unlock_bh(&css_set_lock);
3097+ spin_unlock_irq(&css_set_lock);
30923098
30933099 /* NULL dst indicates self on default hierarchy */
30943100 ret = cgroup_migrate_prepare_dst(&preloaded_csets);
30953101 if (ret)
30963102 goto out_finish;
30973103
3098− spin_lock_bh(&css_set_lock);
3104+ spin_lock_irq(&css_set_lock);
30993105 list_for_each_entry(src_cset, &preloaded_csets, mg_preload_node) {
31003106 struct task_struct *task, *ntask;
31013107
@@ -3107,7 +3113,7 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) · 5 unmodified lines
31073113 list_for_each_entry_safe(task, ntask, &src_cset->tasks, cg_list)
31083114 cgroup_taskset_add(task, &tset);
31093115 }
3110− spin_unlock_bh(&css_set_lock);
3116+ spin_unlock_irq(&css_set_lock);
31113117
31123118 ret = cgroup_taskset_migrate(&tset, cgrp->root);
31133119 out_finish:
@@ -3908,10 +3914,10 @@ static int cgroup_task_count(const struct cgroup *cgrp) · 794 unmodified lines
39083914 int count = 0;
39093915 struct cgrp_cset_link *link;
39103916
3911− spin_lock_bh(&css_set_lock);
3917+ spin_lock_irq(&css_set_lock);
39123918 list_for_each_entry(link, &cgrp->cset_links, cset_link)
39133919 count += atomic_read(&link->cset->refcount);
3914− spin_unlock_bh(&css_set_lock);
3920+ spin_unlock_irq(&css_set_lock);
39153921 return count;
39163922 }
39173923
@@ -4249,7 +4255,7 @@ void css_task_iter_start(struct cgroup_subsys_state *css, · 331 unmodified lines
42494255
42504256 memset(it, 0, sizeof(*it));
42514257
4252− spin_lock_bh(&css_set_lock);
4258+ spin_lock_irq(&css_set_lock);
42534259
42544260 it->ss = css->ss;
42554261
@@ -4262,7 +4268,7 @@ void css_task_iter_start(struct cgroup_subsys_state *css, · 6 unmodified lines
42624268
42634269 css_task_iter_advance_css_set(it);
42644270
4265− spin_unlock_bh(&css_set_lock);
4271+ spin_unlock_irq(&css_set_lock);
42664272 }
42674273
42684274 /**
@@ -4280,7 +4286,7 @@ struct task_struct *css_task_iter_next(struct css_task_iter *it) · 11 unmodified lines
42804286 it->cur_task = NULL;
42814287 }
42824288
4283− spin_lock_bh(&css_set_lock);
4289+ spin_lock_irq(&css_set_lock);
42844290
42854291 if (it->task_pos) {
42864292 it->cur_task = list_entry(it->task_pos, struct task_struct,
@@ -4289,7 +4295,7 @@ struct task_struct *css_task_iter_next(struct css_task_iter *it) · 2 unmodified lines
42894295 css_task_iter_advance(it);
42904296 }
42914297
4292− spin_unlock_bh(&css_set_lock);
4298+ spin_unlock_irq(&css_set_lock);
42934299
42944300 return it->cur_task;
42954301 }
@@ -4303,10 +4309,10 @@ struct task_struct *css_task_iter_next(struct css_task_iter *it) · 7 unmodified lines
43034309 void css_task_iter_end(struct css_task_iter *it)
43044310 {
43054311 if (it->cur_cset) {
4306− spin_lock_bh(&css_set_lock);
4312+ spin_lock_irq(&css_set_lock);
43074313 list_del(&it->iters_node);
43084314 put_css_set_locked(it->cur_cset);
4309− spin_unlock_bh(&css_set_lock);
4315+ spin_unlock_irq(&css_set_lock);
43104316 }
43114317
43124318 if (it->cur_task)
@@ -4338,10 +4344,10 @@ int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from) · 25 unmodified lines
43384344 mutex_lock(&cgroup_mutex);
43394345
43404346 /* all tasks in @from are being moved, all csets are source */
4341− spin_lock_bh(&css_set_lock);
4347+ spin_lock_irq(&css_set_lock);
43424348 list_for_each_entry(link, &from->cset_links, cset_link)
43434349 cgroup_migrate_add_src(link->cset, to, &preloaded_csets);
4344− spin_unlock_bh(&css_set_lock);
4350+ spin_unlock_irq(&css_set_lock);
43454351
43464352 ret = cgroup_migrate_prepare_dst(&preloaded_csets);
43474353 if (ret)
@@ -5449,10 +5455,10 @@ static int cgroup_destroy_locked(struct cgroup *cgrp) · 1101 unmodified lines
54495455 */
54505456 cgrp->self.flags &= ~CSS_ONLINE;
54515457
5452− spin_lock_bh(&css_set_lock);
5458+ spin_lock_irq(&css_set_lock);
54535459 list_for_each_entry(link, &cgrp->cset_links, cset_link)
54545460 link->cset->dead = true;
5455− spin_unlock_bh(&css_set_lock);
5461+ spin_unlock_irq(&css_set_lock);
54565462
54575463 /* initiate massacre of all css's */
54585464 for_each_css(css, ssid, cgrp)
@@ -5723,7 +5729,7 @@ int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns, · 264 unmodified lines
57235729 goto out;
57245730
57255731 mutex_lock(&cgroup_mutex);
5726− spin_lock_bh(&css_set_lock);
5732+ spin_lock_irq(&css_set_lock);
57275733
57285734 for_each_root(root) {
57295735 struct cgroup_subsys *ss;
@@ -5776,7 +5782,7 @@ int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns, · 46 unmodified lines
57765782
57775783 retval = 0;
57785784 out_unlock:
5779− spin_unlock_bh(&css_set_lock);
5785+ spin_unlock_irq(&css_set_lock);
57805786 mutex_unlock(&cgroup_mutex);
57815787 kfree(buf);
57825788 out:
@@ -5921,13 +5927,13 @@ void cgroup_post_fork(struct task_struct *child) · 138 unmodified lines
59215927 if (use_task_css_set_links) {
59225928 struct css_set *cset;
59235929
5924− spin_lock_bh(&css_set_lock);
5930+ spin_lock_irq(&css_set_lock);
59255931 cset = task_css_set(current);
59265932 if (list_empty(&child->cg_list)) {
59275933 get_css_set(cset);
59285934 css_set_move_task(child, NULL, cset, false);
59295935 }
5930− spin_unlock_bh(&css_set_lock);
5936+ spin_unlock_irq(&css_set_lock);
59315937 }
59325938
59335939 /*
@@ -5972,9 +5978,9 @@ void cgroup_exit(struct task_struct *tsk) · 38 unmodified lines
59725978 cset = task_css_set(tsk);
59735979
59745980 if (!list_empty(&tsk->cg_list)) {
5975− spin_lock_bh(&css_set_lock);
5981+ spin_lock_irq(&css_set_lock);
59765982 css_set_move_task(tsk, cset, NULL, false);
5977− spin_unlock_bh(&css_set_lock);
5983+ spin_unlock_irq(&css_set_lock);
59785984 } else {
59795985 get_css_set(cset);
59805986 }
@@ -6042,9 +6048,9 @@ static void cgroup_release_agent(struct work_struct *work) · 61 unmodified lines
60426048 if (!pathbuf || !agentbuf)
60436049 goto out;
60446050
6045− spin_lock_bh(&css_set_lock);
6051+ spin_lock_irq(&css_set_lock);
60466052 path = cgroup_path_ns_locked(cgrp, pathbuf, PATH_MAX, &init_cgroup_ns);
6047− spin_unlock_bh(&css_set_lock);
6053+ spin_unlock_irq(&css_set_lock);
60486054 if (!path)
60496055 goto out;
60506056
@@ -6304,12 +6310,12 @@ struct cgroup_namespace *copy_cgroup_ns(unsigned long flags, · 253 unmodified lines
63046310 return ERR_PTR(-EPERM);
63056311
63066312 mutex_lock(&cgroup_mutex);
6307− spin_lock_bh(&css_set_lock);
6313+ spin_lock_irq(&css_set_lock);
63086314
63096315 cset = task_css_set(current);
63106316 get_css_set(cset);
63116317
6312− spin_unlock_bh(&css_set_lock);
6318+ spin_unlock_irq(&css_set_lock);
63136319 mutex_unlock(&cgroup_mutex);
63146320
63156321 new_ns = alloc_cgroup_ns();
@@ -6433,7 +6439,7 @@ static int current_css_set_cg_links_read(struct seq_file *seq, void *v) · 117 unmodified lines
64336439 if (!name_buf)
64346440 return -ENOMEM;
64356441
6436− spin_lock_bh(&css_set_lock);
6442+ spin_lock_irq(&css_set_lock);
64376443 rcu_read_lock();
64386444 cset = rcu_dereference(current->cgroups);
64396445 list_for_each_entry(link, &cset->cgrp_links, cgrp_link) {
@@ -6444,7 +6450,7 @@ static int current_css_set_cg_links_read(struct seq_file *seq, void *v) · 4 unmodified lines
64446450 c->root->hierarchy_id, name_buf);
64456451 }
64466452 rcu_read_unlock();
6447− spin_unlock_bh(&css_set_lock);
6453+ spin_unlock_irq(&css_set_lock);
64486454 kfree(name_buf);
64496455 return 0;
64506456 }
@@ -6455,7 +6461,7 @@ static int cgroup_css_links_read(struct seq_file *seq, void *v) · 4 unmodified lines
64556461 struct cgroup_subsys_state *css = seq_css(seq);
64566462 struct cgrp_cset_link *link;
64576463
6458− spin_lock_bh(&css_set_lock);
6464+ spin_lock_irq(&css_set_lock);
64596465 list_for_each_entry(link, &css->cgroup->cset_links, cset_link) {
64606466 struct css_set *cset = link->cset;
64616467 struct task_struct *task;
@@ -6478,7 +6484,7 @@ static int cgroup_css_links_read(struct seq_file *seq, void *v) · 16 unmodified lines
64786484 overflow:
64796485 seq_puts(seq, " ...\n");
64806486 }
6481− spin_unlock_bh(&css_set_lock);
6487+ spin_unlock_irq(&css_set_lock);
64826488 return 0;
64836489 }
64846490