From owner-svn-src-head@FreeBSD.ORG Tue Jul 14 22:54:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EACB7106566B; Tue, 14 Jul 2009 22:54:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D87D48FC0A; Tue, 14 Jul 2009 22:54:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6EMsTwn073755; Tue, 14 Jul 2009 22:54:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6EMsT1C073749; Tue, 14 Jul 2009 22:54:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200907142254.n6EMsT1C073749@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 14 Jul 2009 22:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195703 - in head/sys: nfsclient rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2009 22:54:30 -0000 Author: kib Date: Tue Jul 14 22:54:29 2009 New Revision: 195703 URL: http://svn.freebsd.org/changeset/base/195703 Log: Use PBDRY flag for msleep(9) in NFS and NLM when sleeping thread owns kernel resources that block other threads, like vnode locks. The SIGSTOP sent to such thread (process, rather) shall not stop it until thread releases the resources. Tested by: pho Reviewed by: jhb Approved by: re (kensmith) Modified: head/sys/nfsclient/nfs_bio.c head/sys/nfsclient/nfs_vnops.c head/sys/nfsclient/nfsmount.h head/sys/rpc/clnt_rc.c head/sys/rpc/clnt_vc.c Modified: head/sys/nfsclient/nfs_bio.c ============================================================================== --- head/sys/nfsclient/nfs_bio.c Tue Jul 14 22:52:46 2009 (r195702) +++ head/sys/nfsclient/nfs_bio.c Tue Jul 14 22:54:29 2009 (r195703) @@ -1254,7 +1254,7 @@ nfs_getcacheblk(struct vnode *vp, daddr_ sigset_t oldset; nfs_set_sigmask(td, &oldset); - bp = getblk(vp, bn, size, PCATCH, 0, 0); + bp = getblk(vp, bn, size, NFS_PCATCH, 0, 0); nfs_restore_sigmask(td, &oldset); while (bp == NULL) { if (nfs_sigintr(nmp, td)) @@ -1291,7 +1291,7 @@ nfs_vinvalbuf(struct vnode *vp, int flag if ((nmp->nm_flag & NFSMNT_INT) == 0) intrflg = 0; if (intrflg) { - slpflag = PCATCH; + slpflag = NFS_PCATCH; slptimeo = 2 * hz; } else { slpflag = 0; @@ -1370,7 +1370,7 @@ nfs_asyncio(struct nfsmount *nmp, struct } again: if (nmp->nm_flag & NFSMNT_INT) - slpflag = PCATCH; + slpflag = NFS_PCATCH; gotiod = FALSE; /* @@ -1439,7 +1439,7 @@ again: mtx_unlock(&nfs_iod_mtx); return (error2); } - if (slpflag == PCATCH) { + if (slpflag == NFS_PCATCH) { slpflag = 0; slptimeo = 2 * hz; } Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Tue Jul 14 22:52:46 2009 (r195702) +++ head/sys/nfsclient/nfs_vnops.c Tue Jul 14 22:54:29 2009 (r195703) @@ -2934,7 +2934,7 @@ nfs_flush(struct vnode *vp, int waitfor, int bvecsize = 0, bveccount; if (nmp->nm_flag & NFSMNT_INT) - slpflag = PCATCH; + slpflag = NFS_PCATCH; if (!commit) passone = 0; bo = &vp->v_bufobj; @@ -3132,7 +3132,7 @@ loop: error = EINTR; goto done; } - if (slpflag == PCATCH) { + if (slpflag & PCATCH) { slpflag = 0; slptimeo = 2 * hz; } @@ -3170,7 +3170,7 @@ loop: error = nfs_sigintr(nmp, td); if (error) goto done; - if (slpflag == PCATCH) { + if (slpflag & PCATCH) { slpflag = 0; slptimeo = 2 * hz; } Modified: head/sys/nfsclient/nfsmount.h ============================================================================== --- head/sys/nfsclient/nfsmount.h Tue Jul 14 22:52:46 2009 (r195702) +++ head/sys/nfsclient/nfsmount.h Tue Jul 14 22:54:29 2009 (r195703) @@ -107,6 +107,8 @@ struct nfsmount { #define NFS_TPRINTF_DELAY 30 #endif +#define NFS_PCATCH (PCATCH | PBDRY) + #endif #endif Modified: head/sys/rpc/clnt_rc.c ============================================================================== --- head/sys/rpc/clnt_rc.c Tue Jul 14 22:52:46 2009 (r195702) +++ head/sys/rpc/clnt_rc.c Tue Jul 14 22:54:29 2009 (r195703) @@ -264,7 +264,8 @@ clnt_reconnect_call( stat = clnt_reconnect_connect(cl); if (stat == RPC_SYSTEMERROR) { error = tsleep(&fake_wchan, - rc->rc_intr ? PCATCH : 0, "rpccon", hz); + rc->rc_intr ? PCATCH | PBDRY : 0, "rpccon", + hz); if (error == EINTR || error == ERESTART) return (RPC_INTR); tries++; Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Tue Jul 14 22:52:46 2009 (r195702) +++ head/sys/rpc/clnt_vc.c Tue Jul 14 22:54:29 2009 (r195703) @@ -196,7 +196,7 @@ clnt_vc_create( while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { error = msleep(&so->so_timeo, SOCK_MTX(so), - PSOCK | PCATCH, "connec", 0); + PSOCK | PCATCH | PBDRY, "connec", 0); if (error) { if (error == EINTR || error == ERESTART) interrupted = 1; @@ -477,6 +477,7 @@ call_again: errp->re_errno = error; switch (error) { case EINTR: + case ERESTART: stat = RPC_INTR; break; case EWOULDBLOCK: @@ -709,7 +710,7 @@ clnt_vc_control(CLIENT *cl, u_int reques case CLSET_INTERRUPTIBLE: if (*(int *) info) - ct->ct_waitflag = PCATCH; + ct->ct_waitflag = PCATCH | PBDRY; else ct->ct_waitflag = 0; break;