RFR: 8255047: Add HotSpot flag to use with debuggers that restrict the CPU… [v2]

Stefan Karlsson stefank at openjdk.java.net
Wed Oct 21 11:36:25 UTC 2020


> Some debuggers don't work well with many threads, and/or incompletely restricts the number of used CPUs to one.
> 
> This flag is intended as a catch-all for HotSpot developers (not available in product builds) to allow us to more easily use those debuggers.
> 
> Currently, the proposal is to let the flag fix a few things:
> 1) Turn down the number of JVM threads
> 2) Turn off NUMA
> 3) Force processor_id() to return 0 instead of values above processor_count()
> 
> (1) is purely ergonomics: gdb, rr, valgrind is faster and seems to work much better with fewer threads. The values would still be overridable by devs.
> 
> (2) and (3) deals with the fact that some debuggers change the reported processor count, but don't change the processor ids returned by sched_getcpu. This causes problems for ZGC and NUMA, that both assumes that they can rely on os::processor_id() < os::processor_count().
> 
> The current proposed flag name is -XX:+LimitedCPUsDebugging. I'm not entirely happy with that name, but I been able to find a better name.
> 
> An alternative to having one flag, is to split this into two flags, and maybe that would solve the naming problem. However, the usability aspects will be worse.
> 
> If we can't find a suitable name, I rather introduce a flag called:
> -XX:DebuggerWorkarounds or -XX:DebuggerWorkaround1 
> 
> Any suggestions / opinions? I really do want to at least fix the (2, 3) problem, because I keep having to add this to every single branch I'm working on.

Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:

  8255047: Add HotSpot flag to use with debuggers that restrict the CPU count

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/763/files
  - new: https://git.openjdk.java.net/jdk/pull/763/files/67e87758..a7aa7b9f

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=763&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=763&range=00-01

  Stats: 56 lines in 3 files changed: 37 ins; 14 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/763.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/763/head:pull/763

PR: https://git.openjdk.java.net/jdk/pull/763


More information about the hotspot-dev mailing list