On Mon, Mar 20, 2017 at 09:07:16PM +0100, Levente Uzonyi wrote:
IMO the best solution would be to add command line parameters to set the priorities - both main and heartbeat using relative values, and keep the current behavior if none was given. Ben's example would be 0 for both parameters. Then the error message on startup could just say to set one of the parameters to run the VM (e.g. 0,0 or -1,0, etc).
A much simpler solution is to just comment out the "exit(errno)" at line 332 of sqUnixHearbeat.c. The resulting VM will work fine.
If the /etc/security/limits.d/squeak.conf is not in place, then you will see the annoying but otherwise harmless warming:
pthread_setschedparam failed: Operation not permitted This VM uses a thread heartbeat who requires a special configuration to work. You need to allow it to run higher priority threads (real time), to allow clock to work properly You need to add a conf file to /etc/security/limits.d, executing this:
sudo cat >/etc/security/limits.d/squeak.conf <<END * hard rtprio 2 * soft rtprio 2 END
Ben's analysis may or may not be exactly right for all conditions of load, but directionally he is right on target. Clock jitter is of little or no interest to the general user, and the people who do care about it are fully capable of setting the necessary security configuration.
AFAIK you can always decrease the priority of the threads on linux, so 0 and negative values should always work.
I think this is correct, so another resonable strategy would be to lower the priority of threads other than the heartbeat thread when the heartbeat priority cannot be raised. But if Ben's analysis is generally correct, then it may not even be worth the trouble of doing that.
Dave