From: SeongJae Park <sjpark@amazon.com> To: <konrad.wilk@oracle.com>, <roger.pau@citrix.com>, <axboe@kernel.dk> Cc: <sj38.park@gmail.com>, <xen-devel@lists.xenproject.org>, <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>, SeongJae Park <sjpark@amazon.de> Subject: [PATCH 2/2] blkback: Add a module parameter for aggressive pool shrinking duration Date: Wed, 4 Dec 2019 12:34:19 +0100 Message-ID: <20191204113419.2298-3-sjpark@amazon.com> (raw) In-Reply-To: <20191204113419.2298-1-sjpark@amazon.com> From: SeongJae Park <sjpark@amazon.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@amazon.de> Suggested-by: Amit Shah <aams@amazon.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
next prev parent reply index Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-12-04 11:34 [PATCH 0/2] xen/blkback: Aggressively shrink page pools if a memory pressure is detected SeongJae Park 2019-12-04 11:34 ` [PATCH 1/2] " SeongJae Park 2019-12-04 11:34 ` SeongJae Park [this message] 2019-12-04 11:52 ` [Xen-devel] [PATCH 0/2] " Durrant, Paul 2019-12-04 12:09 ` sjpark
Reply instructions: You may reply publically to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20191204113419.2298-3-sjpark@amazon.com \ --to=sjpark@amazon.com \ --cc=axboe@kernel.dk \ --cc=konrad.wilk@oracle.com \ --cc=linux-block@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=roger.pau@citrix.com \ --cc=sj38.park@gmail.com \ --cc=sjpark@amazon.de \ --cc=xen-devel@lists.xenproject.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Linux-Block Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \ linux-block@vger.kernel.org public-inbox-index linux-block Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block AGPL code for this site: git clone https://public-inbox.org/public-inbox.git