Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/puffs Apply patch from PR kern/44093 by yamt:



details:   https://anonhg.NetBSD.org/src/rev/b0f98e6adcaa
branches:  trunk
changeset: 758788:b0f98e6adcaa
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Nov 15 20:31:41 2010 +0000

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

diffstat:

 sys/fs/puffs/puffs_msgif.c |  63 ++++++++++++++++++++++++++++++++++++---------
 1 files changed, 50 insertions(+), 13 deletions(-)

diffs (102 lines):

diff -r 0da1e2405481 -r b0f98e6adcaa sys/fs/puffs/puffs_msgif.c
--- a/sys/fs/puffs/puffs_msgif.c        Mon Nov 15 20:24:09 2010 +0000
+++ b/sys/fs/puffs/puffs_msgif.c        Mon Nov 15 20:31:41 2010 +0000
@@ -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 @@
        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 @@
 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_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;
 }
 



Home | Main Index | Thread Index | Old Index