Hi, The warning/error pthread_setschedparam failed: Not owner is also happening on Solaris, and obviously it also prints some text, I have documented on the following Wiki how to get rid of this warning/error
I don't know how to fix the issue specifically on your Ubuntu distribution, "error: pthread_setschedparam failed: Not owner or "error: heartbeat thread unable to run at higher priority" Such a simple short message would be sufficient, and then the user can I can imagine that on various Unix flavors the instructions for: /etc/security/limits.d/squeak.conf do not apply. Also note that in my limited experience on Solaris, I can either fix But it's not nice that an extensive error message is printed, Regards, — |
Hi everyone, It's good that there is an open issue for this issue. Also note that there are 2 different things here : (1) the issue itself which is that pthread_setschedparam failed: Not owner and (2) how to solve this For the message, it would be sufficient to just report (1) what happens. Now the action that one should take to resolve this, depends on the operating system, and also to some extent I think there may be different approaches. For example, I have recently discovered that an additional necessary privilege must be given at the Solaris zone level : example# zonecfg -z myzone To be able to add "privs=proc_priocntl" in a zone. One possible approach to address the issue itself is by creating a profile: profiles -p Squeakprofiles:Squeak> set desc="Allow Squeak VM to Set Priority" However bottom line is there is a difference between the issue itself, and the many different ways to address the issue on the various platforms and distributions of operating systems. Regards, — |
In reply to this post by David T Lewis
Hi David, would it be practicable to create a page on the wiki here in this repository that lists the solutions fir the various platforms and then have the error message in the vm reference that wiki page? — |
In reply to this post by David T Lewis
-----BEGIN PGP SIGNED MESSAGE----- Currently if I go to http://wiki.squeak.org/squeak/search and I type in the "Search" field : pthread_setschedparam There is "No Match". The recent changes to the Wiki http://wiki.squeak.org/squeak/recent seem to be related mostly to programming in Squeak. But there are also wiki pages on building the VM software, "pthread_setschedparam failed: Not owner issue could be a good idea on wiki.squeak.org. David Stes -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJfz7akAAoJEAwpOKXMq1MaSZcIALmMv1/jOYadGS+2ghb7ePyS — |
In reply to this post by David T Lewis
-----BEGIN PGP SIGNED MESSAGE----- Another thing to consider is whether calling pthread_setschedparam() My impression is that if I just ignore the warning "pthread_setschedparam failed: Not owner" the programs still run fine. So perhaps the default could be changed NOT to issue a pthread_setschedparam() Maybe some option like '-best-performance' could enable this. Currently the message seems to indicate it is for "best operation". So the message implies that the default could be not to issue the In any case, the message is very specific and it combines both error and MESSAGE: pthread_setschedparam failed: Not owner cat <<END | sudo tee /etc/security/limits.d/squeak.conf
END and report to the squeak mailing list whether this improves behaviour. You will need to log out and log back in for the limits to take effect. David Stes -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJf0hMyAAoJEAwpOKXMq1MaazkH/R8KAROHBOUlcaXTZ8MPPr6v — |
In reply to this post by David T Lewis
-----BEGIN PGP SIGNED MESSAGE----- By the way, there seems to be an alternative to running the Squeak VM It also seems possible to permanently raise the privilege, for example, grep proc_priocntl /etc/security/policy.conf
By raising the PRIV_DEFAULT to also allow process/light weight processes Now permanently allowing this for all threads is best limited, zonecfg -z newt info | grep limitprivlimitpriv: default,proc_priocntl David Stes -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJf0nyPAAoJEAwpOKXMq1MaJoAIAJQwLdN/oTJTPvg4QwNdemJl — |
In reply to this post by David T Lewis
-----BEGIN PGP SIGNED MESSAGE----- When running the Web Framework 'Aida 6.8' on the Cog VM 5.0, If I just ignore the warning about the heartbeat thread priority, However the Aida web framework seems to depend on 'scheduling' issues, Or maybe it just appears to work better. grep proc_priocntl /etc/security/policy.conf
In any case modifying the /etc/security/policy.conf gets rid of the warning. The warning itself is however phrased in such a way that there's no indication, My guess is that there's a great many choices and different options, David Stes -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJf3dgMAAoJEAwpOKXMq1Ma9z4IAIDnoXvKZBa/TSNGfxa+DbEr — |
In reply to this post by David T Lewis
Hi David, you say "Another thing to consider is whether calling pthread_setschedparam() My impression is that if I just ignore the warning "pthread_setschedparam failed: Not owner" the programs still run fine. So perhaps the default could be changed NOT to issue a pthread_setschedparam() This is not the right solution, but it's a little non-obvious. What the setschedparam call does is raise the priority of the heartbeat thread relative to the main Smalltalk thread. Leaving it out means that the heartbeat thread runs at the same priority as the main Smalltalk thread. The effect of this is that if the main Smalltalk thread runs continuously, for example is in some compute-intensive loop, then the heartbeat thread will be prevented from running, and hence events such as Delay expiry will not be checked for, and the main thread will never be interrupted. Try something like the following with a heartbeat thread running at the same priority as the main thread running on a single core machine and you'll manifest the issue:
— |
In reply to this post by David T Lewis
I doubt any modern OS does cooperative scheduling at any priority level. Without the increased priority, the heartbeat will still be scheduled but it may not interrupt the main thread at the intended time. — |
> On 2020-12-21, at 3:30 PM, smalltalking <[hidden email]> wrote: > > > The effect of this is that if the main Smalltalk thread runs continuously, for example is in some compute-intensive loop, then the heartbeat thread will be prevented from running, and hence events such as Delay expiry will not be checked for, and the main thread will never be interrupted. > > I doubt any modern OS does cooperative scheduling at any priority level. Without the increased priority, the heartbeat will still be scheduled but it may not interrupt the main thread at the intended time. > Also, today's machines are almost all multi-core, so even if you keep a core busy with the main thread, another core may schedule the heartbeat process. Well, yeah, that's really the point - you can't rely upon it. On some machines, with some versions of some OS it may work perfectly. On another day it might not. The bit that has been bothering me recently with this is that a simple test program to try the priority raise seems to work but the nominally-the-same code in the actual VM tells me the raise failed. I'm not a fan of inconsistency. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim There can never be a computer language in which you cannot write a bad program. |
In reply to this post by David T Lewis
-----BEGIN PGP SIGNED MESSAGE----- Well I can understand that Eliot has good reasons to raise the priority Also I have noticed now that I'm running a nice package "AIDA" My feeling about it is that still the error message is "too specific". Perhaps the "configure" script could define something like HAVE_LINUX_PAM_LIMITS because I believe the directory /etc/security/limits.d on Linux The platforms/vm/unix/sqUnixHeartbeat.c could then print the message #ifdef HAVE_LINUX_PAM_LIMITS Some Linux distros may not even have that directory /etc/security/limits.d. Regarding Solaris, or other Unix systems that are not Linux, they can have See https://en.wikipedia.org/wiki/Pluggable_authentication_module So although Solaris uses PAM, I could then not define HAVE_LINUX_PAM_LIMITS, Although the action to remediate the issue would be different, the David Stes -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJf4cFXAAoJEAwpOKXMq1MaH70H+wZMv7KCxiMNKlAINfMgKmfA — |
In reply to this post by David T Lewis
-----BEGIN PGP SIGNED MESSAGE----- On some Linux systems without PAM, it might be a possibility to use "prlimit" to set rtprio: https://serverfault.com/questions/889635/seting-rtprio-limit-in-system-without-pam For example with prlimit --rtprio=99 --pid= and then start squeak from that shell. If the Linux system has no /etc/security directory that's a possibility. Basically I think there are probably a great many different ways to achieve The current error message prints (1) a problem and (2) a Linux PAM specific However the error message could be limited to just (1) print the problem, David Stes -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJf5KQ2AAoJEAwpOKXMq1MaA8oIAImkmyhtZepUSpbMYGalt2mj — |
Free forum by Nabble | Edit this page |