Minimize scheduler locking on task creation
This takes my CPU utilization on task-perf-spawnalot from 35% to 55%
This commit is contained in:
parent
ec46f07e6e
commit
d552a0b959
2 changed files with 2 additions and 1 deletions
|
|
@ -136,7 +136,6 @@ int rust_kernel::start_task_threads()
|
|||
rust_task *
|
||||
rust_kernel::create_task(rust_task *spawner, const char *name) {
|
||||
rust_scheduler *thread = threads[rand(&rctx) % num_threads];
|
||||
scoped_lock with(thread->lock);
|
||||
return thread->create_task(spawner, name);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -272,7 +272,9 @@ rust_scheduler::create_task(rust_task *spawner, const char *name) {
|
|||
task->pin(spawner->pinned_on);
|
||||
task->on_wakeup(spawner->_on_wakeup);
|
||||
}
|
||||
lock.lock();
|
||||
newborn_tasks.append(task);
|
||||
lock.unlock();
|
||||
|
||||
sync::increment(kernel->live_tasks);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue