dccp: remove module exit functions
Subsystems (2)
PATCH 1/1 dccp: remove module exit functions
The dccp ipv4 & ipv6 modules cannot be unloaded, as their control sockets each maintain a couple of module references. So, it seems like a good idea to just remove the module exit functions completely.
Please review.
---
net/dccp/ipv4.c | 8 -------- net/dccp/ipv6.c | 8 -------- 2 files changed, 16 deletions(-)
net/dccp/ipv4.c +0 -8
@@ -1135,15 +1135,7 @@ out_proto_unregister: goto out; } -static void __exit dccp_v4_exit(void) -{ -inet_unregister_protosw (&dccp_v4_protosw); -inet_del_protocol (&dccp_v4_protocol,IPPROTO_DCCP ); -proto_unregister (&dccp_v4_prot); -} -module_init (dccp_v4_init); -module_exit (dccp_v4_exit);/* * __stringify doesn't likes enums, so use SOCK_DCCP (6) and IPPROTO_DCCP (33)
net/dccp/ipv6.c +0 -8
@@ -1276,15 +1276,7 @@ out_unregister_proto: goto out; } -static void __exit dccp_v6_exit(void) -{ -inet6_del_protocol (&dccp_v6_protocol,IPPROTO_DCCP ); -inet6_unregister_protosw (&dccp_v6_protosw); -proto_unregister (&dccp_v6_prot); -} -module_init (dccp_v6_init); -module_exit (dccp_v6_exit);/* * __stringify doesn't likes enums, so use SOCK_DCCP (6) and IPPROTO_DCCP (33)
Quoted 5 lines · James Morris
The dccp ipv4 & ipv6 modules cannot be unloaded, as their control sockets each maintain a couple of module references. So, it seems like a good idea to just remove the module exit functions completely.
Please review.
Well, I have a patch in the DCCP backlog that uses it, ressurecting the unload hack, for development purposes being able to destroy the control sockets allowing module removal is something the DCCP developers want :)
- Arnaldo
Quoted 11 lines · Arnaldo Carvalho de Melo
Quoted 5 lines · James Morris
The dccp ipv4 & ipv6 modules cannot be unloaded, as their control sockets each maintain a couple of module references. So, it seems like a good idea to just remove the module exit functions completely.
Please review.
Well, I have a patch in the DCCP backlog that uses it, ressurecting the unload hack, for development purposes being able to destroy the control sockets allowing module removal is something the DCCP developers want :)
I wonder if this facility can be integrated more generally into the kernel protocol which people are developing.
Where is the patch you use?
- James
Signature · 2 lines
James Morris <[email protected]>
Quoted 2 lines · James Morris
I wonder if this facility can be integrated more generally into the kernel protocol which people are developing.
Ugh, editor screwup. That was meant to be
I wonder if this facility can be integrated more generally into the kernel as a kernel hacking option, as this is not the only protocol which people are developing.
Quoted 7 lines
Where is the patch you use?
- James
Signature · 2 lines
James Morris <[email protected]>
Quoted 11 lines · James Morris
Quoted 2 lines · James Morris
I wonder if this facility can be integrated more generally into the kernel protocol which people are developing.
Ugh, editor screwup. That was meant to be
I wonder if this facility can be integrated more generally into the kernel as a kernel hacking option, as this is not the only protocol which people are developing.
See:
http://www.erg.abdn.ac.uk/users/gerrit/dccp/patch-backlog/09a_release_ctl_socket_at_exit.diff
This one requires a bit more thinking, so I'm postponing it for now to get the simple bits in Gerrit's patch queue cherrypicked and sent for Dave.
- Arnaldo
Quoting Arnaldo Carvalho de Melo:
| On 11/10/06, James Morris <[email protected]> wrote:
| > I wonder if this facility can be integrated more generally into the kernel | > as a kernel hacking option, as this is not the only protocol which people | > are developing. | > | | See: | http://www.erg.abdn.ac.uk/users/gerrit/dccp/patch-backlog/09a_release_ctl_socket_at_exit.diff | | This one requires a bit more thinking, so I'm postponing it for now to | get the simple bits in Gerrit's patch queue cherrypicked and sent for
There is a similar problem in sctp and so it would indeed be useful to have a (configuration) option. Without the `unload hack' there is no module unloading and that is very bad, especially since DCCP development is likely to continue (there is no single consistent, full DCCP implementation yet, so testing will be one prime activity).
David Miller
maintainerFrom: "Arnaldo Carvalho de Melo" <[email protected]>
Date: Fri, 10 Nov 2006 16:32:16 -0200
Quoted 13 lines · James Morris
Quoted 11 lines · James Morris
Quoted 3 lines
I wonder if this facility can be integrated more generally into the kernel protocol which people are developing.
Ugh, editor screwup. That was meant to be
I wonder if this facility can be integrated more generally into the kernel as a kernel hacking option, as this is not the only protocol which people are developing.
Quoted 6 lines
See:
http://www.erg.abdn.ac.uk/users/gerrit/dccp/patch-backlog/09a_release_ctl_socket_at_exit.diffThis one requires a bit more thinking, so I'm postponing it for now to get the simple bits in Gerrit's patch queue cherrypicked and sent for Dave.
One possible way to handle this is to flag certain sockets such that no refrence counting is done for them against the module. It is an indication that the module will take care of such sockets on cleanup.
It seems that this would limit the cost to a test at socket create and destroy time.
Quoted 23 lines · David Miller
From: "Arnaldo Carvalho de Melo" <[email protected]>
Date: Fri, 10 Nov 2006 16:32:16 -0200Quoted 13 lines · James Morris
Quoted 11 lines · James Morris
Quoted 3 lines
I wonder if this facility can be integrated more generally into the kernel protocol which people are developing.
Ugh, editor screwup. That was meant to be
I wonder if this facility can be integrated more generally into the kernel as a kernel hacking option, as this is not the only protocol which people are developing.
Quoted 6 lines
See:
http://www.erg.abdn.ac.uk/users/gerrit/dccp/patch-backlog/09a_release_ctl_socket_at_exit.diffThis one requires a bit more thinking, so I'm postponing it for now to get the simple bits in Gerrit's patch queue cherrypicked and sent for Dave.
Quoted 7 lines
One possible way to handle this is to flag certain sockets such that no refrence counting is done for them against the module. It is an indication that the module will take care of such sockets on cleanup.
It seems that this would limit the cost to a test at socket create and destroy time.
Yes, but this is not the case currently with Gerrit's proposed patch, I'm postponing it for now, as one has to be very very careful to monitor the TW sockets with iproute2's ss before rmmoding with --force, have to revisit the old unload hack to combine its ideas with SCTP/Gerrit's approach, the old one was ugly, but at least refused to unload before all the TW sockets were gone.
- Arnaldo
[root@qemu ~]# rmmod dccp_ipv4
ERROR: Module dccp_ipv4 is in use by [unsafe]
[root@qemu ~]# rmmod --force dccp_ipv4
[ 128.264180] slab error in kmem_cache_destroy(): cache `tw_sock_DCCP': Can't free all objects [ 128.265284] [<c0141ea7>] kmem_cache_destroy+0x77/0xd0 [ 128.266133] [<c0201dcf>] proto_unregister+0x8f/0xb0 [ 128.267222] [<d085005c>] dccp_v4_exit+0x3c/0x5b [dccp_ipv4] [ 128.268050] [<c0128458>] sys_delete_module+0x158/0x1d0 [ 128.268527] [<c0269ada>] do_page_fault+0x4ea/0x640 [ 128.269014] [<c0102abf>] syscall_call+0x7/0xb [ 128.269472] =========== [root@qemu ~]# rmmod dccp [ 141.267175] slab error in kmem_cache_destroy(): cache `dccp_bind_bucket': Can't free all objects [ 141.268392] [<c0141ea7>] kmem_cache_destroy+0x77/0xd0 [ 141.268950] [<d0847e93>] dccp_fini+0x63/0x70 [dccp] [ 141.270046] [<c0128458>] sys_delete_module+0x158/0x1d0 [ 141.270530] [<c013b6e4>] do_munmap+0x1c4/0x230 [ 141.270964] [<c0102abf>] syscall_call+0x7/0xb [ 141.271414] ===========
Followed by:
<BIG SNIP>
[ 147.347021] ===========[ 147.359334] Code: c3 08 e9 69 ff ff ff eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 90 55 89 cd 57 56 89 c6 53 8d 04 ca 83 ec 08 8b 10 89 e7 89 14 24 <89> 62 04 8b 50 04 89 22 89 54 24 04 89 00 8b 14 24 89 40 04 39 [ 147.395025] EIP: [<c0115b05>] cascade+0x15/0x60 SS:ESP 0068:c0304fa4 [ 147.403619] <0>Kernel panic - not syncing: Fatal exception in interrupt [ 147.482149]