Thread (2 messages) 2 messages, 2 authors, 2015-08-12

correct locking primitive?

From: Jeff Haran <hidden>
Date: 2015-08-12 18:32:42

Possibly related (same subject, not in this thread)

-----Original Message-----
From: kernelnewbies-bounces@kernelnewbies.org [mailto:kernelnewbies-
bounces at kernelnewbies.org] On Behalf Of Nicholas Murphy
Sent: Tuesday, August 11, 2015 7:58 PM
To: nick
Cc: kernelnewbies at kernelnewbies.org
Subject: Re: correct locking primitive?

Please don't answer in riddles.  This page:

https://www.kernel.org/pub/linux/kernel/people/rusty/kernel-
locking/x157.html

...in particular says that timers are basically softirq's, and it therefore seems to
imply the use of spin_lock_bh.

Presumably what I didn't understand is that spin_lock_bh should be used in
the user context, and a simple spin lock should be used in the timer because it
is a softirq?

Thanks,
Nick
Disclaimer: I'm no expert on these hi res timers, but this seems to suggest that high res timer execution context could be either top half or bottom half:

http://blog.csdn.net/ganggexiongqi/article/details/7013764

"One interesting aspect is the ability to define the execution context of the
callback function (such as in softirq or hardiirq context)."

If in fact the callbacks can be executed in top half, that would explain your observations.

Jeff Haran
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help