locking spinlocks during copy_to_user, copy_from_user

2013-01-25 Thread Pablo Pessolani
Hi: It is well know that is not recomended to keep a spinlock locked during operations that can be preempted. Some of these operations are copy_to_user, copy_from_user. Below is the code of the write_lock() as a sample. 340 static inline void __write_lock(rwlock_t *lock) 341{ 342

locking spinlocks during copy_to_user, copy_from_user

2013-01-25 Thread Pablo Pessolani
Hi: It is well know that is not recomended to keep a spinlock locked during operations that can be preempted. Some of these operations are copy_to_user, copy_from_user. Below is the code of the write_lock() as a sample. 340 static inline void __write_lock(rwlock_t *lock) 341{ 342

locking spinlocks during copy_to_user, copy_from_user

2013-01-25 Thread Pablo Pessolani
Hi: It is well know that is not recomended to keep a spinlock locked during operations that can be preempted. Some of these operations are copy_to_user, copy_from_user. Below is the code of the write_lock() as a sample. 340 static inline void __write_lock(rwlock_t *lock) 341{ 342

Re: locking spinlocks during copy_to_user, copy_from_user

2013-01-25 Thread anish kumar
On Fri, 2013-01-25 at 10:00 -0300, Pablo Pessolani wrote: Hi: It is well know that is not recomended to keep a spinlock locked during operations that can be preempted. Some of these operations are copy_to_user, copy_from_user. Below is the code of the write_lock() as a sample. 340

Re: locking spinlocks during copy_to_user, copy_from_user

2013-01-25 Thread Valdis . Kletnieks
On Fri, 25 Jan 2013 09:58:42 -0300, Pablo Pessolani said: My question is: Is there any know consequence if I enable preemption before copy_to_user/copy_from user (keeping the spinlock locked) and then disable preemption again after the copy? Well, at that point, you potentially have a