From: Qian Yingjin Date: Wed, 16 Jan 2019 02:13:20 +0000 (+0800) Subject: LU-11526 rpc: support maximum 64MB I/O RPC X-Git-Tag: 2.12.54~29 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=1a9be0046b1f1772d3f934c2146dc5233c391377 LU-11526 rpc: support maximum 64MB I/O RPC On newer systems, some block drivers allow max_hw_sector_kb to be up to 65536KB (64MB) to the underlying storage. To maximize driver efficiency, Lustre should also have bump up maximum I/O RPC size to 64MB. Clamp max_read_ahead_whold_mb not to exceed max_read_ahead_per_file_mb Signed-off-by: Qian Yingjin Change-Id: Icbf78742f8210d82dc310af7d05b7c32b93af34f Reviewed-on: https://review.whamcloud.com/34042 Reviewed-by: Andreas Dilger Reviewed-by: Patrick Farrell Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index 7fe6619..4fd6440 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -76,7 +76,7 @@ * value. The client is free to limit the actual RPC size for any bulk * transfer via cl_max_pages_per_rpc to some non-power-of-two value. * NOTE: This is limited to 16 (=64GB RPCs) by IOOBJ_MAX_BRW_BITS. */ -#define PTLRPC_BULK_OPS_BITS 4 +#define PTLRPC_BULK_OPS_BITS 6 #if PTLRPC_BULK_OPS_BITS > 16 #error "More than 65536 BRW RPCs not allowed by IOOBJ_MAX_BRW_BITS." #endif diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 6139bf3..91eb088 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -485,10 +485,15 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, sbi->ll_dt_exp->exp_connect_data = *data; /* Don't change value if it was specified in the config log */ - if (sbi->ll_ra_info.ra_max_read_ahead_whole_pages == -1) + if (sbi->ll_ra_info.ra_max_read_ahead_whole_pages == -1) { sbi->ll_ra_info.ra_max_read_ahead_whole_pages = max_t(unsigned long, SBI_DEFAULT_READAHEAD_WHOLE_MAX, (data->ocd_brw_size >> PAGE_SHIFT)); + if (sbi->ll_ra_info.ra_max_read_ahead_whole_pages > + sbi->ll_ra_info.ra_max_pages_per_file) + sbi->ll_ra_info.ra_max_read_ahead_whole_pages = + sbi->ll_ra_info.ra_max_pages_per_file; + } err = obd_fid_init(sbi->ll_dt_exp->exp_obd, sbi->ll_dt_exp, LUSTRE_SEQ_METADATA); diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 3eae25f..6714436 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -2267,12 +2267,12 @@ static void osd_conf_get(const struct lu_env *env, */ param->ddp_inodespace = PER_OBJ_USAGE; /* - * EXT_INIT_MAX_LEN is the theoretical maximum extent size (32k blocks - * = 128MB) which is unlikely to be hit in real life. Report a smaller - * maximum length to not under count the actual number of extents - * needed for writing a file. + * EXT_INIT_MAX_LEN is the theoretical maximum extent size (32k blocks + * is 128MB) which is unlikely to be hit in real life. Report a smaller + * maximum length to not under-count the actual number of extents + * needed for writing a file if there are sub-optimal block allocations. */ - param->ddp_max_extent_blks = EXT_INIT_MAX_LEN >> 2; + param->ddp_max_extent_blks = EXT_INIT_MAX_LEN >> 1; /* worst-case extent insertion metadata overhead */ param->ddp_extent_tax = 6 * LDISKFS_BLOCK_SIZE(sb); param->ddp_mntopts = 0; diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 1714bdb..8f707a9 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -1087,22 +1087,35 @@ run_test 27b "Reacquire MGS lock after failover" test_28A() { # was test_28 setup_noconfig - TEST="llite.$FSNAME-*.max_read_ahead_whole_mb" - PARAM="$FSNAME.llite.max_read_ahead_whole_mb" - ORIG=$($LCTL get_param -n $TEST) - FINAL=$(($ORIG + 1)) - set_persistent_param_and_check client "$TEST" "$PARAM" $FINAL - FINAL=$(($FINAL + 1)) - set_persistent_param_and_check client "$TEST" "$PARAM" $FINAL + + local TEST="llite.$FSNAME-*.max_read_ahead_whole_mb" + local PARAM="$FSNAME.llite.max_read_ahead_whole_mb" + local orig=$($LCTL get_param -n $TEST) + local max=$($LCTL get_param -n \ + llite.$FSNAME-*.max_read_ahead_per_file_mb) + + orig=${orig%%.[0-9]*} + max=${max%%.[0-9]*} + echo "ORIG:$orig MAX:$max" + [[ $max -le $orig ]] && orig=$((max - 3)) + echo "ORIG:$orig MAX:$max" + + local final=$((orig + 1)) + + set_persistent_param_and_check client "$TEST" "$PARAM" $final + final=$((final + 1)) + set_persistent_param_and_check client "$TEST" "$PARAM" $final umount_client $MOUNT || error "umount_client $MOUNT failed" mount_client $MOUNT || error "mount_client $MOUNT failed" - RESULT=$($LCTL get_param -n $TEST) - if [ $RESULT -ne $FINAL ]; then - error "New config not seen: wanted $FINAL got $RESULT" + + local result=$($LCTL get_param -n $TEST) + + if [ $result -ne $final ]; then + error "New config not seen: wanted $final got $result" else - echo "New config success: got $RESULT" + echo "New config success: got $result" fi - set_persistent_param_and_check client "$TEST" "$PARAM" $ORIG + set_persistent_param_and_check client "$TEST" "$PARAM" $orig cleanup || error "cleanup failed with rc $?" } run_test 28A "permanent parameter setting" @@ -1240,6 +1253,8 @@ test_30a() { mount_client $MOUNT || error "mount_client $MOUNT failed" FINAL=$($LCTL get_param -n $TEST) echo "deleted (default) value=$FINAL, orig=$ORIG" + ORIG=${ORIG%%.[0-9]*} + FINAL=${FINAL%%.[0-9]*} # assumes this parameter started at the default value [ "$FINAL" -eq "$ORIG" ] || fail "Deleted value=$FINAL, orig=$ORIG"