From: Jan Kiszka <jan.kiszka@siemens.com>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] [Xenomai-git] Jan Kiszka : cobalt/kernel: Introduce __SCHED_CURRENT policy to setschedparam_ex
Date: Mon, 23 May 2016 14:51:39 +0200 [thread overview]
Message-ID: <5742FCDB.9080608@siemens.com> (raw)
In-Reply-To: <20160523124443.GC27631@hermes.click-hack.org>
On 2016-05-23 14:44, Gilles Chanteperdrix wrote:
> On Mon, May 23, 2016 at 02:22:12PM +0200, Jan Kiszka wrote:
>> On 2016-05-23 14:07, Gilles Chanteperdrix wrote:
>>> On Mon, May 23, 2016 at 12:40:00PM +0200, git repository hosting wrote:
>>>> Module: xenomai-3
>>>> Branch: next
>>>> Commit: c821cbaa31c4a816615a82d7cbbd049987da6f1a
>>>> URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c821cbaa31c4a816615a82d7cbbd049987da6f1a
>>>>
>>>> Author: Jan Kiszka <jan.kiszka@siemens.com>
>>>> Date: Tue Mar 8 14:41:28 2016 +0100
>>>>
>>>> cobalt/kernel: Introduce __SCHED_CURRENT policy to setschedparam_ex
>>>>
>>>> Define the internal scheduling policy "current": it shall refer to the
>>>> target thread's current scheduling policy. This will allow to model
>>>> pthread_setschedprio on top of pthread_setschedparam_ex with only a
>>>> single syscall.
>>>
>>> I am not sure I understand the use of __SCHED_CURRENT all that well.
>>> Since different scheduling policies have different priority ranges,
>>> a particular priority may only make sense for a couple of scheduling
>>> policies. This, means, to use __SCHED_CURRENT, the programmer has to
>>> know the scheduling policy of the current thread anyway. So, since
>>> he knows it, why not specifying it clearly? This will make the
>>> application code more readable, will not change anything with regard
>>> to the number of calls, and avoid to have to change Xenomai core.
>>
>> See "Wrap pthread_setschedprio for proper real-time support" for the use
>> case. I'm open to address that one differently, via a separate syscall
>> or whatever, if preferred. This one was just most simple.
>
> Ok, my point shift to: de we need to support pthread_setschedprio()?
Yes, for existing programs that we want to support over Xenomai without
modifying them.
> The programmer has to know the target thread scheduling policy to be
> able to call that function sanely, so why not using
> pthread_setschedparam instead, which has a "self documenting" effect
> on indicating clearly which policy the target thread is using?
Think of a layer that has no knowledge if the caller has SCHED_RR or
SCHED_FIFO set (or any other policy that have compatible prio scales)
but needs to adjust only the prio. That's the scenario we have to deal with.
Jan
--
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2016-05-23 12:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1b4nHE-0003qK-1y@sd-51317.xenomai.org>
2016-05-23 12:07 ` [Xenomai] [Xenomai-git] Jan Kiszka : cobalt/kernel: Introduce __SCHED_CURRENT policy to setschedparam_ex Gilles Chanteperdrix
2016-05-23 12:22 ` Jan Kiszka
2016-05-23 12:44 ` Gilles Chanteperdrix
2016-05-23 12:51 ` Jan Kiszka [this message]
2016-05-23 13:09 ` Gilles Chanteperdrix
2016-05-23 13:29 ` Jan Kiszka
2016-05-23 13:45 ` Gilles Chanteperdrix
2016-05-24 7:03 ` Gilles Chanteperdrix
2016-05-24 9:12 ` Jan Kiszka
2016-05-24 9:19 ` Gilles Chanteperdrix
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=5742FCDB.9080608@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=gilles.chanteperdrix@xenomai.org \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.