* [dpdk-dev] [PATCH] mempool: remove non-EAL thread note from header
@ 2017-03-21 2:34 Gage Eads
2017-03-22 17:04 ` [dpdk-dev] [PATCH v2] " Gage Eads
0 siblings, 1 reply; 9+ messages in thread
From: Gage Eads @ 2017-03-21 2:34 UTC (permalink / raw)
To: dev; +Cc: olivier.matz
Commit 4b5062755aa7 ("mempool: allow user-owned cache") added the
capability for non-EAL threads to use the mempool library by checking
rte_lcore_id() before accessing the per-lcore cache. 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 <gage.eads@intel.com>
---
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 <stdio.h>
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH v2] mempool: remove non-EAL thread note from header
2017-03-21 2:34 [dpdk-dev] [PATCH] mempool: remove non-EAL thread note from header Gage Eads
@ 2017-03-22 17:04 ` Gage Eads
2017-03-23 14:20 ` [dpdk-dev] [PATCH v3] " Gage Eads
0 siblings, 1 reply; 9+ messages in thread
From: Gage Eads @ 2017-03-22 17:04 UTC (permalink / raw)
To: dev; +Cc: olivier.matz
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 <gage.eads@intel.com>
---
v2: Changed commit message to referenced commit 30e63998 instead of 4b5062755
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 <stdio.h>
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH v3] mempool: remove non-EAL thread note from header
2017-03-22 17:04 ` [dpdk-dev] [PATCH v2] " Gage Eads
@ 2017-03-23 14:20 ` Gage Eads
2017-03-24 14:04 ` Olivier Matz
2017-03-30 23:02 ` [dpdk-dev] [PATCH v4] mempool: update non-EAL thread note in the header Gage Eads
0 siblings, 2 replies; 9+ messages in thread
From: Gage Eads @ 2017-03-23 14:20 UTC (permalink / raw)
To: dev; +Cc: olivier.matz
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 <gage.eads@intel.com>
---
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 <stdio.h>
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH v3] mempool: remove non-EAL thread note from header
2017-03-23 14:20 ` [dpdk-dev] [PATCH v3] " Gage Eads
@ 2017-03-24 14:04 ` Olivier Matz
2017-03-29 15:30 ` Eads, Gage
2017-03-30 23:02 ` [dpdk-dev] [PATCH v4] mempool: update non-EAL thread note in the header Gage Eads
1 sibling, 1 reply; 9+ messages in thread
From: Olivier Matz @ 2017-03-24 14:04 UTC (permalink / raw)
To: Gage Eads; +Cc: dev
Hi Gage,
On Thu, 23 Mar 2017 09:20:58 -0500, Gage Eads <gage.eads@intel.com> 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 <gage.eads@intel.com>
> ---
> 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 <stdio.h>
I agree the comment is not correct today. But I think we should
still highlight that usual functions [ex: rte_mempool_get(),
rte_mempool_put()] won't work when called on a non-EAL thread.
Maybe it could be reworded in that way:
"""
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
from a non-EAL thread, a user cache has to be provided to
rte_mempool_generic_get() or rte_mempool_generic_put().
"""
What do you think?
Thanks,
Olivier
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH v3] mempool: remove non-EAL thread note from header
2017-03-24 14:04 ` Olivier Matz
@ 2017-03-29 15:30 ` Eads, Gage
2017-03-30 15:12 ` Olivier Matz
0 siblings, 1 reply; 9+ messages in thread
From: Eads, Gage @ 2017-03-29 15:30 UTC (permalink / raw)
To: Olivier Matz; +Cc: dev
> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Friday, March 24, 2017 9:05 AM
> To: Eads, Gage <gage.eads@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [PATCH v3] mempool: remove non-EAL thread note from header
>
> Hi Gage,
>
> On Thu, 23 Mar 2017 09:20:58 -0500, Gage Eads <gage.eads@intel.com>
> 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 <gage.eads@intel.com>
> > ---
> > 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 <stdio.h>
>
> I agree the comment is not correct today. But I think we should still highlight
> that usual functions [ex: rte_mempool_get(), rte_mempool_put()] won't work
> when called on a non-EAL thread.
My understanding is that non-EAL threads can call those functions, but their performance will suffer since they go directly to the underlying ring. Is that correct?
>
> Maybe it could be reworded in that way:
>
> """
> 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 from a
> non-EAL thread, a user cache has to be provided to
> rte_mempool_generic_get() or rte_mempool_generic_put().
> """
>
> What do you think?
Agreed, this looks better. If indeed non-EAL threads can call rte_mempool_get() and _put(), perhaps the last sentence can be reworked like so?
Due to the lack of caching, rte_mempool_get() or rte_mempool_put() performance
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().
>
> Thanks,
> Olivier
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH v3] mempool: remove non-EAL thread note from header
2017-03-29 15:30 ` Eads, Gage
@ 2017-03-30 15:12 ` Olivier Matz
0 siblings, 0 replies; 9+ messages in thread
From: Olivier Matz @ 2017-03-30 15:12 UTC (permalink / raw)
To: Eads, Gage; +Cc: dev
Hi Gage,
On Wed, 29 Mar 2017 15:30:49 +0000, "Eads, Gage" <gage.eads@intel.com> wrote:
> > -----Original Message-----
> > From: Olivier Matz [mailto:olivier.matz@6wind.com]
> > Sent: Friday, March 24, 2017 9:05 AM
> > To: Eads, Gage <gage.eads@intel.com>
> > Cc: dev@dpdk.org
> > Subject: Re: [PATCH v3] mempool: remove non-EAL thread note from header
> >
> > Hi Gage,
> >
> > On Thu, 23 Mar 2017 09:20:58 -0500, Gage Eads <gage.eads@intel.com>
> > 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 <gage.eads@intel.com>
> > > ---
> > > 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 <stdio.h>
> >
> > I agree the comment is not correct today. But I think we should still highlight
> > that usual functions [ex: rte_mempool_get(), rte_mempool_put()] won't work
> > when called on a non-EAL thread.
>
> My understanding is that non-EAL threads can call those functions, but their performance will suffer since they go directly to the underlying ring. Is that correct?
Yes, that's more correct than what I wrote :)
>
> >
> > Maybe it could be reworded in that way:
> >
> > """
> > 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 from a
> > non-EAL thread, a user cache has to be provided to
> > rte_mempool_generic_get() or rte_mempool_generic_put().
> > """
> >
> > What do you think?
>
> Agreed, this looks better. If indeed non-EAL threads can call rte_mempool_get() and _put(), perhaps the last sentence can be reworked like so?
>
> Due to the lack of caching, rte_mempool_get() or rte_mempool_put() performance
> 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().
Looks good, thanks!
Olivier
>
> >
> > Thanks,
> > Olivier
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH v4] mempool: update non-EAL thread note in the header
2017-03-23 14:20 ` [dpdk-dev] [PATCH v3] " Gage Eads
2017-03-24 14:04 ` Olivier Matz
@ 2017-03-30 23:02 ` Gage Eads
2017-03-31 13:51 ` Olivier Matz
1 sibling, 1 reply; 9+ messages in thread
From: Gage Eads @ 2017-03-30 23:02 UTC (permalink / raw)
To: dev; +Cc: olivier.matz
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, and replaces it with a more up-to-date note.
Signed-off-by: Gage Eads <gage.eads@intel.com>
---
v2: Changed commit message to referenced commit 30e63998 instead of 4b5062755
v3: Fix checkpatch error
v4: Rework note to highlight non-EAL thread differences
lib/librte_mempool/rte_mempool.h | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index 991feaa..931faf3 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -51,13 +51,15 @@
* meta-data in the object data and retrieve them when allocating a
* new object.
*
- * 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.
+ * Note: the mempool implementation is not preemptible. An 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. Due to the lack of caching,
+ * rte_mempool_get() or rte_mempool_put() performance 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().
*/
#include <stdio.h>
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH v4] mempool: update non-EAL thread note in the header
2017-03-30 23:02 ` [dpdk-dev] [PATCH v4] mempool: update non-EAL thread note in the header Gage Eads
@ 2017-03-31 13:51 ` Olivier Matz
2017-04-03 16:32 ` Thomas Monjalon
0 siblings, 1 reply; 9+ messages in thread
From: Olivier Matz @ 2017-03-31 13:51 UTC (permalink / raw)
To: Gage Eads; +Cc: dev
On Thu, 30 Mar 2017 18:02:00 -0500, Gage Eads <gage.eads@intel.com> 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, and replaces it with a more up-to-date note.
>
> Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH v4] mempool: update non-EAL thread note in the header
2017-03-31 13:51 ` Olivier Matz
@ 2017-04-03 16:32 ` Thomas Monjalon
0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2017-04-03 16:32 UTC (permalink / raw)
To: Gage Eads; +Cc: dev, Olivier Matz
2017-03-31 15:51, Olivier Matz:
> On Thu, 30 Mar 2017 18:02:00 -0500, Gage Eads <gage.eads@intel.com> 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, and replaces it with a more up-to-date note.
> >
> > Signed-off-by: Gage Eads <gage.eads@intel.com>
>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Applied, thanks
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-04-03 16:32 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-21 2:34 [dpdk-dev] [PATCH] mempool: remove non-EAL thread note from header Gage Eads
2017-03-22 17:04 ` [dpdk-dev] [PATCH v2] " Gage Eads
2017-03-23 14:20 ` [dpdk-dev] [PATCH v3] " Gage Eads
2017-03-24 14:04 ` Olivier Matz
2017-03-29 15:30 ` Eads, Gage
2017-03-30 15:12 ` Olivier Matz
2017-03-30 23:02 ` [dpdk-dev] [PATCH v4] mempool: update non-EAL thread note in the header Gage Eads
2017-03-31 13:51 ` Olivier Matz
2017-04-03 16:32 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).