From owner-freebsd-hackers Wed Jul 10 01:39:52 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA22384 for hackers-outgoing; Wed, 10 Jul 1996 01:39:52 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id BAA22379 for ; Wed, 10 Jul 1996 01:39:49 -0700 (PDT) Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.12/8.6.9) id SAA22914; Wed, 10 Jul 1996 18:05:12 +0930 From: Michael Smith Message-Id: <199607100835.SAA22914@genesis.atrad.adelaide.edu.au> Subject: Re: Odd hang in device driver... To: bde@zeta.org.au (Bruce Evans) Date: Wed, 10 Jul 1996 18:05:11 +0930 (CST) Cc: hackers@freebsd.org, msmith@atrad.adelaide.edu.au In-Reply-To: <199607092229.IAA07742@godzilla.zeta.org.au> from "Bruce Evans" at Jul 10, 96 08:29:54 am MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Bruce Evans stands accused of saying: > > >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. Foo! I've been an application programmer too long; stack size limits never ocurred to me. I moved the copy buffers out into the device structure, but it sounds like uiomove will renmder that unnecessary. > 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. Understood - but I wasn't sure how much state was kept in the uio structure, and reading the code didn't make it terribly clear. Thanks! > Bruce -- ]] Mike Smith, Software Engineer msmith@atrad.adelaide.edu.au [[ ]] Genesis Software genesis@atrad.adelaide.edu.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control (ph/fax) +61-8-267-3039 [[ ]] Collector of old Unix hardware. "Where are your PEZ?" The Tick [[