aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/utils.c
diff options
context:
space:
mode:
authorIngo Molnar <[email protected]>2009-09-22 12:44:11 +0000
committerIngo Molnar <[email protected]>2009-09-22 12:05:48 +0000
commitedaac8e3167501cda336231d00611bf59c164346 (patch)
tree5ebf22336dccef4fcd601e0a6a2d13ea347ec568 /net/core/utils.c
parentratelimit: Use per ratelimit context locking (diff)
downloadkernel-edaac8e3167501cda336231d00611bf59c164346.tar.gz
kernel-edaac8e3167501cda336231d00611bf59c164346.zip
ratelimit: Fix/allow use in atomic contexts
I'd like to use printk_ratelimit() in NMI context, but it's not robust right now due to spinlock usage in lib/ratelimit.c. If an NMI is unlucky enough to hit just that spot we might lock up trying to take the spinlock again. Fix that by using a trylock variant. If we contend on that lock we can genuinely skip the message because the state is just being accessed by another CPU (or by this CPU). ( We could use atomics for the suppressed messages field, but i doubt it matters in practice and it makes the code heavier. ) Cc: Peter Zijlstra <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: David S. Miller <[email protected]> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'net/core/utils.c')
0 files changed, 0 insertions, 0 deletions