Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp177760ybl; Tue, 10 Dec 2019 20:26:35 -0800 (PST) X-Google-Smtp-Source: APXvYqwTVJUGpmNP0GF+4e/8MRhyu3WmI8DGclpCRv4Vd60NVDKvWwPHINNEiV5nejdXtsiBZR+H X-Received: by 2002:a9d:65cf:: with SMTP id z15mr974502oth.238.1576038395609; Tue, 10 Dec 2019 20:26:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576038395; cv=none; d=google.com; s=arc-20160816; b=lIAv0DD5QASoZr4unJPyKX9IUpyAheJucX4SahYPYo5TxiSefXTaZd4pH4C2Up+Ms2 2JxjOiSEP1egjS/VguKWrgyIVQuBlzaR17sx9SiAu/Rm1FrN26h8/8DO8Q1reojfvMkK 0JiodhB7lRIBnFXXryGH7Ms3y7enoEqvBN2kBRgLyrnJu+GnekHDw7LMiJrjUvxOxmIN 4lUozbxO8W44YS1CbOHOutgiqPTfLvSiClw+zVOjB6wBUXM+SohqChmMGP1YYTb6vNa8 BQ4QQX1gTyOOS4v8SMK4u+4mrmasfZdXVXkkYTBJ1ZQpMfyK3gMhrmLBayB+zB35IScA 0lhA== 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=uCFfqgYBUHORRZAXz0u1t9CrHuOIZanYgjOuQc5MI40=; b=s/wzkTEAMbXEENXjfBLl9t4+d8IGQ3g6533U/zzlt4Tcb3Ohe6mBfAZYKO0AsLHQl3 pe60kmH3MCZot7JOQiQtZ7e1kgbIgzq9kaukWWEY8t/vO9S4hGpk+ffazr3sPkIcU4yx carLo4g6AU2OP2jEX+yXKgCvGD9f+osRwqWmkX5SV+UlXFWEsWumhRZP+hwbAnkH5mkx yuWE2wGLFtrai6PxDGCudqyCm6aOHQzV4qg4M769NV7uXlvRcP/O9c5JOqpMeMiqwGVG +LTHXyO2AIY5PPUYdv61WE8+iiycFSxq+5Y9+z2ZjqLGGlOSDFONlMCq6y+hcKnxOx6q R5Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C44Wii17; 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 d22si321054ote.229.2019.12.10.20.26.11; Tue, 10 Dec 2019 20:26:35 -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=C44Wii17; 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 S1726989AbfLKEYx (ORCPT + 99 others); Tue, 10 Dec 2019 23:24:53 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:39096 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbfLKEYx (ORCPT ); Tue, 10 Dec 2019 23:24:53 -0500 Received: by mail-pj1-f67.google.com with SMTP id v93so8398699pjb.6; 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=UpBuo6q28rIaZT4kF7x6xcjSWcDgxBOSKlE2HKjBnOd3vXS9w7D2wgC0h//Cm2glAw EtNwwcWOVOEEyD0x3fvC62FYrtfr12urfE50Fz4WoQlCk4fcCYhp2egHbT23USxjyM/l TC/bChTdbXYkPn7RpTIQDFLEfaVWzWp7aoxX9nfSyI2FZ0q2nQIsqpHTteLR69UUo3mF A/oiuVmEx1oE68GwJI13/7blQ4YOAbN4hlZucfECH6/4zLyqBklUef2kCBGGCcbXtu94 7Gf3hUAjnqwbNRTFl4NofMfpfn2WoGK6u3ZlvdE6HoWJ0NTH3ppEW4pKSaOfOAqNyEmk spjA== X-Gm-Message-State: APjAAAUeBfPQiQ8NPErd5rE5JLRteF9dOqK6Lno1oxZ33i8zthk/ETAy cskCot+ypwRg8N/p7mG9UWc= 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 Cc: SeongJae Park , pdurrant@amazon.com, sjpark@amazon.com, xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 0/2] xenbus/backend: Add a memory pressure handler callback 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 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_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(-) -- 2.17.1