RFR: 8261600: NMT: Relax memory order for updating MemoryCounter and fix racy updating of peak values

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR: 8261600: NMT: Relax memory order for updating MemoryCounter and fix racy updating of peak values

Zhengyu Gu-3
Currently, MemoryCounter is updated with default memory_order_conservative, it is too strong for updating a counter.

Also, updating peak values with regular assignment, which is racy and broken.

- [x] hotspot_nmt on Linux x86_64 and aarch64

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

Commit messages:
 - Update Copyrights
 - init

Changes: https://git.openjdk.java.net/jdk/pull/2527/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2527&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261600
  Stats: 55 lines in 2 files changed: 36 ins; 2 del; 17 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2527.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2527/head:pull/2527

PR: https://git.openjdk.java.net/jdk/pull/2527
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8261600: NMT: Relax memory order for updating MemoryCounter and fix racy updating of peak values

David Holmes-2
On Thu, 11 Feb 2021 15:05:17 GMT, Zhengyu Gu <[hidden email]> wrote:

> Currently, MemoryCounter is updated with default memory_order_conservative, it is too strong for updating a counter.
>
> Also, updating peak values with regular assignment, which is racy and broken.
>
> - [x] hotspot_nmt on Linux x86_64 and aarch64

Hi Zhengyu,

This seems okay.

Thanks,
David

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

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/2527
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8261600: NMT: Relax memory order for updating MemoryCounter and fix racy updating of peak values

Aleksey Shipilev-5
In reply to this post by Zhengyu Gu-3
On Thu, 11 Feb 2021 15:05:17 GMT, Zhengyu Gu <[hidden email]> wrote:

> Currently, MemoryCounter is updated with default memory_order_conservative, it is too strong for updating a counter.
>
> Also, updating peak values with regular assignment, which is racy and broken.
>
> - [x] hotspot_nmt on Linux x86_64 and aarch64

This looks fine to me too.

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

Marked as reviewed by shade (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/2527
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8261600: NMT: Relax memory order for updating MemoryCounter and fix racy updating of peak values

Zhengyu Gu-3
In reply to this post by David Holmes-2
On Thu, 18 Feb 2021 03:44:27 GMT, David Holmes <[hidden email]> wrote:

>> Currently, MemoryCounter is updated with default memory_order_conservative, it is too strong for updating a counter.
>>
>> Also, updating peak values with regular assignment, which is racy and broken.
>>
>> - [x] hotspot_nmt on Linux x86_64 and aarch64
>
> Hi Zhengyu,
>
> This seems okay.
>
> Thanks,
> David

Thanks for reviewing, @dholmes-ora and @shipilev

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

PR: https://git.openjdk.java.net/jdk/pull/2527
Reply | Threaded
Open this post in threaded view
|

Integrated: 8261600: NMT: Relax memory order for updating MemoryCounter and fix racy updating of peak values

Zhengyu Gu-3
In reply to this post by Zhengyu Gu-3
On Thu, 11 Feb 2021 15:05:17 GMT, Zhengyu Gu <[hidden email]> wrote:

> Currently, MemoryCounter is updated with default memory_order_conservative, it is too strong for updating a counter.
>
> Also, updating peak values with regular assignment, which is racy and broken.
>
> - [x] hotspot_nmt on Linux x86_64 and aarch64

This pull request has now been integrated.

Changeset: f94a8452
Author:    Zhengyu Gu <[hidden email]>
URL:       https://git.openjdk.java.net/jdk/commit/f94a8452
Stats:     55 lines in 2 files changed: 36 ins; 2 del; 17 mod

8261600: NMT: Relax memory order for updating MemoryCounter and fix racy updating of peak values

Reviewed-by: dholmes, shade

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

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