Skip to content

Zend,fibers: Ensure fiber stack is not backed by THP. #13306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

crrodriguez
Copy link
Contributor

@crrodriguez crrodriguez commented Feb 2, 2024

Ending with fiber stack mapped in hugepages will affect performance badly.
Until < Linux 6.8-rc2 MAP_STACK was a noop, now it implies no THP, older releases need madvise.

Ending with fiber stack mapped in hugepages will affect performance
badly.
Until < Linux 6.8-rc2 MAP_STACK was a noop, now it implies no THP, older releases
need madvise.
@crrodriguez
Copy link
Contributor Author

Changed to use madvise instead because MAP_GROWSDOWN has additional semantic changes not just THP-disable the mapping,

@devnexen
Copy link
Member

devnexen commented Feb 4, 2024

Ending with fiber stack mapped in hugepages will affect performance badly.

How bad that is w/o the changes ?

@crrodriguez
Copy link
Contributor Author

Ending with fiber stack mapped in hugepages will affect performance badly.

How bad that is w/o the changes ?

Im sorry but producing a test case would be quite involved..bad enough to get all MAP_STACK mappings on the whole system not to use THP.
See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c4608d1bf7c6536d1a3d233eb21e50678681564e associated discussions for details.

@devnexen
Copy link
Member

devnexen commented Feb 5, 2024

Fair enough :-) makes sense to me, maybe @nielsdos might have a look.

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

I see why this is useful.
I see that the Linux commit you linked mainly solved a regression caused by allowing more THP usage. But it's of course possible that we get an aligned address by "luck".

I'll wait a bit to see if others want to review as well.

@nielsdos nielsdos merged commit 013978e into php:master Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants