From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6Vx8-0007nO-Db for qemu-devel@nongnu.org; Thu, 23 Jan 2014 20:53:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6Vx2-0004ib-Eb for qemu-devel@nongnu.org; Thu, 23 Jan 2014 20:53:02 -0500 Received: from [222.73.24.84] (port=26876 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6Vx2-0004gk-3d for qemu-devel@nongnu.org; Thu, 23 Jan 2014 20:52:56 -0500 Message-ID: <52E1C742.5030204@cn.fujitsu.com> Date: Fri, 24 Jan 2014 09:52:02 +0800 From: Qiao Nuohan MIME-Version: 1.0 References: <1389944779-31899-1-git-send-email-qiaonuohan@cn.fujitsu.com> <1389944779-31899-8-git-send-email-qiaonuohan@cn.fujitsu.com> <52DFFA35.6030002@redhat.com> In-Reply-To: <52DFFA35.6030002@redhat.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed Subject: Re: [Qemu-devel] [PATCH 07/13 v7] dump: add members to DumpState and init some of them List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: stefanha@gmail.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, anderson@redhat.com, kumagai-atsushi@mxc.nes.nec.co.jp, afaerber@suse.de On 01/23/2014 01:04 AM, Laszlo Ersek wrote: >> @@ -864,6 +884,16 @@ static int dump_init(DumpState *s, int fd, bool paging, bool has_filter, >> > qemu_get_guest_simple_memory_mapping(&s->list,&s->guest_phys_blocks); >> > } >> > >> > + s->nr_cpus = nr_cpus; >> > + s->page_size = TARGET_PAGE_SIZE; >> > + s->page_shift = ffs(s->page_size) - 1; >> > + >> > + get_max_mapnr(s); > Again from v6 10/11, good. The flag_flatten assignment has been dropped. > Initialization seems to happen in a good spot this time too. > >> > + >> > + uint64_t tmp; >> > + tmp = DIV_ROUND_UP(DIV_ROUND_UP(s->max_mapnr, CHAR_BIT), s->page_size); >> > + s->len_dump_bitmap = tmp * s->page_size; >> > + >> > if (s->has_filter) { >> > memory_mapping_filter(&s->list, s->begin, s->length); >> > } > Again from v6 10/11. > > These assignments now all occur without depending on a user request for > a compressed dump (kept this way in v7 12/13 too), but they are not > costly. The loop in get_max_mapnr() iterates over less than 10 mappings > in the non-paging dump case, and in the paging dump case it also > shouldn't be more than a hundred or so (as I recall from earlier > testing). This might be worth some regression-testing (perf-wise), but > it looks OK to me. > I see, moving them into "if(format...) {...}" block would be better. But, I have no idea of "regression-testing (perf-wise)", would you mind give some hint? -- Regards Qiao Nuohan