From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id A7D134C7C for ; Wed, 28 Mar 2018 11:53:50 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2A7252168A; Wed, 28 Mar 2018 05:53:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 28 Mar 2018 05:53:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=5LF+kGUvcfqj7ldkKAbe6kpiou TLmjt0LkpZgS+AybU=; b=IuZrYSHmlsZvhqdWKTfH4YInyxRoFjMLy+C0B6pxAx 0Af6hM87mnjmJcp36wqjR/5Lo+5emKlAQSbw5rCKD6Mxjb68kl513RhT+CQjReVM V10dFSFFFQOpaPJ160qGf4TqRmeTtKKXtuAyjOJSaS5RDd4rLu+rGUiHFMcjeLWF s= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=5LF+kG Uvcfqj7ldkKAbe6kpiouTLmjt0LkpZgS+AybU=; b=GEJtKqsTSH1/RpEnS9+3kd Oy0JO/ceE6qT3MsHrUDPyacJIjS5YZ2s3SrcoT/D6QPzWA5CY6OOU5nUIFkWG70+ zsZ3nkJ3Lsee1B8olPgu/xdy11X/7wAlyBO6YwxxKWLczuylKJPaQDy8mB8ZRgwX FxsMzA/wh+YoHCpXk8cbMCHgPT4pnZ+KfF3StHNEmFEmhjixgS0OUYvPwK4p5OrT oKJ+3W5P1ZfoctdojbVhrJoeyOiBC9CyY7vw4wlenfWB3jElYfCQUeUZkPJjMKSk zkZFwnnvgpUF4nz/MaYlQSOO+9gNMn7Ngix2szYbC+GjzQRvDOk6EJ3l4KHOCyGQ == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 644D6E5083; Wed, 28 Mar 2018 05:53:49 -0400 (EDT) From: Thomas Monjalon To: "Burakov, Anatoly" , "Tan, Jianfeng" Cc: "Van Haaren, Harry" , "dev@dpdk.org" , "Ananyev, Konstantin" Date: Wed, 28 Mar 2018 11:53:20 +0200 Message-ID: <3288381.S1gyJAqTvN@xps> In-Reply-To: <9c6ae3bf-6f45-8148-40c0-757c02fe2102@intel.com> References: <944ebaf4-6dc3-5069-1d7e-2ee7bbcd8adc@intel.com> <9c6ae3bf-6f45-8148-40c0-757c02fe2102@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v6 2/2] eal: add asynchronous request API to DPDK IPC 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: Wed, 28 Mar 2018 09:53:50 -0000 28/03/2018 11:21, Burakov, Anatoly: > On 28-Mar-18 9:55 AM, Tan, Jianfeng wrote: > > On 3/28/2018 4:22 PM, Van Haaren, Harry wrote: > >> From: Thomas Monjalon [mailto:thomas@monjalon.net] > >>> 28/03/2018 04:08, Tan, Jianfeng: > >>>> From: Thomas Monjalon [mailto:thomas@monjalon.net] > >>>>> 27/03/2018 15:59, Anatoly Burakov: > >>>>>> Under the hood, we create a separate thread to deal with replies to > >>>>>> asynchronous requests, that will just wait to be notified by the > >>>>>> main thread, or woken up on a timer. > >>>>> > >>>>> I really don't like that a library is creating a thread. > >>>>> We don't even know where the thread is created (which core). > >>>>> Can it be a rte_service? or in the interrupt thread? > >>>> > >>>> Agree that we'd better not adding so many threads in a library. > >>>> > >>>> I was considering to merge all the threads into the interrupt thread, > >>> however, we don't have an interrupt thread in freebsd. Further, we don't > >>> implement alarm API in freebsd. That's why I tend to current > >>> implementation, > >>> and optimize it later. > >>> > >>> I would prefer we improve the current code now instead of polluting more > >>> with more uncontrolled threads. > >>> > >>>> For rte_service, it may be not a good idea to reply on it as it needs > >>> explicit API calls to setup. > >>> > >>> I don't see the issue of the explicit API. > >>> The IPC is a new service. > > > > My concern is that not every DPDK application sets up rte_service, but > > IPC will be used for very fundamental functions, like memory allocation. > > We could not possibly ask all DPDK applications to add rte_service now. > > > > And also take Harry's comments below into consideration, most likely, we > > will move these threads into interrupt thread now by adding > > > >> Although I do like to see new services, if we want to enable "core" > >> dpdk functionality with Services, we need a proper designed solution > >> for that. Service cores is not intended for "occasional" work - there > >> is no method to block and sleep on a specific service until work > >> becomes available, so this would imply a busy-polling. Using a service > >> (hence busy polling) for rte_malloc()-based memory mapping requests is > >> inefficient, and total overkill :) > >> > >> For this patch I suggest to use some blocking-read capable mechanism. > > > > The problem here is that we add too many threads; blocking-read does not > > decrease # of threads. > > > >> > >> The above said, in the longer term it would be good to have a design > >> that allows new file-descriptors to be added to a "dpdk core" thread, > >> which performs occasional lengthy work if the FD has data available. > > > > Interrupt thread vs rte_service, which is the direction to go? We > > actually have some others threads, in vhost and even virtio-user; we can > > also avoid those threads if we have a clear direction. > > > > Thanks, > > Jianfeng > > > > Hi all, > > First of all, @Thomas, this is not a "new library" - it's part of EAL. I did not say it is a new library. > We're going to be removing a few threads from EAL as it is because of > IPC (Jianfeng has already submitted patches for those), I don't understand. Which threads are you going to remove? Which patch? > so i don't think > it's such a big deal to have two IPC threads instead of one. I'm open to > suggestions on how to make this work without a second thread, but i > don't see it. I am not against the second thread. I am against both threads :) > We've discussed possibility of using rte_service internally, but decided > against it for reasons already outlined by Harry - it's not a suitable > mechanism for this kind of thing, not as it is. > > Using interrupt thread for this _will_ work, however this will require a > a lot more changes, as currently alarm API allocates everything through > rte_malloc, while we want to use IPC for rte_malloc (which would make it > a circular dependency). So it'll probably be more API and more > complexity for dealing with malloc vs rte_malloc allocations. Hence the > least-bad approach taken here: a new thread. If everybody is happy enough with "least bad" design and not trying to improve the core design, what can I say?