linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: Peter Lojkin <ia6432@inbox.ru>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v2] RPC: killing RPC tasks races fixed
Date: Tue, 22 Mar 2011 19:02:58 +0300	[thread overview]
Message-ID: <4D88C832.4010104@parallels.com> (raw)
In-Reply-To: <E1Q22wg-00080R-00.ia6432-inbox-ru@f70.mail.ru>

22.03.2011 17:52, Peter Lojkin пишет:
> On Thu, 2011-03-17 at 15:54:23 2011-03-17 at 18:43 +0300, Stanislav Kinsbursky wrote:
>
>> RPC task RPC_TASK_QUEUED bit is set must be checked before trying to wake up
>> task rpc_killall_tasks() because task->tk_waitqueue can not be set (equal to
>> NULL).
>> Also, as Trond Myklebust mentioned, such approach (instead of checking
>> tk_waitqueue to NULL) allows us to "optimise away the call to
>> rpc_wake_up_queued_task() altogether for those
>> tasks that aren't queued".
>
> you mentioned earlier that you have found this problem in .32 kernel but your patch only works for newer kernels.
> does the following patch is correct and needed for pre .36 kernels?
>


Yes, it is. This bug was found in rhel6 kernel which is based on 2.6.32 vanilla.


> --- a/net/sunrpc/sched.c	2011-03-22 16:55:36.802000287 +0300
> +++ b/net/sunrpc/sched.c	2011-03-22 17:01:13.858000242 +0300
> @@ -939,7 +939,8 @@
>   		if (!(rovr->tk_flags&  RPC_TASK_KILLED)) {
>   			rovr->tk_flags |= RPC_TASK_KILLED;
>   			rpc_exit(rovr, -EIO);
> -			rpc_wake_up_task(rovr);
> +			if (RPC_IS_QUEUED(rovr))
> +				rpc_wake_up_task(rovr);
>   		}
>   	}
>   	spin_unlock(&clnt->cl_lock);
>


-- 
Best regards,
Stanislav Kinsbursky

  reply	other threads:[~2011-03-22 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 14:52 [PATCH v2] RPC: killing RPC tasks races fixed Peter Lojkin
2011-03-22 16:02 ` Stanislav Kinsbursky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-03-17 15:54 Stanislav Kinsbursky

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=4D88C832.4010104@parallels.com \
    --to=skinsbursky@parallels.com \
    --cc=ia6432@inbox.ru \
    --cc=linux-nfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).