From owner-p4-projects@FreeBSD.ORG Fri Sep 3 14:21:49 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 45C4C16A4D0; Fri, 3 Sep 2004 14:21:49 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2244416A4CE for ; Fri, 3 Sep 2004 14:21:49 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1532A43D2F for ; Fri, 3 Sep 2004 14:21:49 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i83ELmml039420 for ; Fri, 3 Sep 2004 14:21:48 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i83ELmY4039417 for perforce@freebsd.org; Fri, 3 Sep 2004 14:21:48 GMT (envelope-from jhb@freebsd.org) Date: Fri, 3 Sep 2004 14:21:48 GMT Message-Id: <200409031421.i83ELmY4039417@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 60954 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Sep 2004 14:21:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=60954 Change 60954 by jhb@jhb_slimer on 2004/09/03 14:21:38 Revert jeff's last hack to this file and restore the previous behavior but in a more optimal fashion. Previously (as in 4.x and 5.2) we waited to return from lapic_ipi_wait() until the IPI was delivered. Jeff changed it to just return immediately and only wait for a short time on the next IPI. While spinwait IPIs like TLB shootdowns and rendezvous ensure that the IPI is delivered before another one is sent, one-shot IPI's like roundrobin, signal, hardclock, and statclock forwards do not wait. So instead, change this code to just wait as long as it needs to until the previous IPI is cleared. My quad xeon can't do a -j4 kernel build without triggering this panic right now, so hopefully this will fix that. Affected files ... .. //depot/projects/smpng/sys/i386/i386/local_apic.c#10 edit Differences ... ==== //depot/projects/smpng/sys/i386/i386/local_apic.c#10 (text+ko) ==== @@ -693,8 +693,8 @@ intr_restore(eflags); } +#ifdef DETECT_DEADLOCK #define BEFORE_SPIN 1000000 -#ifdef DETECT_DEADLOCK #define AFTER_SPIN 1000 #endif @@ -725,9 +725,16 @@ destfield = dest; } +#ifdef DETECT_DEADLOCK + /* Check for an earlier stuck IPI. */ /* Wait for an earlier IPI to finish. */ if (!lapic_ipi_wait(BEFORE_SPIN)) panic("APIC: Previous IPI is stuck"); +#else + /* Wait for an earlier IPI to finish. */ + if (!lapic_ipi_wait(-1)) + panic("APIC: Previous IPI is stuck"); +#endif lapic_ipi_raw(icrlo, destfield);