Skip to content

Commit ddad2d0

Browse files
fixup
1 parent 66d9579 commit ddad2d0

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

src/util/shmem/fd_shmem_cfg

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55

66
SHMEM_PATH="${FD_SHMEM_PATH:-/mnt/.fd}"
77

8-
ALL_TYPES="gigantic huge normal"
8+
ALL_TYPES="gigantic huge"
99

1010
# Disabling SC2128, more context here -> https://stackoverflow.com/questions/35006457/choosing-between-0-and-bash-source
1111
#shellcheck disable=SC2128
1212
BIN=$(dirname -- "$BASH_SOURCE")
1313
NUMA_CNT=`$BIN/fd_shmem_ctl numa-cnt --log-path "" 2> /dev/null`
1414

1515
get_page_size() {
16-
if [ "$1" = "normal" ]; then
17-
echo 4096
1816
elif [ "$1" = "huge" ]; then
1917
echo 2097152
2018
elif [ "$1" = "gigantic" ]; then
@@ -100,16 +98,7 @@ init() {
10098
# system DRAM (in the proc/meminfo total memory sense) for maximum
10199
# flexibility. Since the pages themselves are large, the number of
102100
# inodes required in the mount is still quite small practically.
103-
# For normal pages, we need to use a tmpfs.
104101
try_defrag_memory 2> /dev/null > /dev/null
105-
if [ "$t" = "normal" ]; then
106-
mount -v -t tmpfs tmpfs $MNT_PATH
107-
if [ "$?" != "0" ]; then
108-
echo "init $1 $2 $3: fail, mount failed"
109-
echo "Do $0 help for help"
110-
exit 1
111-
fi
112-
else
113102
msz=`awk '/^MemTotal:/ {print $2}' /proc/meminfo` # In KiB
114103
psz=`get_page_size $t`
115104
msz=$((psz*((1024*msz)/psz))) # Round down to whole pages to be on safe side
@@ -172,15 +161,6 @@ fini() {
172161

173162
query() {
174163
echo ""
175-
for t in $ALL_TYPES; do
176-
if [ "$t" != "normal" ]; then
177-
echo "$t pages:"
178-
for((n=0;n<NUMA_CNT;n++)); do
179-
echo -e "\tnuma $n: `get_page_total $t $n` total, `get_page_free $t $n` free"
180-
done
181-
echo ""
182-
fi
183-
done
184164
if [ -d $SHMEM_PATH ]; then
185165
echo "FD_SHMEM_PATH=$SHMEM_PATH"
186166
echo ""
@@ -204,12 +184,6 @@ alloc() {
204184
TYPE=$2
205185
NUMA=$3
206186

207-
if [ "$TYPE" = "normal" ]; then
208-
echo "alloc $1 $2 $3: fail, normal pages do not require explicit allocation"
209-
echo "Do $0 help for help"
210-
exit 1
211-
fi
212-
213187
T=`get_page_total $TYPE $NUMA`
214188
F=`get_page_free $TYPE $NUMA`
215189
if [ "$T" != "$F" ]; then
@@ -302,12 +276,11 @@ while [ $# -gt 0 ]; do
302276
echo ""
303277
echo " alloc [PAGE_CNT] [PAGE_TYPE] [NUMA_NODE]"
304278
echo " - Reserve [PAGE_CNT] [PAGE_TYPE] DRAM-backed pages on numa [NUMA_NODE]"
305-
echo " systemwide. Does not apply to normal pages."
279+
echo " systemwide."
306280
echo " - This likely needs to run as a superuser or with sudo."
307281
echo ""
308282
echo " free [PAGE_TYPE] [NUMA_NODE]"
309283
echo " - Equivalent to alloc 0 [PAGE_TYPE] [NUMA_NODE]."
310-
echo " - Does not apply to normal pages."
311284
echo " - This likely needs to run as a superuser or with sudo."
312285
echo ""
313286
echo " query"

0 commit comments

Comments
 (0)