com php-src: Fix opcache.revalidate_freq per-request be havior: ext/opcache/ZendAccelerator.c ext/opcache/ZendA ccelerator.h
| From: | Dmitry Stogov | Date: | Fri, 07 Nov 2014 07:16:25 +0000 |
| Subject: | com php-src: Fix opcache.revalidate_freq per-request be havior: ext/opcache/ZendAccelerator.c ext/opcache/ZendA ccelerator.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82969@lists.php.net to get a copy of this message | ||
Commit: 033abd6d7783a8c98e8fc3612aa100de72408363
Author: Dmitry Stogov <dmitry@zend.com> Fri, 7 Nov 2014 10:16:25 +0300
Parents: ed4c0245c7ca51490ea10e2756076285560a5d88
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=033abd6d7783a8c98e8fc3612aa100de72408363
Log:
Fix opcache.revalidate_freq per-request behavior
Changed paths:
M ext/opcache/ZendAccelerator.c
M ext/opcache/ZendAccelerator.h
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 4406400...1d3bd95 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -881,12 +881,12 @@ static inline int do_validate_timestamps(zend_persistent_script
*persistent_scri
int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle
*file_handle TSRMLS_DC)
{
if (ZCG(accel_directives).revalidate_freq &&
- (persistent_script->dynamic_members.revalidate >= ZCSG(revalidate_at))) {
+ persistent_script->dynamic_members.revalidate >= ZCG(request_time)) {
return SUCCESS;
} else if (do_validate_timestamps(persistent_script, file_handle TSRMLS_CC) == FAILURE) {
return FAILURE;
} else {
- persistent_script->dynamic_members.revalidate = ZCSG(revalidate_at);
+ persistent_script->dynamic_members.revalidate = ZCG(request_time) +
ZCG(accel_directives).revalidate_freq;
return SUCCESS;
}
}
@@ -1449,7 +1449,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle
*file_han
* otherwise we have a race-condition.
*/
new_persistent_script->timestamp = timestamp;
- new_persistent_script->dynamic_members.revalidate = ZCSG(revalidate_at);
+ new_persistent_script->dynamic_members.revalidate = ZCG(request_time) +
ZCG(accel_directives).revalidate_freq;
}
if (file_handle->opened_path) {
@@ -2155,13 +2155,6 @@ static void accel_activate(void)
zend_accel_error(ACCEL_LOG_WARNING, "Internal functions count changed - was %d, now
%d", ZCG(internal_functions_count), zend_hash_num_elements(&ZCG(function_table)));
}
- if (ZCG(accel_directives).validate_timestamps) {
- time_t now = ZCG(request_time);
- if (now > ZCSG(revalidate_at) + (time_t)ZCG(accel_directives).revalidate_freq) {
- ZCSG(revalidate_at) = now;
- }
- }
-
ZCG(cwd) = NULL;
SHM_PROTECT();
@@ -2622,10 +2615,6 @@ static int accel_startup(zend_extension *extension)
zend_resolve_path = persistent_zend_resolve_path;
#endif
- if (ZCG(accel_directives).validate_timestamps) {
- ZCSG(revalidate_at) = zend_accel_get_time() + ZCG(accel_directives).revalidate_freq;
- }
-
/* Override chdir() function */
if (zend_hash_find(CG(function_table), "chdir", sizeof("chdir"),
(void**)&func) == SUCCESS &&
func->type == ZEND_INTERNAL_FUNCTION) {
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index bba3631..547e315 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -297,7 +297,6 @@ typedef struct _zend_accel_shared_globals {
unsigned long restart_in;
#endif
zend_bool restart_in_progress;
- time_t revalidate_at;
#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
/* Interned Strings Support */
char *interned_strings_start;