File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ HW_RAM_TOTAL=0
1111HW_RAM_FREE=0
1212HW_SWAP_TOTAL=0
1313HW_SWAP_FREE=0
14+ HW_SLAB_UNRECLAIMABLE=0
1415HW_IB_STATE=( )
1516HW_IB_PHYS_STATE=()
1617HW_IB_RATE=( )
@@ -81,6 +82,8 @@ function nhc_hw_gather_data() {
8182 HW_SWAP_TOTAL=${FIELD[1]}
8283 elif [[ "${FIELD[0]}" = "SwapFree:" ]]; then
8384 HW_SWAP_FREE=${FIELD[1]}
85+ elif [[ "${FIELD[0]}" = "SUnreclaim:" ]]; then
86+ HW_SLAB_UNRECLAIMABLE=${FIELD[1]}
8487 fi
8588 done < /proc/meminfo
8689 else
@@ -328,6 +331,23 @@ function check_hw_mem_free() {
328331 return 0
329332}
330333
334+ # Check amount of Slab unreclaimable against maximum ($1).
335+ function check_hw_slab_unreclaimable() {
336+ local MAXUNRECLAIMABLE=$1
337+
338+ if [[ $HW_RAM_TOTAL -eq 0 ]]; then
339+ nhc_hw_gather_data
340+ fi
341+
342+ nhc_common_parse_size "$MAXUNRECLAIMABLE" MAXUNRECLAIMABLE
343+
344+ if [[ $HW_SLAB_UNRECLAIMABLE -gt $MAXUNRECLAIMABLE ]]; then
345+ die 1 "$FUNCNAME: Slab unreclaimable is too large ($HW_SLAB_UNRECLAIMABLE kB > $MAXUNRECLAIMABLE kB)."
346+ return 1
347+ fi
348+ return 0
349+ }
350+
331351# Check if IB state, phys_state, and rate ($1) all match.
332352function check_hw_ib() {
333353 local STATE="ACTIVE"
You can’t perform that action at this time.
0 commit comments