mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aurelien Degremont <aurelien.degremont@cea.fr>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Jacques-Charles Lafoucriere <jc.lafoucriere@cea.fr>,
	Bruno Faccini <bruno.faccini@bull.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix deadlock in RPC scheduling code.
Date: Mon, 13 Mar 2006 16:16:04 +0100	[thread overview]
Message-ID: <200603131516.QAA19564@styx.bruyeres.cea.fr> (raw)
In-Reply-To: <1142260115.7996.13.camel@lade.trondhjem.org>

Trond Myklebust wrote:
>>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.

Optimisation against potential race (see below) ?

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

IMO, the code will still hang because, the list_for_each_entry_safe() 
loop will never complete, even with the new scheme. Indeed, the loop 
call __rpc_wake_up_task() will try to set RPC_TASK_WAKEUP bit, but it is 
already set by rpc_wake_up_task(), so it hangs...

A: run rpc_wake_up_task(task foo)
A: set RPC_TASK_WAKEUP bit
--interrupt--
B: run rpc_wake_up()
B: grab queue->lock
B: enter the list_for_each_entry_safe() loop
B: run __rpc_wake_up_task(task foo)
B: wait for RPC_TASK_WAKEUP bit
A: wait for queue->lock

  -> deadlock ?

-- 
Aurelien Degremont


  reply	other threads:[~2006-03-13 15:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-09 10:35 Aurelien Degremont
2006-03-09 14:40 ` Trond Myklebust
2006-03-10 15:10   ` Aurelien Degremont
2006-03-10 15:24     ` Trond Myklebust
2006-03-13 10:07       ` Aurelien Degremont
2006-03-13 14:28         ` Trond Myklebust
2006-03-13 15:16           ` Aurelien Degremont [this message]
2006-03-13 16:08             ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200603131516.QAA19564@styx.bruyeres.cea.fr \
    --to=aurelien.degremont@cea.fr \
    --cc=bruno.faccini@bull.net \
    --cc=jc.lafoucriere@cea.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®