Introduce Relaxed_FetchOr for MarkBit::Set [v8/v8 : main]

0 views
Skip to first unread message

Hao A Xu (Gerrit)

unread,
4:47 AM (11 hours ago) 4:47 AM
to Michael Lippautz, chrom...@appspot.gserviceaccount.com, Hannes Payer, mlippau...@chromium.org, v8-re...@googlegroups.com
Attention needed from Michael Lippautz

Hao A Xu added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Hao A Xu . resolved

PTAL, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Michael Lippautz
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I197f79c99a6721157460544ddca108c1364d7aef
Gerrit-Change-Number: 6983342
Gerrit-PatchSet: 3
Gerrit-Owner: Hao A Xu <hao....@intel.com>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Fri, 26 Sep 2025 08:47:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

chromeperf@appspot.gserviceaccount.com (Gerrit)

unread,
7:35 AM (8 hours ago) 7:35 AM
to Hao A Xu, Michael Lippautz, Hannes Payer, mlippau...@chromium.org, v8-re...@googlegroups.com
Attention needed from Hao A Xu and Michael Lippautz

Message from chrom...@appspot.gserviceaccount.com

📍 Job mac-m1_mini_2020-perf/speedometer3 complete.

See results at: https://pinpoint-dot-chromeperf.appspot.com/job/124bab21510000

Open in Gerrit

Related details

Attention is currently required from:
  • Hao A Xu
  • Michael Lippautz
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I197f79c99a6721157460544ddca108c1364d7aef
Gerrit-Change-Number: 6983342
Gerrit-PatchSet: 3
Gerrit-Owner: Hao A Xu <hao....@intel.com>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Hao A Xu <hao....@intel.com>
Gerrit-Comment-Date: Fri, 26 Sep 2025 11:35:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Michael Lippautz (Gerrit)

unread,
7:59 AM (8 hours ago) 7:59 AM
to Hao A Xu, Dominik Inführ, chrom...@appspot.gserviceaccount.com, Hannes Payer, mlippau...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ and Hao A Xu

Michael Lippautz voted and added 1 comment

Votes added by Michael Lippautz

Code-Review+1

1 comment

Patchset-level comments
Michael Lippautz . resolved

lgtm

The bots may show a possible regression though; maybe we need to revert this. It's unclear to me where that would come frome given on the ABI this should be better or the same as before. The CAS loop also has a filtering bailout.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
  • Hao A Xu
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I197f79c99a6721157460544ddca108c1364d7aef
Gerrit-Change-Number: 6983342
Gerrit-PatchSet: 3
Gerrit-Owner: Hao A Xu <hao....@intel.com>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Attention: Hao A Xu <hao....@intel.com>
Gerrit-Comment-Date: Fri, 26 Sep 2025 11:59:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Hao A Xu (Gerrit)

unread,
8:48 AM (7 hours ago) 8:48 AM
to Dominik Inführ, Michael Lippautz, chrom...@appspot.gserviceaccount.com, Hannes Payer, mlippau...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ

Hao A Xu added 1 comment

Patchset-level comments
Michael Lippautz . resolved

lgtm

The bots may show a possible regression though; maybe we need to revert this. It's unclear to me where that would come frome given on the ABI this should be better or the same as before. The CAS loop also has a filtering bailout.

Hao A Xu

Are the bots tested with PGO? I'm not sure if there will be less functions inlined if we made a change like this. It seems to be less likely that an actual data race will happen during the CAS, so I'm not sure whether the filtering bailout works many times.

For x64, the assembly behind FetchOr should be a single atomic bitwise or instruction with a LOCK prefix. I'm not a arm expert but it seems that they have a similar `LDSET` instruction as well. Maybe we can consider making this architecture dependent if it does incur regression on arm? (seems that win-11 bots have some improvement)

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I197f79c99a6721157460544ddca108c1364d7aef
Gerrit-Change-Number: 6983342
Gerrit-PatchSet: 3
Gerrit-Owner: Hao A Xu <hao....@intel.com>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Fri, 26 Sep 2025 12:48:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michael Lippautz <mlip...@chromium.org>
satisfied_requirement
open
diffy

Michael Lippautz (Gerrit)

unread,
8:56 AM (7 hours ago) 8:56 AM
to Hao A Xu, Dominik Inführ, chrom...@appspot.gserviceaccount.com, Hannes Payer, mlippau...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ and Hao A Xu

Michael Lippautz added 1 comment

Patchset-level comments
Michael Lippautz . resolved

lgtm

The bots may show a possible regression though; maybe we need to revert this. It's unclear to me where that would come frome given on the ABI this should be better or the same as before. The CAS loop also has a filtering bailout.

Hao A Xu

