Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88735 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23703 invoked from network); 10 Oct 2015 01:16:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Oct 2015 01:16:36 -0000 Authentication-Results: pb1.pair.com header.from=themattficken@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=themattficken@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.195 as permitted sender) X-PHP-List-Original-Sender: themattficken@gmail.com X-Host-Fingerprint: 209.85.217.195 mail-lb0-f195.google.com Received: from [209.85.217.195] ([209.85.217.195:33834] helo=mail-lb0-f195.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/0C-57614-3F668165 for ; Fri, 09 Oct 2015 21:16:35 -0400 Received: by lbbyc8 with SMTP id yc8so9930445lbb.1 for ; Fri, 09 Oct 2015 18:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=B5+bTZYfhK/oG2Dd+3BfAIu6fJ0GNwIEUa86VgNENZc=; b=qfVDD7tQMJ/w7ZlB4b93EvGXo4LQLeZzjJGyu2rnsycSb79AQUlNn1lFku/txYQ6fC 3vOq74gUWcRwtk0JRzMb5IGiK/+sWTmo/36rOGLRJ58bIRC/At8Dedu6bY81O8WIYaFd AINph9Iu3laLcVFAFqpAqksPBKblJiTo8Zp59JjyvqBZiOi3LDQeMLfXlaIcPYRWV98c +aq/ewBhLW0cgIYOPsXQMWRNslhHdQBGanRcaeXiy32PBDRmIP59cZ6uhwYF80oSL2Jp X4Tmn7gmennTXRfsZlAX9CeK8L55hv7pJVUModmwAGgNZvAVYIGZoQUSPhZpc1+VCdPi 0khg== MIME-Version: 1.0 X-Received: by 10.112.131.70 with SMTP id ok6mr2687903lbb.71.1444286858920; Wed, 07 Oct 2015 23:47:38 -0700 (PDT) Received: by 10.112.46.38 with HTTP; Wed, 7 Oct 2015 23:47:38 -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: Wed, 7 Oct 2015 23:47:38 -0700 Message-ID: To: Anatol Belski Cc: Dmitry Stogov , Pierre Joye , Laruence , PHP Internals , dmitry@php.net Content-Type: multipart/alternative; boundary=047d7b3434022e07950521923dd4 Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix From: themattficken@gmail.com (Matt Ficken) --047d7b3434022e07950521923dd4 Content-Type: text/plain; charset=UTF-8 Yes, earlier I was advocating a side-step SHM area for the side-step OpCache because it'll probably use less memory. Sounded like I lost that argument, so I switched to in-process heap (which is more complicated too). New commit using side-step SHM(not heap): https://github.com/php/php-src/commit/92e568270957a63c8b0d1545d9dc0495a851b5c0 On Wed, Oct 7, 2015 at 4:39 AM, 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. > > 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). > > 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 > > --047d7b3434022e07950521923dd4--