From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 3C050D47F for ; Wed, 29 Mar 2017 17:33:43 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP; 29 Mar 2017 08:33:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,241,1486454400"; d="scan'208";a="66485051" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga002.jf.intel.com with ESMTP; 29 Mar 2017 08:33:42 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 29 Mar 2017 08:30:49 -0700 Received: from fmsmsx108.amr.corp.intel.com ([169.254.9.101]) by fmsmsx116.amr.corp.intel.com ([169.254.2.225]) with mapi id 14.03.0319.002; Wed, 29 Mar 2017 08:30:49 -0700 From: "Eads, Gage" To: Olivier Matz CC: "dev@dpdk.org" Thread-Topic: [PATCH v3] mempool: remove non-EAL thread note from header Thread-Index: AQHSpKeguz6HLvvV/0ybkU1ohqJVsqGr8wig Date: Wed, 29 Mar 2017 15:30:49 +0000 Message-ID: <9184057F7FC11744A2107296B6B8EB1E01E97BAD@FMSMSX108.amr.corp.intel.com> References: <1490202268-3799-1-git-send-email-gage.eads@intel.com> <1490278858-27257-1-git-send-email-gage.eads@intel.com> <20170324150444.233b3045@platinum> In-Reply-To: <20170324150444.233b3045@platinum> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.200.106] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3] mempool: remove non-EAL thread note from header 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, 29 Mar 2017 15:33:43 -0000 > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz@6wind.com] > Sent: Friday, March 24, 2017 9:05 AM > To: Eads, Gage > Cc: dev@dpdk.org > Subject: Re: [PATCH v3] mempool: remove non-EAL thread note from header > =20 > Hi Gage, > =20 > On Thu, 23 Mar 2017 09:20:58 -0500, Gage Eads > wrote: > > Commit 30e6399892276 ("mempool: support non-EAL thread") added the > > capability for non-EAL threads to use the mempool library. This commit > > removes the note indicating that the mempool library cannot be used > > safely by non-EAL threads. > > > > Also, fix a typo. > > > > Signed-off-by: Gage Eads > > --- > > v2: Changed commit message to referenced commit 30e63998 instead of > > 4b5062755 > > v3: Fix checkpatch error > > > > lib/librte_mempool/rte_mempool.h | 6 +----- > > 1 file changed, 1 insertion(+), 5 deletions(-) > > > > diff --git a/lib/librte_mempool/rte_mempool.h > > b/lib/librte_mempool/rte_mempool.h > > index 991feaa..b1186fd 100644 > > --- a/lib/librte_mempool/rte_mempool.h > > +++ b/lib/librte_mempool/rte_mempool.h > > @@ -53,11 +53,7 @@ > > * > > * Note: the mempool implementation is not preemptable. A lcore must > > * not be interrupted by another task that uses the same mempool > > - * (because it uses a ring which is not preemptable). Also, mempool > > - * functions must not be used outside the DPDK environment: for > > - * example, in linuxapp environment, a thread that is not created by > > - * the EAL must not use mempools. This is due to the per-lcore cache > > - * that won't work as rte_lcore_id() will not return a correct value. > > + * (because it uses a ring which is not preemptible). > > */ > > > > #include > =20 > I agree the comment is not correct today. But I think we should still hi= ghlight > that usual functions [ex: rte_mempool_get(), rte_mempool_put()] won't wo= rk > when called on a non-EAL thread. My understanding is that non-EAL threads can call those functions, but thei= r performance will suffer since they go directly to the underlying ring. Is= that correct? > =20 > Maybe it could be reworded in that way: > =20 > """ > Note: the mempool implementation is not preemptable. A lcore must not be > interrupted by another task that uses the same mempool (because it uses = a ring > which is not preemptible). Also, usual mempool functions like > rte_mempool_get() or rte_mempool_put() are designed to be called from an > EAL thread due to the internal per-lcore cache. When using a mempool fro= m a > non-EAL thread, a user cache has to be provided to > rte_mempool_generic_get() or rte_mempool_generic_put(). > """ > =20 > What do you think? Agreed, this looks better. If indeed non-EAL threads can call rte_mempool_g= et() and _put(), perhaps the last sentence can be reworked like so? Due to the lack of caching, rte_mempool_get() or rte_mempool_put() performa= nce will suffer when called by non-EAL threads. Instead, non-EAL threads should= call rte_mempool_generic_get() or rte_mempool_generic_put() with a user cache created with rte_mempool_cache_create(). > =20 > Thanks, > Olivier