From: Vladimir Murzin <murzin.v@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
av1474@comtv.ru
Subject: Re: [PATCH 2/3] net: bpf jit: x86: optimize choose_load_func error path
Date: Mon, 14 Oct 2013 04:55:39 +0200 [thread overview]
Message-ID: <20131014025535.GA1870@hp530> (raw)
In-Reply-To: <1381682194.3392.42.camel@edumazet-glaptop.roam.corp.google.com>
On Sun, Oct 13, 2013 at 09:36:34AM -0700, Eric Dumazet wrote:
> On Sun, 2013-10-13 at 16:54 +0200, Vladimir Murzin wrote:
> > Macro CHOOSE_LOAD_FUNC returns handler for "any offset" if checks for K
> > were not passed. At the same time handlers for "any offset" cases make
> > the same checks against r_addr at run-time, that will always lead to
> > bpf_error.
> >
> > Run-time checks are still necessary for indirect load operations, but
> > error path for absolute and mesh loads are worth to optimize during bpf
> > compile time.
>
> I don't get the point.
>
> What real world use case or problem are you trying to handle ?
>
> bpf_error returns 0, so it seems your patch does the same.
>
> A buggy BPF program should not expect us to 'save' a few cycles.
>
>
>
Hi Eric!
There is no real world use case for me - it was eliminated by plain code
reading. The patch is not supposed to change behavior of BPF program - only
optimization of the error path.
I agree with, you there is no significant reason for optimizations of rarely
used pice of code. However, it is not only saving pipeline cycles and I-cache
lines for usually "never taken" branch. In case this "never taken" branch is a
buggy part of BPF program, we can avoid extra instructions and save space for
the rest of BPF program - there is no need to care about seen flags of buggy
part anymore.
Anyway, if you still think it's not good enough - just throw it away ;)
Thanks
Vladimir
prev parent reply other threads:[~2013-10-14 2:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-08 16:31 [PATCH 1/3] net: bpf jit: ppc: optimize choose_load_func error path Vladimir Murzin
2013-10-08 22:50 ` Jan Seiffert
2013-10-13 14:26 ` Vladimir Murzin
[not found] ` <1381249910-17338-2-git-send-email-murzin.v@gmail.com>
2013-10-11 18:56 ` [PATCH 2/3] net: bpf jit: x86: " David Miller
2013-10-13 14:21 ` Vladimir Murzin
2013-10-13 14:25 ` malc
2013-10-13 14:31 ` Vladimir Murzin
2013-10-13 14:54 ` Vladimir Murzin
2013-10-13 14:54 ` Vladimir Murzin
2013-10-13 16:36 ` Eric Dumazet
2013-10-14 2:55 ` Vladimir Murzin [this message]
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=20131014025535.GA1870@hp530 \
--to=murzin.v@gmail.com \
--cc=av1474@comtv.ru \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/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.