From owner-svn-src-head@FreeBSD.ORG Sat Aug 24 13:34:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 740A6F4C; Sat, 24 Aug 2013 13:34:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 616BC2E8D; Sat, 24 Aug 2013 13:34:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7ODYbDs015526; Sat, 24 Aug 2013 13:34:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7ODYbnT015525; Sat, 24 Aug 2013 13:34:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201308241334.r7ODYbnT015525@svn.freebsd.org> From: Alexander Motin Date: Sat, 24 Aug 2013 13:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254781 - head/sys/netpfil/ipfw 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: Sat, 24 Aug 2013 13:34:37 -0000 Author: mav Date: Sat Aug 24 13:34:36 2013 New Revision: 254781 URL: http://svnweb.freebsd.org/changeset/base/254781 Log: Make dummynet use new direct callout(9) execution mechanism. Since the only thing done by the dummynet handler is taskqueue_enqueue() call, it doesn't need extra switch to the clock SWI context. On idle system this change in half reduces number of active CPU cycles and wakes up only one CPU from sleep instead of two. I was going to make this change much earlier as part of calloutng project, but waited for better solution with skipping idle ticks to be implemented. Unfortunately with 10.0 release coming it is better get at least this. Modified: head/sys/netpfil/ipfw/ip_dummynet.c Modified: head/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dummynet.c Sat Aug 24 13:15:42 2013 (r254780) +++ head/sys/netpfil/ipfw/ip_dummynet.c Sat Aug 24 13:34:36 2013 (r254781) @@ -82,13 +82,15 @@ dummynet(void *arg) { (void)arg; /* UNUSED */ - taskqueue_enqueue(dn_tq, &dn_task); + taskqueue_enqueue_fast(dn_tq, &dn_task); } void dn_reschedule(void) { - callout_reset(&dn_timeout, 1, dummynet, NULL); + + callout_reset_sbt(&dn_timeout, tick_sbt, 0, dummynet, NULL, + C_HARDCLOCK | C_DIRECT_EXEC); } /*----- end of callout hooks -----*/ @@ -2159,12 +2161,12 @@ ip_dn_init(void) DN_LOCK_INIT(); TASK_INIT(&dn_task, 0, dummynet_task, curvnet); - dn_tq = taskqueue_create("dummynet", M_WAITOK, + dn_tq = taskqueue_create_fast("dummynet", M_WAITOK, taskqueue_thread_enqueue, &dn_tq); taskqueue_start_threads(&dn_tq, 1, PI_NET, "dummynet"); callout_init(&dn_timeout, CALLOUT_MPSAFE); - callout_reset(&dn_timeout, 1, dummynet, NULL); + dn_reschedule(); /* Initialize curr_time adjustment mechanics. */ getmicrouptime(&dn_cfg.prev_t);