RFR: 8059066: CardTableModRefBS might commit the same page twice

Kim Barrett kim.barrett at oracle.com
Mon Oct 20 19:52:54 UTC 2014

On Oct 20, 2014, at 9:21 AM, Erik Helin <erik.helin at oracle.com> wrote:
> Webrev:
> http://cr.openjdk.java.net/~ehelin/8059066/webrev.00/
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8059066

280       if (new_end_aligned > _committed[ri].start() &&
281           new_end_aligned <= _committed[ri].end()) {

Is the test against _committed[ri].end() on line 281 correct?

I *think* the intended criteria for interference is
with the understanding at line 280 that
new_region.start() <= _committed[ri].start().
which simplifies the needed checking.  (There's an assertion to that
effect in the if-body.)

I think that line 281 will fail to detect the situation where
_committed[ri] is a proper subset of new_region, and thus the
intersection is non-empty.

On the other hand, I'm not sure what should be done in that
situation.  Maybe that situation is just not supposed to arise for
some reason?  E.g. something in the caller prevents that?  If so, an
assertion somewhere here would seem appropriate, but I don't see one
that deals with this case.

There are some later assertions in the same function which look like
they might have a similar problem, e.g.

302       assert(!_committed[ri].contains(new_end_aligned),

387         // The end of the new committed region should not
388         // be in any existing region unless it matches
389         // the start of the next region.
390         assert(!_committed[ri].contains(end) ||
391                (_committed[ri].start() == (HeapWord*) end),
392                "Overlapping committed regions");

More information about the hotspot-gc-dev mailing list