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 19CA8A00C2; Tue, 29 Nov 2022 23:04:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 011A640A79; Tue, 29 Nov 2022 23:04:48 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 5F50B40693 for ; Tue, 29 Nov 2022 23:04:46 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 4431A20B717A; Tue, 29 Nov 2022 14:04:45 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4431A20B717A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1669759485; bh=a6cegXOTiL9iBp1LBc3jv65fs9cMhsjICiUWKqASoAE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZUpfgzS+cq1oiHygdjH9CctpxvLmvi5D6ZTe1M2NK/02mLCR7owtF0wlBXap0p9NB lrSu3B1rrUy2txrJX1wyKXgUDQP5l9jHQnYCnA17yAP4k5p6peG4V0Nnaq/3ke0JP5 wulAVl8OxW0GG0bI+i5hVGchXisIMG+cE7X6evXk= Date: Tue, 29 Nov 2022 14:04:45 -0800 From: Tyler Retzlaff To: Michael Pfeiffer Cc: Stephen Hemminger , David Marchand , Markus Theil , dev@dpdk.org Subject: Re: [PATCH v2 1/2] eal: expose lcore pthread id Message-ID: <20221129220445.GB31725@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20221014062100.5761-1-markus.theil@tu-ilmenau.de> <20221014075421.10300-1-markus.theil@tu-ilmenau.de> <20221020083605.274c43f2@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Thu, Oct 20, 2022 at 10:03:01PM +0200, Michael Pfeiffer wrote: > On Thu, 2022-10-20 at 08:36 -0700, Stephen Hemminger wrote: > > On Thu, 20 Oct 2022 13:20:40 +0200 > > David Marchand wrote: > > > > > On Fri, Oct 14, 2022 at 9:54 AM Markus Theil > > > wrote: > > > > > > > > From: Michael Pfeiffer > > > > > > > > Also expose the pthread id of each lcore, in > > > > order to allow modification of pthread attributes, > > > > for example use rte_thread_setname without executing > > > > pthread_self() on the maybe already running lcore. > > > > > > > > The rte_lcore_to_thread_id function is added to API. > > > > > > > > Signed-off-by: Michael Pfeiffer   > > > > > > We are trying to abstract the use of pthread in DPDK API. > > > So I don't think this patch is going in the right direction. > > > > Agree, exposing this will make Windows support harder > > and who knows what next OS to come will need. > > Hi, > thanks for your feedback. I understand your concerns regarding abstraction and > portability. > > Markus and I ultimately use the function in the patch to call > rte_thread_setname() (which takes the pthread id as an argument) to rename our > lcore workers from "lcore-worker-X" to something more meaningful in the scope > of our application. Having descriptive thread names makes debugging > significantly easier. For example, verifying CPU pinning worked as intended > with ps -T ..., or identifying threads in the Intel VTune profiler. > > Would you consider something like > - int rte_lcore_setname(unsigned int lcore_id, const char *name) > - int rte_lcore_getname(unsigned int lcore_id, char *name, size_t len) > a more appropriate API? That would still allow us to set names from the main > lcore, but would not expose any pthread internals. if only setname, getname are needed for rte_thread_t i imagine it shouldn't be too objectionable to add them to rte_thread.h you can either wait until i have time to do it (could be a while) or you can put a new patch + unit test together. if testing the windows implementation part of the addition is a barrier i can apply and run the supplied unit test, assist with review. > > Thanks & regards > Michael