Kernel: Return the actual number of CPU cores that we have
... instead of returning the maximum number of Processor objects that we can allocate. Some ports (e.g. gdb) rely on this information to determine the number of worker threads to spawn. When gdb spawned 64 threads, the kernel could not cope with generating backtraces for it, which prevented us from debugging it properly. This commit also removes the confusingly named `Processor::processor_count` function so that this mistake can't happen again.
This commit is contained in:
parent
7828d4254e
commit
fcdd202741
Notes:
sideshowbarker
2024-07-17 22:00:50 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/fcdd2027419 Pull-request: https://github.com/SerenityOS/serenity/pull/11278
2 changed files with 1 additions and 3 deletions
|
@ -179,8 +179,6 @@ public:
|
|||
void flush_gdt();
|
||||
const DescriptorTablePointer& get_gdtr();
|
||||
|
||||
static size_t processor_count() { return processors().size(); }
|
||||
|
||||
template<IteratorFunction<Processor&> Callback>
|
||||
static inline IterationDecision for_each(Callback callback)
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@ ErrorOr<FlatPtr> Process::sys$sysconf(int name)
|
|||
return 1;
|
||||
case _SC_NPROCESSORS_CONF:
|
||||
case _SC_NPROCESSORS_ONLN:
|
||||
return Processor::processor_count();
|
||||
return Processor::count();
|
||||
case _SC_OPEN_MAX:
|
||||
return OpenFileDescriptions::max_open();
|
||||
case _SC_PAGESIZE:
|
||||
|
|
Loading…
Add table
Reference in a new issue