Re: [Fwd: Re: Linux 2.6.25-rc2]
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 1203282165.2929.7.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org
Quoted 8 lines · Trond Myklebust
Hi Bruce,
Here is a question for you.
Why does svc_close_all() get away with deleting xprt->xpt_ready without holding the pool->sp_lock?From a quick look--I think the intention is that the code that calls it
(in svc_destroy()) is only called after all other server threads have exited, and that there can't be anyone else monkeying with that service any more. But I haven't verified that really carefully.
Quoted 3 lines
I ask because the strange Oopses that appear in the attached bugreport often involve the sunrpc server code. They would appear to indicate corruption in the
pool->sp_socketscode...
But obviously this needs a hard look. OK, thanks. I could really use some help if there's someone that has time to look into this....
--b.
Quoted 3 lines
Cheers
Trond
Content-Description: Forwarded message - Re: Linux 2.6.25-rc2
Quoted 56 lines
From: "Rafael J. Wysocki" <[email protected]>
To: Torsten Kaiser <[email protected]>
Subject: Re: Linux 2.6.25-rc2
Date: Sun, 17 Feb 2008 21:25:55 +0100
Cc: Linus Torvalds <[email protected]>,
Linux Kernel Mailing List <[email protected]>Quoted 29 lines · Torsten Kaiser
Quoted 3 lines · Linus Torvalds
Ok,
this kernel is a winner.Sadly not for me:
[ 5282.056415] ------------[ cut here ]------------ [ 5282.059757] kernel BUG at lib/list_debug.c:33! [ 5282.062055] invalid opcode: 0000 [1] SMP [ 5282.062055] CPU 3 [ 5282.062055] Modules linked in: radeon drm w83792d ipv6 tunertea5767 tda8290
tuner_xc2028tda9887tuner_simplemt20xx tea5761 tvaudio msp3400 bttv videodevv4l1_compatir_commoncompat_ioctl32v4l2_commonvideobuf_dma_sgvideobuf_corebtcx_risctveeprom usbhidpata_amdi2c_nforce2hid sg[ 5282.062055] Pid: 12937, comm: sed Not tainted 2.6.25-rc2 #1 [ 5282.062055] RIP: 0010:[<ffffffff803bffe4>]-> then the output from the serial console stopped. I was in X, so I could not see, if there was anything more on the real console.
(gdb) list *0xffffffff803bffe4
0xffffffff803bffe4is in__list_add(lib/list_debug.c:33).
28 }
29 if (unlikely(prev->next != next)) {
30 printk(KERN_ERR "list_addcorruption.prev->nextshould be "
31 "next (%p), but was %p. (prev=%p).\n",
32 next,prev->next, prev);
33BUG();Quoted 6 lines
34 } 35 next->prev = new; 36 new->next = next; 37 new->prev = prev;For more on this problem see http://marc.info/?l=linux-kernel&m=120293042005445
There's the Bugzilla entry for it at
http://bugzilla.kernel.org/show_bug.cgi?id=9973Please update it with the current information.
Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Bruce:
I'll take a look...
Tom
Quoted 20 lines · J. Bruce Fields
Quoted 8 lines · Trond Myklebust
Hi Bruce,
Here is a question for you.
Why does svc_close_all() get away with deleting xprt->xpt_ready without holding the pool->sp_lock?From a quick look--I think the intention is that the code that calls it
(in
svc_destroy()) is only called after all other server threads have exited, and that there can't be anyone else monkeying with that service any more. But I haven't verified that really carefully.Quoted 3 lines
I ask because the strange Oopses that appear in the attached bugreport often involve the sunrpc server code. They would appear to indicate corruption in the
pool->sp_socketscode...But obviously this needs a hard look. OK, thanks. I could really use some help if there's someone that has time to look into this....
Quoted 53 lines
--b.
Quoted 3 lines
Cheers
TrondContent-Description: Forwarded message - Re: Linux 2.6.25-rc2
Quoted 46 lines
From: "Rafael J. Wysocki" <[email protected]>
To: Torsten Kaiser <[email protected]>
Subject: Re: Linux 2.6.25-rc2
Date: Sun, 17 Feb 2008 21:25:55 +0100
Cc: Linus Torvalds <[email protected]>,
Linux Kernel Mailing List <[email protected]>Quoted 29 lines · Torsten Kaiser
Quoted 3 lines · Linus Torvalds
Ok,
this kernel is a winner.Sadly not for me:
[ 5282.056415] ------------[ cut here ]------------ [ 5282.059757] kernel BUG at lib/list_debug.c:33! [ 5282.062055] invalid opcode: 0000 [1] SMP [ 5282.062055] CPU 3 [ 5282.062055] Modules linked in: radeon drm w83792d ipv6 tunertea5767 tda8290
tuner_xc2028tda9887tuner_simplemt20xx tea5761 tvaudio msp3400 bttv videodevv4l1_compatir_commoncompat_ioctl32v4l2_commonvideobuf_dma_sgvideobuf_corebtcx_risctveeprom usbhidpata_amdi2c_nforce2hid sg[ 5282.062055] Pid: 12937, comm: sed Not tainted 2.6.25-rc2 #1 [ 5282.062055] RIP: 0010:[<ffffffff803bffe4>]-> then the output from the serial console stopped. I was in X, so I could not see, if there was anything more on the real console.
(gdb) list *0xffffffff803bffe4
0xffffffff803bffe4is in__list_add(lib/list_debug.c:33).
28 }
29 if (unlikely(prev->next != next)) {
30 printk(KERN_ERR "list_addcorruption.prev->nextshould be "
31 "next (%p), but was %p. (prev=%p).\n",
32 next,prev->next, prev);
33BUG();Quoted 6 lines
34 } 35 next->prev = new; 36 new->next = next; 37 new->prev = prev;For more on this problem see http://marc.info/?l=linux-kernel&m=120293042005445
There's the Bugzilla entry for it at
http://bugzilla.kernel.org/show_bug.cgi?id=9973
Quoted 15 lines
Quoted 10 lines
Please update it with the current information.
Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/-
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1203358682.24272.31.camel-SMNkleLxa3ZimH42XvhXlA@public.gmane.org
Quoted 22 lines · Tom Tucker
Bruce:
I'll take a look...
Tom
Quoted 14 lines · J. Bruce Fields
Quoted 8 lines · Trond Myklebust
Hi Bruce,
Here is a question for you.
Why does svc_close_all() get away with deleting xprt->xpt_ready without holding the pool->sp_lock?From a quick look--I think the intention is that the code that calls it
(in
svc_destroy()) is only called after all other server threads have exited, and that there can't be anyone else monkeying with that service any more. But I haven't verified that really carefully.
That's certainly the intention. The serv->sv_nrthreads fields is used as a refcount, which counts 1 for each nfsd thread and sometimes 1 to guard some short-term manipulations. This refcount should not drop to zero until the last thread exits. So by the time svc_close_all() is called, no thread can be looking at a pool's sp_sockets list. Each xprt could still be racily added to that list from softirq mode data ready handlers calling svc_xprt_enqueue(), but only until the xprt's xpo_detach method is called (which removes any data ready callbacks). At that point, no code should be modifying the xpt_ready field, and it may or may not be used to link the xprt into some pool->sp_sockets but we don't care because all the pools are about to be destroyed anyway.
That's the way it's been working since 2.6.19, and I don't think any of Tom's patches changed that.
I can think of a couple of things that could be wrong:
* serv->sv_nrthreads is used in a few places, and there might be bugs in that which are getting that count wrong (when I left the code, all increments and decrements of that field went through svc_get() and svc_destroy(), but other changes have crept in).
* Currently running data ready callbacks might be racing with xpo_detach. Moving that call inside the spin_lock_bh() critical section just after it might help.
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
For more on this problem see http://marc.info/?l=linux-kernel&m=120293042005445
There's the Bugzilla entry for it at
It's not clear from the bugzilla that NFS is at fault here.
Signature · 3 lines
Greg Banks, R&D Software Engineer, SGI Australian Software Group. The cake is *not* a lie. I don't speak for SGI.
A message that is not in the archive (sent off-list or not yet received): 47BA8CB3.4030703-cP1dWloDopni96+mSzHFpQC/[email protected]
Quoted 23 lines · Greg Banks
Quoted 22 lines · Tom Tucker
Bruce:
I'll take a look...
Tom
Quoted 14 lines · J. Bruce Fields
Quoted 8 lines · Trond Myklebust
Hi Bruce,
Here is a question for you.
Why does svc_close_all() get away with deleting xprt->xpt_ready without holding the pool->sp_lock?From a quick look--I think the intention is that the code that calls it
(in
svc_destroy()) is only called after all other server threads have exited, and that there can't be anyone else monkeying with that service any more. But I haven't verified that really carefully.
Quoted 12 lines
That's certainly the intention. The
serv->sv_nrthreadsfields is used as a refcount, which counts 1 for each nfsd thread and sometimes 1 to guard some short-term manipulations. This refcount should not drop to zero until the last thread exits. So by the timesvc_close_all()is called, no thread can be looking at a pool'ssp_socketslist. Each xprt could still be racily added to that list from softirq mode data ready handlers callingsvc_xprt_enqueue(), but only until the xprt'sxpo_detachmethod is called (which removes any data ready callbacks). At that point, no code should be modifying thexpt_readyfield, and it may or may not be used to link the xprt into somepool->sp_socketsbut we don't care because all the pools are about to be destroyed anyway.
OK, thanks very much for the confirmation. It looks like they've finally decided the problem was actually with the memory allocator:
http://bugzilla.kernel.org/show_bug.cgi?id=9973
so I think we're OK.
Quoted 5 lines
That's the way it's been working since 2.6.19, and I don't think any of Tom's patches changed that.
I can think of a couple of things that could be wrong:
Quoted 8 lines
*
serv->sv_nrthreadsis used in a few places, and there might be bugs in that which are getting that count wrong (when I left the code, all increments and decrements of that field went throughsvc_get()andsvc_destroy(), but other changes have crept in).* Currently running data ready callbacks might be racing with
xpo_detach. Moving that call inside thespin_lock_bh()critical section just after it might help.
But if you were unsure about these two things then I suppose it might be worth doing a closer audit and seeing if there's any refactoring or documentation that could be added to make the rules clearer.
--b.