Skip to content

Conversation

@AGSaidi
Copy link
Contributor

@AGSaidi AGSaidi commented Sep 16, 2021

Update UT_RELAX_CPU to match upstream changes in MySQL
Fix cpu_relax and add RELAX_IS_ISB

Add support for a define RELAX_IS_ISB that adapts cpu_relax() to
using an isb instead of a yield().
#if defined(__x86_64__)
asm volatile ("pause" : : : "memory" );
#elif defined (__arch64__)
#elif defined (__aarch64__) && defined(RELAX_IS_ISB)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When do you recommend a user enabling this over the default? Can you add a define in the Makefile?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the define, this behaves like the kernel does today. I believe the define improves the performance of the kernel locks but it's not what is committed today.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so if the kernel changes in the future we just need to expose this define.

// Theoretically we could emit a yield here but MySQL doesn't do it
// and most ARM cores are likely to NOP it anyway
#define UT_RELAX_CPU() asm volatile ("":::"memory")
#define UT_RELAX_CPU() asm volatile ("isb":::"memory")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine.

@rpgolshan rpgolshan merged commit c6fd724 into ARM-software:master Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants