Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tY1vH-001pq1-Ra for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Jan 2025 11:51:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tY1vF-00AlD3-DZ for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Jan 2025 11:50:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tY1vF-00AlCv-3o for pgsql-hackers@lists.postgresql.org; Wed, 15 Jan 2025 11:50:57 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tY1vC-000XhI-27 for pgsql-hackers@lists.postgresql.org; Wed, 15 Jan 2025 11:50:56 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2166360285dso116910265ad.1 for ; Wed, 15 Jan 2025 03:50:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736941853; x=1737546653; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gGxdxUCFMxo2A5saRF452+jdBkHUwKQpLAMXlU1G4jM=; b=Pkwxnl2dC+s7UE0PqL0f3olzq8OQDr3HVQDeoxCSQV0QIVl0Bhr+hTRPLfDVuLljJZ 478tjGjUNcnq/oBcW3TxWMO3KHX0xAgIqdeB8whQF/+uUOeJ+fs9pY6kqZKueTFRtrSo GV8oZsg1zA/MOUTNQpVUUbHlsQ8mjQ3erl+UaIirkfK5JmWId/vXYr5xL9Cd75AfqXFp 5z5DzCjC/JdcsVR6Jkt8fWPGq9DZUweAGGEbMuA6eoseQ+wom4m4Db7VUDh2blovwKij K2P8dRLkB+WDC76dKvs556cBvz2JV3G9XScVYQF4fzhQgFazxATFOQVlWPpAVmsItJtg dPog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736941853; x=1737546653; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gGxdxUCFMxo2A5saRF452+jdBkHUwKQpLAMXlU1G4jM=; b=O0/BrJW+76EkyQkzSQvT7kNqo8KTV53Ij2xEbcnBXY+3jlYQNDO86Y0yhnvCefNB/E bSjxoqWxnG8CTWLGbbKvMKGgU+oH0m/2LX9Nz5aWiPTg9MRYMgLjFCW8uqc3BfzTfJK8 CZck4e95+WlhEsoAeA7LqDrlrh36GTdogGzj/F2o9LjsNxk+fUdqfqVBd0ANJJV1i2Cq gqKyqVbxo+IGe1MrMMl2jQHO5v86q3swLZQkGWkHaPNQg6i1wkAg6w+jeTaUJ7mfOJz9 jIGA1hH8HHC/yKlnTCFrrnh2gig26Si5Q37ThuD9pULL6Eu5ZiElu31f2+WzSWqWHgNr pQ0g== X-Gm-Message-State: AOJu0Yy54wIA3rTNMX0DJrtDggAAhHS92oht5qPty4HoNe+MAkdY/rXN 3Oz6iH2d5JT/at2dWnBduwFLw1mK6TII7BbDsdveIq4XtAupZB56 X-Gm-Gg: ASbGncv2sOmEYn1C/7/qyfHjrp37h57rpN2/bxIZcXCkMl9gATkMEQ1o7Msmlwb1V7Q G/A3eKtfc1CQqwQBcgj9LDEujG4Kan1IfR6ql1NFeB0aRj6IqRrWj4Q9opvdPw6p0eB+Xd+D64O g4TbeG4Rm8e+12G62L4lywtuBROJq+ozFg5qKUSK6X5lM8ya4XverP3tM1TJW0WmlozGUxGzgr8 d2dTzXwFrTMqgQi/5vuwUTjdctGnsL5JqnabVYV6oqWsYZW5yR0vAzOJRf0P0o= X-Google-Smtp-Source: AGHT+IFAv206vLJh0guoDfo9rNt5Bq4thRfoS/cAKr1pTFmZCAFLH2lz9dOCv7I3FkIuaFmxy5ih1A== X-Received: by 2002:a17:90a:c2ce:b0:2ee:741c:e9f4 with SMTP id 98e67ed59e1d1-2f548ebba5bmr42649048a91.11.1736941852600; Wed, 15 Jan 2025 03:50:52 -0800 (PST) Received: from smtpclient.apple ([198.11.176.14]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f219302sm81060815ad.149.2025.01.15.03.50.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jan 2025 03:50:51 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: use a non-locking initial test in TAS_SPIN on AArch64 From: Jingtang Zhang In-Reply-To: Date: Wed, 15 Jan 2025 19:50:38 +0800 Cc: pgsql-hackers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <74D40BAB-C23D-497E-8153-67B543663182@gmail.com> References: To: Nathan Bossart X-Mailer: Apple Mail (2.3774.600.62) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Nathan. I just realized that I almost forgot about this thread :) > The result looks great, but the discussion in [0] shows that the = result may > vary among different ARM chips. Could you provide the chip model of = this > test? So that we can do a cross validation of this patch. Not sure if = compiler > version is necessary too. I'm willing to test it on Alibaba Cloud = Yitian 710 > if I have time. I did some benchmark on Yitian 710. On c8y.16xlarge (64 cores): Without the patch: 80.31% postgres [.] __aarch64_swp4_acq 1.77% postgres [.] __aarch64_ldadd4_acq_rel 1.13% postgres [.] hash_search_with_hash_value 0.87% pg_stat_statements.so [.] __aarch64_swp4_acq 0.72% postgres [.] perform_spin_delay 0.44% postgres [.] _bt_compare tps =3D 295272.628421 (including connections establishing) tps =3D 295335.660323 (excluding connections establishing) Patched: 9.94% postgres [.] s_lock 6.07% postgres [.] __aarch64_swp4_acq 5.73% postgres [.] hash_search_with_hash_value 2.81% postgres [.] perform_spin_delay 2.29% postgres [.] _bt_compare 2.15% postgres [.] PinBuffer tps =3D 864519.764125 (including connections establishing) tps =3D 864638.244443 (excluding connections establishing) Seems that great performance could be gained if s_lock contention is = severe. This may be more likely to happen on bigger machines. On c8y.2xlarge (8 cores), I failed to make s_lock contended severely, = and as a result this patch didn=E2=80=99t bring any difference outside the = noise. Regards, Jingtang