Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88727 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95705 invoked from network); 9 Oct 2015 21:06:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2015 21:06:10 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.43 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.213.43 mail-vk0-f43.google.com Received: from [209.85.213.43] ([209.85.213.43:35722] helo=mail-vk0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/27-57614-04C28165 for ; Fri, 09 Oct 2015 17:06:09 -0400 Received: by vkha6 with SMTP id a6so1944110vkh.2 for ; Fri, 09 Oct 2015 14:06:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=yHkl7VRbbxfUXHlk6HB3XanlqNZI1/2UC9KqAF1/ISQ=; b=mCjFoUqbvc//wO46CjML+CD2qJVYnQgci7fN7ioLJulAkr8v3daqlHEHyDzb0cKuK4 hlDxKS7ClgGhWfFYqmVeEzRlAJhKcEnqdFAuX2mFh8Q/BqObKX8PSWtk76ib1O1hmyuI q2x4sXUALtfqbJbZOAJGiaPy/XJsLNv693PloPDArBVnpce/gjXNE1pBGANk/CFCvPBk Mtx8CnGNz6QuLHeSUNryb3cwewFfd9NBzfIQ192VHTGmniYIPqR+wE14waAHlqblfwMl CXA5esEbN+1cCtsxbG+LwcUHKMpHEP9bNZgk+dM94x7DLhiXx+qOo7GcKySThdK/0+vu D4nA== X-Gm-Message-State: ALoCoQm3PeaJxlhtohCvZuvp5LQpk+D4X5b0JgQxLPyh6so7eHsKusUVuP50JU+lkBbryrO/AKqXUDqilWcAQ53Ale85qfYPp82IcWVrL3QI+P24mXQekEX0LotCLbmtKefcjZjVIo8INuf6nNTpnAMDhUpxNb3omIwWsasVmCG5D/kxIbYiWC0= MIME-Version: 1.0 X-Received: by 10.31.158.205 with SMTP id h196mr4280021vke.11.1444293667404; Thu, 08 Oct 2015 01:41:07 -0700 (PDT) Received: by 10.103.24.5 with HTTP; Thu, 8 Oct 2015 01:41:07 -0700 (PDT) In-Reply-To: <036a01d100f4$df598060$9e0c8120$@belski.net> References: <024e01d0fc89$31005990$93010cb0$@belski.net> <01e101d0ff3f$8cc0c310$a6424930$@belski.net> <029301d0ff6c$a1cc8370$e5658a50$@belski.net> <020701d1004a$216370c0$642a5240$@belski.net> <036a01d100f4$df598060$9e0c8120$@belski.net> Date: Thu, 8 Oct 2015 11:41:07 +0300 Message-ID: To: Anatol Belski Cc: Matt Ficken , Pierre Joye , Laruence , PHP Internals , "dmitry@php.net" Content-Type: multipart/alternative; boundary=001a11415a8eff5c52052193d22b Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix From: dmitry@zend.com (Dmitry Stogov) --001a11415a8eff5c52052193d22b Content-Type: text/plain; charset=UTF-8 On Wed, Oct 7, 2015 at 2:39 PM, Anatol Belski wrote: > Hi Matt, > > > -----Original Message----- > > From: Matt Ficken [mailto:themattficken@gmail.com] > > Sent: Wednesday, October 7, 2015 12:18 PM > > To: Anatol Belski > > Cc: Dmitry Stogov ; Pierre Joye ; > > Laruence ; PHP Internals ; > > dmitry@php.net > > Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix > > > > I have a patch for the IPC mechanism we talked about (to avoid > consistency > > problems) and to allocate the side-step OpCache on process's private > heap. > > I've done some quick tests of this on Windows 8.1. > > > > See: > > https://github.com/mattficken/php- > > src/commit/e11b6f010be7d48ed4e29f3a758dffc9acf586fd > > > > I added the ZEND_WIN32_SIDESTEP_TEST macro to shared_alloc_win32.c to > > force using a side-step cache instead of the normal reattach procedure, > for > > testing. > > > > Anatol, this would then fit with your file cache work. > > > > Dmitry, see if my separate of accel_shared_globals and shared_segments > makes > > sense, ~line 250 of shared_alloc_win32.c For safety, I tried to limit > the view of > > memfile to only accel_shared_globals. > > > > > I guess you mean this diff > https://github.com/php/php-src/compare/master...mattficken:master > (otherwise there are quite some remains from your older patches). > > Yeah, some similar idea. I had a similar exercise, but then gave up on it > as discussed with Dmitry. There are at least two issues to falling back to > heap - MapViewOfFile() can fail as well. Then we're in the same situation. > MapViewOfFile() can specifically fail if the requested size is big, as > especially on 32-bit system has to find a contiguous chunk of memory. > I hope this is a theoretical problem. Have you ever seen this? > > But that is also something that can enormously increase memory usage. Say > a user would assign 1Gb to opcache, then every process using sidestep heap > would have to allocate 1Gb ... here we're pretty much at the boundary > again. But even we would do it - it should be the system heap (HeapAlloc, > VirtualAlloc or even malloc). Using ZMM is a wrong strategy at this place. > > For these reasons I was suggesting using a separate shared memory of a > couple of bytes - that is unlikely to fail to reattach. Maybe it could be > even expedient to separate the actual SHM from the adminitstartive items > (like counters, etc) in the future. Doing so would give more flexibility in > such situation where the actual cache is unavailable (like failed to > reattach). > Instead of allocating additional SHM at run-time, we may remap only regular SHM header with opcache shared globals (when the whole SHM can't be map). Thanks. Dmitry. > For mpm_winnt or similar SAPIs using heap only could be expedient. > Something for the future it could be. Right now all the cache is global, > but forcing it to be heap only would prevent users to share it outside > Apcahe. Even though, less bugs of such art would be expected. > > Regards > > Anatol > > --001a11415a8eff5c52052193d22b--