From patchwork Wed Dec 11 04:24:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11284223 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1279E14DB for ; Wed, 11 Dec 2019 04:26:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E1C7E2073B for ; Wed, 11 Dec 2019 04:26:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C44Wii17" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1C7E2073B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ietYW-0004pJ-6G; Wed, 11 Dec 2019 04:24:56 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ietYU-0004pA-LA for xen-devel@lists.xenproject.org; Wed, 11 Dec 2019 04:24:54 +0000 X-Inumbo-ID: 2dc4b528-1bce-11ea-b6f1-bc764e2007e4 Received: from mail-pj1-x1043.google.com (unknown [2607:f8b0:4864:20::1043]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2dc4b528-1bce-11ea-b6f1-bc764e2007e4; Wed, 11 Dec 2019 04:24:53 +0000 (UTC) Received: by mail-pj1-x1043.google.com with SMTP id ca19so8393406pjb.8 for ; Tue, 10 Dec 2019 20:24:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uCFfqgYBUHORRZAXz0u1t9CrHuOIZanYgjOuQc5MI40=; b=C44Wii177/uMXj8Mmpff75pIIpPmcFQwgaPEBWdhU7hQoVs+n+MJmNVNXMIXxLKrDW 9edlLaBI8+4/iTI92+z4856xb/GnEtBWETNGkQoETSY1ukQfDLyf1VBC8KJYkxgqNnsy RToZcu66XFgKlic4ml2Myo0UmaR0d9p7fz0H3FFXyqx6cIbs6ak8F+6PaafLfnHpEndi VE2qIisgz8HptNV+CctKjKEmv1VgmuSPN/AzM+ZHKdr6OYdzt8J8iHX9wmiYNQ8Kd8eT 9wBkfOh2n0qOb//QX1kgNqn6infiNH2mbzaHgYI6sAU7u1sGZ6T/ncUH97nJASNvkNMn +jaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uCFfqgYBUHORRZAXz0u1t9CrHuOIZanYgjOuQc5MI40=; b=Ij4pHvk6fL0ngNeDG3LW9WZjyJuEDwT6uh4rNua4XKq7yOhvnidBokx/Bbld4IrbIP gwcVoNYQSJWiHoynSGQsozhlIzWrfWIHFID19XsCtk6paitXJ7dUVqCmsTiKnu7EuypH KmIWuXu5NbEMntAh7oVMdnRMSqHUZje+tza1Zmj8BQtk9f7uHr5lP+lL0b3iPgtPoha5 oBbm9EqmRzI9RBfior0Vo2bmNLF1dEFBo+fW4I57ZYCIcTbdBi41+H7/FyXPT9fpsKl/ sEuI4AIwJ83Dukn2dwHO2W405VyP11wBPoq/2Gt0q9AX0t1lORjErYCkiheHdn/a/D4F UT8A== X-Gm-Message-State: APjAAAVNe/9ONgtBpbgB3mbb1lNvN4RHztrEMXPEiYXhAqdR6LDCytqL 1LnHBcAHXrRwH6NaTH/vir8= X-Google-Smtp-Source: APXvYqwuDHvHi0kuhv5k7XhTYVm0P1tUAaFRdqch3kOwlNDt+3YGwFscAsMaal2g+E/WWOX862OunA== X-Received: by 2002:a17:902:9a94:: with SMTP id w20mr1095998plp.54.1576038292830; Tue, 10 Dec 2019 20:24:52 -0800 (PST) Received: from localhost.localdomain ([12.176.148.120]) by smtp.gmail.com with ESMTPSA id z23sm586738pgj.43.2019.12.10.20.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 20:24:51 -0800 (PST) From: SeongJae Park X-Google-Original-From: SeongJae Park To: jgross@suse.com, axboe@kernel.dk, konrad.wilk@oracle.com, roger.pau@citrix.com Date: Wed, 11 Dec 2019 04:24:25 +0000 Message-Id: <20191211042428.5961-1-sjpark@amazon.de> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v6 0/2] xenbus/backend: Add a memory pressure handler callback X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: sjpark@amazon.com, pdurrant@amazon.com, SeongJae Park , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, xen-devel@lists.xenproject.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Granting pages consumes backend system memory. In systems configured with insufficient spare memory for those pages, it can cause a memory pressure situation. However, finding the optimal amount of the spare memory is challenging for large systems having dynamic resource utilization patterns. Also, such a static configuration might lack flexibility. To mitigate such problems, this patchset adds a memory reclaim callback to 'xenbus_driver' (patch 1) and use it to mitigate the problem in 'xen-blkback' (patch 2). The third patch is a trivial cleanup of variable names. Base Version ------------ This patch is based on v5.4. A complete tree is also available at my public git repo: https://github.com/sjp38/linux/tree/blkback_squeezing_v6 Patch History ------------- Changes from v5 (https://lore.kernel.org/linux-block/20191210080628.5264-1-sjpark@amazon.de/) - Wordsmith the commit messages (suggested by Roger Pau Monné) - Change the reclaim callback return type (suggested by Roger Pau Monné) - Change the type of the blkback squeeze duration variable (suggested by Roger Pau Monné) - Add a patch for removal of unnecessary static variable name prefixes (suggested by Roger Pau Monné) - Fix checkpatch.pl warnings Changes from v4 (https://lore.kernel.org/xen-devel/20191209194305.20828-1-sjpark@amazon.com/) - Remove domain id parameter from the callback (suggested by Juergen Gross) - Rename xen-blkback module parameter (suggested by Stefan Nuernburger) Changes from v3 (https://lore.kernel.org/xen-devel/20191209085839.21215-1-sjpark@amazon.com/) - Add general callback in xen_driver and use it (suggested by Juergen Gross) Changes from v2 (https://lore.kernel.org/linux-block/af195033-23d5-38ed-b73b-f6e2e3b34541@amazon.com) - Rename the module parameter and variables for brevity (aggressive shrinking -> squeezing) Changes from v1 (https://lore.kernel.org/xen-devel/20191204113419.2298-1-sjpark@amazon.com/) - Adjust the description to not use the term, `arbitrarily` (suggested by Paul Durrant) - Specify time unit of the duration in the parameter description, (suggested by Maximilian Heyne) - Change default aggressive shrinking duration from 1ms to 10ms - Merge two patches into one single patch SeongJae Park (2): xenbus/backend: Add memory pressure handler callback xen/blkback: Squeeze page pools if a memory pressure is detected drivers/block/xen-blkback/blkback.c | 23 +++++++++++++++-- drivers/block/xen-blkback/common.h | 1 + drivers/block/xen-blkback/xenbus.c | 3 ++- drivers/xen/xenbus/xenbus_probe_backend.c | 31 +++++++++++++++++++++++ include/xen/xenbus.h | 1 + 5 files changed, 56 insertions(+), 3 deletions(-)