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 0B61BA054A; Thu, 26 May 2022 17:21:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD9C740151; Thu, 26 May 2022 17:21:32 +0200 (CEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id BFE8A40150 for ; Thu, 26 May 2022 17:21:31 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id a13so1699646plh.6 for ; Thu, 26 May 2022 08:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=inZaogCpBy0E36dcMLXhvqu44240VRNnKDAkea1/4+Q=; b=gXZPavjaupzkjh+zWTCbC+3Q/8sXuusPJXLNpjdEF8961Xe1fCGFLmXhnJI+2QHEOY 6Iu1UuV+eBFrXPeeK/du7OJqzWvX4ELCYVr40FL+us1tU9Fztd5Ud2vCgvUiw7j50Uzu GRM9+zbDwgpLnj5mZ3rZgYr0wS6AUsUcolqpNuOW0yYvXHdFnJa9i17mZ3K1I83L2USY TdrhILyoWXn7OyY181Mksrxch0666Ay7IzfNd2RZdIJTnrS5e1nh4TJJUzrcR3A+dsYa 94hvlFXLSQrsi8AVA7WU1KnoBive9OjpcwB80AO2191YrTYrIBQO4mwkyYGaXyRKfEXM mx6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=inZaogCpBy0E36dcMLXhvqu44240VRNnKDAkea1/4+Q=; b=7gKvA6RY5ikXBGp17lltB6FLmK3m5ytOKxjAN+21tGIomOoVnmO+f/2BQuK6QAIB5V UoWL/b34AnnzvZ8vgXiBLcRvKSu9toVh/xs2Z9P/Ph3gpTJrjfDcoH4Mow7RwZ5KMR5P nad5l8yzUsy3+025VUjvBEsUv0MYm9R3Lqqbstwb1MOtY3KF4xEUP63Fz19+MWbNtFQo TSltQrI1T4Fdb6rFaoxfCgWHoVrFAYdBeS6b7JuhR3kyhnGfKjRNFikxRin4dv33c0S5 NAoySvGgIbVS9xFwJTHOQ8I1i0oBWFXpDVKBRPVmOM1g2aPDLk5GkEqgGKomBJlM/RP5 11kQ== X-Gm-Message-State: AOAM530qnkqpeuonZrmSpW6yExFyyUHaNXbYShnlkEl8BT41JnYVGC1C 078H+RF5ABwV2nTJWZUQwDuAyw== X-Google-Smtp-Source: ABdhPJzaXVv7uxIl3QxoD8hgV7VwnngWdqMENRzctOCLZAijtYWlExSFfUPwOvsQvXGIGthwnsBLxw== X-Received: by 2002:a17:902:70c1:b0:163:5a8f:9df9 with SMTP id l1-20020a17090270c100b001635a8f9df9mr8575617plt.9.1653578490746; Thu, 26 May 2022 08:21:30 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id q12-20020a170902c9cc00b0015e8d4eb1f6sm1667714pld.64.2022.05.26.08.21.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 08:21:30 -0700 (PDT) Date: Thu, 26 May 2022 08:21:27 -0700 From: Stephen Hemminger To: Tyler Retzlaff 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: <20220526082127.023edfc3@hermes.local> In-Reply-To: <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> <20220526062957.GA27713@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Wed, 25 May 2022 23:29:57 -0700 Tyler Retzlaff 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 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