Anton9988
Anton9988

Reputation: 436

How does kernel know how many cores there are

I am wondering how is Linux kernel made aware of all available cores on the system? For the purposes of scheduler I'd assume kernel has to know how many cores there are, who provides kernel info about all the cores on the system?

Upvotes: 0

Views: 290

Answers (1)

Brendan
Brendan

Reputation: 37232

Who provides kernel info about all the cores on the system?

It depends on which system.

For 80x86 PCs, the firmware constructs table/s (ACPI tables now) which provide a list of CPUs, and the kernel parses those tables.

For small embedded systems (with no firmware), the number of CPUs might be compile-time constant or provided by the boot loader somehow (e.g. "flattened device tree").

Upvotes: 3

Related Questions