From owner-svn-src-head@FreeBSD.ORG Wed May 22 16:32:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 213B13EA; Wed, 22 May 2013 16:32:19 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1366C287; Wed, 22 May 2013 16:32:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4MGWIFS069434; Wed, 22 May 2013 16:32:18 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4MGWIjK069433; Wed, 22 May 2013 16:32:18 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305221632.r4MGWIjK069433@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 22 May 2013 16:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250911 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 16:32:19 -0000 Author: luigi Date: Wed May 22 16:32:18 2013 New Revision: 250911 URL: http://svnweb.freebsd.org/changeset/base/250911 Log: Increase the (arbitrary) limit for the number of packets per tick from 1k to 20k The previous value was good 10 years ago, but not anymore now. More importantly, lots of good surprises: polling is incredibly effective under virtualization, and not only prevents livelock but also saves most of the VM exit overhead in receive mode. Using polling, a FreeBSD instance under qemu-kvm remains perfectly responsive even when bombed with 10 Mpps over an emulated e1000, and happily processes 1.7 Mpps through ipfw. Note that some incompatibilities still remain: e.g. polling is not (yet) compatible with netmap, and seems to freeze the guest when kern.polling.idle_poll=1 MFC after: 3 days Modified: head/sys/kern/kern_poll.c Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Wed May 22 15:15:05 2013 (r250910) +++ head/sys/kern/kern_poll.c Wed May 22 16:32:18 2013 (r250911) @@ -87,12 +87,11 @@ static struct mtx poll_mtx; * The following constraints hold * * 1 <= poll_each_burst <= poll_burst <= poll_burst_max - * 0 <= poll_each_burst * MIN_POLL_BURST_MAX <= poll_burst_max <= MAX_POLL_BURST_MAX */ #define MIN_POLL_BURST_MAX 10 -#define MAX_POLL_BURST_MAX 1000 +#define MAX_POLL_BURST_MAX 20000 static uint32_t poll_burst = 5; static uint32_t poll_burst_max = 150; /* good for 100Mbit net and HZ=1000 */