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 4FA26A0570 for ; Wed, 19 Oct 2022 00:41:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF87E4069C; Wed, 19 Oct 2022 00:41:10 +0200 (CEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 8669640041 for ; Wed, 19 Oct 2022 00:41:09 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id l4so15198407plb.8 for ; Tue, 18 Oct 2022 15:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=rOXuqX7m+H5mPv4IYv6yipWbWKEyJoz2SxWZL8fJybQ=; b=xUOfiB5120eu9sbMty2MF8w4VsmAcUxdYo6aV2puV+vVwTq8a9rgMX7cGt1Q9knhUs aXI+9TU/C+KZRDsygvD4StRQTvlY9xUJnxMmwGcr5omTPmDl1Tgb5etOfNf7VsTDxaZl 99nEDPNg9roXXpsNEG4uMPeZHVOD0AwaPCw63jOJrDFnc3DJWr3sIsaKloVww0Zur4MB xMZ6Xdqb9V07II/YoRIz7cV5JiDxCpgNeOcBFhtVijCzpdze6qEo255seBGG7BUM8WCl vNL0LUmlOc75vR+ou4Pkl3jMjl+GC4lsQgzf5+52Faj3XtPIXokIFfO1NCuHFrryzlyL 8TEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rOXuqX7m+H5mPv4IYv6yipWbWKEyJoz2SxWZL8fJybQ=; b=cvxxQ8if6KHo93I4jhIhAat0D31qlhWs2TKWx39/ojhnXBYvNntzxflvJicgkNFFsN wdxXoJiLc10dhNJkyHsabSImsb1lULtjdsxLTJR/HcAblJONZNjx+7SnmO0Is+lnJWNr Z5ZxeyrfIBaStkSH+U9ZubtAZxCOZ3KIJ4pHod8M8FjR1E4uYmAaVoyrq9WQKKdQt1zN SvzDctWwPDf9qrQxDUPeXzTg8N3pmalrxdB8n/EoRrhISs2SiWqLUgyvcdsSflSdLzBA 9ClmPUXT3WLYgkncS2KZm/f8DKfXzQ1sciXKqYO87wzvgi7doS7uh3tEZ1Fo4vtKYUze H8rQ== X-Gm-Message-State: ACrzQf2LlqrT1GPD1W650hvG0w7gj+GnXV8jjdeSb3vnV4/dWvU49oXR W+yG3KEPZOEwurk5Ngf0lgKQOQ== X-Google-Smtp-Source: AMsMyM4X8PRIDjo6UgwII9p0AkQygHDc/bG5CDAM8UnOQydDVuAZR9TaLMxPuIzMJxWLjhj2u6pPxQ== X-Received: by 2002:a17:902:e882:b0:183:4bdf:9298 with SMTP id w2-20020a170902e88200b001834bdf9298mr5483794plg.116.1666132868518; Tue, 18 Oct 2022 15:41:08 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id o21-20020a637315000000b00434651f9a96sm8247592pgc.15.2022.10.18.15.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 15:41:08 -0700 (PDT) Date: Tue, 18 Oct 2022 15:41:06 -0700 From: Stephen Hemminger To: "Juan Pablo L." Cc: "users@dpdk.org" Subject: Re: lcores clarification Message-ID: <20221018154106.101b064f@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org On Tue, 18 Oct 2022 22:06:04 +0000 Juan Pablo L. wrote: > Hellos guys, I have a doubt that I have not been able to clarify with the docs, so maybe you can help me please ... > > I have a process that I want to run on a set of CPUs (performing the same task) but I want to run all of them at the same time, so my question is: > > if I configure something like "--lcores='2@(5-7)'" that will make my lcore with id 2 run simultaneously (at the same time in parallel) on CPUs 5,6,7 or it will run my lcore id 2 only one time at any given time on either CPU 5,6 or 7 ? > > would it be better if I configure different lcore id for the same and assign it to individual CPUs ? , e.g: "--lcores='2@5,3@6,4@7'" even though lcore id 2,3,4 are really the same job ? > > I think my question is just a matter of what is the best way to configure EAL to accomplish what I want, that is to run the same process on all CPU available concurrently, even though, I believe, option 2 seems to be the obvious way I just want to make sure I am not doing something that DPDK could do for me already .... > > A bonus question if its not too much, since lcores are really pthreads (in linux) and I have isolated the CPUs from the kernel scheduler, my guess is that if I have different lcores (performing the same or different tasks) running on the same CPU DPDK will be doing the scheduling right ? .. > > thank you very much!!!! > If you have multiple threads running on same lcore, you better not use locks or rings, or mbufs, or most of the DPDK. Because these features all work like: while (resource is busy) spin wait So if one thread has a resource and gets preempted. When another thread runs and tries to acquire the same resource; the thread will spin until scheduler decides to run the other thread. This is not unique to DPDK, the same problem is described in the pthread_spinlock man page.