lkml.org 
[lkml]   [2006]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Fix deadlock in RPC scheduling code.
From
Date
On Mon, 2006-03-13 at 11:07 +0100, Aurelien Degremont wrote:
> Trond Myklebust wrote:
> > Yes. The RPC_TASK_QUEUED bit can only be cleared when both the
> > RPC_TASK_WAKEUP bit _and_ the queue spinlock are held.
> > If you are holding either one of those two, then it is safe to test for
> > RPC_IS_QUEUED(). If the latter is true, then it is also safe to
> > dereference the value of task->u.tk_wait.rpc_waitq.
>
> Hmmm... With those constraints, it seems difficult to be able to modify
> the current rpc_wake_up_task() function...

That is the price of optimisation in this case.

> But, are you sure the patch you provided is sufficient to remove the
> potential deadlock we faced ? I do not see how, could you explain ?

Your deadlock problem resulted in __rpc_wake_up_task() iterating forever
on the same task since the while() loop would not ever exit before it
was empty. By changing the iteration scheme into one where we only try
to wake up each task once, we allow rpc_wake_up()/rpc_wake_up_status()
to complete.

Cheers,
Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-13 15:32    [W:0.073 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site