From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 464B7C76195 for ; Thu, 18 Jul 2019 06:24:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28BB0204FD for ; Thu, 18 Jul 2019 06:24:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727802AbfGRGY3 (ORCPT ); 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: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@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