Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp279815ybh; Thu, 12 Mar 2020 01:47:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtqzhcv7KtlaihBLg2jDJjFtY21EqV0qugekIA4TA1Q9JxH4eYL1QA5U5rTwv263G9Mj8Tv X-Received: by 2002:a05:6830:2105:: with SMTP id i5mr5236116otc.141.1584002874531; Thu, 12 Mar 2020 01:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584002874; cv=none; d=google.com; s=arc-20160816; b=JuyRenzEkcnBBQPOSZnzeAj9bAUYIGDxLy9ce+vm72C84VlJ/nm65XwJe5Rkv/EvVr kTQqbXjnPQG8yVoAsYEE2htLjfMZCgd6RRpcCXpDtkBIutk9ZjZRL/DOFmS1PHlNM7Ym FoszosDp/XsRY722Rq4Uo6q++C5qisKOTtVYHKzjs1NOl2ASXp9qo+AF1314Fvp8Hg9r hWO3bzgWRNQw3fiBtKK3nlIuZsi3MXpNgJCf3Wy7Sx4VdCLAWdf82c69Ode89GTegefm EVvxGnutkyYXHPsUwCzIvn67ridvEUaqbJJtNM8vz4ySaqDl8nFvgoeH0WpY5EAXRvCT KFQg== 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 :dkim-signature; bh=CMGY5NDRnQ6tpPW4NbzkE3whOpE1haBikjv6YCfDFio=; b=JKo1dhfE0/PuHDs5KZ60GrsJBtFYVXxbew5/5UxRIgSpnrS4xwEI+sMQDKwY6PCoV4 p7/Ym+EFR74h9+kL1vPFe2ISPxruiyMTZv7QV1+werBf/C4XlWz0/uxMPnqr8YOsunPE aUXKFoXK54nmcR7L9/+Pm/wg2X3BGLz1L8t7AFnLLHTo85UXtHKPKDbjf9+PrQvWHx9t 103DK4LgmCd0i3CovkiaLpnwpT4CalT2WUMHWdhXOOsfGVUFeI1kqt0hpyDP0rj0KxRY KJPgZdTxa1o6LRJIB4meG5KAdOaxhIHwNeosfbMNPEets3GCnEGnrPxhhdNg94m1hMUq sF1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DC9gPbBZ; 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=pass (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 u199si2445530oif.110.2020.03.12.01.47.40; Thu, 12 Mar 2020 01:47:54 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DC9gPbBZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726299AbgCLIrZ (ORCPT + 99 others); Thu, 12 Mar 2020 04:47:25 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:54511 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726000AbgCLIrZ (ORCPT ); Thu, 12 Mar 2020 04:47:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584002841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CMGY5NDRnQ6tpPW4NbzkE3whOpE1haBikjv6YCfDFio=; b=DC9gPbBZHhQan4cPx/ESxx6Sp7dSXZVxlkS0krOTzFKf7PjXPLF62JPIBBGN4aIDpcRbXe TijJi5aGR7mNRc047ocndiyvuKOe85xsq6JvAFpAgGPJfXrI3ao/ZjldN2N6Zya2Vj24N7 vcSLxbg03vStal1EVdJnrzc0gcE7hJs= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-348-iotjrYj6Ow-GneWn0W_TIA-1; Thu, 12 Mar 2020 04:47:19 -0400 X-MC-Unique: iotjrYj6Ow-GneWn0W_TIA-1 Received: by mail-qv1-f70.google.com with SMTP id r16so3066083qvp.13 for ; Thu, 12 Mar 2020 01:47:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=CMGY5NDRnQ6tpPW4NbzkE3whOpE1haBikjv6YCfDFio=; b=fyakUvuXCYmqsFR3RssEl+RCK6XBZqy0DObbsezsfGDZJBSou+TajDIgvo6co+MrwV 0no3NXabCVV6NKDBV4DjUuQh9YIclOBnvREhsdgH2FCtT+zvv1JI0CHXhGT0rv4VVag3 /ohf8qtbcUZpYBQ8u3o+q5JOHdv93dXRPgxthh/kpR6N13xN3c/x4tIOaUvryzEEOm+4 yThcE5iLnflFufDrU1SCzABprabBRncmGhqLHTLv5YVGCFLNeWSRU6DqvAsekihPoBcq +Li8ELuaHdPleIYThzgEYNzPKZM6myiypp+vKHLQmE7oOzMT8wK3a5+yM4n3Uov0CtPM LHtA== X-Gm-Message-State: ANhLgQ3wypmJpttnOfXoPp7jhbrfEf9qwqJpXqcGWXnn5cr9HQAq2TaU EGx4rNDVBDH68MScvYW0dPUWTVRoe9uaqIwS7xEq2GwHxvst5IxfCloguAqhZEjfmhHRuxH9moK Mx44NPMhMYH/4rDEU2IUmsGe8 X-Received: by 2002:ac8:70d4:: with SMTP id g20mr6375486qtp.146.1584002838845; Thu, 12 Mar 2020 01:47:18 -0700 (PDT) X-Received: by 2002:ac8:70d4:: with SMTP id g20mr6375478qtp.146.1584002838612; Thu, 12 Mar 2020 01:47:18 -0700 (PDT) Received: from redhat.com (bzq-79-178-2-19.red.bezeqint.net. [79.178.2.19]) by smtp.gmail.com with ESMTPSA id c190sm5213470qkb.80.2020.03.12.01.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 01:47:17 -0700 (PDT) Date: Thu, 12 Mar 2020 04:47:11 -0400 From: "Michael S. Tsirkin" To: David Hildenbrand Cc: Hui Zhu , jasowang@redhat.com, akpm@linux-foundation.org, pagupta@redhat.com, mojha@codeaurora.org, namit@vmware.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, qemu-devel@nongnu.org, Hui Zhu , Alexander Duyck Subject: Re: [RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue Message-ID: <20200312043859-mutt-send-email-mst@kernel.org> References: <1583999395-9131-1-git-send-email-teawater@gmail.com> <3e1373f4-6ade-c651-ddde-6f04e78382f9@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3e1373f4-6ade-c651-ddde-6f04e78382f9@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12, 2020 at 09:37:32AM +0100, David Hildenbrand wrote: > 2. You are essentially stealing THPs in the guest. So the fastest > mapping (THP in guest and host) is gone. The guest won't be able to make > use of THP where it previously was able to. I can imagine this implies a > performance degradation for some workloads. This needs a proper > performance evaluation. I think the problem is more with the alloc_pages API. That gives you exactly the given order, and if there's a larger chunk available, it will split it up. But for balloon - I suspect lots of other users, we do not want to stress the system but if a large chunk is available anyway, then we could handle that more optimally by getting it all in one go. So if we want to address this, IMHO this calls for a new API. Along the lines of struct page *alloc_page_range(gfp_t gfp, unsigned int min_order, unsigned int max_order, unsigned int *order) the idea would then be to return at a number of pages in the given range. What do you think? Want to try implementing that? -- MST