Initialization order in SMP

NIIBE Yutaka (
Fri, 22 May 1998 00:24:32 +0900


In 2.1.103, there is a problem in net/ipv4/ip_fw.c:ip_init_chain().

It allocates memory for ip_chain, and the amounts of memory depends
the number of processors (smp_num_cpus). However, we don't know the
number of processors yet, because sock_init() runs before smp_init().

Because of this, kernel gets OOPs when using network.

Here is a patch to point out the problem. As I don't know much about
the order of initilization, it may be wrong.


NIIBE Yutaka

--- linux-2.1.103/init/main.c~ Thu May 21 01:42:25 1998 +++ linux-2.1.103/init/main.c Thu May 21 14:54:09 1998 @@ -1070,7 +1070,6 @@ signals_init(); inode_init(); file_table_init(); - sock_init(); #if defined(CONFIG_SYSVIPC) ipc_init(); #endif @@ -1083,6 +1082,7 @@ #ifdef __SMP__ smp_init(); #endif + sock_init(); #ifdef CONFIG_SYSCTL sysctl_init(); #endif

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to