From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: "dsterba@suse.cz" <dsterba@suse.cz>, Chris Mason <clm@fb.com>,
Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>, Christoph Hellwig <hch@lst.de>,
Naohiro Aota <Naohiro.Aota@wdc.com>, Qu Wenruo <wqu@suse.com>,
Damien Le Moal <dlemoal@kernel.org>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v8 01/11] btrfs: add raid stripe tree definitions
Date: Wed, 13 Sep 2023 16:49:52 +0200 [thread overview]
Message-ID: <20230913144951.GL20408@twin.jikos.cz> (raw)
In-Reply-To: <50cfa5a0-c209-430f-8c00-54ba41c3791d@wdc.com>
On Wed, Sep 13, 2023 at 06:02:09AM +0000, Johannes Thumshirn wrote:
> On 12.09.23 22:32, David Sterba wrote:
> >> @@ -306,6 +306,16 @@ BTRFS_SETGET_FUNCS(timespec_nsec, struct btrfs_timespec, nsec, 32);
> >> BTRFS_SETGET_STACK_FUNCS(stack_timespec_sec, struct btrfs_timespec, sec, 64);
> >> BTRFS_SETGET_STACK_FUNCS(stack_timespec_nsec, struct btrfs_timespec, nsec, 32);
> >>
> >> +BTRFS_SETGET_FUNCS(stripe_extent_encoding, struct btrfs_stripe_extent, encoding, 8);
> >
> > What is encoding referring to?
>
> At the moment (only) the RAID type. But in the future it can be expanded
> to all kinds of encodings, like Reed-Solomon, Butterfly-Codes, etc...
I see, could it be better called ECC? Like stripe_extent_ecc, that would
be clear that it's for the correction, encoding sounds is too generic.
> >> + __le64 devid;
> >> + /* physical location on disk */
> >> + __le64 physical;
> >> + /* length of stride on this disk */
> >> + __le64 length;
> >> +};
> >
> > __attribute__ ((__packed__));
>
> The structure doesn't have any holes in it so packed is not needed.
>
> I might also be misinformed, but doesn't packed potentially lead to bad
> code generation on some platforms? I've always been under the
> impression that packed forces the compiler to do byte-wise loads and
> stores. But as I've said, I might be misinformed.
All on-disk structures have the packed attribute so for consistency and
future safety it should be here too, even if it technically does not
need it due to alignment. In addition, strucutres that need padding
would be also problematic, e.g. u64 followed by u32 needs 4 bytes of
padding but the next item after it would be placed right after u32.
It's right that on some platforms unaligned access is done by more code
but for the same reason on such platforms we can't let the compiler
decide the layout when the structure is directly mapped onto the blocks.
next prev parent reply other threads:[~2023-09-13 14:49 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 12:52 [PATCH v8 00/11] btrfs: introduce RAID stripe tree Johannes Thumshirn
2023-09-11 12:52 ` [PATCH v8 01/11] btrfs: add raid stripe tree definitions Johannes Thumshirn
2023-09-11 21:00 ` Damien Le Moal
2023-09-12 6:09 ` Johannes Thumshirn
2023-09-12 20:32 ` David Sterba
2023-09-13 6:02 ` Johannes Thumshirn
2023-09-13 14:49 ` David Sterba [this message]
2023-09-13 14:57 ` Johannes Thumshirn
2023-09-13 16:06 ` David Sterba
2023-09-11 12:52 ` [PATCH v8 02/11] btrfs: read raid-stripe-tree from disk Johannes Thumshirn
2023-09-14 9:27 ` Qu Wenruo
2023-09-14 9:33 ` Johannes Thumshirn
2023-09-11 12:52 ` [PATCH v8 03/11] btrfs: add support for inserting raid stripe extents Johannes Thumshirn
2023-09-13 16:50 ` David Sterba
2023-09-13 16:57 ` David Sterba
2023-09-14 9:25 ` Qu Wenruo
2023-09-14 9:51 ` Johannes Thumshirn
2023-09-14 10:06 ` Qu Wenruo
2023-09-14 15:35 ` Johannes Thumshirn
2023-09-11 12:52 ` [PATCH v8 04/11] btrfs: delete stripe extent on extent deletion Johannes Thumshirn
2023-09-11 12:52 ` [PATCH v8 05/11] btrfs: lookup physical address from stripe extent Johannes Thumshirn
2023-09-14 9:18 ` Qu Wenruo
2023-09-14 9:45 ` Johannes Thumshirn
2023-09-14 14:16 ` Johannes Thumshirn
2023-09-11 12:52 ` [PATCH v8 06/11] btrfs: implement RST version of scrub Johannes Thumshirn
2023-09-13 9:51 ` Qu Wenruo
2023-09-13 16:59 ` David Sterba
2023-09-11 12:52 ` [PATCH v8 07/11] btrfs: zoned: allow zoned RAID Johannes Thumshirn
2023-09-12 20:49 ` David Sterba
2023-09-13 5:41 ` Johannes Thumshirn
2023-09-13 14:52 ` David Sterba
2023-09-13 14:59 ` Johannes Thumshirn
2023-09-11 12:52 ` [PATCH v8 08/11] btrfs: add raid stripe tree pretty printer Johannes Thumshirn
2023-09-12 20:42 ` David Sterba
2023-09-13 5:34 ` Johannes Thumshirn
2023-09-11 12:52 ` [PATCH v8 09/11] btrfs: announce presence of raid-stripe-tree in sysfs Johannes Thumshirn
2023-09-11 12:52 ` [PATCH v8 10/11] btrfs: add trace events for RST Johannes Thumshirn
2023-09-12 20:46 ` David Sterba
2023-09-11 12:52 ` [PATCH v8 11/11] btrfs: add raid-stripe-tree to features enabled with debug Johannes Thumshirn
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=20230913144951.GL20408@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=Johannes.Thumshirn@wdc.com \
--cc=Naohiro.Aota@wdc.com \
--cc=clm@fb.com \
--cc=dlemoal@kernel.org \
--cc=dsterba@suse.com \
--cc=hch@lst.de \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wqu@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).