Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-12 Thread Dmitry Stogov
Anatol committed a better fix. It falls back to file-cache in case of failure, and maps just a small portion of SHM for synchronization between processes. In general, extending this approach, we may map the whole SHM segment into different address space and implement routines to find/load data from

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-09 Thread Matt Ficken
ski > > Cc: Dmitry Stogov ; Pierre Joye ; > > Laruence ; PHP Internals ; > > dmi...@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 allo

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-09 Thread Dmitry Stogov
Joye ; > > Laruence ; PHP Internals ; > > dmi...@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 pr

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-09 Thread Dmitry Stogov
; wrote: > >> Hi Matt, >> >> > -Original Message- >> > From: Matt Ficken [mailto:themattfic...@gmail.com] >> > Sent: Wednesday, October 7, 2015 12:18 PM >> > To: Anatol Belski >> > Cc: Dmitry Stogov ; Pierre Joye > >; >>

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-09 Thread Kalle Sommer Nielsen
2015-10-08 10:33 GMT+02:00 Dmitry Stogov : > few notes: > - are you sure SysV IPC API is available everywhere? I mean shmget() > in file_cache_fallback_init(). > (I didn't know about Windows). Yes the SysV IPC API is available under Windows, because we have our own implementation in TSRM/, more sp

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-09 Thread Dmitry Stogov
> > > -Original Message- > > From: Dmitry Stogov [mailto:dmi...@zend.com] > > Sent: Tuesday, October 6, 2015 10:01 AM > > To: Anatol Belski > > Cc: Matt Ficken ; Pierre Joye > > ; Laruence ; PHP Internals > > ; dmi...@php.net > > Subject: R

RE: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-07 Thread Anatol Belski
Hi Matt, > -Original Message- > From: Matt Ficken [mailto:themattfic...@gmail.com] > Sent: Wednesday, October 7, 2015 12:18 PM > To: Anatol Belski > Cc: Dmitry Stogov ; Pierre Joye ; > Laruence ; PHP Internals ; > dmi...@php.net > Subject: Re: [PHP-DEV] Re: Window

RE: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-07 Thread Anatol Belski
Hi Dmitry, > -Original Message- > From: Dmitry Stogov [mailto:dmi...@zend.com] > Sent: Tuesday, October 6, 2015 10:01 AM > To: Anatol Belski > Cc: Matt Ficken ; Pierre Joye > ; Laruence ; PHP Internals > ; dmi...@php.net > Subject: Re: [PHP-DEV] Re: Windows OpC

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-07 Thread Matt Ficken
> > Sent: Tuesday, October 6, 2015 10:01 AM > > To: Anatol Belski > > Cc: Matt Ficken ; Pierre Joye > > ; Laruence ; PHP Internals > > ; dmi...@php.net > > Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix > > > > On Mon, Oct 5, 2015 at 6:

RE: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-06 Thread Anatol Belski
Hi Dmitry, > -Original Message- > From: Dmitry Stogov [mailto:dmi...@zend.com] > Sent: Tuesday, October 6, 2015 10:01 AM > To: Anatol Belski > Cc: Matt Ficken ; Pierre Joye > ; Laruence ; PHP Internals > ; dmi...@php.net > Subject: Re: [PHP-DEV] Re: Windows OpC

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-06 Thread Dmitry Stogov
uence ; PHP Internals > > ; dmi...@php.net > > Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix > > > > > > > > Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix > > > > > > > > > > > > > Dmitry, I'd have a question to thi

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-06 Thread Dmitry Stogov
Hi Eric, On Mon, Oct 5, 2015 at 9:49 PM, Eric Stenson wrote: > >From: Dmitry Stogov [mailto:dmi...@zend.com] > > > >> On Thu, Oct 1, 2015 at 11:54 AM, Matt Ficken > >> wrote: > >> > >>> Pierre Joy wrote: > >>> And what wincache does. It is slower but the request is served. > >> > >> WinCache (

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-06 Thread Dmitry Stogov
On Tue, Oct 6, 2015 at 9:27 AM, Matt Ficken wrote: > Ultimately if the 2nd OpCache is shared in a new SHM, in-process in a new > SHM or in-process Heap, memory will increase, scripts have to be recompiled > and there are consistency issues. File-cache will avoid recompiling > scripts, but unless

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-05 Thread Matt Ficken
Ultimately if the 2nd OpCache is shared in a new SHM, in-process in a new SHM or in-process Heap, memory will increase, scripts have to be recompiled and there are consistency issues. File-cache will avoid recompiling scripts, but unless OpCache is disabled, there needs to be a 2nd OpCache stored s

RE: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-05 Thread Eric Stenson
>From: Dmitry Stogov [mailto:dmi...@zend.com] > >> On Thu, Oct 1, 2015 at 11:54 AM, Matt Ficken >> wrote: >> >>> Pierre Joy wrote: >>> And what wincache does. It is slower but the request is served. >> >> WinCache (file cache) if it can't reattach, creates a new shared mem >> file > > I'm not su

RE: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-05 Thread Anatol Belski
> -Original Message- > From: Dmitry Stogov [mailto:dmi...@zend.com] > Sent: Monday, October 5, 2015 3:31 PM > To: Anatol Belski > Cc: Matt Ficken ; Pierre Joye > ; Laruence ; PHP Internals > ; dmi...@php.net > Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-05 Thread Dmitry Stogov
uence ; PHP Internals > > ; dmi...@php.net > > Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix > > > > On Mon, Oct 5, 2015 at 10:29 AM, Anatol Belski > > wrote: > > > > > Hi Dmitry, > > > > > > > -Original Message- > > > &

RE: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-05 Thread Anatol Belski
> -Original Message- > From: Dmitry Stogov [mailto:dmi...@zend.com] > Sent: Monday, October 5, 2015 1:08 PM > To: Anatol Belski > Cc: Matt Ficken ; Pierre Joye > ; Laruence ; PHP Internals > ; dmi...@php.net > Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-05 Thread Dmitry Stogov
gt; ; Anatoliy Belsky ; Laruence > > ; PHP Internals ; > dmi...@php.net > > Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix > > > > > Dmitry, I'd have a question to this > > > > Also. if we can't map SHM into desired address space, we may map

RE: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-05 Thread Anatol Belski
Hi Dmitry, > -Original Message- > From: Dmitry Stogov [mailto:dmi...@zend.com] > Sent: Friday, October 2, 2015 9:34 AM > To: Anatol Belski > Cc: Matt Ficken ; Pierre Joye > ; Anatoliy Belsky ; Laruence > ; PHP Internals ; dmi...@php.net > Subject: Re: [PHP-DEV]

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-02 Thread Dmitry Stogov
t; > Laruence ; PHP Internals ; > > dmi...@php.net > > Subject: Re: [PHP-DEV] Re: Windows OpCache bug fix > > > > On Thu, Oct 1, 2015 at 11:54 AM, Matt Ficken > > wrote: > > > > > > > >> And what wincache does. It is slower but the request i

RE: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-01 Thread Anatol Belski
Hi, > -Original Message- > From: Dmitry Stogov [mailto:dmi...@zend.com] > Sent: Thursday, October 1, 2015 12:20 PM > To: Matt Ficken > Cc: Pierre Joye ; Anatoliy Belsky ; > Laruence ; PHP Internals ; > dmi...@php.net > Subject: Re: [PHP-DEV] Re: Windows OpCache bu

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-01 Thread Dmitry Stogov
On Thu, Oct 1, 2015 at 11:54 AM, Matt Ficken wrote: > >> And what wincache does. It is slower but the request is served. >> >> >> WinCache (file cache) if it can't reattach, creates a new shared mem file > for just that process: see > http://svn.php.net/viewvc/pecl/wincache/trunk/wincache_filemap

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-10-01 Thread Matt Ficken
> > > And what wincache does. It is slower but the request is served. > > > WinCache (file cache) if it can't reattach, creates a new shared mem file for just that process: see http://svn.php.net/viewvc/pecl/wincache/trunk/wincache_filemap.c?revision=336846&view=markup Line 1122. Yes, ideally it w

Re: [PHP-DEV] Re: Windows OpCache bug fix

2015-09-30 Thread Pierre Joye
On Oct 1, 2015 3:59 AM, "Dmitry Stogov" wrote: > > Hi Matt, > > Thanks for looking into the problem, but I afraid that the proposed > solution won't solve the problem completely, but may introduce new > problems. At first, we might to reserve N times more memory. Then different > SHM segments migh

[PHP-DEV] Re: Windows OpCache bug fix

2015-09-30 Thread Dmitry Stogov
Hi Matt, Thanks for looking into the problem, but I afraid that the proposed solution won't solve the problem completely, but may introduce new problems. At first, we might to reserve N times more memory. Then different SHM segments might contain different data. opcache_reset(), opcache_invalidate

[PHP-DEV] Re: Windows OpCache bug fix

2015-09-28 Thread Matt Ficken
Great. The locking issue is fixed. But, it sometimes still fails to reattach to the base address. Because of ASLR, extra DLLs, etc... the existing base address may not be usable in other processes that need to reattach. When I see this issue I'm creating a series of processes (for test runs) and w

[PHP-DEV] Re: Windows OpCache bug fix

2015-09-24 Thread Dmitry Stogov
Ops, I forgot to revert the exit condition. http://git.php.net/?p=php-src.git;a=commitdiff;h=2d55e8c186ef1034c2af64478da8f23dbeb28be9 On Thu, Sep 24, 2015 at 11:00 AM, Dmitry Stogov wrote: > hi Matt, > > Thanks. > I also moved the exit condition to be before Sleep(). > This should prevent ra

[PHP-DEV] Re: Windows OpCache bug fix

2015-09-24 Thread Dmitry Stogov
Ops, I forgot to revert the exit condition. http://git.php.net/?p=php-src.git;a=commitdiff;h=2d55e8c186ef1034c2af64478da8f23dbeb28be9 On Thu, Sep 24, 2015 at 11:00 AM, Dmitry Stogov wrote: > hi Matt, > > Thanks. > I also moved the exit condition to be before Sleep(). > This should prevent ra

[PHP-DEV] Re: Windows OpCache bug fix

2015-09-24 Thread Dmitry Stogov
hi Matt, Thanks. I also moved the exit condition to be before Sleep(). This should prevent race condition on last iteration (after unlocked sleep process should try to reattach). Committed to PHP-7.0 and master. http://git.php.net/?p=php-src.git;a=commitdiff;h=262160e0e9919dce914df2f0643c4b16ca13

[PHP-DEV] Re: Windows OpCache bug fix

2015-09-23 Thread Matt Ficken
Ok, I have a new PR just to unlock around Sleep(): https://github.com/php/php-src/pull/1536 Just by unlocking around Sleep() the OpenFileMapping loop will work. Holding the lock in that loop will not only block detach_segments() in other PHP processes but also reattaching in accel_startup(). Chec

[PHP-DEV] Re: Windows OpCache bug fix

2015-09-23 Thread Dmitry Stogov
Hi Matt, It looks like with your patch, the same file may be mapped to different virtual addresses of different processes and this won't work. I think usage of vista_mapping_base_set[] in your patch is wrong. Do I understand properly, that zend_shared_alloc_unlock/lock_win32() around Sleep() is t