DPDK patches and discussions
 help / color / mirror / Atom feed
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: Tue, 24 May 2022 07:51:05 -0700	[thread overview]
Message-ID: <20220524075105.01713e7d@hermes.local> (raw)
In-Reply-To: <1653390517-4033-2-git-send-email-roretzla@linux.microsoft.com>

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"



> +	default:
> +		RTE_LOG(DEBUG, EAL, "The requested priority value is invalid.\n");
> +		return EINVAL;
> +	}
> +	return 0;
> +}

  reply	other threads:[~2022-05-24 14:51 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 [this message]
2022-05-26  6:29       ` Tyler Retzlaff
2022-05-26 15:21         ` Stephen Hemminger
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=20220524075105.01713e7d@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).