开发者

Are ioctl driver functions executed from an atomic context under linux 2.6?

开发者 https://www.devze.com 2023-01-15 02:17 出处:网络
I am tracking down a \"scheduling while atomic\" error in one of our drivers, and am wondering if ioctl\'s are an atomic context.Also if any one has anything to share on how to get into and out of ato

I am tracking down a "scheduling while atomic" error in one of our drivers, and am wondering if ioctl's are an atomic context. Also if any one has anything to share on how to get into and out of atomic contexts开发者_运维百科, and common places they occur, it would be helpful.


No, ioctls generally run in process context. If a driver grabs a spinlock during the ioctl processing then the driver will enter atomic context and will remain in atomic context until it releases the spinlock.

See: http://lwn.net/Articles/274695/ for a good discussion on atomic context in Linux


Have you turned on CONFIG_DEBUG_SPINLOCK_SLEEP, that might give you more info, including a stack trace, of where the error is.

The other angle to look at is what sleeping functions are you calling. Examples are msleep(), mutex_lock(), copy_to_user() etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消