From: James Simmons <jsimmons@infradead.org>
To: Andreas Dilger <adilger@whamcloud.com>,
Oleg Drokin <green@whamcloud.com>, NeilBrown <neilb@suse.de>
Cc: Artem Blagodarenko <ablagodarenko@ddn.com>,
Lustre Development List <lustre-devel@lists.lustre.org>
Subject: [lustre-devel] [PATCH 10/33] lustre: csdc: reserve layout bits for compress component
Date: Sun, 2 Feb 2025 15:46:10 -0500 [thread overview]
Message-ID: <20250202204633.1148872-11-jsimmons@infradead.org> (raw)
In-Reply-To: <20250202204633.1148872-1-jsimmons@infradead.org>
From: Bobi Jam <bobijam@whamcloud.com>
Add layout bits for compress component layout.
* lcme_compr_type: compression type (gzip, lz4, lz4hc, lzo, etc.)
* lcme_compr_lvl: compression level (0=default, 1-15)
* lcme_compr_chunk_log_bits: chunk size = 2^(16+chunk_log_bits)
Component pattern:
* LOV_PATTERN_COMPRESS - file contains compressed data chunks and
cannot be read by a client without decompression support.
Compress component flags:
* LCME_FL_COMPRESS - the component should be compressed with the
compression algorithm stored in lcme_comp_type, at level
lcme_comp_level, with chunk size 2^(16+lcme_chunk_log_bits)
* LCME_FL_PARTIAL - the component holds some uncompressed chunks due
to poor write size/alignment, and may benefit from being
recompressed as the full file data is available
* LCME_FL_NOCOMPR - the component should not be compressed because
the data was found to be incompressible, or by user request
WC-bug-id: https://jira.whamcloud.com/browse/LU-10026
Lustre-commit: 570d76dc3fd677357 ("LU-10026 csdc: reserve layout bits for compress component")
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49170
Reviewed-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
fs/lustre/ptlrpc/pack_generic.c | 1 -
fs/lustre/ptlrpc/wiretest.c | 13 +++++++++----
include/uapi/linux/lustre/lustre_user.h | 17 ++++++++++++++++-
3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/fs/lustre/ptlrpc/pack_generic.c b/fs/lustre/ptlrpc/pack_generic.c
index 16058b9cd9be..61fd122e8e3f 100644
--- a/fs/lustre/ptlrpc/pack_generic.c
+++ b/fs/lustre/ptlrpc/pack_generic.c
@@ -2299,7 +2299,6 @@ void lustre_swab_lov_comp_md_v1(struct lov_comp_md_v1 *lum)
__swab32s(&ent->lcme_layout_gen);
/* no need to swab lcme_dstripe_count */
/* no need to swab lcme_cstripe_count */
- BUILD_BUG_ON(offsetof(typeof(*ent), lcme_padding_1) == 0);
v1 = (struct lov_user_md_v1 *)((char *)lum + off);
stripe_count = v1->lmm_stripe_count;
diff --git a/fs/lustre/ptlrpc/wiretest.c b/fs/lustre/ptlrpc/wiretest.c
index e336410a6ed1..45adb33a9c56 100644
--- a/fs/lustre/ptlrpc/wiretest.c
+++ b/fs/lustre/ptlrpc/wiretest.c
@@ -1676,10 +1676,10 @@ void lustre_assert_wire_constants(void)
(long long)(int)offsetof(struct lov_comp_md_entry_v1, lcme_cstripe_count));
LASSERTF((int)sizeof(((struct lov_comp_md_entry_v1 *)0)->lcme_cstripe_count) == 1, "found %lld\n",
(long long)(int)sizeof(((struct lov_comp_md_entry_v1 *)0)->lcme_cstripe_count));
- LASSERTF((int)offsetof(struct lov_comp_md_entry_v1, lcme_padding_1) == 46, "found %lld\n",
- (long long)(int)offsetof(struct lov_comp_md_entry_v1, lcme_padding_1));
- LASSERTF((int)sizeof(((struct lov_comp_md_entry_v1 *)0)->lcme_padding_1) == 2, "found %lld\n",
- (long long)(int)sizeof(((struct lov_comp_md_entry_v1 *)0)->lcme_padding_1));
+ LASSERTF((int)offsetof(struct lov_comp_md_entry_v1, lcme_compr_type) == 46, "found %lld\n",
+ (long long)(int)offsetof(struct lov_comp_md_entry_v1, lcme_compr_type));
+ LASSERTF((int)sizeof(((struct lov_comp_md_entry_v1 *)0)->lcme_compr_type) == 1, "found %lld\n",
+ (long long)(int)sizeof(((struct lov_comp_md_entry_v1 *)0)->lcme_compr_type));
BUILD_BUG_ON(LCME_FL_STALE != 0x00000001);
BUILD_BUG_ON(LCME_FL_PREF_RD != 0x00000002);
BUILD_BUG_ON(LCME_FL_PREF_WR != 0x00000004);
@@ -1689,6 +1689,9 @@ void lustre_assert_wire_constants(void)
BUILD_BUG_ON(LCME_FL_NOSYNC != 0x00000020);
BUILD_BUG_ON(LCME_FL_EXTENSION != 0x00000040);
BUILD_BUG_ON(LCME_FL_PARITY != 0x00000080);
+ BUILD_BUG_ON(LCME_FL_COMPRESS != 0x00000100);
+ BUILD_BUG_ON(LCME_FL_PARTIAL != 0x00000200);
+ BUILD_BUG_ON(LCME_FL_NOCOMPR != 0x00000400);
BUILD_BUG_ON(LCME_FL_NEG != 0x80000000);
/* Checks for struct lov_comp_md_v1 */
@@ -1749,6 +1752,8 @@ void lustre_assert_wire_constants(void)
(long long)LCM_FL_SYNC_PENDING);
LASSERTF(LCM_FL_PCC_RDONLY == 8, "found %lld\n",
(long long)LCM_FL_PCC_RDONLY);
+ LASSERTF(LCM_FL_FLR_MASK == 11, "found %lld\n",
+ (long long)LCM_FL_FLR_MASK);
/* Checks for struct lmv_mds_md_v1 */
LASSERTF((int)sizeof(struct lmv_mds_md_v1) == 56, "found %lld\n",
diff --git a/include/uapi/linux/lustre/lustre_user.h b/include/uapi/linux/lustre/lustre_user.h
index 7ee79e21e8ef..8f648ecd91fa 100644
--- a/include/uapi/linux/lustre/lustre_user.h
+++ b/include/uapi/linux/lustre/lustre_user.h
@@ -425,6 +425,7 @@ struct ll_ioc_lease_id {
#define LOV_PATTERN_MDT 0x100
#define LOV_PATTERN_OVERSTRIPING 0x200
#define LOV_PATTERN_FOREIGN 0x400
+#define LOV_PATTERN_COMPRESS 0x800
#define LOV_PATTERN_F_MASK 0xffff0000
#define LOV_PATTERN_F_HOLE 0x40000000 /* there is hole in LOV EA */
@@ -586,6 +587,15 @@ enum lov_comp_md_entry_flags {
LCME_FL_NOSYNC = 0x00000020, /* FLR: no sync for the mirror */
LCME_FL_EXTENSION = 0x00000040, /* extension comp, never init */
LCME_FL_PARITY = 0x00000080, /* EC: a parity code component */
+ LCME_FL_COMPRESS = 0x00000100, /* the component should be
+ * compressed
+ */
+ LCME_FL_PARTIAL = 0x00000200, /* some chunks in the component
+ * are uncompressed
+ */
+ LCME_FL_NOCOMPR = 0x00000400, /* the component should not be
+ * compressed
+ */
LCME_FL_NEG = 0x80000000, /* used to indicate a negative
* flag, won't be stored on disk
*/
@@ -640,7 +650,12 @@ struct lov_comp_md_entry_v1 {
__u8 lcme_cstripe_count; /* code stripe count,
* p value in EC
*/
- __u16 lcme_padding_1;
+ __u8 lcme_compr_type; /* compress type */
+ __u8 lcme_compr_lvl:4; /* compress level */
+ __u8 lcme_compr_chunk_log_bits:4;
+ /* chunk_size = 2^(16+chunk_log_bits)
+ * i.e. power-of-two multiple of 64KiB
+ */
} __attribute__((packed));
#define SEQ_ID_MAX 0x0000FFFF
--
2.39.3
_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
next prev parent reply other threads:[~2025-02-02 20:53 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-02 20:46 [lustre-devel] [PATCH 00/33] lustre: sync to OpenSFS branch May 31, 2023 James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 01/33] lnet: set msg field for lnet message header James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 02/33] Revert "lustre: llite: Check vmpage in releasepage" James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 03/33] lustre: llite: EIO is possible on a race with page reclaim James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 04/33] lustre: llite: add __GFP_NORETRY for read-ahead page James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 05/33] lustre: obd: change lmd flags to bitmap James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 06/33] lustre: uapi: cleanup FSFILT defines James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 07/33] lustre: obd: Reserve metadata overstriping flags James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 08/33] lnet: selftest: manage the workqueue state properly James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 09/33] lustre: remove cl_{offset, index, page_size} helpers James Simmons
2025-02-02 20:46 ` James Simmons [this message]
2025-02-02 20:46 ` [lustre-devel] [PATCH 11/33] lustre: obd: replace simple_strtoul() James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 12/33] lnet: Use dynamic allocation for LND tunables James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 13/33] lustre: cksum: fix generating T10PI guard tags for partial brw page James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 14/33] lustre: llite: remove OBD_ -> CFS_ macros James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 15/33] lustre: obd: " James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 16/33] lnet: improve numeric NID to CPT hashing James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 17/33] lnet: libcfs: Remove unsed LASSERT_ATOMIC_* macros James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 18/33] lustre: misc: replace obsolete ioctl numbers James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 19/33] lustre: lmv: treat unknown hash type as sane type James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 20/33] lustre: llite: Fix return for non-queued aio James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 21/33] lnet: collect data about routes by using Netlink James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 22/33] lustre: ptlrpc: switch sptlrpc_rule_set_choose to large nid James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 23/33] lnet: use list_first_entry() where appropriate James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 24/33] lustre: statahead: using try lock for batched RPCs James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 25/33] lnet: libcfs: use round_up directly James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 26/33] lustre: mdc: md_open_data should keep ref on close_req James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 27/33] lustre: llite: update comment of ll_swap_layouts_close James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 28/33] lustre: ldlm: replace OBD_ -> CFS_ macros James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 29/33] lustre: mdc: remove " James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 30/33] lnet: libcfs: move cfs_expr_list_print to nidstrings.c James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 31/33] lnet: libcfs: Remove reference to LASSERT_ATOMIC_POS James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 32/33] lnet: ksocklnd: ksocklnd_ni_get_eth_intf_speed() must use only rtnl lock James Simmons
2025-02-02 20:46 ` [lustre-devel] [PATCH 33/33] lustre: ldlm: convert ldlm extent locks to linux extent-tree James Simmons
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=20250202204633.1148872-11-jsimmons@infradead.org \
--to=jsimmons@infradead.org \
--cc=ablagodarenko@ddn.com \
--cc=adilger@whamcloud.com \
--cc=green@whamcloud.com \
--cc=lustre-devel@lists.lustre.org \
--cc=neilb@suse.de \
/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).