blis icon indicating copy to clipboard operation
blis copied to clipboard

Add a progressive backoff mechanism for barriers.

Open devinamatthews opened this issue 4 years ago • 1 comments

The mechanism(s) used for backoff must be defined by the configuration or configuration family. Up to three successive mechanisms are supported (e.g. pause/sched_yield/sleep).

Example (in config/<family>/bli_family_<family>.h):

#define BLIS_BARRIER_BACKOFF_1 30    // number of times to loop
#define BLIS_BARRIER_YIELD_1 pause();pause();pause();

//#define BLIS_BARRIER_BACKOFF_2    not needed, the last mechanism is looped forever 
#define BLIS_BARRIER_YIELD_2 sched_yield();

This PR supplants #82 and potentially addresses #604 (family-specific behavior still needs to be decided upon and implemented).

Families needing implementations:

  • [ ] Intel
  • [ ] AMD (same as Intel?)
  • [ ] ARM (v7 same as v8?)
  • [ ] POWER

devinamatthews avatar Jan 31 '22 17:01 devinamatthews

Jim Cownie wrote about this topic here: https://cpufun.substack.com/p/to-sched_yield-or-not-to-sched_yield.

jeffhammond avatar May 03 '22 06:05 jeffhammond