Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1725007ybv; Sat, 8 Feb 2020 04:38:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxcJOy/i3D4L6DBNyf4UEwE3pbdYiqWmBJsQ/iZKfkKy8YI+LQ09EeEMeQlbGZ32vaimTn6 X-Received: by 2002:a9d:7342:: with SMTP id l2mr3343395otk.98.1581165531134; Sat, 08 Feb 2020 04:38:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581165531; cv=none; d=google.com; s=arc-20160816; b=DfoUX5GYHpN88Hy9MWbw6A6xe48J88zIZrFSugMVvVo928nP0k7YF99Ti1uju3UEKa tJ3fzJZmVpoy5vzN8BuBaQis7Lddb2F512rxUJX0lYlLJGIQ6zmUtCQA6pSsrSMxgSjz qAlPr3YTj7VXdbobkuaMoj5dkpc/cvK6gtgNiolgOBPPJ17ESH6OPvJAdoS+pThFkgWI V06iwMHGbC/0D8jlaxlAhbWAa3MSM9u3YplYHlmJYhMhU+y3XB/tQ1qYhiyjCodWWY3l +QkLRyzJd4Vd/obISuaCjiTb04vKuo0H4a4v76kIy0djL+VYoGTQ6Bt39g2VBJ+0XZ6Q 2H1g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=hnneWv7CzijNL2imy1/RI4rBv77ePr7gx4mPbloc0uU=; b=APcqSs7badfmaqV75IAGHEB+531wbMgcHIBKhhJY/jjVz140au6UnAGVVVEnjkwuhN sSML5zoY0M8yZKpFLoZk4BgoA7VIYgLLQe38d+akcGcpVNuinYQD8+oQ0PqVovzatI3A kmjjr/KU9a+o8GUw9OaITKwGZMRAKy6tHP3UlfzLC5ri7pn35dx2nWjT8rkX72n2TJ+Q H4zoSOOSvWdOA+ptTNPk0iSMuPYThesF1Ron/iyu838C7NoYn6O/PRmGCpZ8wodNCZDL 0mhDfwly7iWytC1+oHLtAnUw3ZpyaJmxGJHyze2y39Di/Uubt968dbq/TDYkwE3mAIU3 /m5A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p22si1478512otq.132.2020.02.08.04.38.14; Sat, 08 Feb 2020 04:38:51 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727154AbgBHMey (ORCPT + 99 others); Sat, 8 Feb 2020 07:34:54 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:57844 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726527AbgBHMey (ORCPT ); Sat, 8 Feb 2020 07:34:54 -0500 Received: from fsav404.sakura.ne.jp (fsav404.sakura.ne.jp [133.242.250.103]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 018CX4NR077663; Sat, 8 Feb 2020 21:33:04 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav404.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav404.sakura.ne.jp); Sat, 08 Feb 2020 21:33:04 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav404.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 018CWvOG077502 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 8 Feb 2020 21:33:04 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH RFC] virtio_balloon: conservative balloon page shrinking To: Wei Wang , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Cc: tysand@google.com, mst@redhat.com, david@redhat.com, alexander.h.duyck@linux.intel.com, rientjes@google.com, mhocko@kernel.org, namit@vmware.com References: <1580976107-16013-1-git-send-email-wei.w.wang@intel.com> From: Tetsuo Handa Message-ID: <345addae-0945-2f49-52cf-8e53446e63b2@i-love.sakura.ne.jp> Date: Sat, 8 Feb 2020 21:32:54 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <1580976107-16013-1-git-send-email-wei.w.wang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/02/06 17:01, Wei Wang wrote: > There are cases that users want to shrink balloon pages after the > pagecache depleted. The conservative_shrinker lets the shrinker > shrink balloon pages when all the pagecache has been reclaimed. > > @@ -796,6 +800,10 @@ static unsigned long shrink_balloon_pages(struct virtio_balloon *vb, > { > unsigned long pages_freed = 0; > > + /* Balloon pages only gets shrunk when the pagecache depleted */ > + if (conservative_shrinker && global_node_page_state(NR_FILE_PAGES)) > + return 0; > + Is this NUMA aware? Can "node-A's NR_FILE_PAGES is already 0 and node-B's NR_FILE_PAGES is not 0, but allocation request which triggered this shrinker wants to allocate from only node-B" happen? Can some thread keep this shrinker defunctional by keep increasing NR_FILE_PAGES? Is this patch from "Re: Balloon pressuring page cache" thread? I hope that the guest could start reclaiming memory based on host's request (like OOM notifier chain) which is issued when host thinks that host is getting close to OOM and thus guests should start returning their unused memory to host. Maybe "periodically (e.g. 5 minutes)" in addition to "upon close to OOM condition" is also possible.