From: "Chris Friesen" <cfriesen@nortel.com>
To: Jussi Laako <jussi@sonarnerd.net>
Cc: Peter Zijlstra <peterz@infradead.org>,
James Courtier-Dutton <James@superbug.co.uk>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
d.faggioli@sssup.it
Subject: Re: [RFC][PATCH] Multimedia scheduling class, take 2
Date: Tue, 12 May 2009 11:00:30 -0600 [thread overview]
Message-ID: <4A09AB2E.8030002@nortel.com> (raw)
In-Reply-To: <4A09A525.4080107@sonarnerd.net>
Jussi Laako wrote:
> Chris Friesen wrote:
>
>>If all you're trying to do is allow different threads to run at
>>different nice levels, what about extending sys_setpriority() to take a
>>"which" of PRIO_THREAD? We'd probably have to call the syscall directly
>>until/unless libc picks up the new option.
>
>
> How would this be mapped to a POSIX standard API?
You'd call sys_setpriority. Actually, you'd probably have to call
syscall(__NR_getpriority...) until glibc picks up the new option.
Then for the "which" field, instead of PRIO_PROCESS you would use a new
PRIO_THREAD (or PRIO_TASK, whichever makes more sense) which would only
set the nice level for the specific thread specified in the "who" field.
Of course, without glibc/pthreads support you would only be able to set
the nice level for the current thread since you don't have any way to
map from "pthread_t *" to tid. And you wouldn't be able to create new
threads with a particular nice level already set. But that argument
holds true for a new sched policy as well, because glibc checks the
policy internally and only knows about the normal three.
> I would like to see
> something which works straight out with
> pthread_setschedprio()/pthread_getschedparam(). In order it to work
> correctly it also needs sys_sched_get_priority_min and
> sys_sched_get_priority_max.
This option extends the "nice" API rather than the static priority API,
so all of the above would still have a static priority of 0 for SCHED_OTHER.
Chris
next prev parent reply other threads:[~2009-05-12 17:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-29 18:40 [RFC][PATCH] Multimedia scheduling class Jussi Laako
2008-12-30 7:42 ` Peter Zijlstra
2008-12-30 8:39 ` Jussi Laako
2009-01-12 9:55 ` Jussi Laako
2009-01-12 10:28 ` Peter Zijlstra
2009-01-13 9:44 ` Jussi Laako
2009-01-17 12:49 ` James Courtier-Dutton
2009-01-25 23:09 ` Jussi Laako
2009-01-26 7:25 ` Peter Zijlstra
2009-05-11 8:22 ` [RFC][PATCH] Multimedia scheduling class, take 2 Jussi Laako
2009-05-12 5:38 ` Artem Bityutskiy
2009-05-12 5:57 ` Peter Zijlstra
2009-05-12 9:53 ` Jussi Laako
2009-05-12 15:32 ` Chris Friesen
2009-05-12 16:34 ` Jussi Laako
2009-05-12 16:45 ` Raistlin
2009-05-12 17:38 ` Jussi Laako
2009-05-12 17:55 ` Jussi Laako
2009-05-12 17:00 ` Chris Friesen [this message]
2009-05-12 17:53 ` Jussi Laako
2009-05-12 23:04 ` Chris Friesen
2009-05-13 6:36 ` Jussi Laako
2009-05-12 10:07 ` Jussi Laako
2009-05-12 11:19 ` Peter Zijlstra
2009-05-12 12:12 ` Jussi Laako
2009-05-12 9:40 ` Henrik Austad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A09AB2E.8030002@nortel.com \
--to=cfriesen@nortel.com \
--cc=James@superbug.co.uk \
--cc=d.faggioli@sssup.it \
--cc=jussi@sonarnerd.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox