POETSII / Orchestrator

The Orchestrator is the configuration and run-time management system for POETS platforms.
1 stars 1 forks source link

Softswitch: Implement Hardware Idle #242

Open heliosfa opened 3 years ago

heliosfa commented 3 years ago

This will be needed for Synchronisation steps in DPD as it is implemented.

heliosfa commented 2 years ago

Implementing hardware idle is not going to be as easy as it first seems.

Underlying support in the Softswitch (and a couple of needed tweaks in the composer to exploit the Softswitch's function-pointer design) has been implemented on the feature branch for this issue and seems to work as far as can be tested currently.

Unfortunately, the hardware idle detection requires all threads in the system, whether they are actually executing or not, to end up at a call to tinselIdle() for the idle detection to work. Ultimately, this means that we need to make some deeper changes to composition, deployment and startup logic.

My proposed way forward is to create a "dummy" softswitch that starts and enters a while(1) that just calls tinselIdle() ad infiniteum. This then needs to be loaded onto the relevant cores that are not part of the application.

The obvious option is to make use of Hostlink's Boot() method, as this loads one instruction binary and one data binary onto every core in the system, and then overwrite the instructions and data for the cores we actually care about. The problem with this is that Boot() calls startAll() at the end of its execution, knocking the core out of the bootloader. There is also the issue of what about unused cores and threads that share instuction space with active threads? they will try to execute the "normal" softswitch.

So, suggested chain of events to realise this:

This seems to have the minimal overall overhead in terms of implementation effort and setup time impact.

thoughts?

mvousden commented 2 years ago

Regarding Hostlink changes, see https://github.com/POETSII/tinsel/pull/111.

mvousden commented 2 years ago

So what I'm going to do is:

mvousden commented 2 years ago

See #282 for my progress on the above.

m8pple commented 2 years ago

Isn't this done now? I thought it was fixed long ago.

mvousden commented 2 years ago

If I recall correctly, @heliosfa is still in documentation hell over this one.