From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Fran=E7ois-Fr=E9d=E9ric_Ozog?= Subject: Re: Question on the Ring Library Date: Wed, 4 Dec 2013 14:47:27 +0100 Message-ID: <03b201cef0f7$5fba0d20$1f2e2760$@com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: dev-VfR2kkLFssw@public.gmane.org To: "'Sambath Kumar Balasubramanian'" Return-path: In-Reply-To: Content-Language: fr List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi On a 10Gbps link, there is a new packet every 650ns on average on each direction. So handling latency is extremely important. Traditional "fast" userland mutexes involves system call and scheduling costs (look at the kernel code: it is "hairy"). I measured difference between mutex controlled fifo and DPDK controlled fifo on a Xeon = E5-2680v2, 1867MHz RAM: for times the performance... I consider the cost of a mutex lock is something close to 400ns on average (well I don't say that it = always costs that, but the delays can be not predictable and extremely high - I = saw a few ms even if you use isolcpus and precise affinities-). So if you = plan to do 10Gbps stuff, I guess polling is the only way to go. Fran=E7ois-Fr=E9d=E9ric > -----Message d'origine----- > De=A0: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] De la part de Sambath Kumar > Balasubramanian > Envoy=E9=A0: mercredi 4 d=E9cembre 2013 12:47 > =C0=A0: dev-VfR2kkLFssw@public.gmane.org > Objet=A0: [dpdk-dev] Question on the Ring Library >=20 > Hi, >=20 > The ring library seems to be an excellent IPC. But looking at one = use > case where the fast path code posts events to event thread for = example, the > event thread will spend some cycles polling the ring rather than = waiting > for the event. One approach could be a fast path code basically posts = the > event in the ring as is today and there is a background thread that = polls > the queues and wakes up the event threads. This is similar to Linux > SOFTIRQs.The event threads are asynchronous. Is this a fair model to = avoid > extra polling CPU cycles by the event threads? Is there any other > alternatives in dpdk? >=20 > Regards, > Sambath