Apply patch from PR kern/44093 by yamt:

Interrupt server wait only on certain signals (same set at nfs -i)
instead of all signals.  According to the PR this helps with
"git clone" run on a puffs file system.
This commit is contained in:
pooka 2010-11-15 20:31:41 +00:00
parent ab9955e060
commit f129909f87

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_msgif.c,v 1.83 2010/11/12 17:46:09 pooka Exp $ */
/* $NetBSD: puffs_msgif.c,v 1.84 2010/11/15 20:31:41 pooka Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.83 2010/11/12 17:46:09 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.84 2010/11/15 20:31:41 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@ -378,17 +378,30 @@ puffs_msg_enqueue(struct puffs_mount *pmp, struct puffs_msgpark *park)
if (__predict_false((park->park_flags & PARKFLAG_WANTREPLY)
&& (park->park_flags & PARKFLAG_CALL) == 0
&& (l->l_flag & LW_PENDSIG) != 0 && sigispending(l, 0))) {
park->park_flags |= PARKFLAG_HASERROR;
preq->preq_rv = EINTR;
if (PUFFSOP_OPCLASS(preq->preq_opclass) == PUFFSOP_VN
&& (preq->preq_optype == PUFFS_VN_INACTIVE
|| preq->preq_optype == PUFFS_VN_RECLAIM)) {
park->park_preq->preq_opclass |= PUFFSOPFLAG_FAF;
park->park_flags &= ~PARKFLAG_WANTREPLY;
DPRINTF(("puffs_msg_enqueue: converted to FAF %p\n",
park));
} else {
return;
sigset_t ss;
/*
* see the comment about signals in puffs_msg_wait.
*/
sigpending1(l, &ss);
if (sigismember(&ss, SIGINT) ||
sigismember(&ss, SIGTERM) ||
sigismember(&ss, SIGKILL) ||
sigismember(&ss, SIGHUP) ||
sigismember(&ss, SIGQUIT)) {
park->park_flags |= PARKFLAG_HASERROR;
preq->preq_rv = EINTR;
if (PUFFSOP_OPCLASS(preq->preq_opclass) == PUFFSOP_VN
&& (preq->preq_optype == PUFFS_VN_INACTIVE
|| preq->preq_optype == PUFFS_VN_RECLAIM)) {
park->park_preq->preq_opclass |=
PUFFSOPFLAG_FAF;
park->park_flags &= ~PARKFLAG_WANTREPLY;
DPRINTF(("puffs_msg_enqueue: "
"converted to FAF %p\n", park));
} else {
return;
}
}
}
@ -426,10 +439,30 @@ puffs_msg_enqueue(struct puffs_mount *pmp, struct puffs_msgpark *park)
int
puffs_msg_wait(struct puffs_mount *pmp, struct puffs_msgpark *park)
{
lwp_t *l = curlwp;
proc_t *p = l->l_proc;
struct puffs_req *preq = park->park_preq; /* XXX: hmmm */
sigset_t ss;
sigset_t oss;
int error = 0;
int rv;
/*
* block unimportant signals.
*
* The set of "important" signals here was chosen to be same as
* nfs interruptible mount.
*/
sigfillset(&ss);
sigdelset(&ss, SIGINT);
sigdelset(&ss, SIGTERM);
sigdelset(&ss, SIGKILL);
sigdelset(&ss, SIGHUP);
sigdelset(&ss, SIGQUIT);
mutex_enter(p->p_lock);
sigprocmask1(l, SIG_BLOCK, &ss, &oss);
mutex_exit(p->p_lock);
mutex_enter(&pmp->pmp_lock);
puffs_mp_reference(pmp);
mutex_exit(&pmp->pmp_lock);
@ -503,6 +536,10 @@ puffs_msg_wait(struct puffs_mount *pmp, struct puffs_msgpark *park)
puffs_mp_release(pmp);
mutex_exit(&pmp->pmp_lock);
mutex_enter(p->p_lock);
sigprocmask1(l, SIG_SETMASK, &oss, NULL);
mutex_exit(p->p_lock);
return rv;
}