From owner-freebsd-current Mon Mar 12 14:31:39 2001 Delivered-To: freebsd-current@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id ECA7737B719 for ; Mon, 12 Mar 2001 14:31:36 -0800 (PST) (envelope-from dillon@earth.backplane.com) Received: (from dillon@localhost) by earth.backplane.com (8.11.2/8.9.3) id f2CMVaL75959; Mon, 12 Mar 2001 14:31:36 -0800 (PST) (envelope-from dillon) Date: Mon, 12 Mar 2001 14:31:36 -0800 (PST) From: Matt Dillon Message-Id: <200103122231.f2CMVaL75959@earth.backplane.com> To: "David Schwartz" Cc: "Mark Murray" , Subject: Re: RE: Ethernet entropy harvesting seriously pessimizes performance References: Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Let me be clear about what I mean by interrupt rate limiting: interrupt() { harvester(...) } harvester(...) { if (queue is not full) { ... add data to queue (reasonably sized queue, like 32 entries) } } queue-runner(...) { for(;;) { sleep for 1/10 second Pull next item (if any) off queue } } That is what my patch does. If a high rate of interrupts occur, the queue becomes full almost instantly because the queue-runner only pulls one item off per 1/10 second. The result is that the harvester() routine effectively becomes a NOP for most of the interrupts. This is the proper solution. It is not appropriate to go bcopy()ing data for every single interrupt routine that calls the harvester, no matter how little data it is. Some interrupts can be processed very quickly and even a small 'fast' procedure can double the interrupt overhead for those interrupts. It is simply not appropriate to go harvesting every time an interrupt occurs. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message