From patchwork Mon May 19 15:23:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Nevill X-Patchwork-Id: 30389 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 54CFF202FE for ; Mon, 19 May 2014 15:23:12 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 19sf14332260ykq.8 for ; Mon, 19 May 2014 08:23:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:subject:from:reply-to:to :cc:date:organization:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=tqjWFasZg8wS+07OfzIhCJ9WNeXJEPXKA0xnOavrlfc=; b=R07CkQLK9Kb7vZ4Vm8s0joHXSee+9j7y7cKyVSeafCXYkKDFp4ozQkqhayxXk5JLXR toBvk/f5TrVBDIvFyyWebDaDc1cShBJ3YBMGOvJfyAZbvPqJJlprGlgdUiHaY6MxwgDq xj5TRXMujeFjAUUi9I11oO6ox2Uzk3ydPSoxljq89yBf+5vecobWjKUhv2JeUwzctfAp AFhHcwlHkoq4nkW5eLQUeglVyw6YtY9N2NAIzGt/VkMwplsim1AkOepqOkG9jjpSr7gz OP2yJT5VTeuFCPDzbYcWGDmtBxPPukQWX/Q8rcTIidHxh7t0z2OMzx3qTWIYKhPukm7u t2Pw== X-Gm-Message-State: ALoCoQmLlUx6sOiVj99eHFtu6hwazMsDrqA1c57rcvdI1SseK6Hgp9vkPBhKNq4ZjgQ/Unzk2Fsu X-Received: by 10.58.202.10 with SMTP id ke10mr16369543vec.8.1400512992083; Mon, 19 May 2014 08:23:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.72 with SMTP id k66ls1667114qgd.96.gmail; Mon, 19 May 2014 08:23:12 -0700 (PDT) X-Received: by 10.58.128.229 with SMTP id nr5mr201855veb.76.1400512991988; Mon, 19 May 2014 08:23:11 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id c1si4013193vem.162.2014.05.19.08.23.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 May 2014 08:23:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jw12so6631650veb.33 for ; Mon, 19 May 2014 08:23:11 -0700 (PDT) X-Received: by 10.58.112.8 with SMTP id im8mr7445680veb.35.1400512991907; Mon, 19 May 2014 08:23:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp243188vcb; Mon, 19 May 2014 08:23:11 -0700 (PDT) X-Received: by 10.194.90.39 with SMTP id bt7mr2615181wjb.93.1400512991045; Mon, 19 May 2014 08:23:11 -0700 (PDT) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx.google.com with ESMTPS id g10si2801987wix.31.2014.05.19.08.23.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 May 2014 08:23:11 -0700 (PDT) Received-SPF: pass (google.com: domain of edward.nevill@linaro.org designates 209.85.212.174 as permitted sender) client-ip=209.85.212.174; Received: by mail-wi0-f174.google.com with SMTP id r20so4355142wiv.13 for ; Mon, 19 May 2014 08:23:10 -0700 (PDT) X-Received: by 10.180.107.97 with SMTP id hb1mr13801549wib.20.1400512990384; Mon, 19 May 2014 08:23:10 -0700 (PDT) Received: from [10.0.7.5] ([88.98.47.97]) by mx.google.com with ESMTPSA id b19sm15586960wic.5.2014.05.19.08.23.09 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Mon, 19 May 2014 08:23:09 -0700 (PDT) Message-ID: <1400512988.25209.4.camel@localhost.localdomain> Subject: RFR: JDK9: Fix biased locking From: Edward Nevill Reply-To: edward.nevill@linaro.org To: "aarch64-port-dev@openjdk.java.net" Cc: patches@linaro.org Date: Mon, 19 May 2014 16:23:08 +0100 Organization: Linaro X-Mailer: Evolution 3.8.5 (3.8.5-2.fc19) Mime-Version: 1.0 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: edward.nevill@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi, The following patch fixes biased locking and re-enables it. I have tested it with jtreg/hotspot, jtreg/langtools and SPECjvm2008. This patch modifies shared code (it re-enables biased locking). OK to push? Ed. --- CUT HERE --- # HG changeset patch # User Edward Nevill edward.nevill@linaro.org # Date 1400512495 -3600 # Mon May 19 16:14:55 2014 +0100 # Node ID ddbcca4965f29762ced6755229642c9f4694536e # Parent a1363bc1be1dbe8a3bbe72732c30a27487753ed6 Fix biased locking and re-enable diff -r a1363bc1be1d -r ddbcca4965f2 src/cpu/aarch64/vm/macroAssembler_aarch64.cpp --- a/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Mon May 19 07:19:20 2014 -0400 +++ b/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Mon May 19 16:14:55 2014 +0100 @@ -414,7 +414,7 @@ Label here; load_prototype_header(tmp_reg, obj_reg); orr(tmp_reg, rthread, tmp_reg); - cmpxchgptr(tmp_reg, swap_reg, obj_reg, rscratch1, here, slow_case); + cmpxchgptr(swap_reg, tmp_reg, obj_reg, rscratch1, here, slow_case); // If the biasing toward our thread failed, then another thread // succeeded in biasing it toward itself and we need to revoke that // bias. The revocation will occur in the runtime in the slow case. @@ -441,7 +441,7 @@ { Label here, nope; load_prototype_header(tmp_reg, obj_reg); - cmpxchgptr(tmp_reg, swap_reg, obj_reg, rscratch1, here, &nope); + cmpxchgptr(swap_reg, tmp_reg, obj_reg, rscratch1, here, &nope); bind(here); // Fall through to the normal CAS-based lock, because no matter what diff -r a1363bc1be1d -r ddbcca4965f2 src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp --- a/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp Mon May 19 07:19:20 2014 -0400 +++ b/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp Mon May 19 16:14:55 2014 +0100 @@ -1818,7 +1818,7 @@ __ ldr(obj_reg, Address(oop_handle_reg, 0)); if (UseBiasedLocking) { - // __ biased_locking_enter(lock_reg, obj_reg, swap_reg, rscratch1, false, lock_done, &slow_path_lock); + __ biased_locking_enter(lock_reg, obj_reg, swap_reg, rscratch2, false, lock_done, &slow_path_lock); } // Load (object->mark() | 1) into swap_reg %r0 diff -r a1363bc1be1d -r ddbcca4965f2 src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Mon May 19 07:19:20 2014 -0400 +++ b/src/share/vm/runtime/globals.hpp Mon May 19 16:14:55 2014 +0100 @@ -1257,7 +1257,7 @@ product(bool, RestrictContended, true, \ "Restrict @Contended to trusted classes") \ \ - product(bool, UseBiasedLocking, false, \ + product(bool, UseBiasedLocking, true, \ "Enable biased locking in JVM") \ \ product(intx, BiasedLockingStartupDelay, 4000, \ --- CUT HERE ---