提交 8fd5c7ff 编写于 作者: P Peter Zijlstra 提交者: Yang Yingliang

perf: Fix get_recursion_context()

stable inclusion
from linux-4.19.158
commit 0f4eb125c56b524776a2f396bb7a7c119bb2e0a1

--------------------------------

[ Upstream commit ce0f17fc ]

One should use in_serving_softirq() to detect SoftIRQ context.

Fixes: 96f6d444 ("perf_counter: avoid recursion")
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20201030151955.120572175@infradead.orgSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 ae3b3e79
......@@ -209,7 +209,7 @@ static inline int get_recursion_context(int *recursion)
rctx = 3;
else if (in_irq())
rctx = 2;
else if (in_softirq())
else if (in_serving_softirq())
rctx = 1;
else
rctx = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册