ShabbyX / RTAI

(NO LONGER MAINTAINED) Clone of RTAI from https://www.rtai.org
28 stars 17 forks source link

Configure latency at run-time from init script #25

Open zultron opened 9 years ago

zultron commented 9 years ago

My RTAI package 4.1 branch builds the latest ShabbyX/RTAI code, and the linux-ipipe-deb 3.16.7 branch builds kernel packages from that.

ShabbyX/RTAI#24 raised the issue of scheduling latency calibration, which is reported to be done at build time, traditionally. This doesn't make sense in a package setting, since latency values likely won't apply to the application host (if calibration on the build host is even possible, which it isn't in my environment).

RTAI ships an init script that loads modules at boot time. I propose to use this init script to run the calibrate tool on the application host to determine latency, and then load modules with the resulting figures.

I'd appreciate help with these questions:

ShabbyX commented 9 years ago

Reading the README now, it says the calibration needs to be done preferably while there is nothing else going on in the computer. Would boot time qualify for that? There is certainly fewer processes during boot, but where systemd is available, this means that we are likely not the only active task in the system.

  1. I think this is a question we could ask in the mailing list. However, RTAI just takes the output of the calibration tool and sticks it in the configuration, so I guess it doesn't matter much?
  2. rtai_lxrt and rtai_ksched are now synonyms with rtai_sched. From what I can gather, of the three calibration output parameters, CONFIG_RTAI_SCHED_LATENCY, CONFIG_RTAI_KERN_BUSY_ALIGN_RET_DELAY and CONFIG_RTAI_USER_BUSY_ALIGN_RET_DELAY, only the first can be overridden and that is by setting the Latency module parameter. However, there are pieces of code that get conditionally compiled even based on the value of CONFIG_RTAI_SCHED_LATENCY, so it seems that simply setting Latency may not be enough.

    I think some complaining on the mailing list is in order, but as it usually gets ignored, I could try to change them so proper parameters are used instead of compile time constants.

  3. Yes, of course! Once it's possible to dynamically change those parameters, writing the script should be easy and I could do that.
ShabbyX commented 8 years ago

@zultron Is this still an issue? I didn't have time to get around to do this, and I had completely forgot about it.