From: Xi Wang <xi.wang@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] ipv4: avoid undefined behavior in do_ip_setsockopt()
Date: Sun, 11 Nov 2012 17:18:55 -0500 [thread overview]
Message-ID: <50A0244F.1070302@gmail.com> (raw)
In-Reply-To: <20121111.170247.780516266044882867.davem@davemloft.net>
On 11/11/12 5:02 PM, David Miller wrote:
>
> This code is a fast bit test on purpose. You're making the
> code slower.
No, it's the opposite. All modern compilers optimize switch cases
into a fast bit test. The original "smarter" code, however, hinders
the compiler determining the mask for a fast bit test. With this
patch, GCC is able to compute a better mask. You can check the
assembly.
- xi
next prev parent reply other threads:[~2012-11-11 22:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-11 21:20 [PATCH] ipv4: avoid undefined behavior in do_ip_setsockopt() Xi Wang
2012-11-11 22:02 ` David Miller
2012-11-11 22:18 ` Xi Wang [this message]
2012-11-11 22:50 ` David Miller
2012-11-12 13:54 ` David Laight
2012-11-12 17:00 ` Xi Wang
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=50A0244F.1070302@gmail.com \
--to=xi.wang@gmail.com \
--cc=davem@davemloft.net \
--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.