From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5aV5-0005Fn-CB for qemu-devel@nongnu.org; Fri, 11 Jul 2014 09:04:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5aUx-0000ZD-RY for qemu-devel@nongnu.org; Fri, 11 Jul 2014 09:04:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5aUx-0000Ys-HT for qemu-devel@nongnu.org; Fri, 11 Jul 2014 09:04:23 -0400 Date: Fri, 11 Jul 2014 15:04:13 +0200 From: Stefan Hajnoczi Message-ID: <20140711130413.GA4255@stefanha-thinkpad.redhat.com> References: <87B246BB5ED53A4C98E4F9A35839EDE128F6F49D@nkgeml506-mbs.china.huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <87B246BB5ED53A4C98E4F9A35839EDE128F6F49D@nkgeml506-mbs.china.huawei.com> Subject: Re: [Qemu-devel] [PATCH] Tap: fix vcpu long time io blocking on tap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Wangkai (Kevin,C)" Cc: Lee yang , "qemu-devel@nongnu.org" , "aliguori@amazon.com" --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 11, 2014 at 01:05:30AM +0000, Wangkai (Kevin,C) wrote: > When used a tap as net driver for vm, if too many packets was delivered t= o the=20 > guest os via tap interface, the guest os will be blocked on io events for= a long > time, while tap driver was busying process packets. >=20 > kvm vcpu thread block on io lock call trace: > __lll_lock_wait > _L_lock_1004 > __pthread_mutex_lock > qemu_mutex_lock > kvm_cpu_exec > qemu_kvm_cpu_thread_fn > start_thread >=20 > qemu io thread call trace: > ... > qemu_net_queue_send > tap_send > qemu_iohandler_poll > main_loop_wait > main_loop > =20 >=20 > I think the qemu io lock time should be as small as possible, and the io = work > slice should be limited at a particular ration or time. >=20 > --- > Signed-off-by: Wangkai How many packets are you seeing in a single tap_send() call? Have you profiled the tap_send() code path? Maybe it is performing some operation that is very slow. By the way, if you want good performance you should use vhost_net instead of userspace vhost_net. Userspace virtio-net is not very optimized. Stefan --ikeVEW9yuYc//A+q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTv+DNAAoJEJykq7OBq3PIm0YIALijhhTYT653LTOIgNXYCSv+ NWVLPwGSscxSJHmj5SFR+JfEXmm3Mz0mTQPepQMgYUHFN2/0poNHp9Dwsq2WUh6H UfYhmPJUIjufjT9g1cW9QAVgKwn4CitUxQs3sUxgumbYCAPLEU08ocSRx6XOXRTW fNyFhd27cVI2tRPUfmitq4RWDsy/gBkj7J+LTirMg+kVinNEpyp97n/cmuTyaVEq CDPIIFkV+16noX2jHS0jzBVG+9QGsV9ePfnjgIaflilrOgMT3zPM2cykCIPvdWkK b9nqsMXtRJGlc3Uqznxmd9HXNz00UlbyMRN+jVJ3eL3gdnBRBz5fEBI7eraBn9k= =mHx4 -----END PGP SIGNATURE----- --ikeVEW9yuYc//A+q--