Integrated: JDK-8257588: Make os::_page_sizes a bitmask
Thomas Stuefe
stuefe at openjdk.java.net
Mon Dec 7 10:36:18 UTC 2020
On Mon, 30 Nov 2020 16:48:35 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> Hi,
>
> may I please have reviews for the following very small improvement:
>
> While discussing JDK-8243315 [1], and aiming to make planned changes like JDK-8256155 [2] easier:
>
> size_t os::_page_sizes[os::page_sizes_max];
>
> is an array used to keep all page sizes the hotspot can use. It is sorted by size and filled in at initialization time.
>
> Coding dealing with this can be simplified by making this a set (which is very easy since all page sizes are power-2-values so they lend themselves nicely to a bitmap).
>
> That has the following advantages:
> - makes adding new sizes simple since we do not have to re-sort the array. Coding is easier to read too.
> - it makes it possible to encode a set of page sizes in one number, so we can hand a set-of-page-sizes around as a value.
>
> -----
>
> The patch adds a new class, os::PagesizeSet, which is a bitmap containing page sizes. It adds gtests for this class. It replaces the old os::_page_sizes with an object of that class. It also removes an unused function.
>
>
> Testing:
> - nightlies at SAP
> - manual tests with UseLargePages
> - the new gtests
> - gh actions (with x86 still failing because of unrelated issues)
>
> Thank you,
>
> Thomas
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8243315
> [2] https://bugs.openjdk.java.net/browse/JDK-8256155
This pull request has now been integrated.
Changeset: 8e8e5845
Author: Thomas Stuefe <stuefe at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/8e8e5845
Stats: 228 lines in 7 files changed: 171 ins; 30 del; 27 mod
8257588: Make os::_page_sizes a bitmask
Reviewed-by: tschatzl, stefank
-------------
PR: https://git.openjdk.java.net/jdk/pull/1522
More information about the hotspot-dev
mailing list