From owner-freebsd-current Thu Sep 13 16: 7:21 2001 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 523E437B405 for ; Thu, 13 Sep 2001 16:07:18 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id JAA10186; Fri, 14 Sep 2001 09:07:05 +1000 Date: Fri, 14 Sep 2001 09:06:42 +1000 (EST) From: Bruce Evans X-X-Sender: To: Warner Losh Cc: Julian Elischer , , Subject: Re: KSE usage, and one forgotten item (PC98) In-Reply-To: <200109130731.f8D7Vut96075@harmony.village.org> Message-ID: <20010914085205.Q14510-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 13 Sep 2001, Warner Losh wrote: > In message <3BA05949.1CCB2D82@elischer.org> Julian Elischer writes: > : All looks good.. obviously the logic of what was going on was easy > : enough to pick up :-) > : > : the only bit I didn't see so easily was: > : ... > : @@ -2860,7 +2861,7 @@ > : /* > : * keep the process from being swapped > : */ > : - PHOLD(p); > : + PROC_LOCK(p); > : bzero((void *)bp, sizeof(*bp)); > : bp->bio_cmd = BIO_FORMAT; > : ... > : the replacement of PHOLD with PROC_LOCK().. I'm not sure of what this actualy > : means.. This means that this version of fd.c has been broken :-). > Since I don't know what either PHOLD or PROC_LOCK are, I don't know if > I did this right. Maybe it is bogus. PHOLD() used to hold the user pages in core while the process waited for i/o to complete. The pc98 version of fd.c is rather out of date, so it still rather bogusly does DMA from the address where sys_generic.c:ioctl() copied the user data. This address may be on the kernel stack, so the driver needs to lock down the user pages until the DMA completes. I'm not sure if PROC_LOCK() does this accidentally. It gives a lock that is too strong in most ways. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message