Hi Patrick, I have done allmost all changes to the code as you suggested. The changes to use the return value of can_rx_register() also fixed a minor flax with failing bind() and setsockopt() on raw sockets. But there are two things left I would like to ask/understand: Patrick McHardy <kaber@trash.net> writes:How would I use the module reference counter? Somehow with try_module_get()? I have thought something like cp = proto_tab[protocol]; if (!cp ...) return ...; if (!try_module_get(cp->prot->owner)) return ...; sk = sk_alloc(...) module_put(...); return ret; But here I see two problems: 1. Between the check !cp... and referencing cp->prot->owner the module could get unloaded and the reference be invalid. Is there some lock I can hold that prevents module unloading? I haven't found something like this in include/linux/module.h 2. If the module gets unloaded after the first check and request_module() but before the call to try_module_get() the socket() syscall will return with error, although module auto loading would normally be successful. How can I prevent that? I have no objections to add the _rcu suffix for the code changing the receive lists, but I don't see why it's necessary. When I do a spin_lock_bh() before writing, can't I be sure that there is no interrupt routine running in parallel while I hold this spinlock? If so, there is no reader in parallel because the can_rcv() function runs in a softirq. I'd really like to understand why you think the writers should also use the _rcu variant. I'm sorry if I miss something obvious here, but could you try to explain it to me? urs - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
| Greg Kroah-Hartman | [PATCH 007/196] Chinese: add translation of stable_kernel_rules.txt |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
git: | |
| Alexey Dobriyan | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [BUG] New Kernel Bugs |
