>On Tue, 08/01 12:25, Paolo Bonzini wrote: >> On 28/07/2017 02:25, Fam Zheng wrote:
>> > On Thu, 07/27 15:47, Zhang Chen wrote: >> >> CC. Fam and David. >> >> >> >> Any idea about it? >> > >> > Is it possible to use g_main_context_{push,pop}_thread_default to "move" >> > chardev >> > GSources to IOThread's context, then use g_main_context_query like main >> > thread >> > and poll the fds in aio_poll? >> >> How would you do that without making aio_poll performance worse for >> everyone? > >I don't knoe. Maintain a flag and only do these slow stuff after at least one >GSource has been moved around? How about this, when Iothread's GMainContext is NULL, use io_poll, or else use g_main_context_* poll the fds ? Iothread's GMainContext is NULL by default,so use aio_poll in iothread_run function. In addition we can create a new GMainContext in chardev,use g_main_context_* in iothread_run. Maybe this doesn't affect performance ? Thanks WangYong 原始邮件 发件人: <f...@redhat.com> 收件人: <pbonz...@redhat.com> 抄送人: <zhangchen.f...@cn.fujitsu.com>王勇10170530 <lizhij...@cn.fujitsu.com>王广10165992 <jasow...@redhat.com> <qemu-devel@nongnu.org> <dgilb...@redhat.com> <marcandre.lur...@gmail.com> <stefa...@redhat.com> <zhang.zhanghaili...@huawei.com> 日 期 :2017年08月01日 22:52 主 题 :Re: [Qemu-devel] [PATCHv2 02/04] colo-compare: Processpactkets inthe IOThreadofthe primary On Tue, 08/01 12:25, Paolo Bonzini wrote: > On 28/07/2017 02:25, Fam Zheng wrote: > > On Thu, 07/27 15:47, Zhang Chen wrote: > >> CC. Fam and David. > >> > >> Any idea about it? > > > > Is it possible to use g_main_context_{push,pop}_thread_default to "move" > > chardev > > GSources to IOThread's context, then use g_main_context_query like main > > thread > > and poll the fds in aio_poll? > > How would you do that without making aio_poll performance worse for > everyone? I don't knoe. Maintain a flag and only do these slow stuff after at least one GSource has been moved around? Fam