From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 742C11B6CB for ; Fri, 10 Nov 2017 12:14:56 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP; 10 Nov 2017 03:14:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,373,1505804400"; d="scan'208";a="829984" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.32]) by orsmga003.jf.intel.com with SMTP; 10 Nov 2017 03:14:52 -0800 Received: by (sSMTP sendmail emulation); Fri, 10 Nov 2017 11:14:52 +0000 Date: Fri, 10 Nov 2017 11:14:51 +0000 From: Bruce Richardson To: Daniel Bristot de Oliveira Cc: "Ananyev, Konstantin" , Adrien Mazarguil , Marcelo Tosatti , "dev@dpdk.org" , Luiz Capitulino Message-ID: <20171110111451.GA9164@bricha3-MOBL3.ger.corp.intel.com> References: <20171110060210.GA23340@amt.cnet> <20171110091219.GE24849@6wind.com> <2601191342CEEE43887BDE71AB9772585FABBC64@irsmsx105.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.9.1 (2017-09-22) Subject: Re: [dpdk-dev] [PATCH] testpmd: add nanosleep in main loop X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 11:14:56 -0000 On Fri, Nov 10, 2017 at 11:42:56AM +0100, Daniel Bristot de Oliveira wrote: > > > On 11/10/2017 11:14 AM, Ananyev, Konstantin wrote: > > Agree with Adrian here - the patch doesn't fix the problem in any case, > > I would agree with you if it were possible to assume one can fully > isolate a CPU on Linux... but it is not... > > This: > https://lwn.net/Articles/659490/ > > is still an open issue, and the reason why it is an open issue is the > kernel threads that need to run on every CPU, mainly when using the > PREEMPT_RT, which turns almost everything on threads. > > > while introducing an unnecessary slowdown in testpmd iofwd mode. > > Please think up some other approach. > > The other approach is to increase the priority of all other threads that > run on the isolate CPU. But that is not a good idea at all, as the other > threads might preempt the busy-loop thread at the worst possible moment. > > Using the knowledge of the thread about when it is the best time to give > a chance for other threads to run would be a smarter decision. > I don't like having this in the main loop either, and to echo others I wouldn't have thought that testpmd was actually used as anything other than a testing app. Also, I would have thought that running it at realtime priority wouldn't be a good idea, because of exactly this problem. On the specifics of the solution, would using sched_yield() rather than nanosleep not be more suitable, given that the reason for this sleep is just to give the CPU to other threads? /Bruce