This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Sparc ASAN


On Wed, 2012-11-21 at 19:39 +0400, Konstantin Serebryany wrote:
> On Wed, Nov 21, 2012 at 7:29 PM, David Miller <davem@davemloft.net> wrote:
> > From: Konstantin Serebryany <konstantin.s.serebryany@gmail.com>
> > Date: Wed, 21 Nov 2012 17:39:05 +0400
> >
> >> Today, kPageSize is used in several places where it is expected to be
> >> a compile-time constant.
> >> Even if it seems like replacing it with GetPageSize() is safe, it
> >> would need very significant testing (including performance testing).
> >> Can we just define kPageSize=1UL<<13 under ifdef __sparc__?
> >>
> >> What are the possible page size values for SPARC?
> >
> > 4K, 8K, 64K, 512K
> >
> > It's not a constant and the library really cannot expect it to be one.
> 
> How often 64K and 512K are used?
> If we use kPageSize=8K, will this cover most of the use cases?

To answer this for PowerPC, most current 64-bit distro kernels are
compiled with 64K pages, although some older kernel still out there
are compiled with 4K pages.  For 32-bit kernels, I believe they
usually default to 4K pages.  As with SPARC, the kernel can be
configured to use any number of different page sizes.

An 8K page size won't work for us or a SPARC system with page size
above 8K, since the minimum mmap size is a page size, so if you
attempt to mmap something smaller than a page size (eg, 8K on a
64K page size system), mmap returns an error.  If this stays a
constant, you have to err on the large side of the potential
page sizes.

I agree with David, that this has to be runtime generated value.
I'll play with his GetPageSize() suggestion and see whether it
works for us.

Peter





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]