Bug #79487 Provide non-Windows implementations for LF_BACKOFF
Submitted: 2 Dec 2015 6:21 Modified: 3 Dec 2015 8:47
Reporter: Alexey Kopytov Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:5.6, 5.7 OS:Any
Assigned to: Marc Alff CPU Architecture:Any
Triage: Needs Triage: D5 (Feature request)

[2 Dec 2015 6:21] Alexey Kopytov
Description:
There's the following macro defined in include/my_atomic.h and used by Performance Schema and (in 5.7) MDL:

/*
  the macro below defines (as an expression) the code that
  will be run in spin-loops. Intel manuals recummend to have PAUSE there.
  It is expected to be defined in include/atomic/ *.h files
*/
#ifndef LF_BACKOFF
#define LF_BACKOFF (1)
#endif

The problem is that it is defined as intended only for Windows in include/atomic/generic-msvc.h, all other platforms will not have anything executed in the spinloop body, not even a "nop" instruction.

This is a request to implement it at least for Linux/x86. Even better, unify that code with UT_RELAX_CPU() in InnoDB?

How to repeat:
Grep the source tree for LF_BACKOFF.
[3 Dec 2015 8:47] Umesh Shastry
Hello Alexey Kopytov,

Thank you for the feature request!

Thanks,
Umesh
[22 Dec 2015 22:17] OCA Admin
Contribution submitted via Github - Bug #79487: Provide non-Windows implementations for LF_BACKOFF 
(*) Contribution by Alexey Kopytov (Github akopytov, mysql-server/pull/40#issuecomment-166551102): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_54297781.txt (text/plain), 7.43 KiB.

[23 Dec 2015 0:04] Stewart Smith
Patch looks good to me from a POWER perspective. Haven't benchmarked/built though.. maybe I'll con^W convince Daniel to :D
[25 May 2018 15:14] OCA Admin
Contribution submitted via Github - Bug #79487: Provide non-Windows implementations for LF_BACKOFF 
(*) Contribution by Alexey Kopytov (Github akopytov, mysql-server/pull/208#issuecomment-392049914): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_190563496.txt (text/plain), 4.39 KiB.