From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2 5/6] rte_sched: allow reading statistics without clearing Date: Mon, 16 Mar 2015 13:33:04 -0700 Message-ID: <20150316133304.5a0e2b48@urahara> References: <1426004018-25948-1-git-send-email-stephen@networkplumber.org> <1426004018-25948-6-git-send-email-stephen@networkplumber.org> <3EB4FA525960D640B5BDFFD6A3D89126323225F4@IRSMSX108.ger.corp.intel.com> <20150312160626.47315f49@urahara> <3EB4FA525960D640B5BDFFD6A3D8912632323539@IRSMSX108.ger.corp.intel.com> <20150316131112.6a945025@urahara> <3EB4FA525960D640B5BDFFD6A3D89126323235E5@IRSMSX108.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "dev-VfR2kkLFssw@public.gmane.org" , Stephen Hemminger To: "Dumitrescu, Cristian" Return-path: In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D89126323235E5-kPTMFJFq+rEMvF1YICWikbfspsVTdybXVpNB7YpNyf8@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" On Mon, 16 Mar 2015 20:21:39 +0000 "Dumitrescu, Cristian" wrote: > When stats read is decoupled from stats clear, the exchange operation cannot fix this. > > To your point: when stats are cleared on read, would it make sense to use the exchange operation? In my opinion, it does not make sense, as the rte_sched API is not thread safe (for performance reasons), which is explicitly stated. As clearly documented, the scheduler enqueue and dequeue operations need to run on the same CPU core. Therefore, IMHO having a thread safe stats read function while the main functional API is not thread safe is not going to add value. Agreed but for a different reason. It is safe but not consistent to read statistics from another management thread. As long as no other thread is making changes to underlying configuration only the values might change while packets in flight. Making all the statistics fully atomic_t would be a performance killer.