On Mon, Dec 04, 2017 at 08:16:46PM +0000, Bhanuprakash Bodireddy wrote:
> This commit introduces prefetch variants by using the GCC built-in
> prefetch function.
> 
> The prefetch variants gives the user better control on designing data
> caching strategy in order to increase cache efficiency and minimize
> cache pollution. Data reference patterns here can be classified in to
> 
>  - Non-temporal(NT) - Data that is referenced once and not reused in
>                       immediate future.
>  - Temporal         - Data will be used again soon.
> 
> The Macro variants can be used where there are
>  - Predictable memory access patterns.
>  - Execution pipeline can stall if data isn't available.
>  - Time consuming loops.
> 
> For example:
> 
>   OVS_PREFETCH_CACHE(addr, OPCH_LTR)
>     - OPCH_LTR : OVS PREFETCH CACHE HINT-LOW TEMPORAL READ.
>     - __builtin_prefetch(addr, 0, 1)
>     - Prefetch data in to L3 cache for readonly purpose.
> 
>   OVS_PREFETCH_CACHE(addr, OPCH_HTW)
>     - OPCH_HTW : OVS PREFETCH CACHE HINT-HIGH TEMPORAL WRITE.
>     - __builtin_prefetch(addr, 1, 3)
>     - Prefetch data in to all caches in anticipation of write. In doing
>       so it invalidates other cached copies so as to gain 'exclusive'
>       access.
> 
>   OVS_PREFETCH(addr)
>     - OPCH_HTR : OVS PREFETCH CACHE HINT-HIGH TEMPORAL READ.
>     - __builtin_prefetch(addr, 0, 3)
>     - Prefetch data in to all caches in anticipation of read and that
>       data will be used again soon (HTR - High Temporal Read).
> 
> Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodire...@intel.com>

The information in this commit message seems like it could also be
useful as part of a code comment.

I didn't review the details of the patch.  I will leave that for others.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to