From owner-freebsd-current@FreeBSD.ORG Sat Sep 24 01:14:00 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75ADC106564A; Sat, 24 Sep 2011 01:14:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2413D8FC0C; Sat, 24 Sep 2011 01:13:59 +0000 (UTC) Received: by gxk26 with SMTP id 26so2899541gxk.13 for ; Fri, 23 Sep 2011 18:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=50P4S2CfaEsIX0Phsalyi0M+fmsPUj23xoxSJngtEW8=; b=ogY8GyanXgm2mfizx4dOlHVlV9QEy7fuvukKRfncaM/fBQL3tQvEthU9uLH2iyosE5 gFm3N92PHCrEMt8fMx/qSW9BFAMb9veT0d+LA4+f4DYN2Py+hD1zGFN0RY5xxtN+Z7kC bgh4MKymlQPFIbESrnVcXzLRE72Sl3v5X9FLU= MIME-Version: 1.0 Received: by 10.236.176.65 with SMTP id a41mr25956394yhm.72.1316826839431; Fri, 23 Sep 2011 18:13:59 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.236.111.42 with HTTP; Fri, 23 Sep 2011 18:13:59 -0700 (PDT) In-Reply-To: <4E7CFC42.8000409@FreeBSD.org> References: <4E7CFC42.8000409@FreeBSD.org> Date: Sat, 24 Sep 2011 09:13:59 +0800 X-Google-Sender-Auth: VYf5mnljpbRcZ0iCKcR9G4gx9ik Message-ID: From: Adrian Chadd To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-current@freebsd.org Subject: Re: ath / 802.11n performance issues and timer code X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Sep 2011 01:14:00 -0000 On 24 September 2011 05:38, Alexander Motin wrote: >> When I set kern.eventtimer.periodic=1, the 11n TX/RX performance >> suddenly jumps to where it should be. >> >> Would you mind helping me figure out what the problem is? > > I would be glad to help, but at this moment I am not sure how network > traffic related to timer. May be wireless has some specifics, but for > wired adapters traffic processing happens on network interrupts. Well, here the interrupt handler just sets up some deferred tasks to run via taskqueue_schedule(). This isn't the only driver which does this - I think the gige/10gige NICs also do this. >> I didn't think kern.eventtimer.periodic was needed? > > It should not be needed. > > Have you tried to set kern.eventtimer.idletick=1 instead? I just tested it - it has the same effect. > kern.eventtimer.periodic=1 on UP system effectively includes > kern.eventtimer.idletick=1. kern.eventtimer.idletick=0 may somewhat > increase interrupts overhead due to need to reprogram timer before > context switch, but under high interrupt rate (about few KHz) kernel > should dynamically switch to "quick" mode skipping it. The clock rate interrupt difference is quite startling - at 150mbit 11n bridging (from wlan0 -> arge0 wired) the clock interrupt rate is around 300/sec for idletick=0, and about 1150/sec for idletick=1. The other thing to keep in mind is that the wlreless NIC isn't interrupting per RX or TX completed packet. So although I'm doing ~ 19,000 pps, it's only interrupting me ~ 390 times a second. Adrian