]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0159-block-mq-do-not-invoke-preempt_disable.patch
rt_patches: required rebase due to printk change
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0159-block-mq-do-not-invoke-preempt_disable.patch
1 From 53beb5a2617e7a5c3674ba9324168b85f297dd08 Mon Sep 17 00:00:00 2001
2 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
3 Date: Tue, 14 Jul 2015 14:26:34 +0200
4 Subject: [PATCH 159/366] block/mq: do not invoke preempt_disable()
5
6 preempt_disable() and get_cpu() don't play well together with the sleeping
7 locks it tries to allocate later.
8 It seems to be enough to replace it with get_cpu_light() and migrate_disable().
9
10 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
11 ---
12  block/blk-mq.c | 10 +++++-----
13  1 file changed, 5 insertions(+), 5 deletions(-)
14
15 diff --git a/block/blk-mq.c b/block/blk-mq.c
16 index 2d9a255..3e8e02a 100644
17 --- a/block/blk-mq.c
18 +++ b/block/blk-mq.c
19 @@ -343,7 +343,7 @@ static void blk_mq_ipi_complete_request(struct request *rq)
20                 return;
21         }
22  
23 -       cpu = get_cpu();
24 +       cpu = get_cpu_light();
25         if (!test_bit(QUEUE_FLAG_SAME_FORCE, &rq->q->queue_flags))
26                 shared = cpus_share_cache(cpu, ctx->cpu);
27  
28 @@ -355,7 +355,7 @@ static void blk_mq_ipi_complete_request(struct request *rq)
29         } else {
30                 rq->q->softirq_done_fn(rq);
31         }
32 -       put_cpu();
33 +       put_cpu_light();
34  }
35  
36  static void __blk_mq_complete_request(struct request *rq)
37 @@ -864,14 +864,14 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
38                 return;
39  
40         if (!async) {
41 -               int cpu = get_cpu();
42 +               int cpu = get_cpu_light();
43                 if (cpumask_test_cpu(cpu, hctx->cpumask)) {
44                         __blk_mq_run_hw_queue(hctx);
45 -                       put_cpu();
46 +                       put_cpu_light();
47                         return;
48                 }
49  
50 -               put_cpu();
51 +               put_cpu_light();
52         }
53  
54         kblockd_schedule_delayed_work_on(blk_mq_hctx_next_cpu(hctx),
55 -- 
56 1.9.1
57