From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrjkB-0004HG-En for qemu-devel@nongnu.org; Fri, 21 Nov 2014 03:39:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xrjk5-00032d-9s for qemu-devel@nongnu.org; Fri, 21 Nov 2014 03:39:07 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:33720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xrjk4-00031D-JA for qemu-devel@nongnu.org; Fri, 21 Nov 2014 03:39:01 -0500 Message-ID: <546EFA14.7040603@huawei.com> Date: Fri, 21 Nov 2014 16:38:44 +0800 From: ChenLiang MIME-Version: 1.0 References: <1415272128-8273-1-git-send-email-liang.z.li@intel.com> <1415272128-8273-3-git-send-email-liang.z.li@intel.com> <546EE9C6.10203@huawei.com> <546EF52A.9030103@huawei.com> In-Reply-To: <546EF52A.9030103@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [v2 2/2] migration: Implement multiple compression threads List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Li, Liang Z" Cc: "Zhang, Yang Z" , "armbru@redhat.com" , "qemu-devel@nongnu.org" , "lcapitulino@redhat.com" On 2014/11/21 16:17, ChenLiang wrote: > On 2014/11/21 15:38, Li, Liang Z wrote: > >>>> +int migrate_compress_threads(void) >>>> +{ >>>> + MigrationState *s; >>>> + >>>> + s = migrate_get_current(); >>>> + >>>> + return s->compress_thread_count; >>>> +} >>>> + >>>> int migrate_use_xbzrle(void) >>>> { >>>> MigrationState *s; >>>> @@ -697,4 +795,5 @@ void migrate_fd_connect(MigrationState *s) >>>> >>>> qemu_thread_create(&s->thread, "migration", migration_thread, s, >>>> QEMU_THREAD_JOINABLE); >>>> + migrate_compress_threads_create(s); >> >> >>> don't create compress_threads always. >>> It may be better: >> >>> if (!migrate_use_xbzrle()) { >>> migrate_compress_threads_create(s); >>> } >> >> Thanks for your comments, in fact, the multiple thread compression can co-work with xbrzle, which can help to accelerate live migration. > > > hmm, multiple thread compression can't co-work with xbzrle. xbzrle need guarantee > the cache at src is same to dest. But I dont see that below: > > + /* XBZRLE overflow or normal page */ > + if (bytes_sent == -1) { > + bytes_sent = migrate_save_block_hdr(¶m->migbuf, block, > + offset, cont, RAM_SAVE_FLAG_COMPRESS_PAGE); > + blen = migrate_qemu_add_compress(¶m->migbuf, p, > + TARGET_PAGE_SIZE, migrate_compress_level()); > + bytes_sent += blen; > + atomic_inc(&acct_info.norm_pages); > > the code don't update the cache of xbzrle at src. > >> >>> BTW, this patch is too big to review. Spliting it into some patch will be welcome. >> >> I am doing it. >> >> >> >> >> > > > > > >