Messages in this thread | | | Date | Tue, 6 Mar 2012 16:49:16 -0800 | From | Andrew Morton <> | Subject | Re: [PATCH] selinux: init target class when add avc callback |
| |
On Tue, 06 Mar 2012 19:41:33 -0500 Eric Paris <eparis@parisplace.org> wrote:
> __initcall() functions aren't serialized? I guess that would be bad and > we would need a lock. I wonder if there are other places I assumed > __initcall() would be serialized (note that all of these call sites are > built in and not modules if that makes a difference)
There's plenty of code in the kernel which assumes that initcalls are singly-threaded. And init/main.c:do_initcalls() is very singly-threaded! It's less clear when the initcall is executed by modprobe, but presumably there's something in the module code which prevents concurrent execution of module_init() functions.
So I think the list management code is acceptable, as long as we ensure that the function is only ever called from initcall functions. We can add a comment, but a neat way of ensuring this is to mark the function __init. This saves memory and will cause a build-time warning if we screw up.
My point was that given that this function is only ever called from initcalls, that weak GFP_ATOMIC could/should be replaced with GFP_KERNEL.
| |