Re: define pg_structiszero(addr, s, r)
Ranier Vilela <ranier.vf@gmail.com>
From: Ranier Vilela <ranier.vf@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>,
David Rowley <dgrowleyml@gmail.com>, Peter Smith <smithpb2250@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, Heikki Linnakangas <hlinnaka@iki.fi>, pgsql-hackers@lists.postgresql.org
Date: 2024-11-14T12:13:19Z
Lists: pgsql-hackers
Em qui., 14 de nov. de 2024 às 08:58, Bertrand Drouvot < bertranddrouvot.pg@gmail.com> escreveu: > Hi, > > On Thu, Nov 14, 2024 at 08:22:23AM -0300, Ranier Vilela wrote: > > Em qui., 14 de nov. de 2024 ąs 07:09, Bertrand Drouvot < > > bertranddrouvot.pg@gmail.com> escreveu: > > > > > Hi, > > > > > > On Thu, Nov 14, 2024 at 09:27:06AM +0900, Michael Paquier wrote: > > > > Makes sense to me to just do that, with a first < 8 loop, and a > second > > > > for the 8~63 range. > > > > > > Thanks for looking at it! > > > > > > > There is also a "cant'" in the last size_t check. Simple typo. > > > > > > Please find attached v12, with more comments and comments changes to > > > explain > > > the multiple cases (for safety) and phases (for efficiency). > > > > > Is it worth mentioning that pg_memory_is_all_zeros does not work > correctly > > on 32-bit systems? > > > > (63 < (size_t) * 8) /* 63 - 32*/ > > I think that the code is fully portable on 32-bit systems as it's using > size_t > in all the places. > Maybe I'm doing something wrong. But I'm testing in 32-bit, with the size set to 63, with v12 and I'm seeing the SIMD loop execute. Because the test if (len < sizeof(size_t) * 8) // 8-63 bytes failed. I expected that with size 63, it would be solved by case 2, or am I wrong? best regards, Ranier Vilela PS. Windows 11 64 bits msvc 32 bits 2022
Commits
-
Use pg_memory_is_all_zeros() in PageIsVerifiedExtended()
- 03a42c9652f8 18.0 landed
-
Optimize pg_memory_is_all_zeros() in memutils.h
- 5be1dabd2ae0 18.0 landed
-
Remove use of pg_memory_is_all_zeros() in bufpage.c
- e819bbb7c82a 18.0 landed
-
Add pg_memory_is_all_zeros() in memutils.h
- 07e9e28b56db 18.0 landed