From: Andy Lutomirski <luto@kernel.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>,
Stefano Brivio <sbrivio@redhat.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next] nft_set_pipapo_avx2: Skip LDMXCSR, we don't need a valid MXCSR state
Date: Tue, 18 May 2021 09:48:41 -0700 [thread overview]
Message-ID: <61461a47-acc3-877e-e5ec-5d4de1c7db45@kernel.org> (raw)
In-Reply-To: <20210518160159.GA24307@salvia>
On 5/18/21 9:01 AM, Pablo Neira Ayuso wrote:
> On Mon, May 10, 2021 at 07:58:52AM +0200, Stefano Brivio wrote:
>> We don't need a valid MXCSR state for the lookup routines, none of
>> the instructions we use rely on or affect any bit in the MXCSR
>> register.
>>
>> Instead of calling kernel_fpu_begin(), we can pass 0 as mask to
>> kernel_fpu_begin_mask() and spare one LDMXCSR instruction.
>>
>> Commit 49200d17d27d ("x86/fpu/64: Don't FNINIT in kernel_fpu_begin()")
>> already speeds up lookups considerably, and by dropping the MCXSR
>> initialisation we can now get a much smaller, but measurable, increase
>> in matching rates.
>>
>> The table below reports matching rates and a wild approximation of
>> clock cycles needed for a match in a "port,net" test with 10 entries
>> from selftests/netfilter/nft_concat_range.sh, limited to the first
>> field, i.e. the port (with nft_set_rbtree initialisation skipped), run
>> on a single AMD Epyc 7351 thread (2.9GHz, 512 KiB L1D$, 8 MiB
Please consider reverting this patch. You have papered over the actual
problem, which is that the kernel does not get the AVX pipeline stalls
right. LDMXCSR merely exacerbates the problem, but your patch won't
really fix it.
A real fix is on my radar. If you end up applying this patch, I'll
probably revert it later.
next prev parent reply other threads:[~2021-05-18 16:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 5:58 [PATCH nf-next] nft_set_pipapo_avx2: Skip LDMXCSR, we don't need a valid MXCSR state Stefano Brivio
2021-05-18 16:01 ` Pablo Neira Ayuso
2021-05-18 16:48 ` Andy Lutomirski [this message]
2021-05-18 18:27 ` Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=61461a47-acc3-877e-e5ec-5d4de1c7db45@kernel.org \
--to=luto@kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.