[dpdk-dev] [PATCH v6] eal: add cache-line demote support

Bruce Richardson bruce.richardson at intel.com
Tue Oct 13 18:20:15 CEST 2020


On Tue, Oct 13, 2020 at 02:59:24AM +0000, Ruifeng Wang wrote:
> 
> > -----Original Message-----
> > From: Omkar Maslekar <omkar.maslekar at intel.com>
> > Sent: Monday, October 12, 2020 6:20 PM
> > To: dev at dpdk.org
> > Cc: bruce.richardson at intel.com; ciara.loftus at intel.com;
> > omkar.maslekar at intel.com; drc at linux.vnet.ibm.com; jerinj at marvell.com;
> > Ruifeng Wang <Ruifeng.Wang at arm.com>; Honnappa Nagarahalli
> > <Honnappa.Nagarahalli at arm.com>
> > Subject: [PATCH v6] eal: add cache-line demote support
> > 
> > rte_cldemote is similar to a prefetch hint - in reverse. cldemote(addr)
> > enables software to hint to hardware that line is likely to be shared.
> > Useful in core-to-core communications where cache-line is likely to be
> > shared. ARM and PPC implementation is provided with NOP and can be
> > added if any equivalent instructions could be used for implementation on
> > those architectures.
> > 
> > Signed-off-by: Omkar Maslekar <omkar.maslekar at intel.com>
> > Acked-by: Bruce Richardson <bruce.richardson at intel.com>
> > 
> > ---
> > v6: marked rte_cldemote as experimental
> >     added rte_cldemote call in existing app/test_prefetch.c
> > 
> > v5: documentation updated
> >     fixed formatting issue in release notes
> >     added Acked-by: Bruce Richardson <bruce.richardson at intel.com>
> > *
> > v4: updated bold text for title and fixed margin in release notes
> > *
> > v3: fixed warning regarding whitespace
> > *
> > v2: documentation updated
> > ---
> > ---
<snip>
> 
> > +/**
> > + * Demote a cache line to a more distant level of cache from the processor.
> > + *
> > + * CLDEMOTE hints to hardware to move (demote) a cache line from the
> > +closest to
> > + * the processor to a level more distant from the processor. It is a
> > +hint and
> > + * not guarantee. rte_cldemote is intended to move the cache line to
> > +the more
> > + * remote cache, where it expects sharing to be efficient and to
> > +indicate that a
> > + * line may be accessed by a different core in the future.
> > + *
> > + * @param p
> > + *   Address to demote
> > + */
> > +static inline void
> > +__rte_experimental
> 
> 1. Experimental tag is only needed in this file. Tags at other places can be removed.

I'm not sure that is the case. The generic file is used when preparing the
docs, so the experimental tag needs to go there for the docs, but when
actually using the function in compiled code the "generic" version is
unused. Therefore we need the experimental tag there to trigger a build
warning about using the function if the appropriate ALLOW_EXPERIMENTAL_APIS
flag is not set.

/Bruce


More information about the dev mailing list