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 1sqnqn-00Cvx6-Af for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Sep 2024 06:07:42 +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 1sqnqn-004QUp-0O for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Sep 2024 06:07:41 +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 1sqnqm-004QUg-Mq for pgsql-hackers@lists.postgresql.org; Wed, 18 Sep 2024 06:07:40 +0000 Received: from fout7-smtp.messagingengine.com ([103.168.172.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqnqj-001l26-O6 for pgsql-hackers@lists.postgresql.org; Wed, 18 Sep 2024 06:07:39 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id 8ED4413802E7; Wed, 18 Sep 2024 02:07:36 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Wed, 18 Sep 2024 02:07:36 -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=fm1; t=1726639656; x=1726726056; bh=ZEA+SndIcF ZkXtKe7G9ZK4dwsfMcteoS6iwVZPkJVjY=; b=BexrN67u/y4OqErMgRQxXeHf6W p/nIEJv8rW8qOBWHmco7+bltmK+nS2W/NFritKQMdL0ugW7qBNAVc0Am9DCqPEpM SqdmlcEv686d2WX7nOCYtQh6FXkPDaFIv+qyt768GepWzT+70Ab1Jcy4RTnQ/mEL vSsQ1fbKIwx/Ae3uDeCpTNJ8zPgoRoj5gj6PmsKqzd9iXjzl8rrhOIUgY6hMc87D jskZrUQN8+D5XyxbR5KQo1qt2hoO5klN0n8LmXN+0nXGKFpZw64U8TijzCIXQDmv uRQgZJ0HwzVxMBt18aUgIcYE3RndVYSpIite83WarnS+3T9o03dAWGwHoFCg== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1726639656; x=1726726056; bh=ZEA+SndIcFZkXtKe7G9ZK4dwsfMc teoS6iwVZPkJVjY=; b=Hemka3ef1z5lfHP2LTrI+Mi8qTJitW11dKrcGMLM21DJ zJ0sDpobOOEAry0eUwtQeGUDA7YNEhk10n88Epz3DyNZaJiJYqq3fc0E1FjDOQ5g QgymU4oJuH6EEeyUJQpCP8iOr4YJLt3MWb/A4DjovtZcPML2pVPhi3Vb4zppO79G 2IZoLkj18gponZZ2roQC2ojsv1RV/UqVf1DlMwqEAVh5rrMlE9LOdx9bulinWAsK QW/OBHj4JRM9P4O0uoVx/O2NN6rCg5cEI0nSVYvpFzMcTRsVhHkSjGkKqhHczLy4 ds8aVEWQuhT+m+oJZgTRILK1Zz0Y6dDUUATCj0bZPg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudekkedguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculd ejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomhep ofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighi iiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeffhfekueevteei gfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhnsggprhgtphht thhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsvghrthhrrghnuggurh houhhvohhtrdhpghesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggt khgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Sep 2024 02:07:34 -0400 (EDT) Date: Wed, 18 Sep 2024 15:07:15 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: pgsql-hackers@lists.postgresql.org Subject: Re: define pg_structiszero(addr, s, r) Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="uSRNnUkuajDTysm5" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --uSRNnUkuajDTysm5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 18, 2024 at 04:16:12AM +0000, Bertrand Drouvot wrote: > The macro is created in pgstat_internal.h as it looks like that "only" th= e=20 > statistics related code would benefit of it currently (could be moved to = other > header file later on if needed). I'm OK to add a helper macro in pgstat_internal.h as this is a pattern used only for some stats kinds (the other one I'm aware of is the allzero check for pages around bufmgr.c), cleaning up all these static declarations to make the memcpy() calls cheaper. That can also be useful for anybody doing a custom pgstats kind, fixed or variable-numbered. #define pg_structiszero(addr, s, r) \ Locating that at the top of pgstat_internal.h seems a bit out of order to me. Perhaps it would be better to move it closer to the inline functions? Also, is this the best name to use here? Right, this is something that may be quite generic. However, if we limit its scope in the stats, perhaps this should be named pgstat_entry_all_zeros() or something like that? -- Michael --uSRNnUkuajDTysm5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmbqbhMACgkQnvQgOdby QH1Q6w//dwaj1oylAchaWCUMJPQFat/GEU2WdzcLOBJIoArbOByLlTsAcfOLSmv3 qSzLNoLwBjiZy+/fHSYQYqcWmCWiekJf1odhlVm2BCgGMXnNJIDkv7r/6fpd5f2z SscFSgbYsrh/wk8dt7XwTOS+TrPceTlCVzWO8n7EAYRt2WVmAY6XEGkFej3UgguU C6cp86kEqItYcJDWuM/pcvQzeONjXhG88LbAV8jzq+CHMh/skMpF/vKreYYBXIEh cKO32mxGuFMWMzt9pYQj2wzZ4E7AnR8Qyjg3nP+Jfuq1UEF9TuyG7PlSKQ6O5IyM 8fPBhVgraLzzTGgCOEpAhENFiRVHGdBigXSHrkro/aTv54Z5d07tuDbPpWv5zNkC GVeCtu+066j6Wr+o8Id2FHWiG8EZsnqZYAbltn7nVVo7t3J0PJYZXt9CBEySmt/D 90EpwBl3x0OvUNMyEdj/L0oLv0xm2qePK+5/L03rsw27CSE06T8zOp+NrbPalVeb zlGUefcpNN4A+OyT8Kul3dwMUCHenU52tttmHGeeV0HDLhaqL2UyYOMrgC19rm6u 9CDscHxeGJg0rVyuJ97EJDwYEXNrEr3L6HkGjAMzsr+uSnqU+CARYMvCd1cyis89 29Sf51cCBaipCuvEkqIBFrltNndxBoJfBCYGSTP2dYYBmLEPpFs= =ADv4 -----END PGP SIGNATURE----- --uSRNnUkuajDTysm5--