linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Liam Howlett <howlett@gmail.com>
Cc: linux-kernel@vger.kernel.org, neilb@suse.de,
	trond.myklebust@fys.uio.no, bfields@fieldses.org
Subject: Re: NFS Killable tasks request comments on patch
Date: Tue, 4 Dec 2007 15:43:21 -0700	[thread overview]
Message-ID: <20071204224321.GD14152@parisc-linux.org> (raw)
In-Reply-To: <20071204212543.GA6907@solidsnake>

On Tue, Dec 04, 2007 at 04:25:43PM -0500, Liam Howlett wrote:
> @@ -433,15 +433,11 @@ static int nfs_wait_schedule(void *word)
>   */
>  static int nfs_wait_on_inode(struct inode *inode)
>  {
> -	struct rpc_clnt	*clnt = NFS_CLIENT(inode);
>  	struct nfs_inode *nfsi = NFS_I(inode);
> -	sigset_t oldmask;
>  	int error;
>  
> -	rpc_clnt_sigmask(clnt, &oldmask);
>  	error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING,
>  					nfs_wait_schedule, TASK_INTERRUPTIBLE);
> -	rpc_clnt_sigunmask(clnt, &oldmask);

Looks like you missed one case that should change to KILLABLE?

>  static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp)
>  {
> -	sigset_t oldset;
>  	int res;
>  
>  	might_sleep();
>  
>  	rwsem_acquire(&clp->cl_sem.dep_map, 0, 0, _RET_IP_);
>  
> -	rpc_clnt_sigmask(clnt, &oldset);
>  	res = wait_on_bit(&clp->cl_state, NFS4CLNT_STATE_RECOVER,
>  			nfs4_wait_bit_interruptible,
>  			TASK_INTERRUPTIBLE);
> -	rpc_clnt_sigunmask(clnt, &oldset);

Ditto

> @@ -2844,14 +2837,12 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout)
>  		*timeout = NFS4_POLL_RETRY_MIN;
>  	if (*timeout > NFS4_POLL_RETRY_MAX)
>  		*timeout = NFS4_POLL_RETRY_MAX;
> -	rpc_clnt_sigmask(clnt, &oldset);
>  	if (clnt->cl_intr) {
>  		schedule_timeout_interruptible(*timeout);
>  		if (signalled())
>  			res = -ERESTARTSYS;
>  	} else
>  		schedule_timeout_uninterruptible(*timeout);
> -	rpc_clnt_sigunmask(clnt, &oldset);

Hmm ... guess we need a schedule_timeout_killable.  This should probably
look like:

	if (*timeout > NFS4_POLL_RETRY_MAX)
		*timeout = NFS4_POLL_RETRY_MAX;
+	schedule_timeout_killable(*timeout);
+	if (fatal_signalled())
		res = -ERESTARTSYS;
 	*timeout <<= 1;

> @@ -206,10 +204,8 @@ nfs_wait_on_request(struct nfs_page *req)
>  	 * Note: the call to rpc_clnt_sigmask() suffices to ensure that we
>  	 *	 are not interrupted if intr flag is not set
>  	 */
> -	rpc_clnt_sigmask(clnt, &oldmask);
>  	ret = out_of_line_wait_on_bit(&req->wb_flags, PG_BUSY,
>  			nfs_wait_bit_interruptible, TASK_INTERRUPTIBLE);
> -	rpc_clnt_sigunmask(clnt, &oldmask);

Another missing KILLABLE.

> @@ -520,9 +520,7 @@ extern void * nfs_root_data(void);
>  	int __retval = 0;						\
>  	if (clnt->cl_intr) {						\
>  		sigset_t oldmask;					\
> -		rpc_clnt_sigmask(clnt, &oldmask);			\
>  		__retval = wait_event_interruptible(wq, condition);	\
> -		rpc_clnt_sigunmask(clnt, &oldmask);			\
>  	} else								\
>  		wait_event(wq, condition);				\
>  	__retval;							\

wait_event_killable?

Anyway, none of these explain the non-killability of the *stat* calls.

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2007-12-04 22:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-04 21:25 NFS Killable tasks request comments on patch Liam Howlett
2007-12-04 22:43 ` Matthew Wilcox [this message]
2007-12-06 17:34 ` Matthew Wilcox
2007-12-06 23:00   ` Matthew Wilcox

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=20071204224321.GD14152@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=bfields@fieldses.org \
    --cc=howlett@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    --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;
as well as URLs for NNTP newsgroup(s).