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 1t6lrl-00FPfI-Fc for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Nov 2024 07:14:41 +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 1t6lri-00AUwG-UC for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Nov 2024 07:14:39 +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 1t6lri-00AUw7-K4 for pgsql-hackers@lists.postgresql.org; Fri, 01 Nov 2024 07:14:38 +0000 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6lrc-003uxU-88 for pgsql-hackers@lists.postgresql.org; Fri, 01 Nov 2024 07:14:37 +0000 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 6E5C713801A0; Fri, 1 Nov 2024 03:14:31 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Fri, 01 Nov 2024 03:14:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1730445271; x=1730531671; bh=HnRqhHFTx3 Mjhqf7edvs0W9dMXfzC0KXVRxVByXKA/M=; b=AOd1S8TC3oSu0PrbT8cSNxZAkt s5qjPxXPZap8e0AQ3ZucrSJy6q8zQsJUQif+XUNqI07ARm7JxzKOb12eLlPBLS7B lp4bhzvCrBVU2XcW7Lm8mMk7HpridPlSPtA6y2jFMNZPR7h+6ZHSFh46QYfwjdJz 6BjEZf/2rNUKs2cOnZ4LWJTnBFp1KNcrRSKmKVchcBXD0ZwQUApqN72GM9JtM+6P X8NjiyNkR2eQaOFYJtiLCUHdnFhXpiDcsWvrXvUNHHB4ae4lrmP+VEcupPEQIFYy BhKjZpY0FTHwQWXJgAo/o8IcmhrXd776rUsFA9jsLoPOnK/t9CwyIKDVXw3g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1730445271; x=1730531671; bh=HnRqhHFTx3Mjhqf7edvs0W9dMXfzC0KXVRx VByXKA/M=; b=QX3PkyrnkKV4zktvASvqbaNTVwi8shF6j5lBQvaYCwsPjMNPPqu GhJwrj+ME2+8V2jnepLIhR/AtFYAGZHsUretLNE4zpqM0Y/Zs58y683MoVseyvba coTj11WSxnQZ+usJpmTj0ZCs2O02ItTlBtWlgCRmOAMC7DJsMDtjW1nF3sbeeyO0 nNbu7SU2KdY6RQmlw5SkReFyKQXOTO7+B6KPKKnhlbFhK90XU3Zg0p0mIg9A8NF5 epWtyxi8QFvGhq6cs4YAMJRqpVtbmcbBHU6s4q5Gf4sALdFxmt/4InuH0JdOcdd+ HdYIki3F07ewzE0/d7kPmIxUnQJhO4NE7bA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdekkedguddtvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenfghrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffk fhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrh cuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeet heeutefhteejudehvdekteekueevvddutdetteeuleeutddtgfdutdelkeehveenucffoh hmrghinhepghhouggsohhlthdrohhrghdpphhoshhtghhrvghsqhhlrdhorhhgnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlh esphgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepsggvrhhtrhgrnhguughrohhuvhhothdrphhgsehgmhgrihhlrd gtohhmpdhrtghpthhtohepughgrhhofihlvgihmhhlsehgmhgrihhlrdgtohhmpdhrtghp thhtohepshhmihhthhhpsgdvvdehtdesghhmrghilhdrtghomhdprhgtphhtthhopehpvg htvghrsegvihhsvghnthhrrghuthdrohhrghdprhgtphhtthhopehhlhhinhhnrghkrges ihhkihdrfhhipdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrph hoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Nov 2024 03:14:28 -0400 (EDT) Date: Fri, 1 Nov 2024 16:14:09 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: David Rowley , Peter Smith , Peter Eisentraut , Heikki Linnakangas , pgsql-hackers@lists.postgresql.org Subject: Re: define pg_structiszero(addr, s, r) Message-ID: References: <36371fab-f90c-427c-9c14-210e93e9cd12@eisentraut.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eKWWLhr3HurK583H" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --eKWWLhr3HurK583H Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 01, 2024 at 06:33:51AM +0000, Bertrand Drouvot wrote: > We could try to write a more elaborate version of pg_memory_is_all_zeros(= ), but > as it looks like there is only one use case, then it's probably better to= not > implement (revert) this change here and "just" add a comment as to why pg= _memory_is_all_zeros() > should not be used here, thoughts? >=20 > [0]: https://godbolt.org/z/xqnW4MPY5 Note that the two printf() calls make the code less optimized. Anyway, I see the following from bufpage.s for these lines under -O2: 1) On HEAD at 07e9e28b56db: =2ELVL306: .loc 3 201 23 is_stmt 1 discriminator 1 view .LVU547 cmpq $1024, %rbx <- Yep, that's wrong. jne .L417 2) On HEAD at 49d6c7d8daba: =2ELVL299: .loc 1 131 16 is_stmt 0 discriminator 1 view .LVU524 cmpq $8192, %rbx je .L419 3) With the patch sent at [1]: =2ELVL306: .loc 3 201 23 is_stmt 1 discriminator 1 view .LVU545 cmpq $8192, %rbx jne .L417 So it does not matter one way or another for 2) or 3), does it? [1]: https://www.postgresql.org/message-id/ZyR02ofHiWG1HmLI@paquier.xyz -- Michael --eKWWLhr3HurK583H Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmckf8AACgkQnvQgOdby QH1iDg//e1UxntFeuQSOrr5GRwny6khcyUQToAP04cOTfhUVL37NLIZyZY+jKVT6 CQfBy7mM1zJtli0D+yPqJIahEmyvCWkASewGCN8Z7usSgAEB9EuI3uptrJSSjM+7 +BYAwAesk+2AvrrcrFx+dj5LI1OWMdTiX/8IlDCsnCLWFZAulkrescxj5ghiVYtF k5v1UoG1MSQM+5Tb6TUhQsoFZTPpvyHKaBQ7LU+0axFgnR9G2Gm001DU4w8lYr8j Zv53a3PI4IaigII1XFQPVMsZkKwIfY5IHF97LBVptgOJ3PLCf0gFTzGwpnlo7Tl3 geyev8V3N2ZnFauvPBlHR7QiDsEuzSNQYNDLfIOP2wC51VnsdwGxfFYlXbNAvoWq 1oteImI8uybsUm1mjaSY/DPqm2lQGhrVByovXQApClnHPHOg/BctNJX26300nYIs TpyAbAJFYOtb7cvCv5Mn+YzucINkDrlRoRLEsygO7/jvh9EWoADNXBdV5kUZ3cpN FeTMbWcjdFs8AaBe9Zx6ezexvABdk2cADNxsNmsVb2zdyn6YxHX0maFCXzfBf8xJ m23crgO0+puoomRFlKt4ZlZL91hkdKbdgezh5bnbUldoLsCGORjqBbZHvqVbKdHe 5wYNC+R6Izxy4VgnxM37TJIG9DGpxdpdtBIfBdoweHSfIzptLCs= =Y7E1 -----END PGP SIGNATURE----- --eKWWLhr3HurK583H--