From patchwork Tue Sep 18 06:38:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nadav Amit X-Patchwork-Id: 10603787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0DCC6161F for ; Tue, 18 Sep 2018 06:40:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0BC52A1C2 for ; Tue, 18 Sep 2018 06:40:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E49D22A22D; Tue, 18 Sep 2018 06:40:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 796C12A1C2 for ; Tue, 18 Sep 2018 06:40:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C1208E0001; Tue, 18 Sep 2018 02:40:23 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 07E158E0005; Tue, 18 Sep 2018 02:40:23 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E12868E0001; Tue, 18 Sep 2018 02:40:22 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by kanga.kvack.org (Postfix) with ESMTP id 81B078E0003 for ; Tue, 18 Sep 2018 02:40:22 -0400 (EDT) Received: by mail-pg1-f197.google.com with SMTP id h3-v6so562142pgc.8 for ; Mon, 17 Sep 2018 23:40:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:mime-version; bh=wGTP/hDT/Rjo8Dv7ko3fhUMqBfO2BLsOrba5WuGXdJs=; b=JKOHcC1zGpUM6pVpQ3BWVWKycFIpwCbHs0UuibzyhasWKsKwjq//IYLKPzTSLj6EtI b4anTTFx/tupg0VCmf3viBUo/3vLiHDOND2S4LF6EL/gtUVXGtF/gTAGBsDQkQCdebHk EZlv8B3WZyUb/eHO/hpo37scqZSVYVNx8nKOZvcQrk829tple4G9gH/h1jJNw8EMeS7Z gnL3+7x2jkWK4a9b98q/88nt9pxD33c8vPzy6mJh5n3YFaLmCkaXB0PzvrZ1A2zM5iSD QMXvnDMOEg3T8y71Gr4G9O9ifPDCZ1auOcq9lA35c37se/zgztEpN5DeIN7FuTTnOCD5 SNNg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of namit@vmware.com designates 208.91.0.190 as permitted sender) smtp.mailfrom=namit@vmware.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=vmware.com X-Gm-Message-State: APzg51AoUPce4FmgqYhawVs8Do654B32wv5md+RrMn61jYpUcQ2+OPfV zLOUgKXTL3vHsH2ObpGgfUXWAaFgSMye/pPf9rj8ZNiMMOQpPiEwNQYkzjPeQNYpGjsrzRxAHbw aevGobDEv5HriQ+mVOxT0vPqf7Yiov9+DaB4KPd/5wL25s92ZciuII4mb5YbT84IaEw== X-Received: by 2002:a63:d10c:: with SMTP id k12-v6mr26805536pgg.49.1537252822177; Mon, 17 Sep 2018 23:40:22 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbj6rsHNLUNrdkzCAXIrClC/dy9XaoSZQnPTP7MW0eBPCXWe0fGZFg7Z0WgZnIii0ErOABh X-Received: by 2002:a63:d10c:: with SMTP id k12-v6mr26805439pgg.49.1537252820539; Mon, 17 Sep 2018 23:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537252820; cv=none; d=google.com; s=arc-20160816; b=iHfiNKadTmrOI/pGynyiMUdWCP6Q/QfmpGn6WzI/qm0zF9akCqxIk4hopaEbWZHLi3 9IumWhDw7weERQc7pQc2k3vLwcGVpP9o8YsgcYBH2A39/q57goV9j9OvyA8eHE3R7dld ICSRLxMQ62I7o7/YJjiQMkKE8qi5XB5/egsaQzrGA7wAd/9oGxQ8ZpYCM3GBdU53MVcL IQN8Wa6lcbdvrnMWzi6+hkmzf6nSJPmVwqmQ0ERmeA3O5bigLOwRD2CpEFS/r2FIUrGD DiSkDsDoDIRMXFtjKyOoa9DxRgA0X8BGKIZvUELCDuxVoeC0Fn3TGJrlW2rNUbTMiEee fwSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:subject:cc:to:from; bh=wGTP/hDT/Rjo8Dv7ko3fhUMqBfO2BLsOrba5WuGXdJs=; b=gnx8HuVWg/AOquC+LHbuY6kA1vvi/iGHssU26kN8xny/EkM28/YaWNi+muSJWmtFy5 AdhYcgaGKmsxBe5Qpc7RctD363KQFv5Z9hkXo9TbTqbyPCipkwzuSTjvMLUXoZM1wBn7 WQdXbazH1TGSkhLzwFMlD7TQWY6tR5ywAFj8xXTKOtsRfvyo2n4EhgKwd58UaMoB30gj devJRPfvoDtS5bnDO7kvEkpHwpxMGtTxf5hYt8fnsf8/Pfb+XxoFmFYvSPtixReBRPzS fSfiZEIYdH3wxuz6t3lbZ8oI/gSf8mNAsX1EqPHUYYqdOqN0KG7AGPcjmU4xL3c+DupG 0Hhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of namit@vmware.com designates 208.91.0.190 as permitted sender) smtp.mailfrom=namit@vmware.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: from EX13-EDG-OU-002.vmware.com (ex13-edg-ou-002.vmware.com. [208.91.0.190]) by mx.google.com with ESMTPS id f8-v6si17201045pgl.383.2018.09.17.23.40.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Sep 2018 23:40:20 -0700 (PDT) Received-SPF: pass (google.com: domain of namit@vmware.com designates 208.91.0.190 as permitted sender) client-ip=208.91.0.190; Authentication-Results: mx.google.com; spf=pass (google.com: domain of namit@vmware.com designates 208.91.0.190 as permitted sender) smtp.mailfrom=namit@vmware.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Mon, 17 Sep 2018 23:39:55 -0700 Received: from sc2-haas01-esx0118.eng.vmware.com (sc2-haas01-esx0118.eng.vmware.com [10.172.44.118]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 8DE6C40840; Mon, 17 Sep 2018 23:40:19 -0700 (PDT) From: Nadav Amit To: Arnd Bergmann , Greg Kroah-Hartman CC: , Nadav Amit , Xavier Deguillard , "Michael S. Tsirkin" , Jason Wang , , Subject: [PATCH 00/19] vmw_balloon: compaction, shrinker, 64-bit, etc. Date: Mon, 17 Sep 2018 23:38:34 -0700 Message-ID: <20180918063853.198332-1-namit@vmware.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-002.vmware.com: namit@vmware.com does not designate permitted sender hosts) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP This patch-set adds the following enhancements to the VMware balloon driver: 1. Balloon compaction support. 2. Report the number of inflated/deflated ballooned pages through vmstat. 3. Memory shrinker to avoid balloon over-inflation (and OOM). 4. Support VMs with memory limit that is greater than 16TB. 5. Faster and more aggressive inflation. To support compaction we wish to use the existing infrastructure. However, we need to make slight adaptions for it. We add a new list interface to balloon-compaction, which is more generic and efficient, since it does not require as many IRQ save/restore operations. We leave the old interface that is used by the virtio balloon. Big parts of this patch-set are cleanup and documentation. Patches 1-13 simplify the balloon code, document its behavior and allow the balloon code to run concurrently. The support for concurrency is required for compaction and the shrinker interface. For documentation we use the kernel-doc format. We are aware that the balloon interface is not public, but following the kernel-doc format may be useful one day. Cc: Xavier Deguillard Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: linux-mm@kvack.org Cc: virtualization@lists.linux-foundation.org Nadav Amit (18): vmw_balloon: handle commands in a single function. vmw_balloon: unify commands tracing and stats vmw_balloon: merge send_lock and send_unlock path vmw_balloon: simplifying batch access vmw_balloon: remove sleeping allocations vmw_balloon: change batch/single lock abstractions vmw_balloon: treat all refused pages equally vmw_balloon: refactor change size from vmballoon_work vmw_balloon: simplify vmballoon_send_get_target() vmw_balloon: stats rework vmw_balloon: rework the inflate and deflate loops vmw_balloon: general style cleanup vmw_balloon: add reset stat mm/balloon_compaction: suppress allocation warnings mm/balloon_compaction: list interfaces vmw_balloon: compaction support vmw_balloon: memory shrinker vmw_balloon: split refused pages Xavier Deguillard (1): vmw_balloon: support 64-bit memory limit drivers/misc/Kconfig | 1 + drivers/misc/vmw_balloon.c | 2181 ++++++++++++++++++---------- include/linux/balloon_compaction.h | 4 + include/uapi/linux/magic.h | 1 + mm/balloon_compaction.c | 142 +- 5 files changed, 1560 insertions(+), 769 deletions(-)