- 1. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Tue, 20 Jun 2000 12:46:13 +0200
- Ok, there is still a small race with the actual module unload. I think the cleanest solution is to let open/close run in the big kernel lock. They are not performance critical anyways. Comments ? Loo
- /archives/netdev/2000-06/msg00218.html (11,785 bytes)
- 2. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Tue, 20 Jun 2000 22:06:58 +1000
- - devinet_ioctl() calls dev_change_flags() direct, thus neatly bypassing your lock_kernel() :( - sys_ioctl() and sys_delete_module() both already claim the big lock, so where's the race anyway? I fee
- /archives/netdev/2000-06/msg00219.html (9,792 bytes)
- 3. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Tue, 20 Jun 2000 17:38:57 +0200
- Ugh, I missed that. Ok, with that there is no race. Even better :-) I guess there are some time critical ioctls that should be run outside kernel lock though. It is far too late to audit them all tho
- /archives/netdev/2000-06/msg00220.html (9,570 bytes)
- 4. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 07:52:48 +1000
- ioctls are not a problem, as long as they use a file descriptor, i.e. no global ioctls. Getting a file descriptor requires open() or its equivalent which set the module use_count. The race is in open
- /archives/netdev/2000-06/msg00224.html (9,399 bytes)
- 5. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 00:42:41 +0000
- I think I lied. Look at this: int sock_ioctl(...) { struct socket *sock; int err; unlock_kernel(); sock = socki_lookup(inode); err = sock->ops->ioctl(sock, cmd, arg); lock_kernel(); return err; }
- /archives/netdev/2000-06/msg00226.html (9,878 bytes)
- 6. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 01:18:43 +0000
- I don't think you're right here, Keith. ioctls on the netdevice don't require a descriptor which is associated with dev->open(). For example, Donald's mii-diag application and ifconfig both call devi
- /archives/netdev/2000-06/msg00227.html (11,165 bytes)
- 7. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 11:48:15 +1000
- Note I said "ioctls are not a problem, as long as they use a file descriptor". Getting the file descriptor sets the module reference count. But anything that accesses module code without a reference
- /archives/netdev/2000-06/msg00228.html (12,028 bytes)
- 8. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 02:37:58 +0000
- Not when you put it that way. Yes. These two can be avoided by hoisting the inc/dec up into the netdevice layer. But we need to wrap dev->get_stats(), dev->ioctl(), etc with inc/dec as well.. I am no
- /archives/netdev/2000-06/msg00229.html (11,095 bytes)
- 9. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Tue, 20 Jun 2000 23:12:36 -0400 (EDT)
- Hmmm, now this is an important point. I just "know" that ioctl() and get_stats() should be "simple" functions that shouldn't do call any kernel function, except for perhaps printk(). This is not docu
- /archives/netdev/2000-06/msg00230.html (9,987 bytes)
- 10. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 13:44:00 +1000
- CPU 0 CPU 1 rmmod use_count == 0, OK to remove Grab big kernel lock. Wait for other cpus to spin. Enter open(). spin. sys_delete_module runs. module_exit() sleeps, drops lock. open() continues, enter
- /archives/netdev/2000-06/msg00231.html (10,255 bytes)
- 11. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 03:47:29 +0000
- Yes, these functions tend to be atomic in-and-out. But there are opportunities for module unload prior to them even being called. The call path appears to be: sys_ioctl() lock_kernel() -> fd.file_ope
- /archives/netdev/2000-06/msg00232.html (10,851 bytes)
- 12. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 13:53:49 +1000
- Worse than that. If the module use count is zero then it can be removed at any time from another cpu. The only things preventing this are :- * Big kernel lock for open() and similar functions. * MOD_
- /archives/netdev/2000-06/msg00233.html (10,577 bytes)
- 13. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 04:24:01 +0000
- You're a hard man, Mr Owens. So sys_delete_module() isn't allowed to sleep. It's hard to make this rule future-safe. Do you think that the concept of grabbing the entire machine during module unload
- /archives/netdev/2000-06/msg00234.html (10,697 bytes)
- 14. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 04:45:19 +0000
- sys_delete_module() doesn't do the vfree(). It schedules it for 5 seconds in the future. Or provides a mechanism for userland to do this.
- /archives/netdev/2000-06/msg00235.html (9,240 bytes)
- 15. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 15:12:15 +1000
- I try ... Impossible because sys_delete_module() calls module_exit() which is allowed to do anything. It is the best solution, if it can be done. But I have not found any method of doing this. sys_de
- /archives/netdev/2000-06/msg00236.html (10,931 bytes)
- 16. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 15:16:24 +1000
- Does not fix the problem where module open() code is running at the same time as module_exit() code which tears down the kernel structures that open needs. Freeing the code pages while they are in us
- /archives/netdev/2000-06/msg00237.html (9,587 bytes)
- 17. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 05:41:58 +0000
- I was proposing that the global CPU-grab only need surround the vfree(). It's more of a way of getting all CPUs into a known state than a lock. So sys_delete_module would be more like: sys_delete_mod
- /archives/netdev/2000-06/msg00238.html (11,307 bytes)
- 18. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 12:21:23 +0200
- Ok. Just let's hope that no non-ioctl function grabs first a different lock (like the rtnl_lock) and then does a lock_kernel(). That would give a nice deadlock race. -Andi -- This is like TV. I don't
- /archives/netdev/2000-06/msg00239.html (9,956 bytes)
- 19. Re: modular net drivers, take 2 (score: 1)
- Author: xxxx>
- Date: Wed, 21 Jun 2000 21:06:41 +1000
- Aaaah. I can see it all clearly now. The fundamental misdesign here is that register_netdevice() and unregister_netdev() are called from within the module constructor and destructor functions. You se
- /archives/netdev/2000-06/msg00240.html (11,128 bytes)
- 20. Re: modular net drivers, take 2 (score: 1)
- Author: Andi Kleen <ak@xxxxxx>
- Date: Tue, 20 Jun 2000 12:46:13 +0200
- Ok, there is still a small race with the actual module unload. I think the cleanest solution is to let open/close run in the big kernel lock. They are not performance critical anyways. Comments ? Loo
- /archives/netdev/2000-06/msg00517.html (11,912 bytes)
This search system is powered by
Namazu