Re: Enabling Checksums
Ants Aasma <ants@cybertec.at>
From: Ants Aasma <ants@cybertec.at>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: Florian Pflug <fgp@phlo.org>, Jeff Davis <pgsql@j-davis.com>, Robert Haas <robertmhaas@gmail.com>, Greg Smith <greg@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@2ndquadrant.com>, Bruce Momjian <bruce@momjian.us>, Heikki Linnakangas <hlinnakangas@vmware.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2013-04-22T22:08:07Z
Lists: pgsql-hackers
Attachments
- parallel-fnv-checksum.patch (application/octet-stream) patch
On Mon, Apr 22, 2013 at 10:57 PM, Ants Aasma <ants@cybertec.at> wrote: > On Mon, Apr 22, 2013 at 10:54 PM, Simon Riggs <simon@2ndquadrant.com> wrote: >> On 22 April 2013 20:32, Florian Pflug <fgp@phlo.org> wrote: >> >>> Assuming that we only ship a plain C implementation with 9.3, what >>> are we missing on that front? The C implementation of FNV1+SHIFT is >>> only a few dozen lines or so. >> >> Forgive me, I can't seem to locate the patch for this? Re-post please, >> just for clarity. > > Not posted yet. I'm writing it as we speak. Will post within half an hour or so. A slight delay, but here it is. I didn't lift the checksum part into a separate file as I didn't have a great idea what I would call it. The code is reasonably compact so I don't see a great need for this right now. It would be more worth the effort when/if we add non-generic variants. I'm not particularly attached to the method I used to mask out pd_checksum field, this could be improved if someone has a better idea how to structure the code. I confirmed with objdump that compiling on GCC 4.7 with -msse4.1 -funroll-loops -ftree-vectorize does in fact vectorize that loop. Simple way to verify: objdump -d src/backend/storage/page/bufpage.o | grep pmulld | wc -l should output 16. Unfortunately I can't work on this patch for about a week. Postgresql 9.3 will have to wait for me as I need to tend to the release of Ants v2.0. Regards, Ants Aasma -- Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt Web: http://www.postgresql-support.de