From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH v2 repost 3/7] mm: add a function to get the max pfn Date: Thu, 28 Jul 2016 01:08:05 +0300 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 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 To: Liang Li Return-path: 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: kvm.vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162917AbcG0WIU (ORCPT ); Wed, 27 Jul 2016 18:08:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38348 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162471AbcG0WIL (ORCPT ); Wed, 27 Jul 2016 18:08:11 -0400 Date: Thu, 28 Jul 2016 01:08:05 +0300 From: "Michael S. Tsirkin" 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 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> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 27 Jul 2016 22:08:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSWzx-0008Iv-0K for qemu-devel@nongnu.org; Wed, 27 Jul 2016 18:08:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSWzr-0001WI-TJ for qemu-devel@nongnu.org; Wed, 27 Jul 2016 18:08:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSWzr-0001WE-NV for qemu-devel@nongnu.org; Wed, 27 Jul 2016 18:08:11 -0400 Date: Thu, 28 Jul 2016 01:08:05 +0300 From: "Michael S. Tsirkin" 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> Subject: Re: [Qemu-devel] [PATCH v2 repost 3/7] mm: add a function to get the max pfn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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