pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Devulapalli, Raghuveer <raghuveer.devulapalli@intel.com>
Cc: John Naylor <johncnaylorls@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Cc: Shankaran, Akash <akash.shankaran@intel.com>
Subject: Re: Improve CRC32C performance on SSE4.2
Date: Wed, 12 Feb 2025 16:01:58 -0600
Message-ID: <Z60aVnYHjxsh9XYo@nathan> (raw)
In-Reply-To: <PH8PR11MB82862F0F720DABB913AA31B3FBFC2@PH8PR11MB8286.namprd11.prod.outlook.com>
References: <PH8PR11MB82869FF741DFA4E9A029FF13FBF72@PH8PR11MB8286.namprd11.prod.outlook.com>
	<PH8PR11MB8286F844321BA1DEEC518348FBFD2@PH8PR11MB8286.namprd11.prod.outlook.com>
	<CANWCAZYXk9xWrjEPNsm1oGYZ4CHBSVonn4XcCfWnusg+s_wiEA@mail.gmail.com>
	<PH8PR11MB828604A88A2E6C5EB5FF71E1FBFD2@PH8PR11MB8286.namprd11.prod.outlook.com>
	<CANWCAZZZWQc3VQauZ2bCPxDxKpjKbV7z=zntGu3zD1HgT76Fdw@mail.gmail.com>
	<PH8PR11MB82860A6C0E5C4B384B52E55AFBFC2@PH8PR11MB8286.namprd11.prod.outlook.com>
	<Z60QDnEuYptMjbQO@nathan>
	<PH8PR11MB82862F0F720DABB913AA31B3FBFC2@PH8PR11MB8286.namprd11.prod.outlook.com>

On Wed, Feb 12, 2025 at 09:48:57PM +0000, Devulapalli, Raghuveer wrote:
>> I think the idea behind USE_SSE42_CRC32C is to avoid the function pointer
>> overhead if possible.  I looked at switching to always using runtime checks for this
>> stuff, and we concluded that we'd better not [0].
> 
> Does that mean we want this feature for the new PCLMUL (and AVX-512) crc32c implementations too? The code for that will look a little ugly, I might need to think about a cleaner way to do this. 

Well, I suspect the AVX-512 version will pretty much always need the
runtime check given that its not available on a lot of newer hardware and
requires a bunch of extra runtime checks (see pg_popcount_avx512.c).  But
it might be worth doing for PCLMUL.  Otherwise, I think we'd have to leave
out the PCLMUL optimizations if built with -msse4.2 -mpclmul because we
don't want to regress existing -msse4.2 users with a runtime check.

-- 
nathan





view thread (82+ messages)  latest in thread

Message-ID: <Z60aVnYHjxsh9XYo@nathan>
Permalink:  ../Z60aVnYHjxsh9XYo@nathan/
Also on:    postgresql.org/message-id/Z60aVnYHjxsh9XYo@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, raghuveer.devulapalli@intel.com, johncnaylorls@gmail.com, akash.shankaran@intel.com
  Subject: Re: Improve CRC32C performance on SSE4.2
  In-Reply-To: <Z60aVnYHjxsh9XYo@nathan>
  References: <PH8PR11MB82869FF741DFA4E9A029FF13FBF72@PH8PR11MB8286.namprd11.prod.outlook.com> <PH8PR11MB8286F844321BA1DEEC518348FBFD2@PH8PR11MB8286.namprd11.prod.outlook.com> <CANWCAZYXk9xWrjEPNsm1oGYZ4CHBSVonn4XcCfWnusg+s_wiEA@mail.gmail.com> <PH8PR11MB828604A88A2E6C5EB5FF71E1FBFD2@PH8PR11MB8286.namprd11.prod.outlook.com> <CANWCAZZZWQc3VQauZ2bCPxDxKpjKbV7z=zntGu3zD1HgT76Fdw@mail.gmail.com> <PH8PR11MB82860A6C0E5C4B384B52E55AFBFC2@PH8PR11MB8286.namprd11.prod.outlook.com> <Z60QDnEuYptMjbQO@nathan> <PH8PR11MB82862F0F720DABB913AA31B3FBFC2@PH8PR11MB8286.namprd11.prod.outlook.com> <Z60aVnYHjxsh9XYo@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox