6783381: NUMA allocator: don't pretouch eden space with UseNUMA

Moved pretouching to MutableSpace. Also MutableSpace now turns on page interleaving for the region it covers.

Reviewed-by: jmasa, jcoomes
This commit is contained in:
Igor Veresov 2009-01-27 18:13:59 -08:00
parent f031c45430
commit da292a7197
8 changed files with 135 additions and 59 deletions

View file

@ -25,7 +25,10 @@
// A MutableSpace is a subtype of ImmutableSpace that supports the
// concept of allocation. This includes the concepts that a space may
// be only partially full, and the querry methods that go with such
// an assumption.
// an assumption. MutableSpace is also responsible for minimizing the
// page allocation time by having the memory pretouched (with
// AlwaysPretouch) and for optimizing page placement on NUMA systems
// by make the underlying region interleaved (with UseNUMA).
//
// Invariant: (ImmutableSpace +) bottom() <= top() <= end()
// top() is inclusive and end() is exclusive.
@ -37,15 +40,23 @@ class MutableSpace: public ImmutableSpace {
// Helper for mangling unused space in debug builds
MutableSpaceMangler* _mangler;
// The last region which page had been setup to be interleaved.
MemRegion _last_setup_region;
size_t _alignment;
protected:
HeapWord* _top;
MutableSpaceMangler* mangler() { return _mangler; }
void numa_setup_pages(MemRegion mr, bool clear_space);
void pretouch_pages(MemRegion mr);
void set_last_setup_region(MemRegion mr) { _last_setup_region = mr; }
MemRegion last_setup_region() const { return _last_setup_region; }
public:
virtual ~MutableSpace();
MutableSpace();
MutableSpace(size_t page_size);
// Accessors
HeapWord* top() const { return _top; }
@ -57,13 +68,20 @@ class MutableSpace: public ImmutableSpace {
virtual void set_bottom(HeapWord* value) { _bottom = value; }
virtual void set_end(HeapWord* value) { _end = value; }
size_t alignment() { return _alignment; }
// Returns a subregion containing all objects in this space.
MemRegion used_region() { return MemRegion(bottom(), top()); }
static const bool SetupPages = true;
static const bool DontSetupPages = false;
// Initialization
virtual void initialize(MemRegion mr,
bool clear_space,
bool mangle_space);
bool mangle_space,
bool setup_pages = SetupPages);
virtual void clear(bool mangle_space);
// Does the usual initialization but optionally resets top to bottom.
#if 0 // MANGLE_SPACE