From owner-freebsd-bugs Sun Jun 14 03:00:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA15416 for freebsd-bugs-outgoing; Sun, 14 Jun 1998 03:00:46 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA15360 for ; Sun, 14 Jun 1998 03:00:40 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id DAA10109; Sun, 14 Jun 1998 03:00:02 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA14618 for ; Sun, 14 Jun 1998 02:55:42 -0700 (PDT) (envelope-from dillon@backplane.com) Received: (dillon@localhost) by apollo.backplane.com (8.8.8/8.6.5) id CAA00381; Sun, 14 Jun 1998 02:55:34 -0700 (PDT) Message-Id: <199806140955.CAA00381@apollo.backplane.com> Date: Sun, 14 Jun 1998 02:55:34 -0700 (PDT) From: Matthew Dillon Reply-To: dillon@backplane.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: i386/6944: bug in i386/isa/icu_ipl.s - AST gets lost, causes extreme network slowdown when cpu-bound processes present, possibly other problems Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 6944 >Category: i386 >Synopsis: icu_ipl.s does has a case commented as can't happen which happens >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jun 14 03:00:01 PDT 1998 >Last-Modified: >Originator: Matthew Dillon >Organization: BEST Internet Communications >Release: FreeBSD 3.0-CURRENT i386 >Environment: FreeBSD-current, June 14 cvs update, PPro 200 w/ PCI 10/100BaseT and SCSI & IDE disks >Description: If FreeBSD is running cpu-bound processes and a network interrupt occurs, causing an swi_net to occur, if the network swi queues an AST (for example, if it wakes up nfsd), the AST will get lost and the nfsd will not get the cpu until the next clock interrupt. This can create severe NFS slowdowns as well as slowdowns to processes being woken up from the network (or even other interrupts). The problem is in icu_ipl.s. The situation: cmpl $SWI_AST,%ecx je splz_nextx /* "can't happen" */ Actually can happen. I'm not exactly sure how it happens, but the result is that that AST gets cleared from ipending without being run. The patch I include re-sets the bit in ipending and also sets the bit in the temporary CPL to prevent it from trying to dispatch it again in the routine. This fixes the problem completely on my machine... now I can run cpu bound programs and bring up xterms and nfsd is no longer effects by the cpu-bound processes. I am marking the bug critical & high priority because it's in the core interrupt code, but the bug does not cause a fatal condition to occur (it just slows down process wakeups massively in the face of a cpu-bound program). >How-To-Repeat: I noticed this trying to run an xterm on my diskless workstation while running crack in the background on my server. The xterm took 30 seconds to come up. Killing the cpu-bound crack and the xterm took 2 seconds to come up. >Fix: Notice! This patch fixes icu_ipl.s. apic_ipl.s might have the same problem. Index: icu_ipl.s =================================================================== RCS file: /src/FreeBSD-CVS/ncvs/src/sys/i386/isa/icu_ipl.s,v retrieving revision 1.3 diff -c -r1.3 icu_ipl.s *** icu_ipl.s 1997/09/02 19:40:13 1.3 --- icu_ipl.s 1998/05/31 09:36:16 *************** *** 107,119 **** ALIGN_TEXT splz_swi: cmpl $SWI_AST,%ecx ! je splz_next /* "can't happen" */ pushl %eax orl imasks(,%ecx,4),%eax movl %eax,_cpl call %edx popl %eax movl %eax,_cpl jmp splz_next /* --- 107,124 ---- ALIGN_TEXT splz_swi: cmpl $SWI_AST,%ecx ! je splz_nextx /* "can't happen" XXX can happen! */ pushl %eax orl imasks(,%ecx,4),%eax movl %eax,_cpl call %edx popl %eax movl %eax,_cpl + jmp splz_next + + splz_nextx: + orl $0x80000000,%eax + orl $0x80000000,_ipending jmp splz_next /* >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message