linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A question of "cond_resched_lock" called in atomic context
@ 2017-10-07 10:34 Jia-Ju Bai
  0 siblings, 0 replies; only message in thread
From: Jia-Ju Bai @ 2017-10-07 10:34 UTC (permalink / raw)
  To: viro, davem, torvalds, gregkh; +Cc: linux-kernel, linux-fsdevel

I have seen some drivers or file systems calls "cond_resched_lock" when 
holding a spinlock.
An example is in fs/ocfs2/dlm/dlmdomain.c:
dlm_migrate_all_locks (acquire the spinlock)
   cond_resched_lock

I find that "cond_resched_lock" has two functions: "___might_sleep" and 
"__cond_resched_lock".
I know that "__cond_resched_lock" is safe and okay to be called when 
holding a spinlock.
However, I think "___might_sleep" can be removed, because it prints 
error messages in this situation, but it is safe in fact.

Am I right? I am looking forward to your comments :)


Thanks,
Jia-Ju Bai

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-07 10:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-07 10:34 A question of "cond_resched_lock" called in atomic context Jia-Ju Bai

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).