From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f69.google.com (mail-it0-f69.google.com [209.85.214.69]) by kanga.kvack.org (Postfix) with ESMTP id 93D906B0260 for ; Wed, 27 Jul 2016 18:08:12 -0400 (EDT) Received: by mail-it0-f69.google.com with SMTP id c126so25540846ith.3 for ; Wed, 27 Jul 2016 15:08:12 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id l2si29327985ite.77.2016.07.27.15.08.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jul 2016 15:08:11 -0700 (PDT) Date: Thu, 28 Jul 2016 01:08:05 +0300 From: "Michael S. Tsirkin" Subject: Re: [PATCH v2 repost 3/7] mm: add a function to get the max pfn Message-ID: <20160728010729-mutt-send-email-mst@kernel.org> References: <1469582616-5729-1-git-send-email-liang.z.li@intel.com> <1469582616-5729-4-git-send-email-liang.z.li@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1469582616-5729-4-git-send-email-liang.z.li@intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: Liang Li Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, dgilbert@redhat.com, quintela@redhat.com, Andrew Morton , Vlastimil Babka , Mel Gorman , Paolo Bonzini , Cornelia Huck , Amit Shah On Wed, Jul 27, 2016 at 09:23:32AM +0800, Liang Li wrote: > Expose the function to get the max pfn, so it can be used in the > virtio-balloon device driver. > > Signed-off-by: Liang Li > Cc: Andrew Morton > Cc: Vlastimil Babka > Cc: Mel Gorman > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Cc: Cornelia Huck > Cc: Amit Shah > --- > mm/page_alloc.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 8b3e134..7da61ad 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -4517,6 +4517,12 @@ void show_free_areas(unsigned int filter) > show_swap_cache_info(); > } > > +unsigned long get_max_pfn(void) > +{ > + return max_pfn; > +} > +EXPORT_SYMBOL(get_max_pfn); > + This needs a coment that this can change at any time. So it's only good as a hint e.g. for sizing data structures. > static void zoneref_set_zone(struct zone *zone, struct zoneref *zoneref) > { > zoneref->zone = zone; > -- > 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org