Thread (6 messages) 6 messages, 3 authors, 2008-12-08

Re: locking in hidraw

From: Jiri Kosina <hidden>
Date: 2008-12-01 10:07:14

On Wed, 12 Nov 2008, Oliver Neukum wrote:
quoted
quoted
quoted
in this code:

		mutex_lock(&list->read_mutex);

		if (list->head == list->tail) {
			add_wait_queue(&list->hidraw->wait, &wait);
			set_current_state(TASK_INTERRUPTIBLE);
it would make more sense to lock the mutex interruptable so all
tasks sleep the same way. Is this intentional?
Well, we have the test for pending signals just below that code, right?
So the tasks blocking on the mutex sleep all the time until another
task is finished and unlocks the mutex, only to return to user space
because signals are pending. Therefore why not make the wait on
the mutex interruptible, so the signals are processed right away?
Yes, it makes sense. Could you please fold this change together with the 
hidraw changes you are going to push with the autosuspend patches?

Thanks,

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