From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 9 17:07:38 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 369F537B401 for ; Wed, 9 Apr 2003 17:07:38 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 1C30643F3F for ; Wed, 9 Apr 2003 17:07:37 -0700 (PDT) (envelope-from silby@silby.com) Received: (qmail 10251 invoked from network); 10 Apr 2003 00:07:35 -0000 Received: from niwun.pair.com (HELO localhost) (209.68.2.70) by relay.pair.com with SMTP; 10 Apr 2003 00:07:35 -0000 X-pair-Authenticated: 209.68.2.70 Date: Wed, 9 Apr 2003 20:04:01 -0500 (CDT) From: Mike Silbersack To: harti@freebsd.org In-Reply-To: <20030409211302.S1322@beagle.fokus.fraunhofer.de> Message-ID: <20030409200025.K472@odysseus.silby.com> References: <20030409114957.GN83126@cicely9.cicely.de> <200304091900.h39J0igT063938@strings.polstra.com> <20030409211302.S1322@beagle.fokus.fraunhofer.de> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1288989415-1049936641=:472" cc: hackers@freebsd.org cc: John Polstra Subject: Re: realtime problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2003 00:07:38 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1288989415-1049936641=:472 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 9 Apr 2003, Harti Brandt wrote: > I first discovered this with the xl driver. Mike Silbersack commited a Hmmm, someone has summoned me? Here's the patch I started and stopped working on a few months back. As you can see, it's small, but it reduces the amount of time spent in mii_tick _greatly_. Most specifically, it doesn't waste time reading the BMSR register twice, because even reading it twice doesn't mean that we don't lose the race! In addition, it takes advantage of the fact that since the link status bit is latch low, we do not need to proceed any further if it's still high, thereby saving another few register accesses. Harti, you're more than welcome to investigate and see if those changes reduce delay for you. :) Mike "Silby" Silbersack --0-1288989415-1049936641=:472 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="mii-linkstatuschanges.patch" Content-Transfer-Encoding: BASE64 Content-ID: <20030409200401.C472@odysseus.silby.com> Content-Description: Content-Disposition: attachment; filename="mii-linkstatuschanges.patch" ZGlmZiAtdSAtciAvdXNyL3NyYy9zeXMub2xkL2Rldi9taWkvZXhwaHkuYyAv dXNyL3NyYy9zeXMvZGV2L21paS9leHBoeS5jDQotLS0gL3Vzci9zcmMvc3lz Lm9sZC9kZXYvbWlpL2V4cGh5LmMJU2F0IERlYyAyMSAwMTo1NTowOCAyMDAy DQorKysgL3Vzci9zcmMvc3lzL2Rldi9taWkvZXhwaHkuYwlUdWUgRGVjIDI0 IDExOjQ0OjQzIDIwMDINCkBAIC0xOTUsNiArMTk1LDcgQEANCiANCiAJc2Mt Pm1paV9jYXBhYmlsaXRpZXMgPQ0KIAkgICAgUEhZX1JFQUQoc2MsIE1JSV9C TVNSKSAmIG1hLT5taWlfY2FwbWFzazsNCisJcHJpbnRmKCJtaWkgY2FwYWJp bGl0aWVzOiAleFxuIiwgc2MtPm1paV9jYXBhYmlsaXRpZXMpOw0KIAlkZXZp Y2VfcHJpbnRmKGRldiwgIiAiKTsNCiAJbWlpX3BoeV9hZGRfbWVkaWEoc2Mp Ow0KIAlwcmludGYoIlxuIik7DQpkaWZmIC11IC1yIC91c3Ivc3JjL3N5cy5v bGQvZGV2L21paS9taWlfcGh5c3Vici5jIC91c3Ivc3JjL3N5cy9kZXYvbWlp L21paV9waHlzdWJyLmMNCi0tLSAvdXNyL3NyYy9zeXMub2xkL2Rldi9taWkv bWlpX3BoeXN1YnIuYwlTYXQgRGVjIDIxIDA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