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 1tVe7B-00AGki-TZ for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 22:01:26 +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 1tVe7B-007j8E-BE for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 22:01:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tVe7B-007j86-13 for pgsql-hackers@lists.postgresql.org; Wed, 08 Jan 2025 22:01:24 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tVe78-000anc-1n for pgsql-hackers@postgresql.org; Wed, 08 Jan 2025 22:01:23 +0000 Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-3ab37d98dd4so654795ab.3 for ; Wed, 08 Jan 2025 14:01:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736373682; x=1736978482; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fpS4w9NfftfcEHZPIauuyE8eAKYkApz1V2npH/T5odQ=; b=LlMx1OiaeXSwzuW6EXOe+i0jWWBaqLGMfZHXSXLKq6TO+c9Yko7iS8qzUSXy7QZkcN 5XkNqr9S4rnnyQgKlEaOaJqM0B5KlxKbfuYolkhXvZlBmWeGK2ESE/8ZVQIq8DeDlSBJ QZLa5mXGWksNtzaoVJgYmfD4pBaw7RI3TnayWmOd0JM/mtRHBhsdGTtaAUOMgOSQayAc nOFKlzWO76BMAsNiHNlR9jUYDDMj0H6yhkVAsGzFcF3WRLSBgYssxQCoq6DYcOGrypMS dsz5KBjiG9J99JZuFoV5MmusJl9RRrrUE3+xsdR8Zptvng5NRPHO3T3OhBU9Su5MVhOB KlTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736373682; x=1736978482; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fpS4w9NfftfcEHZPIauuyE8eAKYkApz1V2npH/T5odQ=; b=Vr1Zo+XXNoSsl03BKBkRZqT7faZJ1yUUT/RBZ72zLqoV07suqF6uvselq+dlc/FpNE 3mCL7gmzyllZQKCbQGlqnVdQPsLsJBWj1TOeVjqVaxm/3xQhgi4tvbdbjwFyonIK/hS6 fm7KPd/x/J2S4OcjyTqc/2+wQibr3OiCdQa8pY5n9JkwMM5XDSXekUVTTMZXNVVE7s/g erfmRhGsxRwYysrUg/PsJyo2ssdsylMnr8N+a0jHenkFecqXKLoWlpSmkSnYMwQASlol 3tT2oVf2/+RvBprXh0WhR2Dd8UjTmww0B4HST8y7CIfH9aTRD5M0jnoHkyXRAwAeo130 iEjQ== X-Gm-Message-State: AOJu0Yys518aJN8CnWD+1QzaiKk9YyV7lnhwR06PaloTGgTuddrw+eHm jdMRhnwQjOSNX05SBPTpXJEmtUtLL3EUgl/c7hOiZnDRN5V+yJef X-Gm-Gg: ASbGnct2JSVEZxq5PgqN7tEtIXpgk6yV5YGbR0wjB3kYTieNhqGPY9622iM4+vpk+XH fJV7o3IWsh2snMzBwtD2uBnwVSWmelbxTHv1mSvyWzMlTqoX2O+SlYwjFHDwLDF6SujaUzSPRe1 zwxLdhjZG/aM2fuh8EDQxUu8bRxPqv1lGrDEZXhVq+zOED//WDDK1SR1pcl/XSnHb0vNuqlvt00 ThOEuCKxzXa4uEjqrTxpiSrH/EBZbdbOhk1kyMzBfAHuvAnDVmogHH8SL9sOePRcFAnyo1VgHMv o1weQVRM5g3SYV767oUhOz68Hsg2lRuUB4D0zyIlxdRCUmM= X-Google-Smtp-Source: AGHT+IFtlSC4lsI2IyZdmTPOe7K5fXROTjJAw0i77T7FWUYIXeUCD5o4Jpw5+az9mezC7jeLPecqOA== X-Received: by 2002:a05:6e02:1a01:b0:3a7:7a68:44e2 with SMTP id e9e14a558f8ab-3ce3a8bb67bmr36779005ab.15.1736373681832; Wed, 08 Jan 2025 14:01:21 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4e68c189367sm10707772173.101.2025.01.08.14.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 14:01:21 -0800 (PST) Date: Wed, 8 Jan 2025 16:01:19 -0600 From: Nathan Bossart To: Andres Freund Cc: pgsql-hackers@postgresql.org, dipiets@amazon.com Subject: Re: use a non-locking initial test in TAS_SPIN on AArch64 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jan 08, 2025 at 03:07:24PM -0500, Andres Freund wrote: > Out of curiosity, have you measured whether this has a positive effect without > pg_stat_statements? I think it'll e.g. also affect lwlocks, as they also use > perform_spin_delay(). AFAICT TAS_SPIN() is only used for s_lock(), which doesn't appear to be used by LWLocks. But I did retry my test from upthread without pg_stat_statements and was surprised to find a reproducible 4-6% regression. I'm not seeing any obvious differences in perf, but I do see that the thread for adding TAS_SPIN() for PPC mentions a regression at lower contention levels [0]. Perhaps the non-locked test is failing often enough to hurt performance in this case... Whatever it is, it'll be mighty frustrating to miss out on a >7x gain because of a 4% regression. [0] https://postgr.es/me/26496.1325625436%40sss.pgh.pa.us -- nathan