On the hw kernel, the Cpu_thread::start operation wraps up the initialization of the Core::Platform_thread. As part of this procedure, there happens to be a cap slot allocation that is needed to send the initial IPC from core's starting thread to the newly created thread. Should the PD's capability slab be exhausted at this point, this allocation fails. This condition, however, cannot be reflected to the client because the Cpu_thread::start RPC has no result. At the interface level, such allocation issues should be reflected during Cpu_session::create_thread.
To cleanly solve this issue, we should move the final steps of the thread initialization from the start operation to the point of the Platform_thread construction. Currently this is not easily possible because the Platform_thread lacks the Platform_pd at construction time.
As an interim solution, we can detect the corner case by evaluating the PD's remaining cap-slab capacity ahead of the start call, and upgrading the cap slab opportunistically.
On the hw kernel, the
Cpu_thread::start
operation wraps up the initialization of theCore::Platform_thread
. As part of this procedure, there happens to be a cap slot allocation that is needed to send the initial IPC from core's starting thread to the newly created thread. Should the PD's capability slab be exhausted at this point, this allocation fails. This condition, however, cannot be reflected to the client because theCpu_thread::start
RPC has no result. At the interface level, such allocation issues should be reflected duringCpu_session::create_thread
.To cleanly solve this issue, we should move the final steps of the thread initialization from the
start
operation to the point of thePlatform_thread
construction. Currently this is not easily possible because thePlatform_thread
lacks thePlatform_pd
at construction time.As an interim solution, we can detect the corner case by evaluating the PD's remaining cap-slab capacity ahead of the
start
call, and upgrading the cap slab opportunistically.