From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932686AbcG0Wwf (ORCPT ); Wed, 27 Jul 2016 18:52:35 -0400 Received: from mga04.intel.com ([192.55.52.120]:41520 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932335AbcG0Ww1 (ORCPT ); Wed, 27 Jul 2016 18:52:27 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,431,1464678000"; d="scan'208";a="1003813260" Subject: Re: [PATCH v2 repost 3/7] mm: add a function to get the max pfn To: "Michael S. Tsirkin" , Liang Li References: <1469582616-5729-1-git-send-email-liang.z.li@intel.com> <1469582616-5729-4-git-send-email-liang.z.li@intel.com> <20160728010729-mutt-send-email-mst@kernel.org> 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 From: Dave Hansen Message-ID: <57993B16.5010703@intel.com> Date: Wed, 27 Jul 2016 15:52:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160728010729-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/27/2016 03:08 PM, Michael S. Tsirkin wrote: >> > +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. Or, if we limit the batches to 1GB like you suggested earlier, then we might not even need this exported. It would mean that in the worst case, we temporarily waste 28k out of the 32k allocation for a small VM that had <128MB of memory. That seems like a small price to pay for not having to track max_pfn anywhere. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [PATCH v2 repost 3/7] mm: add a function to get the max pfn Date: Wed, 27 Jul 2016 15:52:06 -0700 Message-ID: <57993B16.5010703@intel.com> References: <1469582616-5729-1-git-send-email-liang.z.li@intel.com> <1469582616-5729-4-git-send-email-liang.z.li@intel.com> <20160728010729-mutt-send-email-mst@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: "Michael S. Tsirkin" , Liang Li Return-path: In-Reply-To: <20160728010729-mutt-send-email-mst@kernel.org> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.org On 07/27/2016 03:08 PM, Michael S. Tsirkin wrote: >> > +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. Or, if we limit the batches to 1GB like you suggested earlier, then we might not even need this exported. It would mean that in the worst case, we temporarily waste 28k out of the 32k allocation for a small VM that had <128MB of memory. That seems like a small price to pay for not having to track max_pfn anywhere. -- 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 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSXgn-0003q1-VC for qemu-devel@nongnu.org; Wed, 27 Jul 2016 18:52:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSXgi-0003pT-1Q for qemu-devel@nongnu.org; Wed, 27 Jul 2016 18:52:32 -0400 Received: from mga03.intel.com ([134.134.136.65]:3012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSXgh-0003pM-RN for qemu-devel@nongnu.org; Wed, 27 Jul 2016 18:52:27 -0400 References: <1469582616-5729-1-git-send-email-liang.z.li@intel.com> <1469582616-5729-4-git-send-email-liang.z.li@intel.com> <20160728010729-mutt-send-email-mst@kernel.org> From: Dave Hansen Message-ID: <57993B16.5010703@intel.com> Date: Wed, 27 Jul 2016 15:52:06 -0700 MIME-Version: 1.0 In-Reply-To: <20160728010729-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: "Michael S. Tsirkin" , 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 07/27/2016 03:08 PM, Michael S. Tsirkin wrote: >> > +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. Or, if we limit the batches to 1GB like you suggested earlier, then we might not even need this exported. It would mean that in the worst case, we temporarily waste 28k out of the 32k allocation for a small VM that had <128MB of memory. That seems like a small price to pay for not having to track max_pfn anywhere.