From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f198.google.com (mail-qt0-f198.google.com [209.85.216.198]) by kanga.kvack.org (Postfix) with ESMTP id 61D2A6B0007 for ; Mon, 25 Jun 2018 21:55:30 -0400 (EDT) Received: by mail-qt0-f198.google.com with SMTP id m2-v6so8873373qti.2 for ; Mon, 25 Jun 2018 18:55:30 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id k10-v6si429524qtb.84.2018.06.25.18.55.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 18:55:29 -0700 (PDT) Date: Tue, 26 Jun 2018 04:55:26 +0300 From: "Michael S. Tsirkin" Subject: Re: [PATCH v33 1/4] mm: add a function to get free page blocks Message-ID: <20180626045118-mutt-send-email-mst@kernel.org> References: <1529037793-35521-1-git-send-email-wei.w.wang@intel.com> <1529037793-35521-2-git-send-email-wei.w.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Linus Torvalds Cc: wei.w.wang@intel.com, virtio-dev@lists.oasis-open.org, Linux Kernel Mailing List , virtualization , KVM list , linux-mm , Michal Hocko , Andrew Morton , Paolo Bonzini , liliang.opensource@gmail.com, yang.zhang.wz@gmail.com, quan.xu0@gmail.com, nilal@redhat.com, Rik van Riel , peterx@redhat.com On Sat, Jun 16, 2018 at 08:08:53AM +0900, Linus Torvalds wrote: > On Fri, Jun 15, 2018 at 2:08 PM Wei Wang wrote: > > > > This patch adds a function to get free pages blocks from a free page > > list. The obtained free page blocks are hints about free pages, because > > there is no guarantee that they are still on the free page list after > > the function returns. ... > > +uint32_t get_from_free_page_list(int order, __le64 buf[], uint32_t size) ... > > Ack. This is the kind of simple interface where I don't need to worry > about the MM code calling out to random drivers or subsystems. > > I think that "order" should be checked for validity, but from a MM > standpoint I think this is fine. > > Linus The only issue seems to be getting hold of buf that's large enough - and we don't really know what the size is, or whether one buf would be enough. Linus, do you think it would be ok to have get_from_free_page_list actually pop entries from the free list and use them as the buffer to store PAs? Caller would be responsible for freeing the returned entries. -- MST