-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Revert "ext/opcache: use C11 atomics for "restart_in" (#10276)" #10339
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
ext/opcache/ZendAccelerator.c
Outdated
@@ -899,7 +895,11 @@ static inline void kill_all_lockers(struct flock *mem_usage_check) | |||
|
|||
static inline int accel_is_inactive(void) | |||
{ | |||
#ifdef LOCKVAL | |||
#ifdef ZEND_WIN32 | |||
/* TODO: the Windows-specific code path is broken because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per comment #10276 (comment) this doesn't seem to be accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that explains it, thanks @cmb69 - I'll adjust the comment.
This reverts commit 061fcdb. While the commit does indeed improve performance, @dstogov complained that it disables the code path calling kill_all_lockers(), and thus hanging workers are never killed and restarted. php#10276 (comment) The fact that this feature was not implemented in the existing atomic code path (i.e. Windows) did not mean that the feature was considered not strictly necessary, but that the Windows implementation just did not need the feature because SAPIs that work on Windows do not manage child processes php#10276 (comment) php#10276 (comment)
kill_all_lockers() is not implemented on Windows, and does not need to be.
485c5bb
to
c0f0c19
Compare
After @cmb69's explanation, I've adjusted the comment to explain why |
I was just wondering if we can keep the C11 atomics if there is no SAPI that manages child processes. |
Looking into your reverted patch, I'm not sure if the usage of In the current opcache implementation I would welcome a cheaper kind of locks, but they should come without breaking anything (may be wrapped with #ifdefs to allow easy switch between old and new implementations). |
My C11 code has the same guarantees as the old Windows specific code. If you believe that's wrong, please explain why.
Not true. (I had to look it up before I wrote this patch - I'm a C++ guy, and never cared about C11.) |
Yes, you are right (I wasn't sure). |
@MaxKellermann Thank you! |
This reverts commit 061fcdb.
While the commit does indeed improve performance, @dstogov complained
that it disables the code path calling kill_all_lockers(), and thus
hanging workers are never killed and restarted.
#10276 (comment)
The fact that this feature was not implemented in the existing atomic
code path (i.e. Windows) did not mean that the feature was considered
not strictly necessary, but that the Windows implementation was
incomplete and broken.
#10276 (comment)