365 return Flag::VIOLATES_CONSTRAINT; 366 } else { 367 return Flag::SUCCESS; 368 } 369 } 370 #endif // INCLUDE_ALL_GCS 371 372 Flag::Error ParGCStridesPerThreadConstraintFunc(uintx value, bool verbose) { 373 #if INCLUDE_ALL_GCS 374 if (UseConcMarkSweepGC && (value > ((uintx)max_jint / (uintx)ParallelGCThreads))) { 375 CommandLineError::print(verbose, 376 "ParGCStridesPerThread (" UINTX_FORMAT ") must be " 377 "less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n", 378 value, ((uintx)max_jint / (uintx)ParallelGCThreads)); 379 return Flag::VIOLATES_CONSTRAINT; 380 } 381 #endif 382 return Flag::SUCCESS; 383 } 384 385 Flag::Error CMSOldPLABMinConstraintFunc(size_t value, bool verbose) { 386 Flag::Error status = Flag::SUCCESS; 387 388 #if INCLUDE_ALL_GCS 389 if (UseConcMarkSweepGC) { 390 if (value > CMSOldPLABMax) { 391 CommandLineError::print(verbose, 392 "CMSOldPLABMin (" SIZE_FORMAT ") must be " 393 "less than or equal to CMSOldPLABMax (" SIZE_FORMAT ")\n", 394 value, CMSOldPLABMax); 395 return Flag::VIOLATES_CONSTRAINT; 396 } 397 status = MaxPLABSizeBounds("CMSOldPLABMin", value, verbose); 398 } 399 #endif 400 return status; 401 } 402 403 Flag::Error CMSOldPLABMaxConstraintFunc(size_t value, bool verbose) { 404 Flag::Error status = Flag::SUCCESS; | 365 return Flag::VIOLATES_CONSTRAINT; 366 } else { 367 return Flag::SUCCESS; 368 } 369 } 370 #endif // INCLUDE_ALL_GCS 371 372 Flag::Error ParGCStridesPerThreadConstraintFunc(uintx value, bool verbose) { 373 #if INCLUDE_ALL_GCS 374 if (UseConcMarkSweepGC && (value > ((uintx)max_jint / (uintx)ParallelGCThreads))) { 375 CommandLineError::print(verbose, 376 "ParGCStridesPerThread (" UINTX_FORMAT ") must be " 377 "less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n", 378 value, ((uintx)max_jint / (uintx)ParallelGCThreads)); 379 return Flag::VIOLATES_CONSTRAINT; 380 } 381 #endif 382 return Flag::SUCCESS; 383 } 384 385 Flag::Error ParGCCardsPerStrideChunkConstraintFunc(intx value, bool verbose) { 386 #if INCLUDE_ALL_GCS 387 if (UseConcMarkSweepGC) { 388 // ParGCCardsPerStrideChunk shoule be compared with card table size. 389 size_t heap_size = Universe::heap()->reserved_region().word_size(); 390 CardTableModRefBS* bs = (CardTableModRefBS*)GenCollectedHeap::heap()->rem_set()->bs(); 391 size_t card_table_size = bs->cards_required(heap_size) - 1; // Valid card table size 392 393 if ((size_t)value > card_table_size) { 394 CommandLineError::print(verbose, 395 "ParGCCardsPerStrideChunk (" INTX_FORMAT ") is too large for the heap size and " 396 "must be less than or equal to card table size (" SIZE_FORMAT ")\n", 397 value, card_table_size); 398 return Flag::VIOLATES_CONSTRAINT; 399 } 400 401 // ParGCCardsPerStrideChunk is used with n_strides(ParallelGCThreads*ParGCStridesPerThread) 402 // from CardTableModRefBSForCTRS::process_stride(). However, ParGCStridesPerThread is already checked 403 // not to make an overflow with ParallelGCThreads from its constraint function. 404 uintx n_strides = ParallelGCThreads * ParGCStridesPerThread; 405 uintx ergo_max = max_uintx / n_strides; 406 if ((uintx)value > ergo_max) { 407 CommandLineError::print(verbose, 408 "ParGCCardsPerStrideChunk (" INTX_FORMAT ") must be " 409 "less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n", 410 value, ergo_max); 411 return Flag::VIOLATES_CONSTRAINT; 412 } 413 } 414 #endif 415 return Flag::SUCCESS; 416 } 417 418 Flag::Error CMSOldPLABMinConstraintFunc(size_t value, bool verbose) { 419 Flag::Error status = Flag::SUCCESS; 420 421 #if INCLUDE_ALL_GCS 422 if (UseConcMarkSweepGC) { 423 if (value > CMSOldPLABMax) { 424 CommandLineError::print(verbose, 425 "CMSOldPLABMin (" SIZE_FORMAT ") must be " 426 "less than or equal to CMSOldPLABMax (" SIZE_FORMAT ")\n", 427 value, CMSOldPLABMax); 428 return Flag::VIOLATES_CONSTRAINT; 429 } 430 status = MaxPLABSizeBounds("CMSOldPLABMin", value, verbose); 431 } 432 #endif 433 return status; 434 } 435 436 Flag::Error CMSOldPLABMaxConstraintFunc(size_t value, bool verbose) { 437 Flag::Error status = Flag::SUCCESS; |