* Can't change priority via sys_sched_setscheduler()?
@ 2006-04-28 11:23 Malcolm Rowe
0 siblings, 0 replies; only message in thread
From: Malcolm Rowe @ 2006-04-28 11:23 UTC (permalink / raw)
To: linux-kernel
Sorry, this is probably a silly question, but what's the correct way to
adjust (reduce, in my case) the priority of a SCHED_NORMAL/SCHED_OTHER
pthread?
glibc translates calls to pthread_setschedprio and pthread_setschedparam
into sys_sched_setparam and sys_sched_setscheduler respectively, which
both end up at sched_setscheduler(), which does:
/*
* Valid priorities for SCHED_FIFO and SCHED_RR are
* 1..MAX_USER_RT_PRIO-1, valid priority for SCHED_NORMAL and
* SCHED_BATCH is 0.
*/
if (param->sched_priority < 0 ||
(p->mm && param->sched_priority > MAX_USER_RT_PRIO-1) ||
(!p->mm && param->sched_priority > MAX_RT_PRIO-1))
return -EINVAL;
if ((policy == SCHED_NORMAL || policy == SCHED_BATCH)
!= (param->sched_priority == 0))
return -EINVAL;
So calls to (for example)
struct sched_param sp = {9};
pthread_setschedparam(scthread, SCHED_OTHER, &sp);
Will fail with EINVAL. Yet calls to setpriority(PRIO_PROCESS, 0, 9)
within the thread will work as expected.
I suspect I'm missing something - what is it?
Thanks,
Malcolm
(please cc: me, I'm not subscribed)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-04-28 11:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-28 11:23 Can't change priority via sys_sched_setscheduler()? Malcolm Rowe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome