From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEgdj-0007PH-VX for qemu-devel@nongnu.org; Mon, 13 Jul 2015 12:31:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEgdg-0005PY-J9 for qemu-devel@nongnu.org; Mon, 13 Jul 2015 12:31:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56761) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEgdg-0005PQ-Cc for qemu-devel@nongnu.org; Mon, 13 Jul 2015 12:31:32 -0400 Date: Mon, 13 Jul 2015 17:31:26 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20150713163125.GI2492@work-vm> References: <1434450415-11339-1-git-send-email-dgilbert@redhat.com> <1434450415-11339-22-git-send-email-dgilbert@redhat.com> <877fq4l2xi.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877fq4l2xi.fsf@neno.neno> Subject: Re: [Qemu-devel] [PATCH v7 21/42] postcopy: OS support test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, liang.z.li@intel.com, qemu-devel@nongnu.org, luis@cs.umu.se, amit.shah@redhat.com, pbonzini@redhat.com, david@gibson.dropbear.id.au * Juan Quintela (quintela@redhat.com) wrote: > "Dr. David Alan Gilbert (git)" wrote: > > From: "Dr. David Alan Gilbert" > > > > Provide a check to see if the OS we're running on has all the bits > > needed for postcopy. > > > > Creates postcopy-ram.c which will get most of the other helpers we need. > > > > Signed-off-by: Dr. David Alan Gilbert > > Reviewed-by: Juan Quintela > > I am guessing that test is ok, but we are doing the test each time that > we change the function. We always end calling that kind of functions in > several places. Shouldn't be good to rename the function to > __postcopy_ram_supported_by_host() > > and do a toplevel function that is: > > bool postcopy_ram_supported_by_host(void) > { > static bool first_time = true; > static supported = false; > > if (firt_time) { > first_time = false; > supported = __postcopy_ram_supported_by_host() > } > return supported; > } > > Notice that I don't know how slow the mmap + usefault thing is, but I > guess that the values would not change while running, no? Since we only call this once, at the start of an incoming migration, it seems overkill to do that. Dave > > It has a review-by because I don't see anything wrong with it. -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK