[nsd-users] Run-time effects of new SIMD code
Jeroen Koekkoek
jeroen at nlnetlabs.nl
Fri Jul 19 08:28:56 UTC 2024
Hi Anand,
Doing it with "nsd -v" is not implemented right now because it's meant
to be transparent to users of the library, but I think you're right and
it'd be good to show the info.
The kernel is selected when the parse function is called. For NSD it
makes sense to select one on startup and always use that one. There's a
GH issue for that: https://github.com/NLnetLabs/simdzone/issues/116. I
didn't consider printing it before. I have created a GH issue for it:
https://github.com/NLnetLabs/nsd/issues/354.
To select a kernel on startup, you can set the ZONE_KERNEL environment
variable. Possible values: fallback, westmere, haswell. We'll might add
a command line argument or configuration option for it.
As always, thanks for your suggestions.
- Jeroen
On Wed, 2024-07-17 at 17:36 +0200, Anand Buddhdev via nsd-users wrote:
> On 17/07/2024 16:57, Jeroen Koekkoek wrote:
>
> Hi Jeroen,
>
> > That is indeed correct. At runtime the CPUID instruction is used to
> > detect which extensions are offered and it chooses based on that.
> > When
> > compiling on x86_64 with SSE4.2 and AVX2 enabled, the binary will
> > actually contain 3 parsers, the most optimal one is used at
> > runtime.
>
> Thanks for this clarification. NSD doesn't log this info when
> starting,
> and "nsd -v" also doesn't reveal which parser it has chosen. I think
> such information will be useful to both users and developers,
> especially
> when trying to debug an issue. Do you think you could add this to the
> output of "nsd -v" (something like which parsers have been compiled,
> and
> which one is being chosen)?
>
> So a question: as a packager and distributor, do I need to build on a
> processor that has both SSE4.2 and AVX2 instructions enabled? And if
> one
> or both of these are not enabled, will the resulting build contain
> fewer
> parsers?
>
> > Optimized versions can be disabled with --disable-westmere (SSE4.2)
> > and
> > --disable-haswell (AVX2) if desired btw.
>
> Thanks for providing these options. But it would help users to know
> the
> effects of enabling/disabling these options, so that they can make an
> informed choice.
>
> Another question: if a user has a binary containing all three
> parsers,
> and wants to disable one or more of them at run-time, how is the user
> supposed to do this?
>
> Actually, I just went to look at doc/README, which has notes on how
> to
> compile NSD, but not all the enable/disable options are fully
> documented, so a user cannot make informed choices about whether to
> enable/disable certain features in their builds. I think I'll open a
> separate issue about this.
>
> Regards,
> Anand
> _______________________________________________
> nsd-users mailing list
> nsd-users at lists.nlnetlabs.nl
> https://lists.nlnetlabs.nl/mailman/listinfo/nsd-users
More information about the nsd-users
mailing list