RFR: 8245543: Cgroups: Incorrect detection logic on some systems (still reproducible) [v6]

Aleksey Shipilev shade at openjdk.java.net
Fri Oct 9 09:54:19 UTC 2020


On Fri, 9 Oct 2020 09:46:55 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> src/java.base/linux/classes/jdk/internal/platform/CgroupSubsystemFactory.java line 183:
>> 
>>> 181:              }
>>> 182:          }
>>> 183:          return relevantControllerFound;
>> 
>> If I am reading the code right, then `relevantControllerFound` can be replaced with just `return true` or `return
>> false`?
>
> I don't think so. It starts out as `false` and is being set to true on lines 180 and 174. So we could change it to
> `return false` here iff lines 174 and 180 would `return true`.

Yes, that's what I meant: instead of dragging the boolean flag, do the early `return true`, or `return false`
otherwise. Your choice if you want to make that change.

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

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


More information about the serviceability-dev mailing list