Re: [rvm-research] [PATCH] enlarge org.mmtk.utility.heap.layout.Mmapper()'s second

Erik Brangs <[email protected]> Thu, 14 Dec 2017 19:32:58 +0100
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <[email protected]>
Hi,

On 06.12.2017 03:50, Lingyu Zhu wrote:
> This method's second parameter 'pages' is of type int, which can not fit 64-bit VM.

but it counts memory pages, which are usually >= 2^12 bytes. I suppose you could use more than 2^32 pages but do you actually have an approach for testing this?

> diff --git a/MMTk/src/org/mmtk/policy/Space.java b/MMTk/src/org/mmtk/policy/Space.java
> index cddf3a8..c9bca2c 100644
> --- a/MMTk/src/org/mmtk/policy/Space.java
> +++ b/MMTk/src/org/mmtk/policy/Space.java
> @@ -653,7 +653,7 @@ public abstract class Space {
>            Log.write("->");
>            Log.writeln(space.start.plus(space.extent.minus(1)));
>          }
> -        HeapLayout.mmapper.ensureMapped(space.start, space.extent.toInt() >> LOG_BYTES_IN_PAGE);
> +        HeapLayout.mmapper.ensureMapped(space.start, space.extent.toLong() >> LOG_BYTES_IN_PAGE);

This line is in fact incorrect. I suppose it ought to be 

HeapLayout.mmapper.ensureMapped(space.start, Conversions.bytesToPagesUp(space.extent));


Speaking of pages, a problem with pages that MMTk really does have is that it assumes a fixed page size at compile time. Page size is only known at runtime. Unfortunately, that's not easy to fix (see https://xtenlang.atlassian.net/browse/RVM-816 ). 


Kind regards,

Erik Brangs

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jikesrvm-researchers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers