From: Stephen Hemminger <stephen@networkplumber.org>
To: Tyler Retzlaff <roretzla@linux.microsoft.com>
Cc: dev@dpdk.org, thomas@monjalon.net, dmitry.kozliuk@gmail.com,
anatoly.burakov@intel.com,
Narcisa Vasile <navasile@linux.microsoft.com>
Subject: Re: [PATCH v3 1/2] eal: get/set thread priority per thread identifier
Date: Thu, 26 May 2022 08:21:27 -0700 [thread overview]
Message-ID: <20220526082127.023edfc3@hermes.local> (raw)
In-Reply-To: <20220526062957.GA27713@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
On Wed, 25 May 2022 23:29:57 -0700
Tyler Retzlaff <roretzla@linux.microsoft.com> wrote:
> On Tue, May 24, 2022 at 07:51:05AM -0700, Stephen Hemminger wrote:
> > On Tue, 24 May 2022 04:08:36 -0700
> > Tyler Retzlaff <roretzla@linux.microsoft.com> wrote:
> >
> > > +static int
> > > +thread_map_priority_to_os_value(enum rte_thread_priority eal_pri,
> > > + int *os_pri, int *pol)
> > > +{
> > > + /* Clear the output parameters */
> > > + *os_pri = sched_get_priority_min(SCHED_OTHER) - 1;
> > > + *pol = -1;
> > > +
> > > + switch (eal_pri) {
> > > + case RTE_THREAD_PRIORITY_NORMAL:
> > > + *pol = SCHED_OTHER;
> > > +
> > > + /*
> > > + * Choose the middle of the range to represent
> > > + * the priority 'normal'.
> > > + * On Linux, this should be 0, since both
> > > + * sched_get_priority_min/_max return 0 for SCHED_OTHER.
> > > + */
> > > + *os_pri = (sched_get_priority_min(SCHED_OTHER) +
> > > + sched_get_priority_max(SCHED_OTHER))/2;
> > > + break;
> > > + case RTE_THREAD_PRIORITY_REALTIME_CRITICAL:
> > > + *pol = SCHED_RR;
> > > + *os_pri = sched_get_priority_max(SCHED_RR);
> > > + break;
> >
> > Many people have experimented with realtime priorities with DPDK
> > and Linux, and have never heard of any one not having problems.
> >
> > Recommend that this either be an error add a warning log message
> > that "Setting real time priority may break"
>
> so i went back through the feedback when the priority change was
> originally introduced. you're request was that you didn't want it to be
> possible for realtime priority to be set on linux.
>
> this particular function is just about mapping the abstracted
> representation of realtime priority in eal to the platform specific
> linux representation.
>
> so if you take a look at the other parts of the patch you will notice
> that the rte_thread_set_priority() for linux will in fact fail if you
> try to use realtime priority.
>
> additionally, the unit test exercises that attempting to use realtime
> priority does fail for linux.
>
> take another look and let me know if you don't agree.
>
> thanks
Thanks for clarifying.
Is there any analog for SCHED_DEADLINE worth considering?
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
next prev parent reply other threads:[~2022-05-26 15:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-23 10:46 [PATCH 0/2] add thread priority accessors Tyler Retzlaff
2022-05-23 10:46 ` [PATCH 1/2] eal: get/set thread priority per thread identifier Tyler Retzlaff
2022-05-23 10:46 ` [PATCH 2/2] test/threads: add unit test for get set priority Tyler Retzlaff
2022-05-23 10:52 ` Tyler Retzlaff
2022-05-23 13:07 ` [PATCH v2 0/2] add thread priority accessors Tyler Retzlaff
2022-05-23 13:07 ` [PATCH v2 1/2] eal: get/set thread priority per thread identifier Tyler Retzlaff
2022-05-23 13:07 ` [PATCH v2 2/2] test/threads: add unit test for get set priority Tyler Retzlaff
2022-05-24 11:08 ` [PATCH v3 0/2] add thread priority accessors Tyler Retzlaff
2022-05-24 11:08 ` [PATCH v3 1/2] eal: get/set thread priority per thread identifier Tyler Retzlaff
2022-05-24 14:51 ` Stephen Hemminger
2022-05-26 6:29 ` Tyler Retzlaff
2022-05-26 15:21 ` Stephen Hemminger [this message]
2022-05-27 11:15 ` Tyler Retzlaff
2022-05-24 11:08 ` [PATCH v3 2/2] test/threads: add unit test for get set priority Tyler Retzlaff
2022-06-07 10:39 ` [PATCH v3 0/2] add thread priority accessors David Marchand
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=20220526082127.023edfc3@hermes.local \
--to=stephen@networkplumber.org \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=navasile@linux.microsoft.com \
--cc=roretzla@linux.microsoft.com \
--cc=thomas@monjalon.net \
/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.