Re: [PATCH] random: Fix the issue of '_might_sleep' function running in an atomic contex

From
Guoyong Wang <hidden>
Date
2024-03-19 09:31:16
Also in
linux-mediatek, lkml
Reply to
Jason A. Donenfeld, 2024-03-18
On Mon, 18 Mar 2024 21:00:42 +0100, Jason A. Donenfeld wrote:
I'm wondering, though, rather than introducing a second function, maybe
execute_in_process_context() should just gain a `&& !in_atomic()`.
That'd make things a bit simpler.  
However, I'm pretty sure in_atomic() isn't actually a reliable way of
determining that, depending on config. So maybe this should just call
the worker always (if system_wq isn't null).
Alternatively, any chance the call to add_input_randomness() could be
moved outside the spinlock, or does this not look possible?
Hi Jason,

Thanks for your suggestions. 

I am inclined to accept your second suggestion. My reluctance to accept 
the first is due to the concern that "&& !in_atomic()" could potentially 
alter the original meaning of the 'execute_in_process_context' interface. 
Regarding the third suggestion, modifying the logic associated with 'input' 
is not recommended.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (9 messages) 9 messages, 2 authors, last reply 2024-04-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help