Are the bots tested with PGO? I'm not sure if there will be less functions inlined if we made a change like this. It seems to be less likely that an actual data race will happen during the CAS, so I'm not sure whether the filtering bailout works many times.

For x64, the assembly behind FetchOr should be a single atomic bitwise or instruction with a LOCK prefix. I'm not a arm expert but it seems that they have a similar `LDSET` instruction as well. Maybe we can consider making this architecture dependent if it does incur regression on arm? (seems that win-11 bots have some improvement)

Michael Lippautz

Yeah, I think it's just okay to land and try and let PGO pick it up.

Really, from what I understand this should always be better or the same.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
  • Hao A Xu
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I197f79c99a6721157460544ddca108c1364d7aef
Gerrit-Change-Number: 6983342
Gerrit-PatchSet: 3
Gerrit-Owner: Hao A Xu <hao....@intel.com>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Hao A Xu <hao....@intel.com>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Fri, 26 Sep 2025 12:56:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michael Lippautz <mlip...@chromium.org>
Comment-In-Reply-To: Hao A Xu <hao....@intel.com>
satisfied_requirement
open
diffy

Hao A Xu (Gerrit)

unread,
9:33 AM (6 hours ago) 9:33 AM
to Dominik Inführ, Michael Lippautz, chrom...@appspot.gserviceaccount.com, Hannes Payer, mlippau...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ

Hao A Xu added 1 comment

Patchset-level comments
Michael Lippautz . resolved

lgtm

The bots may show a possible regression though; maybe we need to revert this. It's unclear to me where that would come frome given on the ABI this should be better or the same as before. The CAS loop also has a filtering bailout.

Hao A Xu

Are the bots tested with PGO? I'm not sure if there will be less functions inlined if we made a change like this. It seems to be less likely that an actual data race will happen during the CAS, so I'm not sure whether the filtering bailout works many times.

For x64, the assembly behind FetchOr should be a single atomic bitwise or instruction with a LOCK prefix. I'm not a arm expert but it seems that they have a similar `LDSET` instruction as well. Maybe we can consider making this architecture dependent if it does incur regression on arm? (seems that win-11 bots have some improvement)

Michael Lippautz

Yeah, I think it's just okay to land and try and let PGO pick it up.

Really, from what I understand this should always be better or the same.

Hao A Xu

Thanks, I will land this CL.

I think in theory this should always be better or the same as well, I'm just saying that making it architecture dependent can give us some time to investigate where the regression on arm comes from.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I197f79c99a6721157460544ddca108c1364d7aef
Gerrit-Change-Number: 6983342
Gerrit-PatchSet: 3
Gerrit-Owner: Hao A Xu <hao....@intel.com>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Fri, 26 Sep 2025 13:33:39 +0000
satisfied_requirement
open
diffy

Hao A Xu (Gerrit)

unread,
9:36 AM (6 hours ago) 9:36 AM
to Dominik Inführ, Michael Lippautz, chrom...@appspot.gserviceaccount.com, Hannes Payer, mlippau...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ

Hao A Xu voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I197f79c99a6721157460544ddca108c1364d7aef
Gerrit-Change-Number: 6983342
Gerrit-PatchSet: 3
Gerrit-Owner: Hao A Xu <hao....@intel.com>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Hao A Xu <hao....@intel.com>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Fri, 26 Sep 2025 13:36:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

V8 LUCI CQ (Gerrit)

unread,
10:10 AM (6 hours ago) 10:10 AM
to Hao A Xu, Dominik Inführ, Michael Lippautz, chrom...@appspot.gserviceaccount.com, Hannes Payer, mlippau...@chromium.org, v8-re...@googlegroups.com

V8 LUCI CQ submitted the change

Change information

Commit message:
Introduce Relaxed_FetchOr for MarkBit::Set

Relaxed_SetBits were using Relaxed_CompareAndSwap to set the bits. It
contains a loop to ensure that the three operations (getting bits
/bitwise or/setting bits) are atomic. However, when all the bits to be
set are 1, we can use atomic fetch_or directly to avoid this loop.
This can be used in MarkBit::Set.
Change-Id: I197f79c99a6721157460544ddca108c1364d7aef
Commit-Queue: Hao A Xu <hao....@intel.com>
Reviewed-by: Michael Lippautz <mlip...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#102797}
Files:
  • M src/base/atomic-utils.h
  • M src/base/atomicops.h
  • M src/heap/marking-inl.h
  • M src/heap/marking.h
  • M test/unittests/base/atomic-utils-unittest.cc
Change size: M
Delta: 5 files changed, 62 insertions(+), 2 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Michael Lippautz
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I197f79c99a6721157460544ddca108c1364d7aef
Gerrit-Change-Number: 6983342
Gerrit-PatchSet: 4
Gerrit-Owner: Hao A Xu <hao....@intel.com>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Hao A Xu <hao....@intel.com>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages