From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 4BA7110CC0 for ; Thu, 22 Dec 2016 04:14:32 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP; 21 Dec 2016 19:14:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,386,1477983600"; d="scan'208";a="45278585" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga005.jf.intel.com with ESMTP; 21 Dec 2016 19:14:30 -0800 Date: Thu, 22 Dec 2016 11:16:17 +0800 From: Yuanhan Liu To: Stephen Hemminger Cc: dev@dpdk.org, Patrik Andersson , Jan Wickbom Message-ID: <20161222031617.GX18991@yliu-dev.sh.intel.com> References: <1481729401-27546-1-git-send-email-jan.wickbom@ericsson.com> <1482313513-1709-1-git-send-email-yuanhan.liu@linux.intel.com> <20161221100636.71a27b22@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161221100636.71a27b22@xeon-e3> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v6] vhost: allow for many vhost user ports X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2016 03:14:32 -0000 On Wed, Dec 21, 2016 at 10:06:36AM -0800, Stephen Hemminger wrote: > On Wed, 21 Dec 2016 17:45:13 +0800 > Yuanhan Liu wrote: > > > From: Jan Wickbom > > > > Currently select() is used to monitor file descriptors for vhostuser > > ports. This limits the number of ports possible to create since the > > fd number is used as index in the fd_set and we have seen fds > 1023. > > This patch changes select() to poll(). This way we can keep an > > packed (pollfd) array for the fds, e.g. as many fds as the size of > > the array. > > > > Also see: > > http://dpdk.org/ml/archives/dev/2016-April/037024.html > > > > Reported-by: Patrik Andersson > > Signed-off-by: Jan Wickbom > > Signed-off-by: Yuanhan Liu > > Why not epoll()? It scales much better. The old System V poll > is just as bad with 1023 fd's. Indeed, there was a plan to use epoll() to fix this issue. It's been delayed long enough that Jan came up with a fix with poll recently. I don't have strong preference to epoll() over poll, for following reasons: - epoll() is Linux only, though I don't know other platforms (mainly *BSD) actually care vhost-user or not. - epoll indeed scales much better, but I don't think the scale actually matters a lot here: vhost-user negotiation normally happens once on QEMU startup, and it's a short lived process. Both facts make it be non-performance critical. - 1023 is also not a big problem so far: vhost lib hardcodes the max vhost devices we could support to be 1024 after all. For above reasons and Jan already came up with a solution (that would work for most platforms), I think I'm fine with this poll() so far. --yliu