Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101643 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26607 invoked from network); 21 Jan 2018 10:00:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jan 2018 10:00:57 -0000 Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 212.232.28.122 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 212.232.28.122 mx201.easyname.com Received: from [212.232.28.122] ([212.232.28.122:56551] helo=mx201.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/C9-12394-6D4646A5 for ; Sun, 21 Jan 2018 05:00:56 -0500 Received: from cable-81-173-135-182.netcologne.de ([81.173.135.182] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1edCQl-0002vf-WF for internals@lists.php.net; Sun, 21 Jan 2018 10:00:52 +0000 Reply-To: internals@lists.php.net To: php-internals Message-ID: Date: Sun, 21 Jan 2018 11:00:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-DNSBL-PBLSPAMHAUS: YES X-DNSBL-SURBL: YES Subject: OPCache: invalidate vs unlink From: php@fleshgrinder.com (Fleshgrinder) `zend_accel_invalidate` is exposed to userland as `opcache_invalidate` and marks a script as wasted, however, it does not remove that script from the OPCache. There is also the `zend_accel_hash_unlink` that actually does that, it's there since the beginning of time but without a single call to it in the entire codebase. It actually removes a script from OPCache, yielding the desired result of freeing up some space without requiring a complete restart of OPCache. What are the reasons that this function is not used and not exposed? What side-effects does it have if we actually selectively remove scripts from OPCache? We replaced the `zend_accel_invalidate` call with `zend_accel_hash_unlink` in the `opcache_invalidate` implementation and it worked flawlessly. However, it could be that there are some things that we are simply overlooking. -- Richard "Fleshgrinder" Fussenegger