From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1B9A6A0557; Thu, 26 May 2022 08:30:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EE7340E64; Thu, 26 May 2022 08:30:01 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 81B7C40DF7 for ; Thu, 26 May 2022 08:29:59 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id A4EB820B71D5; Wed, 25 May 2022 23:29:57 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A4EB820B71D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1653546597; bh=HKP5X+czddL8Y+axPxDQLd2nkfUmrKBuR5P9YXKjyGQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sJwyBfV/8B8FdypQwke6uMly+xHmDURKFthoOfNgMfXJuHvcaN+L6Cbmi6i0e69wn F/O5nDn6VEWZLJvLW6VXXKkpkLoquLDvgkHRUqP5jQKIXrABCKBN31AhgmqI461LYN RHMH1q2ItvG6BS0x/dMriZJKSPDYySvp1MwL0mBY= Date: Wed, 25 May 2022 23:29:57 -0700 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org, thomas@monjalon.net, dmitry.kozliuk@gmail.com, anatoly.burakov@intel.com, Narcisa Vasile Subject: Re: [PATCH v3 1/2] eal: get/set thread priority per thread identifier Message-ID: <20220526062957.GA27713@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1653302773-11043-1-git-send-email-roretzla@linux.microsoft.com> <1653390517-4033-1-git-send-email-roretzla@linux.microsoft.com> <1653390517-4033-2-git-send-email-roretzla@linux.microsoft.com> <20220524075105.01713e7d@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220524075105.01713e7d@hermes.local> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, May 24, 2022 at 07:51:05AM -0700, Stephen Hemminger wrote: > On Tue, 24 May 2022 04:08:36 -0700 > Tyler Retzlaff 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