Skip to content

Commit d428557

Browse files
sourabhjainscoiby
authored andcommitted
Use all available CPUs to collect dump
By default, use all available CPUs to collect the dump instead of just one CPU. This reduces the dump collection time significantly, specially for the systems with very large memory configuration. The graph below show the time reduction in dump collection on large memory system from 4 Hours to 10 Minutes. | 14000 | * | | | | | | 1600 | * | | 1400 | execution Time (Sec) | | 1200 | | | 1000 | | * | 800 | | | * 600 | | * * | ------------------------------------ 1 9 17 25 33 41 Number of Threads System details: Architecture: PowerPC /proc/vmcore size: 3.7T Filter level: 1 Similar tests with different filter levels, 31 and 16, also show significant reduction in time consumption for dump collection. Although the above tests were performed only on the PowerPC architecture, but I think using all CPUs for dump collection will have performance benefits on other architectures too. Note: The `--num-threads` command-line argument is added to the `makedumpfile` core collector only when more than one processing unit is available in the system. This helps to keep the default case (nr_cpus=1) the same. Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
1 parent 77b80ce commit d428557

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

dracut/99kdumpbase/kdump.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ dump_fs() {
147147
case $CORE_COLLECTOR in
148148
*makedumpfile*)
149149
CORE_COLLECTOR=$(echo "$CORE_COLLECTOR" | sed -e "s/-F//g")
150+
THREADS=$(nproc)
151+
if [ "$THREADS" -gt 1 ]; then
152+
CORE_COLLECTOR="$CORE_COLLECTOR --num-threads=$THREADS"
153+
fi
150154
;;
151155
esac
152156

@@ -384,6 +388,13 @@ dump_raw() {
384388
/kdumpscripts/monitor_dd_progress.sh $_src_size_mb &
385389
fi
386390

391+
if echo "$CORE_COLLECTOR" | grep -q makedumpfile; then
392+
THREADS=$(nproc)
393+
if [ "$THREADS" -gt 1 ]; then
394+
CORE_COLLECTOR="$CORE_COLLECTOR --num-threads=$THREADS"
395+
fi
396+
fi
397+
387398
dinfo "saving vmcore"
388399
$CORE_COLLECTOR /proc/vmcore | dd of="$1" bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1
389400
sync

dracut/99kdumpbase/module-setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,7 @@ install() {
10951095
inst "/usr/bin/printf" "/sbin/printf"
10961096
inst "/usr/bin/logger" "/sbin/logger"
10971097
inst "/usr/bin/chmod" "/sbin/chmod"
1098+
inst "/usr/bin/nproc" "/sbin/nproc"
10981099
inst "/usr/bin/dirname" "/sbin/dirname"
10991100
inst "/lib/kdump/kdump-lib-initramfs.sh" "/lib/kdump-lib-initramfs.sh"
11001101
inst "/lib/kdump/kdump-logger.sh" "/lib/kdump-logger.sh"

0 commit comments

Comments
 (0)