NetBSD-Bugs archive

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

Re: kern/42455: tstile hang with nfs



I tried this patch:

Index: nfs_vnops.c
===================================================================
RCS file: /cvsroot/src/sys/nfs/nfs_vnops.c,v
retrieving revision 1.284
diff -u -p -r1.284 nfs_vnops.c
--- nfs_vnops.c 24 Jun 2010 13:03:17 -0000      1.284
+++ nfs_vnops.c 3 Aug 2010 09:13:57 -0000
@@ -1468,7 +1468,12 @@ nfsmout:
                mutex_enter(&ctx.nwc_lock);
                ctx.nwc_mbufcount--;
                while (ctx.nwc_mbufcount > 0) {
-                       cv_wait(&ctx.nwc_cv, &ctx.nwc_lock);
+                       error = cv_timedwait(&ctx.nwc_cv, &ctx.nwc_lock,
+                           mstohz(1000));
+                       if (error) {
+                               printf("nfsmblk timeout\n");
+                               break;
+                       }
                }
                mutex_exit(&ctx.nwc_lock);
        }

The result is this:

nfsmblk timeout
panic: lockdebug_lookup: uninitialized lock (lock=0xffffa00026111a70, 
from=ffffffff804dd6ad)
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip ffffffff80201d65 cs e030 rflags 246 cr2  
ffffa000221e7064 cpl 8 rsp ffffa00026b93980
Stopped in pid 750.1 (qemu-dm) at       netbsd:breakpoint+0x5:  leave
breakpoint() at netbsd:breakpoint+0x5
panic() at netbsd:panic+0x28f
lockdebug_abort() at netbsd:lockdebug_abort
mutex_enter() at netbsd:mutex_enter+0x263
nfs_writerpc_extfree() at netbsd:nfs_writerpc_extfree+0x35
m_ext_free() at netbsd:m_ext_free+0xcf
tap_dev_read() at netbsd:tap_dev_read+0x100
dofileread() at netbsd:dofileread+0x6f
sys_read() at netbsd:sys_read+0x73
syscall() at netbsd:syscall+0xa8
ds          0x3960
es          0
fs          0x7b40
gs          0x51f8
rdi         0
rsi         0xffffffff805c0119  printf+0xbc
rbp         0xffffa00026b93980
rbx         0xffffa00026b93990
rdx         0
rcx         0
rax         0x1
r8          0xffffa00026b938a0
r9          0x400
r10         0xffffa00026b938a0
r11         0x1
r12         0x104
r13         0xffffffff80a351f8
r14         0xffffa00026b67b40
r15         0
rip         0xffffffff80201d65  breakpoint+0x5
cs          0xe030
rflags      0x246
rsp         0xffffa00026b93980
ss          0xe02b
netbsd:breakpoint+0x5:  leave
db>

The lockdebug address 0xffffffff804dd6ad is at
sys/dev/nfs/nfs_vnops.c:1259

/*
 * free mbuf used to refer protected pages while write rpc call.
 * called at splvm.
 */
static void
nfs_writerpc_extfree(struct mbuf *m, void *tbuf, size_t size, void *arg)
{
        struct nfs_writerpc_context *ctx = arg;

        KASSERT(m != NULL);
        KASSERT(ctx != NULL);
        pool_cache_put(mb_cache, m);
        mutex_enter(&ctx->nwc_lock);      <-- line 1259
        if (--ctx->nwc_mbufcount == 0) {
                cv_signal(&ctx->nwc_cv);
        }
        mutex_exit(&ctx->nwc_lock);
}



Home | Main Index | Thread Index | Old Index