From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH v5 18/19] ring: add sched_yield to avoid spin forever Date: Thu, 12 Feb 2015 12:16:08 +0100 Message-ID: <54DC8B78.2040009@6wind.com> References: <1422842559-13617-1-git-send-email-cunming.liang@intel.com> <1423728996-3004-1-git-send-email-cunming.liang@intel.com> <1423728996-3004-19-git-send-email-cunming.liang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit To: Cunming Liang , dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1423728996-3004-19-git-send-email-cunming.liang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 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 02/12/2015 09:16 AM, Cunming Liang wrote: > Add a sched_yield() syscall if the thread spins for too long, waiting other thread to finish its operations on the ring. > That gives pre-empted thread a chance to proceed and finish with ring enqnue/dequeue operation. > The purpose is to reduce contention on the ring. By ring_perf_test, it doesn't shows additional perf penalty. > > Signed-off-by: Cunming Liang > --- > v5 changes: > add RTE_RING_PAUSE_REP to config file > > v4 changes: > update and add more comments on sched_yield() > > v3 changes: > new patch adding sched_yield() in rte_ring to avoid long spin > > config/common_bsdapp | 1 + > config/common_linuxapp | 1 + > lib/librte_ring/rte_ring.h | 31 +++++++++++++++++++++++++++---- > 3 files changed, 29 insertions(+), 4 deletions(-) > > diff --git a/config/common_bsdapp b/config/common_bsdapp > index 57bacb8..52c5143 100644 > --- a/config/common_bsdapp > +++ b/config/common_bsdapp > @@ -234,6 +234,7 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y > CONFIG_RTE_LIBRTE_RING=y > CONFIG_RTE_LIBRTE_RING_DEBUG=n > CONFIG_RTE_RING_SPLIT_PROD_CONS=n > +CONFIG_RTE_RING_PAUSE_REP=n Maybe it's better to use CONFIG_RTE_RING_PAUSE_REP=0 instead? If I understand well, it has to be set to an integer value to enable it, am I correct? Thanks, Olivier