From owner-freebsd-hackers Tue Jul 9 15:31:23 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA13625 for hackers-outgoing; Tue, 9 Jul 1996 15:31:23 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id PAA13618 for ; Tue, 9 Jul 1996 15:31:20 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id IAA07742; Wed, 10 Jul 1996 08:29:54 +1000 Date: Wed, 10 Jul 1996 08:29:54 +1000 From: Bruce Evans Message-Id: <199607092229.IAA07742@godzilla.zeta.org.au> To: hackers@freebsd.org, msmith@atrad.adelaide.edu.au Subject: Re: Odd hang in device driver... Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >I'm seeing a 'Panic: double fault' hang that has me wondering about >the save size of auto data on the kernel stack. I have a function I'll >call 'fooread()' - it's a device driver read function. The kernel stack is about 7K. It has to hold sometimes deeply nested system calls and up to about 10 levels of nested interrupts and traps. It may already be too small for some (extremely rare) worst cases. Don't put large buffers on it. ttwrite() is careful to use only a 100 byte buffer. >To handle some serious application latency problems (not easily curable 8( ) >I recently upped the receive buffer from 1K to 4K, and have subsequently >started seeing these double-fault hangs. What has me wondering about 1K was already dangerously large. >And as an aside which would help me avoid the double copy altogether, is >it fair to say that : > uiomove(buf, a, uio); > uiomove(buf + a, b, uio); >would have the same effect as > uiomove(buf, a + b, uio); >ie. is it possible to call uiomove more than once in a read/write function? Yes, at least provided (a + b) < (residual count before first uiomove). uiomove() just copies the data and advances the pointer and reduces the residual count in the uio struct. This is too complicated to do directly because the user buffers may be split up. Bruce