Blame SOURCES/pr155.patch

fabfcd
From e639fe97eabe40445ad6c1308125ce8c2687ec6f Mon Sep 17 00:00:00 2001
fabfcd
From: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
fabfcd
Date: Thu, 7 Apr 2022 16:40:37 -0300
fabfcd
Subject: [PATCH] Increase the value for max_vas_reuse_count
fabfcd
fabfcd
While running tests on PowerVM with 1MB files, it has been noticed a
fabfcd
huge delay when processing the 100th stream.
fabfcd
The penalty for reopening the VAS window is still too high for 100
fabfcd
executions and is being increased to 10000 in order to keep its execution less
fabfcd
than 10% of the time spent executing those 10000 streams.
fabfcd
fabfcd
Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
fabfcd
---
fabfcd
 lib/nx_zlib.c     | 13 ++++++++++++-
fabfcd
 test/nx-zlib.conf |  4 ++--
fabfcd
 2 files changed, 14 insertions(+), 3 deletions(-)
fabfcd
fabfcd
diff --git a/lib/nx_zlib.c b/lib/nx_zlib.c
fabfcd
index fa7000e..b3737a2 100644
fabfcd
--- a/lib/nx_zlib.c
fabfcd
+++ b/lib/nx_zlib.c
fabfcd
@@ -982,7 +982,18 @@ void nx_hw_init(void)
fabfcd
 	nx_config.max_byte_count_current = (1UL<<30);
fabfcd
 	nx_config.max_source_dde_count = MAX_DDE_COUNT;
fabfcd
 	nx_config.max_target_dde_count = MAX_DDE_COUNT;
fabfcd
-	nx_config.max_vas_reuse_count = 100;
fabfcd
+	/** On PowerVM, reopening a VAS window takes 300x the time used to
fabfcd
+	 *  process a single stream with the maximum per job length allowed,
fabfcd
+	 *  causing serious performance issues when max_vas_reuse_count is too
fabfcd
+	 *  low. In order to avoid these issues, it has been decided the
fabfcd
+	 *  average impact of reopening a VAS window should be less than 10% of
fabfcd
+	 *  of the time spent processing max_vas_reuse_count streams at
fabfcd
+	 *  maximum per job length.  That means 3000, which we rounded up.
fabfcd
+	 *  Notice that setting this number too high may impact the performance
fabfcd
+	 *  of multithreaded processes with a massive amount of threads. For
fabfcd
+	 *  those cases, it's recommended to use a lower value in the config
fabfcd
+	 *  file. */
fabfcd
+	nx_config.max_vas_reuse_count = 10000;
fabfcd
 	nx_config.per_job_len = nx_query_job_limits(); /* less than suspend limit */
fabfcd
 	nx_config.strm_def_bufsz = (1024 * 1024); /* affect the deflate fifo_out */
fabfcd
 	nx_config.soft_copy_threshold = 1024; /* choose memcpy or hwcopy */
fabfcd
diff --git a/test/nx-zlib.conf b/test/nx-zlib.conf
fabfcd
index 444d966..cb30c36 100644
fabfcd
--- a/test/nx-zlib.conf
fabfcd
+++ b/test/nx-zlib.conf
fabfcd
@@ -59,5 +59,5 @@ logfile = ./nx.log
fabfcd
 #nx_ratio_s = 100
fabfcd
 
fabfcd
 # Maximum number of times deflateInit/inflateInit can reuse an already-open VAS
fabfcd
-# window
fabfcd
-# max_vas_reuse_count = 100
fabfcd
+# window. Default: 10000
fabfcd
+# max_vas_reuse_count = 10000