Whamcloud - gitweb
LU-9859 libcfs: open code cfs_trace_max_debug_mb() into cfs_trace_set_debug_mb() 29/37829/5
authorMr NeilBrown <neilb@suse.de>
Thu, 12 Mar 2020 19:52:56 +0000 (15:52 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 24 Mar 2020 05:21:07 +0000 (05:21 +0000)
commit721ae5993285a2ac30a20e89079c38df88c134f0
tree90ca1cf7263f98b674cc013d3b52d184f6c165cf
parent8b78a3ffb5220330f41b4fa8576a05c4e017cfb1
LU-9859 libcfs: open code cfs_trace_max_debug_mb() into cfs_trace_set_debug_mb()

This function in used twice.
In libcfs_debug_init() the usage is pointless as
the only place that set libcfs_debug_mb ensures
that it does not exceed the maximum.  So checking
again can never help.

So open-code the small function into the only
other place that it is used - in cfs_trace_set_debug_mb(),
which is used to set libcfs_debug_mb.

HPC machines are being deployed with 24 TiB or more memory.
Change the variables uses to calculate the max_debug_mb
to unsigned long to avoid a potential overflow and change
80 / 100 scaling factors to 4 / 5.

Linux-commit: 5b5df84f3582b0e3a2ff70d49867bc3e03f67502

Change-Id: I497502bb7418e0b3d24b24c507029652bc9a9e55
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/37829
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/debug.c
libcfs/libcfs/linux-tracefile.c
libcfs/libcfs/tracefile.c
libcfs/libcfs/tracefile.h