RFR: 8325821: [REDO] use "dmb.ishst+dmb.ishld" for release barrier [v4]

kuaiwei duke at openjdk.org
Wed Apr 10 08:36:36 UTC 2024


> The origin patch for https://bugs.openjdk.org/browse/JDK-8324186 has 2 issues:
> 1 It show regression in some platform, like Apple silicon in mac os
> 2 Can not handle instruction sequence like "dmb.ishld; dmb.ishst; dmb.ishld; dmb.ishld"
> 
> It can be fixed by:
> 1 Enable AlwaysMergeDMB by default, only disable it in architecture we can see performance improvement (N1 or N2)
> 2 Check the special pattern and merge the subsequent dmb.
> 
> It also fix a bug when code buffer is expanding, st/ld/dmb can not be merged. I added unit tests for these.
> 
> This patch still has a unhandled case. Insts like "dmb.ishld; dmb.ishst; dmb.ish", it will merge the last 2 instructions and can not merge all three. Because when emitting dmb.ish, if merge all previous dmbs, the code buffer will shrink the size. I think it may break some resumption and think it's not a common pattern.
> 
> - Update:
> After discussion, I made a new implementation based on finite state machine for merging instruction. The mergeable instruction will be pending in fsm until next unmergeable instruction.

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

  Simplify code

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/18467/files
  - new: https://git.openjdk.org/jdk/pull/18467/files/fe4f4f20..1a49c60c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=18467&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=18467&range=02-03

  Stats: 161 lines in 14 files changed: 12 ins; 82 del; 67 mod
  Patch: https://git.openjdk.org/jdk/pull/18467.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18467/head:pull/18467

PR: https://git.openjdk.org/jdk/pull/18467


More information about the hotspot-dev mailing list