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 A6135A0552; Thu, 20 Oct 2022 22:03:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CFCC410D1; Thu, 20 Oct 2022 22:03:04 +0200 (CEST) Received: from smail.rz.tu-ilmenau.de (smail.rz.tu-ilmenau.de [141.24.186.67]) by mails.dpdk.org (Postfix) with ESMTP id 7918F40FAE for ; Thu, 20 Oct 2022 22:03:02 +0200 (CEST) Received: from [192.168.6.10] (unknown [141.24.207.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id ED94B580094; Thu, 20 Oct 2022 22:03:01 +0200 (CEST) Message-ID: Subject: Re: [PATCH v2 1/2] eal: expose lcore pthread id From: Michael Pfeiffer To: Stephen Hemminger , David Marchand Cc: Markus Theil , dev@dpdk.org, Tyler Retzlaff Date: Thu, 20 Oct 2022 22:03:01 +0200 In-Reply-To: <20221020083605.274c43f2@hermes.local> References: <20221014062100.5761-1-markus.theil@tu-ilmenau.de> <20221014075421.10300-1-markus.theil@tu-ilmenau.de> <20221020083605.274c43f2@hermes.local> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 MIME-Version: 1.0 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, 2022-10-20 at 08:36 -0700, Stephen Hemminger wrote: > On Thu, 20 Oct 2022 13:20:40 +0200 > David Marchand wrote: >=20 > > On Fri, Oct 14, 2022 at 9:54 AM Markus Theil > > wrote: > > >=20 > > > From: Michael Pfeiffer > > >=20 > > > 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. > > >=20 > > > The rte_lcore_to_thread_id function is added to API. > > >=20 > > > Signed-off-by: Michael Pfeiffer =C2= =A0=20 > >=20 > > 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. >=20 > 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 sco= pe 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 mai= n lcore, but would not expose any pthread internals. Thanks & regards Michael