From: Marco Elver <elver@google.com>
To: elver@google.com
Cc: linux-kernel@vger.kernel.org, davem@davemloft.net,
kuba@kernel.org, netdev@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>,
Eric Dumazet <edumazet@google.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH] random32: Use rcuidle variant for tracepoint
Date: Fri, 21 Aug 2020 08:30:43 +0200 [thread overview]
Message-ID: <20200821063043.1949509-1-elver@google.com> (raw)
With KCSAN enabled, prandom_u32() may be called from any context,
including idle CPUs.
Therefore, switch to using trace_prandom_u32_rcuidle(), to avoid various
issues due to recursion and lockdep warnings when KCSAN and tracing is
enabled.
Fixes: 94c7eb54c4b8 ("random32: add a tracepoint for prandom_u32()")
Link: https://lkml.kernel.org/r/20200820155923.3d5c4873@oasis.local.home
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Marco Elver <elver@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
---
lib/random32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/random32.c b/lib/random32.c
index 932345323af0..1c5607a411d4 100644
--- a/lib/random32.c
+++ b/lib/random32.c
@@ -83,7 +83,7 @@ u32 prandom_u32(void)
u32 res;
res = prandom_u32_state(state);
- trace_prandom_u32(res);
+ trace_prandom_u32_rcuidle(res);
put_cpu_var(net_rand_state);
return res;
--
2.28.0.297.g1956fa8f8d-goog
next reply other threads:[~2020-08-21 6:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 6:30 Marco Elver [this message]
2020-08-21 8:58 ` [PATCH] random32: Use rcuidle variant for tracepoint Marco Elver
2020-08-21 8:59 ` peterz
2020-08-21 15:06 ` Eric Dumazet
2020-08-21 15:35 ` Marco Elver
2020-09-18 1:21 ` Steven Rostedt
2020-08-21 15:38 ` Steven Rostedt
2020-08-21 15:41 ` Steven Rostedt
2020-08-21 18:38 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200821063043.1949509-1-elver@google.com \
--to=elver@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).