#!/usr/bin/ksh curr_fold_threshold=`echo "dw schedp+20"|kdb -script | awk '/schedp+/ {printf "%d\n", "0x"$2}' | tail -1` curr_fold_delta=`echo "dw schedp+44"|kdb -script | awk '/schedp+/ {printf "%d\n", "0x"$2}' | tail -1` curr_normalized=$(( curr_fold_threshold + curr_fold_delta )) curr_smt_mode=`smtctl | awk '/^proc0/ {print $3}'` PROC_TYPE=`lsconf | awk '/PowerPC/ {print $3}'` printf "%-30s: %s in SMT%s\n" "The Power platform is" $PROC_TYPE $curr_smt_mode printf "%-30s: %s %s %s\n" "Kernel values" $curr_fold_threshold $curr_fold_delta $curr_normalized printf "%-30s: %s %s %s\n" "schedo current" `schedo -o vpm_fold_threshold` case $PROC_TYPE in PowerPC_POWER8 ) if [[ curr_smt_mode -eq 8 ]]; then rec_fold_delta=4 rec_fold_threshold=45 else rec_fold_delta=0 rec_fold_threshold=49 fi;; PowerPC_POWER9 ) if [[ curr_smt_mode -eq 8 ]]; then rec_fold_delta=23 rec_fold_threshold=26 elif [[ curr_smt_mode -eq 4 ]]; then rec_fold_delta=13 rec_fold_threshold=36 elif [[ curr_smt_mode -eq 2 ]]; then rec_fold_delta=9 rec_fold_threshold=40 elif [[ curr_smt_mode -eq 1 ]]; then rec_fold_delta=0 rec_fold_threshold=49 fi;; * ) printf "%-30s: %s\n" "Unknown platform, exiting" exit;; esac rec_normalized=$(( rec_fold_threshold + curr_fold_delta )) printf "%-30s: %s %s %s\n" "schedo recommend" "vpm_fold_threshold = $rec_normalized" if [[ curr_fold_threshold -ne rec_fold_threshold ]]; then printf "%-30s: %s %s %s\n" "Recommend" "schedo -o vpm_fold_threshold=$rec_normalized" else printf "%-30s: %s %s\n" "Recommend" "No change. VPM fold threshold already" $rec_normalized fi