All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] GFS2: pull request for high-priority bug
Date: Wed, 15 Mar 2017 13:40:27 -0400 (EDT)	[thread overview]
Message-ID: <1503230067.2693820.1489599627064.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CA+55aFy1yJptuB02ph0=VsQ6F7Duws-UxU-+NCBQxni8VXrFBw@mail.gmail.com>

----- Original Message -----
| On Wed, Mar 15, 2017 at 7:32 AM, Bob Peterson <rpeterso@redhat.com> wrote:
| >
| > Andreas Gruenbacher (1):
| >       gfs2: Avoid alignment hole in struct lm_lockname
| 
| So I've pulled this because I think it fixes a real bug, but honestly
| I think it's the wrong fix.
| 
| Marking that lm_lockname structure "packed, aligned(4)" means that the
| compiler will now think that the 64-bit fields in it may be unaligned
| - including on architectures where that can be very expensive and the
| compiler now might generate stupid unaligned instruction sequences to
| load those values.
| 
| So the *correct* fix, I think, would have been:
| 
|  - add a comment about not having holes in the struct due to the hashing
| 
|  - sort the fields by size (so "ln_number" first, then "ln_sbd", then
|  "ln_type")
| 
|  - use offsetofend(struct lm_lockname, ln_type) instead of sizeof() when
|  hashing
| 
| which avoids the "possibly generate garbage code" issue due to the
| quick-and-dirty one-liner approach.
| 
| Hmm?
| 
|                  Linus

Hi Linus,

Thanks. Yes, good ideas.
I see your point and I'll see if we can get that fixed up for the next merge window.

Bob Peterson



WARNING: multiple messages have this Message-ID (diff)
From: Bob Peterson <rpeterso@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
	cluster-devel <cluster-devel@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: GFS2: pull request for high-priority bug
Date: Wed, 15 Mar 2017 13:40:27 -0400 (EDT)	[thread overview]
Message-ID: <1503230067.2693820.1489599627064.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CA+55aFy1yJptuB02ph0=VsQ6F7Duws-UxU-+NCBQxni8VXrFBw@mail.gmail.com>

----- Original Message -----
| On Wed, Mar 15, 2017 at 7:32 AM, Bob Peterson <rpeterso@redhat.com> wrote:
| >
| > Andreas Gruenbacher (1):
| >       gfs2: Avoid alignment hole in struct lm_lockname
| 
| So I've pulled this because I think it fixes a real bug, but honestly
| I think it's the wrong fix.
| 
| Marking that lm_lockname structure "packed, aligned(4)" means that the
| compiler will now think that the 64-bit fields in it may be unaligned
| - including on architectures where that can be very expensive and the
| compiler now might generate stupid unaligned instruction sequences to
| load those values.
| 
| So the *correct* fix, I think, would have been:
| 
|  - add a comment about not having holes in the struct due to the hashing
| 
|  - sort the fields by size (so "ln_number" first, then "ln_sbd", then
|  "ln_type")
| 
|  - use offsetofend(struct lm_lockname, ln_type) instead of sizeof() when
|  hashing
| 
| which avoids the "possibly generate garbage code" issue due to the
| quick-and-dirty one-liner approach.
| 
| Hmm?
| 
|                  Linus

Hi Linus,

Thanks. Yes, good ideas.
I see your point and I'll see if we can get that fixed up for the next merge window.

Bob Peterson

  reply	other threads:[~2017-03-15 17:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <186538212.2600624.1489588290616.JavaMail.zimbra@redhat.com>
2017-03-15 14:32 ` [Cluster-devel] GFS2: pull request for high-priority bug Bob Peterson
2017-03-15 14:32   ` Bob Peterson
2017-03-15 17:21   ` [Cluster-devel] " Linus Torvalds
2017-03-15 17:21     ` Linus Torvalds
2017-03-15 17:40     ` Bob Peterson [this message]
2017-03-15 17:40       ` Bob Peterson

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=1503230067.2693820.1489599627064.JavaMail.zimbra@redhat.com \
    --to=rpeterso@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.