smp_processor_id() internal
If I follow the smp_processor_id(), I reach at per_cpu__cpu_number. However, I can not find when the per_cpu__cpu_number is set :(
Please let me know. Thank you for your reading. |
I think it's in the /boot/System.map file. But your question is not very clear to me...
|
I think the OP means where in the running of the kernel is this value set (this is not at all obvious since it is given a value through preprocessor stringification). The answer is, at least for x86(_64) systems, in arch/x86/kernel/setup_percpu.c, line 491:
Code:
per_cpu(cpu_number, cpu) = cpu; |
First of all, thank you for your answers and I'm sorry for not to mention about my working environment. My working environment is like below:
- Linux kernel 2.6.29 - x86, 32bit machine with 2 processors I have seen that code and feel strange because of below code. Code:
// arch/x86/kernel/smpboot.c |
Quote:
This, however, is irrelevant since the offending code has already been removed. Moreover, the entire function init_gdt() is now gone. |
All times are GMT -5. The time now is 02:28 AM. |