From patchwork Tue Dec 10 08:06:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11281631 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 3483914B7 for ; Tue, 10 Dec 2019 08:07:37 +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 10ECB206D5 for ; Tue, 10 Dec 2019 08:07:37 +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="nWtyrFvD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 10ECB206D5 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 1ieaXd-0002Ph-6f; Tue, 10 Dec 2019 08:06:45 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ieaXc-0002Pa-EX for xen-devel@lists.xenproject.org; Tue, 10 Dec 2019 08:06:44 +0000 X-Inumbo-ID: 00b75f68-1b24-11ea-a914-bc764e2007e4 Received: from mail-wr1-x442.google.com (unknown [2a00:1450:4864:20::442]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 00b75f68-1b24-11ea-a914-bc764e2007e4; Tue, 10 Dec 2019 08:06:43 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id c9so18888494wrw.8 for ; Tue, 10 Dec 2019 00:06:43 -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; bh=TrPkwEXfKMcmBJRMNstq7uxjKx3WNx+bbydVyI6MWHE=; b=nWtyrFvDAYkYyZJFWyDb04U2iRVuCXLIWSsQVgMM5vtBaveIFSiKAZTL6II3BjWL/9 Uuhx1xzzjRAmkyflJ9d5X1fHwm6+s+DnJqvbNCWUFhjLVOYjica5dgr2OHwnQHJuneIT 9JpF05dCR+CcHLB1XhsCcYIITeIZWH2vSgx0KeUxqcOSg24KVR5nVx+ZZnFP3aLm9lkB dCdKYSznWWUsHPwyT7P6FRTyJ7sh7Ob+v7m+z0kh4s8feYBndiWNz6QvofqcfnI6LCnT LO4cZYp9ZGbyGVmxEy21FYfBEdDxSs197KtaSInF/iHLC2qPnc5hu2krrTf2Tz4w9Udk CSMA== 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; bh=TrPkwEXfKMcmBJRMNstq7uxjKx3WNx+bbydVyI6MWHE=; b=o24kHuNzj89KCkU8hlVmsaqerCxLOLA80yXcVXMdF9onJFIKK0RJQCBRKPdYPhClJy 5klCBUWb+s93iOAXd5lHxf54PhUPyHxD6eD2toA0bIJLfe9KjXnmUVKevtlTZASu37UN tFahXgijOrZbFNMy38FPw9WbH9AIXiIPhigdZy2apo8X5T3VvfxYShATep3WxxOeLq0t 2nCSWpCAISmHMFxtcVx61wethx1hRTLRdPt1otE96C9i9ZjuLYHJmvW6XLFN856ZHqel zuXEOAh30SQGpdtxoZqfLfWzQqI+XdrVekqa6RvYsCpvdnEhkUqHVXa5LziKscStUqFO iTnw== X-Gm-Message-State: APjAAAVWtRug8vOOXk0DwmKagqt/9uvmzm7YH9cWWbBtQWbcnXC0e2Zt WEstiOws+caOrEG/XOoiQXs= X-Google-Smtp-Source: APXvYqwvF9vb1Pg/03dTB9bQnN2IbN1gpJnIMJTJQB2WBT2IvDLxvGQ+qQaE01Fk2ySzFRrDqJNniQ== X-Received: by 2002:adf:ef92:: with SMTP id d18mr1570233wro.234.1575965202797; Tue, 10 Dec 2019 00:06:42 -0800 (PST) Received: from localhost.localdomain (x2f7fae7.dyn.telefonica.de. [2.247.250.231]) by smtp.gmail.com with ESMTPSA id a16sm2342587wrt.37.2019.12.10.00.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 00:06:42 -0800 (PST) From: SeongJae Park X-Google-Original-From: SeongJae Park To: sjpark@amazon.com Date: Tue, 10 Dec 2019 08:06:26 +0000 Message-Id: <20191210080628.5264-1-sjpark@amazon.de> X-Mailer: git-send-email 2.17.1 Subject: [Xen-devel] [PATCH v5 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: axboe@kernel.dk, sj38.park@gmail.com, konrad.wilk@oracle.com, pdurrant@amazon.com, SeongJae Park , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, xen-devel@lists.xenproject.org, roger.pau@citrix.com MIME-Version: 1.0 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 a 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). 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_v5 Patch History ------------- Changes from v4 (https://lore.kernel.org/xen-devel/20191209194305.20828-1-sjpark@amazon.com/) - Remove domain id parameter from the callback (suggested by Jergen Gross) 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(-)