From owner-freebsd-mips@FreeBSD.ORG Tue Sep 27 03:36:27 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C261106564A; Tue, 27 Sep 2011 03:36:27 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id C160A8FC14; Tue, 27 Sep 2011 03:36:26 +0000 (UTC) Received: by ywp17 with SMTP id 17so6241606ywp.13 for ; Mon, 26 Sep 2011 20:36:26 -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=e3vu+KCQnPyddaZ7enWH5N+Bt+1gajRj+42qCY/Lpm4=; b=aGaMZ8vExCqJOE1DJyYPem3QJA9nCekOPU5Oko34krvb8wS2Zr/O4S5+vIhrqkDv/+ dq2kVtL1CHELxBYnNWgspHZVrwX7B+FQy0+UfyRanD6bHdFzUyu++R5mGXRqqGh3pyA0 Cck1X/alQ4mp7exdobSdezkdngGPX3JUvxVi0= MIME-Version: 1.0 Received: by 10.236.176.65 with SMTP id a41mr44945415yhm.72.1317094586115; Mon, 26 Sep 2011 20:36:26 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.236.111.42 with HTTP; Mon, 26 Sep 2011 20:36:26 -0700 (PDT) In-Reply-To: References: <201109261053.30410.jhb@freebsd.org> <201109261305.57602.jhb@freebsd.org> Date: Tue, 27 Sep 2011 11:36:26 +0800 X-Google-Sender-Auth: MQwqO8SZOYGGyXDIcSp_xVj1Kuo Message-ID: From: Adrian Chadd To: John Baldwin , attilio@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-current@freebsd.org, freebsd-mips@freebsd.org Subject: Re: ath / 802.11n performance issues and timer code X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 03:36:27 -0000 .. and as a follow up (and cc'ing attillo and freebsd-mips, in case it's relevant to other platforms and there's a MIPS specific thing to fix): * 2128: mi_switch to idle * 2129: kern_clocksource.c:762 - ie, cpu_idleclock() has been called * 2130: the ath interrupt comes in * 2134: it's skipped for now as the idle thread is in a critical section * 2136: kern_clocksource.c:266 - ie, getnextcpuevent(), inside cpu_idleclock(). What I bet is happening is this race between the critical section + cpu_idleclock() and the ath0 interrupt: * idle gets scheduled * critical_enter() is called in the mips cpu_idle() routine * the ath interrupt comes in here and gets handled, but since we're in a critical section, it won't preempt things * the cpu_idleclock() code completes without releasing the preemption, and the only thing that wakes up from that wait is the next interrupt (clock, arge0, etc.) Adrian