]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0178-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch
Fix memguard and related syscalls
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0178-sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch
1 From d3a8328499e20daabc552a99d2489c840016cd5e Mon Sep 17 00:00:00 2001
2 From: Mike Galbraith <umgwanakikbuti@gmail.com>
3 Date: Wed, 18 Feb 2015 16:05:28 +0100
4 Subject: [PATCH 178/366] sunrpc: Make svc_xprt_do_enqueue() use
5  get_cpu_light()
6
7 |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915
8 |in_atomic(): 1, irqs_disabled(): 0, pid: 3194, name: rpc.nfsd
9 |Preemption disabled at:[<ffffffffa06bf0bb>] svc_xprt_received+0x4b/0xc0 [sunrpc]
10 |CPU: 6 PID: 3194 Comm: rpc.nfsd Not tainted 3.18.7-rt1 #9
11 |Hardware name: MEDION MS-7848/MS-7848, BIOS M7848W08.404 11/06/2014
12 | ffff880409630000 ffff8800d9a33c78 ffffffff815bdeb5 0000000000000002
13 | 0000000000000000 ffff8800d9a33c98 ffffffff81073c86 ffff880408dd6008
14 | ffff880408dd6000 ffff8800d9a33cb8 ffffffff815c3d84 ffff88040b3ac000
15 |Call Trace:
16 | [<ffffffff815bdeb5>] dump_stack+0x4f/0x9e
17 | [<ffffffff81073c86>] __might_sleep+0xe6/0x150
18 | [<ffffffff815c3d84>] rt_spin_lock+0x24/0x50
19 | [<ffffffffa06beec0>] svc_xprt_do_enqueue+0x80/0x230 [sunrpc]
20 | [<ffffffffa06bf0bb>] svc_xprt_received+0x4b/0xc0 [sunrpc]
21 | [<ffffffffa06c03ed>] svc_add_new_perm_xprt+0x6d/0x80 [sunrpc]
22 | [<ffffffffa06b2693>] svc_addsock+0x143/0x200 [sunrpc]
23 | [<ffffffffa072e69c>] write_ports+0x28c/0x340 [nfsd]
24 | [<ffffffffa072d2ac>] nfsctl_transaction_write+0x4c/0x80 [nfsd]
25 | [<ffffffff8117ee83>] vfs_write+0xb3/0x1d0
26 | [<ffffffff8117f889>] SyS_write+0x49/0xb0
27 | [<ffffffff815c4556>] system_call_fastpath+0x16/0x1b
28
29 Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com>
30 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
31 ---
32  net/sunrpc/svc_xprt.c | 6 +++---
33  1 file changed, 3 insertions(+), 3 deletions(-)
34
35 diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
36 index a6cbb21..5b69bb5 100644
37 --- a/net/sunrpc/svc_xprt.c
38 +++ b/net/sunrpc/svc_xprt.c
39 @@ -340,7 +340,7 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt)
40                 goto out;
41         }
42  
43 -       cpu = get_cpu();
44 +       cpu = get_cpu_light();
45         pool = svc_pool_for_cpu(xprt->xpt_server, cpu);
46  
47         atomic_long_inc(&pool->sp_stats.packets);
48 @@ -376,7 +376,7 @@ redo_search:
49  
50                 atomic_long_inc(&pool->sp_stats.threads_woken);
51                 wake_up_process(rqstp->rq_task);
52 -               put_cpu();
53 +               put_cpu_light();
54                 goto out;
55         }
56         rcu_read_unlock();
57 @@ -397,7 +397,7 @@ redo_search:
58                 goto redo_search;
59         }
60         rqstp = NULL;
61 -       put_cpu();
62 +       put_cpu_light();
63  out:
64         trace_svc_xprt_do_enqueue(xprt, rqstp);
65  }
66 -- 
67 1.9.1
68