]> git.karo-electronics.de Git - karo-tx-linux.git/commit
s390/sysinfo,topology: fix cpu topology maximum nesting detection
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 4 Sep 2012 12:26:03 +0000 (14:26 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 10 Sep 2012 07:54:29 +0000 (09:54 +0200)
commitddb2ce1d7b1cecb23e5e46e37544dd5cfd31266d
tree6e357515a16b20a41fcab4535c8924d0400ee9c3
parent2fd44e2def72c0b2b2028ef9a79b6685c3b54fc0
s390/sysinfo,topology: fix cpu topology maximum nesting detection

The maximum nesting of the cpu topology is evaluated when /proc/sysinfo
is the first time read. This happens without a lock and a concurrent
reader on a different cpu can see and use an invalid intermediate value.
Besides the fact that this race is quite unlikely the worst thing that
could happen is that /proc/sysinfo would contain bogus information about
the machine's cpu topology.
Nevertheless this should be fixed. So move the detection code to the
early machine detection code and since now the value is early available
use it in the topology code as well.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/sysinfo.h
arch/s390/kernel/early.c
arch/s390/kernel/sysinfo.c
arch/s390/kernel/topology.c