(RFR)(S)(10): 8176768: hotspot ignores PTHREAD_STACK_MIN when creating new threads (original) (raw)
Daniel D. Daugherty daniel.daugherty at oracle.com
Wed Mar 22 22:10:05 UTC 2017
- Previous message: (RFR)(S)(10): 8176768: hotspot ignores PTHREAD_STACK_MIN when creating new threads
- Next message: (RFR)(S)(10): 8176768: hotspot ignores PTHREAD_STACK_MIN when creating new threads
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 3/22/17 3:38 PM, Chris Plummer wrote:
Hello,
Sorry to beat a dead horse here, but in addition to Dan's recommended fixes, I also reworked how I check for overflow when aligning up thanks to a suggestion from David: http://cr.openjdk.java.net/~cjplummer/8176768/webrev.03/webrev.hotspot/
src/os/linux/vm/os_linux.cpp No comments.
src/os/posix/vm/os_posix.cpp No comments.
Thumbs up!
Dan
src/os/linux/vm/oslinux.cpp: 726 // behaviour. However, be careful not to end up with a size 727 // of zero due to overflow. Don't add the guard page in that case. 728 sizet guardsize = os::Linux::defaultguardsize(thrtype); 729 if (stacksize <= SIZEMAX - guardsize) { 730 stacksize += guardsize; 731 } 732 assert(issizealigned(stacksize, os::vmpagesize()), "stacksize not aligned"); src/os/posix/vm/osposix.cpp: 1260 // pthreadattrsetstacksize() may require that the size be rounded up to the OS page size. 1261 // Be careful not to round up to 0. Align down in that case. 1262 if (stacksize <= SIZEMAX - vmpagesize()) { 1263 stacksize = alignsizeup(stacksize, vmpagesize()); 1264 } else { 1265 stacksize = alignsizedown(stacksize, vmpagesize()); 1266 } Dan's comments below for reference: src/os/aix/vm/osaix.cpp No comments.
src/os/bsd/vm/osbsd.cpp No comments. src/os/linux/vm/oslinux.cpp L729: // In that cast just subract the page size to get the maximum possible stack size. Typo: 'cast' -> 'case' Typo: 'subract' -> 'subtract' (Thomas also commented on it) src/os/posix/vm/osposix.cpp L263: // aligning up could have resulted in the size being 0. In that case just subract the Nit: 'aligning' -> 'Aligning' (since it's a sentence) Typo: 'subract' -> 'subtract' src/os/solaris/vm/ossolaris.cpp No comments. src/share/vm/prims/jvm.cpp L2812: // -Avoid truncating on 32-bit platforms if size is greater than UINTMAX Nit: needs a period at the end like L2813. test/runtime/Thread/TooSmallStackSize.java No comments. test/runtime/Thread/TestThreadStackSizes.java L26: * @summary Test user threads with various stacks sizes. Typo?: "stacks sizes" -> "stack sizes" L36: super(null, null, "TestThreadStackSizes"+stackSize, stackSize); Nit: spaces around the "+". L46: TestThreadStackSizes testThreadStackSize = new TestThreadStackSizes(stackSize); Nit: extra space before '='. thanks Chris
- Previous message: (RFR)(S)(10): 8176768: hotspot ignores PTHREAD_STACK_MIN when creating new threads
- Next message: (RFR)(S)(10): 8176768: hotspot ignores PTHREAD_STACK_MIN when creating new threads
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]