Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2738685ybi; Thu, 18 Jul 2019 13:29:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWzrxHvSMqpfo8UkOLR2EaNmSAkp6YnRgQJTm4ltkDh4M0tKZFeCtFYS9fNLWjHEwX/BW4 X-Received: by 2002:a63:ff66:: with SMTP id s38mr50141564pgk.363.1563481770021; Thu, 18 Jul 2019 13:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563481770; cv=none; d=google.com; s=arc-20160816; b=kkVh+xTVMU7Uuin9hMgmp20ucz9SetDFs8fPr9Gwfys7EaNo1ZOaSrNz04395fhXEV LE2hCcFiYZ2hH30LGvYBkLhyw+/Mtpgdz2WL2bWH3tOFqtx87EDgGFemVdCJaXGxcz0v W3zqOWMTAe9K4D6IkFAdDLPqbyzVwNoMO27h0YFQNtdvUtfK1vzRjfFZOVuUIq4gJg2n ROuLIen1gmi/bqzaVBOXrIA5T+9nVlKhBOC71r064o6b8RuPgERa5J0JMtXPsXkwDwMJ xd9vrYu67/I17b9Wu9D+KGebXKOoNS1DD6TIuLhQiITFAe6noLs7rbNKOKrqvWR/+6O3 /Low== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=B3D519saV0IY04hwLwSMWExcabGqmr2ZPbFB5vbgjIY=; b=Y0mZ7gVpHwXRlZVtmD52uJLY5uwyGfzldKOqZXQZPs9L1K6xGOqntS53Ku5DSEZBrs uUlqkBGnuFc6f8mJg1Za19nqM/j2M6MM9D/u59tLLtoiPKqDDkxVxLpeYuCBaPWJVwxY wKdQP3rrRN3nkQI1OkiySjLPaPIpIo45cKnU5LhVU1NJ6wKfLoo6P4gsdcLMi/WbEUCO W8Oby4AhS3d8I5yFG75nILq87gsFl3yh662PQCWHBIkOF5iuG3ztJ0wNAfXFXU2W+Hf6 mRW80QmS75O0ewpPm4fNQ8QgyYgL0zKNIbeRdD/b5yfWlSx2uHFwl/SZUkXkPA16L2Rx xK7A== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si693249pfi.31.2019.07.18.13.29.14; Thu, 18 Jul 2019 13:29:30 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391468AbfGRU2O (ORCPT + 99 others); Thu, 18 Jul 2019 16:28:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58122 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727687AbfGRU2O (ORCPT ); Thu, 18 Jul 2019 16:28:14 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B13D4C060201; Thu, 18 Jul 2019 20:28:13 +0000 (UTC) Received: from redhat.com (ovpn-120-147.rdu2.redhat.com [10.10.120.147]) by smtp.corp.redhat.com (Postfix) with SMTP id 9E80D5D71C; Thu, 18 Jul 2019 20:27:56 +0000 (UTC) Date: Thu, 18 Jul 2019 16:27:55 -0400 From: "Michael S. Tsirkin" To: Nitesh Narayan Lal Cc: Alexander Duyck , kvm list , David Hildenbrand , Dave Hansen , LKML , linux-mm , Andrew Morton , Yang Zhang , pagupta@redhat.com, Rik van Riel , Konrad Rzeszutek Wilk , lcapitulino@redhat.com, wei.w.wang@intel.com, Andrea Arcangeli , Paolo Bonzini , dan.j.williams@intel.com, Alexander Duyck Subject: Re: [PATCH v1 6/6] virtio-balloon: Add support for aerating memory via hinting Message-ID: <20190718162502-mutt-send-email-mst@kernel.org> References: <20190716115535-mutt-send-email-mst@kernel.org> <20190716125845-mutt-send-email-mst@kernel.org> <20190717055804-mutt-send-email-mst@kernel.org> <20190718003211-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 18 Jul 2019 20:28:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 18, 2019 at 12:03:23PM -0400, Nitesh Narayan Lal wrote: > >>>> For example we allocate pages until shrinker kicks in. > >>>> Fair enough but in fact many it would be better to > >>>> do the reverse: trigger shrinker and then send as many > >>>> free pages as we can to host. > >>> I'm not sure I understand this last part. > >> Oh basically what I am saying is this: one of the reasons to use page > >> hinting is when host is short on memory. In that case, why don't we use > >> shrinker to ask kernel drivers to free up memory? Any memory freed could > >> then be reported to host. > > Didn't the balloon driver already have a feature like that where it > > could start shrinking memory if the host was under memory pressure? > If you are referring to auto-ballooning (I don't think it is merged). It > has its own set of disadvantages such as it could easily lead to OOM, > memory corruption and so on. Right. So what I am saying is: we could have a flag that triggers a shrinker once before sending memory hints. Worth considering. -- MST