Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1432959ybb; Thu, 26 Mar 2020 00:11:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvdvuI40BGlsOGNhqDcrdW0NI0Rcl0PpNjijutGMc6baWUM02NC/tGNTxs7wyXBP5+Vu3zM X-Received: by 2002:a4a:d2de:: with SMTP id j30mr4180552oos.95.1585206691077; Thu, 26 Mar 2020 00:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585206691; cv=none; d=google.com; s=arc-20160816; b=cF8ElgcfvoqhzccjFgzBzxJzyAz6s2f+7d0NRQ5hIyghBcWOBp7IxSsLuw0aPh9nC5 J//V4G84kxJADwCyRak2j4lDXThd7iQJP6w5fMLwTkt9wtisjf0AL04xX1hGZ9RNg/4Q LwRG0HxQ938HJc4m0pwo87bo9zxUdv7R2THL9cj0QV1F6NmWdHSlBEdeUEGFWfGzOev4 v3V2fZqlx+JiZGtL8nHfWXCnxP2YZUjIXRLFWv9I8aS4+Jow57EPXp56Myg4UcPDf92R xCx2jo0D3/7TQVF1Bj0WcMs8YcfRTOhjWXBjP8BKrdAp7GOJn7/i6PRQYP/bnI7QVTnl 5uQg== 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=H8Cw3DLh+iXs54zjqQfuZxMBQva4d9GTteg9CmCE+Ho=; b=G8XwmmEHBwDrkcMTTtQsvNffR5+dHIN5oxSHlM89swt6EWm1i3KZGE/MBdEb3LBxq3 GOHrW6L2c2K0S+d1z3LS4CXCUE+FOgXudFjKDRVEr1eItcjtRYLqgSItAfTot9eGoeT7 Tfrvr/04coeUnGgYmhBdu59TmNNxHysV7YG5+Sp/iDOgiQpbpxTt+i7avtWYsWIT1WYn 9clVIpi98bMrIohaAKcSG13IyL3iT11cSSgxkmIoVvEdMXA55gEti8UnUUVKbdo/+2Sq 2XFMHdkIUXnWZpSBIh1A3li3Uil80LIfqHRv2XSqSV8C+FEKqH2MPzgv5fbae+QjXYuw pzVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Wguo4yhy; 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 x14si615285ooc.26.2020.03.26.00.11.18; Thu, 26 Mar 2020 00:11:31 -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=Wguo4yhy; 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 S1727655AbgCZHKT (ORCPT + 99 others); Thu, 26 Mar 2020 03:10:19 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:33559 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726338AbgCZHKT (ORCPT ); Thu, 26 Mar 2020 03:10:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585206618; 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=H8Cw3DLh+iXs54zjqQfuZxMBQva4d9GTteg9CmCE+Ho=; b=Wguo4yhyvKwELK68RLUfkhcbTYUBRRFOeCMwwgtREfN3LqcX2aUGYlTXrwvhqSSPi8WyIU EwI+8IVRMMTlLF9HDWHleYx0lPbCjbblbk6pyRiV6DTh6b1aaVMNPz62DEcE1OPufAdnVg PYkFs3lv0529MqMOj0bGNF5ntyWi7SI= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-otfINWqYO9CpmEvG1Hr9IQ-1; Thu, 26 Mar 2020 03:10:16 -0400 X-MC-Unique: otfINWqYO9CpmEvG1Hr9IQ-1 Received: by mail-wr1-f72.google.com with SMTP id c8so692386wru.20 for ; Thu, 26 Mar 2020 00:10:16 -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=H8Cw3DLh+iXs54zjqQfuZxMBQva4d9GTteg9CmCE+Ho=; b=NF8wgjWNJqmOCbLUUXwFc37L8cARYEYfttUQeY1NbIpZiIpQmNH2jv8flz4wLnea8T R4pxmob/qypPeUvYPhVIZKqtyG3N6ycq5UaThOSHso4mVyvGkIAYHobvR8ZcVoeKW8Qu Hc4k/533qaZ3dPpU4Yvx+JVGcyoVsYI7tdnFI0W1F56n+Tp4f5JvxRGgytZFgi5BcRbk IIdy+VG4ZXBc90y6ji4Qcw47qg5KpA8MfwyTwVm4ZLegIaN0Oz0xpIaNwwCXyj9k6tf5 teG0NnJoEnRvTPdhqWQF9ZDF1rw1wyVuhpxDS5sWvzDRc6Cdyt7ss23E/LV+ls1yy1cM CXMw== X-Gm-Message-State: ANhLgQ1Em9hWroPezHzGB4Db4XxwNwPKH+ghhZJaJtwun58wP5z/YT8q KnaApQdQ9gFu2OYLHq/C5rnjS/zuKDk34GdDEs8VxApebkpSD6yeGN3OQPfESOnMbx1jNRwcwAs T2SsthCPLqa3F+S83ho664R52 X-Received: by 2002:a5d:4e03:: with SMTP id p3mr7455129wrt.408.1585206614577; Thu, 26 Mar 2020 00:10:14 -0700 (PDT) X-Received: by 2002:a5d:4e03:: with SMTP id p3mr7455094wrt.408.1585206614278; Thu, 26 Mar 2020 00:10:14 -0700 (PDT) Received: from redhat.com (bzq-79-182-20-254.red.bezeqint.net. [79.182.20.254]) by smtp.gmail.com with ESMTPSA id y16sm2272355wrp.78.2020.03.26.00.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 00:10:13 -0700 (PDT) Date: Thu, 26 Mar 2020 03:10:10 -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: <20200326030833-mutt-send-email-mst@kernel.org> References: <1583999395-9131-1-git-send-email-teawater@gmail.com> <3e1373f4-6ade-c651-ddde-6f04e78382f9@redhat.com> <20200312043859-mutt-send-email-mst@kernel.org> <45756694-560d-0276-d39e-cc2fd1c4e3a7@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45756694-560d-0276-d39e-cc2fd1c4e3a7@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:51:25AM +0100, David Hildenbrand wrote: > On 12.03.20 09:47, Michael S. Tsirkin wrote: > > 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? > > You can just start with the highest order and decrement the order until > your allocation succeeds using alloc_pages(), which would be enough for > a first version. At least I don't see the immediate need for a new > kernel API. Well there's still a chance of splitting a big page if one becomes available meanwhile. But OK. > -- > Thanks, > > David / dhildenb