From 63691d6734d575a03bc1354b205dd71019fb1d82 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Fri, 26 Jun 2020 00:00:00 -0500 Subject: [PATCH] top: raise the amount by which top's stat buffer grows We won't go as far as the merge request shown below in increasing buffer size, but we'll reduce substantially total iterations while growing it to achieve one read. [ and this seems in line with what was recently done ] [ to accommodate the massively parallel environments ] [ thru 2 abreast ('4') and combined cpus ('!') modes ] Reference(s: https://gitlab.com/procps-ng/procps/-/merge_requests/105 Signed-off-by: Jim Warner --- top/top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/top/top.c b/top/top.c index cc6f4f0c..3dc55a6b 100644 --- a/top/top.c +++ b/top/top.c @@ -2512,7 +2512,7 @@ static void cpus_refresh (void) { rewind(fp); fflush(fp); - #define buffGRW 1024 + #define buffGRW 8192 /* we slurp in the entire directory thus avoiding repeated calls to fgets, especially in a massively parallel environment. additionally, each cpu line is then frozen in time rather than changing until we get around to