Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp961312ybl; Wed, 11 Dec 2019 10:11:38 -0800 (PST) X-Google-Smtp-Source: APXvYqxXXI4OJnoKc7MU1l4QsOQNt7VKBVc4zxiOZ2EXiN3Y45y0CHrOL0ldSNCqRh7JVkri+0Oa X-Received: by 2002:aca:f495:: with SMTP id s143mr3674657oih.118.1576087898357; Wed, 11 Dec 2019 10:11:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576087898; cv=none; d=google.com; s=arc-20160816; b=RdAxerxoLW65X/vni+9KZHt1YtKAJmhsmOD8u8ALkPRl+aQ42OuyaQRq89gESL3p+x XiSq7noYkKy++9ucvojPayo9YFvQRgeYP4NZVvb/AS78etX/5qM9gi48fvbyFHZr+YgM 1WNqjDjy5zVN4SCTPYXN0L2GF5bI+7fmru3hQiTAdHXx1GVSqVXn5XB1inswyoscs+6n +qDkaRvKEYomUlmq14adYiDjVKdDMeQ+OADqXkppybbHWBndXzRSZVYfS9548zUShGO5 dvoXGyCz32cbdj4lws4IE8+zcnud8iE4JCTZrrOTeyD81Nmx0kiV8gcR+yODJSy564nb Wdmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mc5ORNKDsv0ygGReB4brTZGP+nxF11a/con+3NutTy4=; b=tgTQGFJOHl7WCpmJfSLnkK1H4WKzALEEazwhOOeIHyrN1aZYkJ8vZNjhSsAIA3jvFD eQKBPSMlBfWf+Hr5f6zwyBvfs7NQXVHxyKUH0menC5nhB1RjBorUVcSP/9aboBrVpZVv CIgk3dIM0/t2Azp9t1A7xUn3ORX1q144oaC0qsryA3IxNLNC8h+03EP76RCfstip7rIF cUCqNlGbWRMRgDlzj7rp7tRgwSYA+vOIQnepR+khvdsTJxH8MD3pOuPGEoPX2z4m2fqe Fj6/J/EBVKSMRLVQoTklCQpV0aGEqTwV5CZLTDh/o4Lmr9bQwUImfqVkO1cN1aRUMfIo 1gFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y79caoQ+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c9si1506357otr.233.2019.12.11.10.11.25; Wed, 11 Dec 2019 10:11:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y79caoQ+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731155AbfLKSKi (ORCPT + 99 others); Wed, 11 Dec 2019 13:10:38 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45978 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbfLKSKh (ORCPT ); Wed, 11 Dec 2019 13:10:37 -0500 Received: by mail-pf1-f195.google.com with SMTP id 2so2173839pfg.12; Wed, 11 Dec 2019 10:10:36 -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=mc5ORNKDsv0ygGReB4brTZGP+nxF11a/con+3NutTy4=; b=Y79caoQ+lf7odw5APsp3kG+n/VzcsE2Qqxe+syQlgY/qPzHq6ZuRTkiyKhd6DRW3Ux f4D/PUQOZcZY+iqmcLRNz3NnTUHT7PfjJQBcLCnI2aqkwYC64sKRpzJdOHX7b974Fy+x vxhGhp7bD2wQgNDZqFK9859BBc+84xXdvvvgdiGw6b5OUf1XDwn5eIUu3Nd+OLcaHVXu eRQr7P/kICKCCL5Wa5S4U2wDcXekrBpZXOQ4jN149MsLmob8X+xfSLm6HCI8UNCzgpZ7 XA23ImjbBjjHw/kDa///ygXqgIGoJ+g+oRi7pYN8mJ16gu5Nfl1yCDGyEiwtZ/QuogJT hYgg== 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=mc5ORNKDsv0ygGReB4brTZGP+nxF11a/con+3NutTy4=; b=Yb5Qt1zwc71JBvCIcXWiuhba23v8PuD/fxoM74wJDETM017CFXD2CSaBmPYxoXxGNM AdUv6Di7ZzWBJv/tT+hhPblHYnVkD0vBIsenvuK+rfanJBVcKrNUWl8myeK21P/dqp1U VINJ7V20EXdU4EisYc3mEDtXTgh6hNjUlspBnr7FSsvNGFPnD9SF8fW9z8E00PjioHdP Jr0g72ss4mRr/Vs6Qp9qUk7c27zwLddkOf7zTiHF7ZWZEufthhd6uApTgGeKhW+AP0AO fNDn3p8gM51buRPE0I3PUZhOGgpK1VGV10yOkbg97N5ahsAOvA+5rTWveVo/WEgXCNjw l6DQ== X-Gm-Message-State: APjAAAXUEcjA0v9UMbok9YLbomlUX0clnUVZhCVz0su++tQFUf66oMM9 eeZ/UrAGU01rWRq+GQG4Okk= X-Received: by 2002:a63:4723:: with SMTP id u35mr5415175pga.194.1576087836383; Wed, 11 Dec 2019 10:10:36 -0800 (PST) Received: from localhost.localdomain (campus-094-212.ucdavis.edu. [168.150.94.212]) by smtp.gmail.com with ESMTPSA id x33sm3552651pga.86.2019.12.11.10.10.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 10:10:35 -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 Cc: SeongJae Park , pdurrant@amazon.com, sjpark@amazon.com, sj38.park@gmail.com, xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 0/2] xenbus/backend: Add a memory pressure handler callback Date: Wed, 11 Dec 2019 18:10:13 +0000 Message-Id: <20191211181016.14366-1-sjpark@amazon.de> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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_v7 Patch History ------------- Changes from v6 (https://lore.kernel.org/linux-block/20191211042428.5961-1-sjpark@amazon.de/) - Remove more unnecessary prefixes (suggested by Roger Pau Monné) - Constify a variable (suggested by Roger Pau Monné) - Rename 'reclaim' into 'reclaim_memory' (suggested by Roger Pau Monné) - More wordsmith of the commit message (suggested by Roger Pau Monné) 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(-) -- 2.17.1