X-Spam-Check-By: sourceware.org
Date: Tue, 9 Jan 2007 06:15:44 -0800
From: Christopher Layne <clayne@anodized.com>
To: cygwin@cygwin.com
Subject: Re: 1.7.0 CVS mmap failure
Message-ID: <20070109141544.GE19638@ns1.anodized.com>
References: <Pine.CYG.4.58.0701051054010.280@PC1163-8460-XP.flightsafety.com> <Pine.CYG.4.58.0701051144030.2880@PC1163-8460-XP.flightsafety.com> <20070105182234.GC12776@calimero.vinschen.de> <Pine.CYG.4.58.0701051237090.2880@PC1163-8460-XP.flightsafety.com> <20070105192302.GD12776@calimero.vinschen.de> <Pine.CYG.4.58.0701051513500.2880@PC1163-8460-XP.flightsafety.com> <20070106154519.GA19640@ns1.anodized.com> <20070107105844.GB10586@calimero.vinschen.de> <20070109090415.GA19638@ns1.anodized.com> <20070109115643.GD23638@calimero.vinschen.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20070109115643.GD23638@calimero.vinschen.de>
User-Agent: Mutt/1.5.11
X-Assp-Spam-Prob: 0.00000
X-Assp-Whitelisted: Yes
X-Assp-Envelope-From: clayne@ns1.anodized.com
X-Assp-Intended-For: cygwin@cygwin.com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Tue, Jan 09, 2007 at 12:56:43PM +0100, Corinna Vinschen wrote:
> > Okay, I understand where you're coming from. Where I'm coming from is that it
> > is difficult to generate a test case that actually demonstrates the issue
> > outside of the scope of my application. Suffice to say, I do see the errors in
> > strace output - and I can see MapViewNT returning an error in the double-map
> > -so-we-can-have-4k-pseudopages version.
> 
> I'm under the impression you're getting something upside-down.  Windows
> has 4K system pages, but an allocation granularity of 64K.  For a long
> time I stubbornly tried to stick with 4K pagesize for POSIX applications,
> but the code got more and more complicated because there was always yet
> another situation which just didn't work correctly due to the 64K
> allocation granularity.

extern "C" size_t
getpagesize ()
{
  if (!system_info.dwPageSize)
    GetSystemInfo (&system_info);
  return (size_t) system_info.dwAllocationGranularity;
}

size_t
getsystempagesize ()
{
  if (!system_info.dwAllocationGranularity)
    GetSystemInfo (&system_info);
  return (size_t) system_info.dwPageSize;
}

Turns out I was reading these backwards, yes.

$ ./psz
psz == 4096, ag == 65536

I'll try and reanalyze some of the other stuff tomorrow.

-cl

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

