lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191204113419.2298-3-sjpark@amazon.com>
Date:   Wed, 4 Dec 2019 12:34:19 +0100
From:   SeongJae Park <sjpark@...zon.com>
To:     <konrad.wilk@...cle.com>, <roger.pau@...rix.com>, <axboe@...nel.dk>
CC:     <sj38.park@...il.com>, <xen-devel@...ts.xenproject.org>,
        <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        SeongJae Park <sjpark@...zon.de>
Subject: [PATCH 2/2] blkback: Add a module parameter for aggressive pool shrinking duration

From: SeongJae Park <sjpark@...zon.de>

As discussed by the previous commit ("xen/blkback: Aggressively shrink
page pools if a memory pressure is detected"), the aggressive pool
shrinking duration should be carefully selected:
``If it is too long, free pages pool shrinking overhead can reduce the
I/O performance.  If it is too short, blkback will not free enough pages
to reduce the memory pressure.``

That said, the proper duration would depends on given configurations and
workloads.  For the reason, this commit allows users to set it via a
module parameter interface.

Signed-off-by: SeongJae Park <sjpark@...zon.de>
Suggested-by: Amit Shah <aams@...zon.de>
---
 drivers/block/xen-blkback/blkback.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index aa1a127093e5..88c011300ee9 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -137,9 +137,13 @@ module_param(log_stats, int, 0644);
 
 /*
  * Once a memory pressure is detected, keep aggressive shrinking of the free
- * page pools for this time (msec)
+ * page pools for this time (milliseconds)
  */
-#define AGGRESSIVE_SHRINKING_DURATION	1
+static int xen_blkif_aggressive_shrinking_duration = 1;
+module_param_named(aggressive_shrinking_duration,
+		xen_blkif_aggressive_shrinking_duration, int, 0644);
+MODULE_PARM_DESC(aggressive_shrinking_duration,
+"Duration to do aggressive shrinking when a memory pressure is detected");
 
 static unsigned long xen_blk_mem_pressure_end;
 
@@ -147,7 +151,7 @@ static unsigned long blkif_shrink_count(struct shrinker *shrinker,
 				struct shrink_control *sc)
 {
 	xen_blk_mem_pressure_end = jiffies +
-		msecs_to_jiffies(AGGRESSIVE_SHRINKING_DURATION);
+		msecs_to_jiffies(xen_blkif_aggressive_shrinking_duration);
 	return 0;
 }
 
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