Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1867749ybi; Wed, 17 Jul 2019 23:25:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAaXCIZyUseQsRTuBIPOMaZ2+X1J7NNFZ/fphMF5UUXe9lUNCFfwVIdSIe7/PX+k4cGJHU X-Received: by 2002:a63:1908:: with SMTP id z8mr44732670pgl.433.1563431127271; Wed, 17 Jul 2019 23:25:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563431127; cv=none; d=google.com; s=arc-20160816; b=tKFdO4/YnbZgf9iIYofvsu5T/urEpsr6YXL8tZQ81atvi5Tw/F9hhyuqxnq2jHldl5 +dpP83jDYlAR7KPJ2oQsZN5i+97w0CSJmIbm7ZhIDaB5lLXM8NHZRiIKkFrGc5GXmSm6 oPWyhf1Y6LsJsGXayZSEULX9l2PTTknORN3pbv4gs/uJg7woCvnGQSH0bsFsU4GWKvMB 2Kwuc59c+bn6Y4ldYpSGr3R9ckSo917frz3TGd1IXVrh0EXFlhDdiLv+xaEkHacN9riZ 30dcoP7iGUBxIC+nWOfgiJ9sRq48e8H6ZGzwFKV6/FKe8esxN1NJPIHxL20hlC219bcP dLLg== 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:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=wlt7IgxhDbN6y+nDGBuY58WV4H+ze496zzF13EIGCbQ=; b=t/bgJjIOMcatM7cWPJ1OatmBcQ9USQLBS/D6lpBwfTHO/wtKQFjgPKzU5e1DwAmOz3 xXL/YFrYWPNMpL2ScJoo4c4jAHcZua3KBj7pMM+IU0xFA0LXTlJNNiMhvNt3LNpuvTBv x4Kx1+6bjA5g0k7qcO+V3K6yh/4Q9YThqQdp1zzGjmZ8d8e7YScfnZGlOqdFsFcL06G5 LEmm9KyX0xdGcK4u1XzK4cSzLbBHXbShbCz75MXP3cv0zt3PfOJjIsqOKqg3yPiaW8IU S5SH7xWYDztutdWxjFKfFGet3m5m6V5SBEs6JI/Ui5pxCpb5hvk6Hu5LQWw972vFngRp rwKQ== 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 t18si134851pfh.29.2019.07.17.23.25.10; Wed, 17 Jul 2019 23:25:27 -0700 (PDT) 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 S1728127AbfGRGY3 (ORCPT + 99 others); Thu, 18 Jul 2019 02:24:29 -0400 Received: from mga11.intel.com ([192.55.52.93]:44788 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbfGRGY3 (ORCPT ); Thu, 18 Jul 2019 02:24:29 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 23:24:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,276,1559545200"; d="scan'208";a="191506353" Received: from unknown (HELO [10.239.13.7]) ([10.239.13.7]) by fmsmga004.fm.intel.com with ESMTP; 17 Jul 2019 23:24:25 -0700 Message-ID: <5D3011E9.4040908@intel.com> Date: Thu, 18 Jul 2019 14:30:01 +0800 From: Wei Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Michael S. Tsirkin" CC: Alexander Duyck , Nitesh Narayan Lal , kvm list , David Hildenbrand , "Hansen, Dave" , LKML , linux-mm , Andrew Morton , Yang Zhang , "pagupta@redhat.com" , Rik van Riel , Konrad Rzeszutek Wilk , "lcapitulino@redhat.com" , Andrea Arcangeli , Paolo Bonzini , "Williams, Dan J" , Alexander Duyck Subject: Re: use of shrinker in virtio balloon free page hinting References: <20190717071332-mutt-send-email-mst@kernel.org> <286AC319A985734F985F78AFA26841F73E16D4B2@shsmsx102.ccr.corp.intel.com> <20190718000434-mutt-send-email-mst@kernel.org> <5D300A32.4090300@intel.com> <20190718015319-mutt-send-email-mst@kernel.org> In-Reply-To: <20190718015319-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/18/2019 01:58 PM, Michael S. Tsirkin wrote: > > what if it does not fail? > > >> Shrinker is called on system memory pressure. On memory pressure >> get_free_page_and_send will fail memory allocation, so it stops allocating >> more. > Memory pressure could be triggered by an unrelated allocation > e.g. from another driver. As memory pressure is system-wide (no matter who triggers it), free page hinting will fail on memory pressure, same as other drivers. As long as the page allocation succeeds, we could just think the system is not in the memory pressure situation, then thing could go on normally. Also, the VIRTIO_BALLOON_FREE_PAGE_ALLOC_FLAG includes NORETRY and NOMEMALLOC, which makes it easier than most other drivers to fail allocation first. Best, Wei