Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1302479ybv; Thu, 6 Feb 2020 01:31:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzx/1Mr69jBmekMN0VnA7In4pOv9zylDS8NICar58LgdMEVCXmNwtLAMUe027qFzHquacpG X-Received: by 2002:aca:b808:: with SMTP id i8mr6084769oif.66.1580981496918; Thu, 06 Feb 2020 01:31:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580981496; cv=none; d=google.com; s=arc-20160816; b=z7sYb8i+8dmxJztzYf4ZRx31mWQ1sf4VtnS08eI2je4DYvQqQw6aVOK8ugskZKfVAE hI6IxRdWnaKozagmELEIw3yBSlMryY/ncfUSnK1mKceLKwuk2zAlal2yyV/YQmcIvDIw 495vt3r8PHtpdNxmkD5LAkqWvaxPergkKm1aaElb6rQ5hKwPksyfaho5/mxgA2K3uxpz zxgCli2Q2cwzyz5Zm0/VSNZySbMOJ31RWOqwHNzofvyyS9fUMXcVbqdfwW2jJ/zPnurm bZIowM+8d4kUvmPviRR3EOzUoF0GrGao78qt79UO8jB9vmHHnC4/rL9XHlv6V+v9PKmn 7M+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=P3/XBq/WhGKBjauSo9PPgCGpyPugC9fhFxM7d69wybk=; b=XHr0/iB5vI7StiwlbeTg1c69KRvq4Asj/RVy9CAGJcxx5/rfTTPvekrRI5/xdqZtw3 t9rECE/UWzXwl1KwBQOTYHtMZa3Xjl1dVxUwv6CeVMhap0WbibLe6U1SxiAMgI4K0ByV x7QkeEcMDJtsD1zOWzOcSpJORxZr7t879A2RtgyBZfvEfTDltXaWI3lI7tLl1M7zt7m6 Nf6elRz3tObYagN7D2OXxxl98kWedxAkifvBC33ISlylbSwQmeedLWlTzcNB8ru4BMiX W+Oy6sxgjU1wFlQxOlV5LDcS6gFSreiO7kqGThmlDrfPSxMTk3uYnrxS82mSi69orYZ3 /k7g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6si1494196oth.182.2020.02.06.01.31.24; Thu, 06 Feb 2020 01:31:36 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728102AbgBFI5J convert rfc822-to-8bit (ORCPT + 99 others); Thu, 6 Feb 2020 03:57:09 -0500 Received: from mga11.intel.com ([192.55.52.93]:43116 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726538AbgBFI5I (ORCPT ); Thu, 6 Feb 2020 03:57:08 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 00:57:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,409,1574150400"; d="scan'208";a="404425769" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 06 Feb 2020 00:57:07 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 6 Feb 2020 00:57:07 -0800 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 6 Feb 2020 00:57:06 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.126]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.98]) with mapi id 14.03.0439.000; Thu, 6 Feb 2020 16:57:05 +0800 From: "Wang, Wei W" To: David Hildenbrand , "linux-kernel@vger.kernel.org" CC: "linux-mm@kvack.org" , "virtualization@lists.linux-foundation.org" , Tyler Sanderson , "Michael S . Tsirkin" , Alexander Duyck , David Rientjes , Nadav Amit , Michal Hocko Subject: RE: [PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM Thread-Topic: [PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM Thread-Index: AQHV3EIpfQc0Q8o+LUGdBo475Vlup6gN3WAA Date: Thu, 6 Feb 2020 08:57:05 +0000 Message-ID: <286AC319A985734F985F78AFA26841F73E4237B0@shsmsx102.ccr.corp.intel.com> References: <20200205163402.42627-1-david@redhat.com> <20200205163402.42627-4-david@redhat.com> In-Reply-To: <20200205163402.42627-4-david@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, February 6, 2020 12:34 AM, David Hildenbrand wrote: > Commit 71994620bb25 ("virtio_balloon: replace oom notifier with shrinker") > changed the behavior when deflation happens automatically. Instead of > deflating when called by the OOM handler, the shrinker is used. > > However, the balloon is not simply some slab cache that should be shrunk > when under memory pressure. The shrinker does not have a concept of > priorities, so this behavior cannot be configured. > > There was a report that this results in undesired side effects when inflating > the balloon to shrink the page cache. [1] > "When inflating the balloon against page cache (i.e. no free memory > remains) vmscan.c will both shrink page cache, but also invoke the > shrinkers -- including the balloon's shrinker. So the balloon > driver allocates memory which requires reclaim, vmscan gets this > memory by shrinking the balloon, and then the driver adds the > memory back to the balloon. Basically a busy no-op." Not sure if we need to go back to OOM, which has many drawbacks as we discussed. Just posted out another approach, which is simple. Best, Wei