Skip to contentSkip to conversation

pthread_setschedprio and __SCHED_CURRENT

DISCUSSION Jan Kiszka 2 participants 2 messages Nov 27, 2019

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi Philippe,

fortunately before we set the new ABI into stone, I just discovered flaw in my pthread_setschedparam_ex(__SCHED_CURRENT) approach for modelling pthread_setschedprio: It breaks over non-trivial policies like SCHED_QUOTA.

Userspace would have to query all current policy parameters of the target thread first in order to just update the priority in param_ex. Currently, it sends down bogus values via the setschedparam_ex call.

I could work around this by handling __SCHED_CURRENT even more special in the kernel or - which I'm leaning to ATM - introduce a real setschedprio syscall.

What do you think?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
#1 lore raw
Quoted 10 lines · Jan Kiszka

Hi Philippe,

fortunately before we set the new ABI into stone, I just discovered flaw in my pthread_setschedparam_ex(__SCHED_CURRENT) approach for modelling
pthread_setschedprio: It breaks over non-trivial policies like SCHED_QUOTA.

Userspace would have to query all current policy parameters of the target thread first in order to just update the priority in param_ex. Currently, it sends down bogus values via the setschedparam_ex call.

Quoted 6 lines

I could work around this by handling __SCHED_CURRENT even more special in the kernel or - which I'm leaning to ATM - introduce a real setschedprio syscall.

What do you think?

I would go for a new syscall too, other options may prove to be fragile at the end of the day.

Signature · 1 line
Philippe.