From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39144 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLHEQ-00079t-S4 for qemu-devel@nongnu.org; Sun, 06 Jun 2010 10:53:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLHEP-0000uS-Nw for qemu-devel@nongnu.org; Sun, 06 Jun 2010 10:53:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20165) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLHEP-0000uN-EM for qemu-devel@nongnu.org; Sun, 06 Jun 2010 10:53:45 -0400 Message-ID: <4C0BB66F.8080005@redhat.com> Date: Sun, 06 Jun 2010 17:53:35 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2 2/2] vnc: threaded VNC server References: <1275657620-26226-1-git-send-email-corentincj@iksaif.net> <1275657620-26226-3-git-send-email-corentincj@iksaif.net> <4C0BAC89.10804@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corentin Chary Cc: Anthony Liguori , Alexander Graf , Qemu-development List , Gautham R Shenoy On 06/06/2010 05:48 PM, Corentin Chary wrote: > On Sun, Jun 6, 2010 at 4:11 PM, Avi Kivity wrote: > >> On 06/04/2010 04:20 PM, Corentin Chary wrote: >> >>> + if (vnc_trylock_display(vd)) { >>> + vd->timer_interval = VNC_REFRESH_INTERVAL_BASE; >>> + qemu_mod_timer(vd->timer, qemu_get_clock(rt_clock) + >>> + vd->timer_interval); >>> + return; >>> + } >>> + >>> has_dirty = vnc_refresh_server_surface(vd); >>> + vnc_unlock_display(vd); >>> >>> >> This could delay the update by quite a bit, no? >> > Yep, but it's far better than waiting the lock because it doesn't slow > down the main thread. > I played big buck bunny trailler (33sec) in mplayer and tight encoding: > - ~40 sec with the non-threaded server > - ~37 sec with a lock > - ~33 sec with a try_lock > Definitely, blocking the main thread is a no-no. >> A more elaborate approach would be to enqueue the refresh job into the >> queue. May need the iothread enabled so we have qemu_mutex. >> > Maybe, but I'd like to wait the generic async work subsystem before > adding different kind of jobs to the queue. And it's already a big > improvment over the current code :). > Hm, ok. >> btw, I could not find other uses of vd->mutex, shouldn't it protect against >> the work thread? >> > Check vnc-jobs.c, there is a qemu_mutex_lock(vs->vd->mutex); > > Shouldn't it use vnc_lock_display()? That's why I missed it. -- error compiling committee.c: too many arguments to function