All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] rt_task_set_priority vs. Linux priority
Date: Thu, 02 Oct 2008 18:18:50 +0200	[thread overview]
Message-ID: <48E4F46A.5060504@domain.hid> (raw)
In-Reply-To: <48E4F276.7040001@domain.hid>

Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> Gilles Chanteperdrix wrote:
>>> Jan Kiszka wrote:
>>>> Quick question $customer stumbled over: Shouldn't the user space part of
>>>> rt_task_set_priority also (or rather?) adjust the Linux priority of the
>>>> caller? My impression is yes. Actually, translating the native priority
>>>> to sched_setscheduler parameters and calling that service would be
>>>> better, no?
>>> I believe Philippe already fixed that in trunk.
>>>
>> Hmmm... but we are on trunk, just a few weeks old...
>>
>> The scenario, as far as I understood it, is that rt_task_set_priority is
>> called from primary context. But the propagation in
>> xnpod_renice_thread_inner targets relaxed contexts only. Probably that's
>> the core of the issue. We need to propagate the modification when
>> migrating next time. Maybe some flag "update Linux prio" so that we only
>> go that way when actually required.
>>
>> BTW, strike my idea of using plain sched_setscheduler - would kick us
>> out of primary mode unconditionally.
> 
> No, you should use pthread_setschedparam, and yes, it will kick us out
> of primary mode, but we decided that it was preferable to complicated
> alternatives: pthread_setschedparam is the only way for libc to be
> informed of the priority change. Libc has its only idea of what the
> priority of a thread is, so, we can not change the priority only in the
> kernel.

So we should warn the user (in the doc) that rt_task_set_priority will
leave an inconsistent priority distribution between Linux and Xenomai
behind? But what is that propagation path in xnpod_renice_thread_inner
good for then?

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux


  reply	other threads:[~2008-10-02 16:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02 15:51 [Xenomai-core] rt_task_set_priority vs. Linux priority Jan Kiszka
2008-10-02 15:52 ` Gilles Chanteperdrix
2008-10-02 16:06   ` Gilles Chanteperdrix
2008-10-02 16:06   ` Jan Kiszka
2008-10-02 16:10     ` Gilles Chanteperdrix
2008-10-02 16:18       ` Jan Kiszka [this message]
2008-10-02 16:30         ` Philippe Gerum
2008-10-02 16:37           ` Gilles Chanteperdrix
2008-10-02 16:48             ` Philippe Gerum
2008-10-02 16:12   ` Philippe Gerum
2008-10-02 16:18     ` Gilles Chanteperdrix
2008-10-02 16:23       ` Jan Kiszka
2008-10-02 16:26         ` Jan Kiszka
2008-10-02 16:45       ` Philippe Gerum

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=48E4F46A.5060504@domain.hid \
    --to=jan.kiszka@domain.hid \
    --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.