diff mbox series

[07/27] lustre: fid: reduce LUSTRE_DATA_SEQ_MAX_WIDTH

Message ID 1681739243-29375-8-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: sync to OpenSFS branch April 17, 2023 | expand

Commit Message

James Simmons April 17, 2023, 1:47 p.m. UTC
From: Li Dongyang <dongyangli@ddn.com>

Reduce LUSTRE_DATA_SEQ_MAX_WIDTH from ~4B to ~32M
to limit the number of objects under /O/[seq]/d[0..31]
dir on OSTs. This makes the directories stay optimial
for ldiskfs, to avoid going into the largedir/3-level
htree territory.

Check the seq->lcs_width which is a tunable set to
LUSTRE_DATA_SEQ_MAX_WIDTH by default, allow the value
up to IDIF_MAX_OID if a larger seq width is needed.

The seq will rollover when the seq width is exhausted,
the default is LUSTRE_DATA_SEQ_MAX_WIDTH.
For seq >= FID_SEQ_NORMAL objects, the upper limit of
seq width is OBIF_MAX_OID,
For IDIF/MDT0 objects, the upper limit is IDIF_MAX_OID.
The seq FID_SEQ_OST_MDT0 will change to a normal seq after the
rollover.

WC-bug-id: https://jira.whamcloud.com/browse/LU-11912
Lustre-commit: 0ecb2a167c56ffff8 ("LU-11912 ofd: reduce LUSTRE_DATA_SEQ_MAX_WIDTH")
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/38424
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Sergey Cheremencev <scherementsev@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/fid/lproc_fid.c      | 2 +-
 fs/lustre/include/lustre_fid.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/fs/lustre/fid/lproc_fid.c b/fs/lustre/fid/lproc_fid.c
index 8f6a4a8..9ca2814 100644
--- a/fs/lustre/fid/lproc_fid.c
+++ b/fs/lustre/fid/lproc_fid.c
@@ -154,7 +154,7 @@  static ssize_t ldebugfs_fid_width_seq_write(struct file *file,
 
 	spin_lock(&seq->lcs_lock);
 	if (seq->lcs_type == LUSTRE_SEQ_DATA)
-		max = LUSTRE_DATA_SEQ_MAX_WIDTH;
+		max = IDIF_MAX_OID;
 	else
 		max = LUSTRE_METADATA_SEQ_MAX_WIDTH;
 
diff --git a/fs/lustre/include/lustre_fid.h b/fs/lustre/include/lustre_fid.h
index 88a6061..5ebe362 100644
--- a/fs/lustre/include/lustre_fid.h
+++ b/fs/lustre/include/lustre_fid.h
@@ -173,9 +173,9 @@  enum {
 	LUSTRE_METADATA_SEQ_MAX_WIDTH = 0x0000000000020000ULL,
 
 	/*
-	 * This is how many data FIDs could be allocated in one sequence(4B - 1)
+	 * This is how many data FIDs could be allocated in one sequence(32M - 1)
 	 */
-	LUSTRE_DATA_SEQ_MAX_WIDTH = 0x00000000FFFFFFFFULL,
+	LUSTRE_DATA_SEQ_MAX_WIDTH = 0x0000000001FFFFFFULL,
 
 	/*
 	 * How many sequences to allocate to a client at once.