RFR: 8374945: Avoid fstat in os::open [v2]

David Holmes dholmes at openjdk.org
Fri Jan 16 02:25:52 UTC 2026


On Wed, 14 Jan 2026 15:37:15 GMT, Jonas Norlinder <jnorlinder at openjdk.org> wrote:

>> Eliminate unnecessary calls to fstat in os::open akin to JDK-8373647. This optimization reduces system overhead.
>
> Jonas Norlinder has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Fixes
>  - Remove trailing whitespace
>  - [Linux] Avoid fstat in os::open

Sorry I was going to sponsor but spotted a typo.

src/hotspot/os/linux/os_linux.cpp line 4886:

> 4884:   int fd = ::open(path, oflag, mode);
> 4885:   // No further checking is needed if open() returned an error or
> 4886:   // access mode is not read only

Suggestion:

  // access mode is not read only.

src/hotspot/os/linux/os_linux.cpp line 4892:

> 4890: 
> 4891:   // If the open succeeded and is read only, the file might be a directory
> 4892:   // which the JVM don't allow to be read

Suggestion:

  // which the JVM doesn't allow to be read.

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

PR Review: https://git.openjdk.org/jdk/pull/29152#pullrequestreview-3668462012
PR Review Comment: https://git.openjdk.org/jdk/pull/29152#discussion_r2696624666
PR Review Comment: https://git.openjdk.org/jdk/pull/29152#discussion_r2696625067


More information about the hotspot-runtime-dev mailing list