review for 7029167: add support for conditional card marks

Tom Rodriguez tom.rodriguez at
Wed Mar 30 18:00:47 PDT 2011

On Mar 30, 2011, at 5:30 PM, John Rose wrote:

> Your comment mentions ldsb/ldub, but I think it is about ldsw/lduw.

Actually that's an ancient comment from Steve Goldman who originally wrote this for Doug many moons ago.  It really will be an ldsb.  The result is typed TypeInt::INT but the basic type is T_BYTE.  I'll correct the result type to be TypeInt::BYTE since that's what it really is.  I'm going to delete the language about what we'd like to see on sparc too since that seems extraneous to me.  It know looks like this:

  if (UseCondCardMark) {
    // The classic GC reference write barrier is typically implemented                                                                               
    // as a store into the global card mark table.  Unfortunately                                                                                     
    // unconditional stores can result in false sharing and excessive                                                                                 
    // coherence traffic as well as false transactional aborts.                                                                                       
    // UseCondCardMark enables MP "polite" conditional card mark                                                                                     
    // stores.  In theory we could relax the load from ctrl() to                                                                                     
    // no_ctrl, but that doesn't buy much latitude.                                                                                                   
    Node* card_val = __ load( __ ctrl(), card_adr, TypeInt::BYTE, bt, adr_type);
    __ if_then(card_val, BoolTest::ne, zero);

> (I think you'll get lduw from the LoadI, and whether that turns into a brnz depends on the vagaries of can_branch_register in

We don't use can_branch_register at all right now because we can't handle the short branches it produces.  We'll fix that in a bit though.

> I spot-checked other places where card marks are processed in opto, and saw no problems.



> Reviewed.
> -- John
> On Mar 30, 2011, at 4:46 PM, Tom Rodriguez wrote:
>> 7029167: add support for conditional card marks
>> Reviewed-by:
>> Repeated updates to the card table can be a source of contention on
>> multiprocessor machines that can greatly inhibit scalability.  This
>> adds support in C2 for conditional card marks.  Tested with jbb and
>> CTW.  At some point this should be turned on automatically when multi
>> socket machines are detected but that's covered under another bug as
>> is C1 support.

More information about the hotspot-compiler-dev mailing list