From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWKlX-0001D4-AD for qemu-devel@nongnu.org; Wed, 25 Jan 2017 05:25:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWKlU-0005cb-40 for qemu-devel@nongnu.org; Wed, 25 Jan 2017 05:25:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47160) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cWKlT-0005cR-Tv for qemu-devel@nongnu.org; Wed, 25 Jan 2017 05:25:20 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D64C4C05AA66 for ; Wed, 25 Jan 2017 10:25:19 +0000 (UTC) From: Juan Quintela In-Reply-To: <20170106182823.1960-8-dgilbert@redhat.com> (David Alan Gilbert's message of "Fri, 6 Jan 2017 18:28:15 +0000") References: <20170106182823.1960-1-dgilbert@redhat.com> <20170106182823.1960-8-dgilbert@redhat.com> Reply-To: quintela@redhat.com Date: Wed, 25 Jan 2017 11:25:13 +0100 Message-ID: <87efzr77xy.fsf@emacs.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 07/15] postcopy: Plumb pagesize down into place helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: qemu-devel@nongnu.org, amit.shah@redhat.com, aarcange@redhat.com "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > Now we deal with normal size pages and huge pages we need > to tell the place handlers the size we're dealing with > and make sure the temporary page is large enough. > > Signed-off-by: Dr. David Alan Gilbert I understand the what you are trying here, but .... Why do we always map/upmap with the bigger pagesize? I would assume that this deppends on the block we are dealing with, no? > @@ -321,7 +321,7 @@ int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis) > migrate_send_rp_shut(mis, qemu_file_get_error(mis->from_src_file) != 0); > > if (mis->postcopy_tmp_page) { > - munmap(mis->postcopy_tmp_page, getpagesize()); > + munmap(mis->postcopy_tmp_page, mis->largest_page_size); > mis->postcopy_tmp_page = NULL; > } > trace_postcopy_ram_incoming_cleanup_exit(); Here > void *postcopy_get_tmp_page(MigrationIncomingState *mis) > { > if (!mis->postcopy_tmp_page) { > - mis->postcopy_tmp_page = mmap(NULL, getpagesize(), > + mis->postcopy_tmp_page = mmap(NULL, mis->largest_page_size, > PROT_READ | PROT_WRITE, MAP_PRIVATE | > MAP_ANONYMOUS, -1, 0); > if (mis->postcopy_tmp_page == MAP_FAILED) { And here ... > if (all_zero) { > ret = postcopy_place_page_zero(mis, > host + TARGET_PAGE_SIZE - > - qemu_host_page_size); > + block->page_size, > + block->page_size); > } else { > ret = postcopy_place_page(mis, host + TARGET_PAGE_SIZE - > - qemu_host_page_size, > - place_source); > + block->page_size, > + place_source, block->page_size); > } > } > if (!ret) { creating a temp for addr = host + TARGET_PAGE_SIZE - block->page_size; would make things more readable IMHO. I was missreading the - by a , and didn't understand so many parameters O:-)