From owner-freebsd-hackers Tue Oct 24 1: 8:12 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp05.primenet.com (smtp05.primenet.com [206.165.6.135]) by hub.freebsd.org (Postfix) with ESMTP id 8A5C037B479; Tue, 24 Oct 2000 01:08:10 -0700 (PDT) Received: (from daemon@localhost) by smtp05.primenet.com (8.9.3/8.9.3) id BAA25961; Tue, 24 Oct 2000 01:08:37 -0700 (MST) Received: from usr01.primenet.com(206.165.6.201) via SMTP by smtp05.primenet.com, id smtpdAAA7taWRY; Tue Oct 24 01:08:30 2000 Received: (from tlambert@localhost) by usr01.primenet.com (8.8.5/8.8.5) id BAA11953; Tue, 24 Oct 2000 01:08:00 -0700 (MST) From: Terry Lambert Message-Id: <200010240808.BAA11953@usr01.primenet.com> Subject: Re: Cache Questions To: msmith@FreeBSD.ORG (Mike Smith) Date: Tue, 24 Oct 2000 08:08:00 +0000 (GMT) Cc: charrer@alacritech.com (Christopher Harrer), freebsd-hackers@FreeBSD.ORG (Freebsd-Hackers) In-Reply-To: <200010232007.e9NK7Ih04538@mass.osd.bsdi.com> from "Mike Smith" at Oct 23, 2000 01:07:18 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > We're working on a driver for a PCI card, we're currently running into a > > problem that's symptomatic of a cache coherency problem. We have a area of > > memory that we manipulate and pass a physical address to our card. In other > > OS's (Linux, NT), before we manipulate this memory area, we mark the area as > > non-cachable. Are there similar operations/system calls we can use in > > FreeBSD? Are there any FAQ's, Docs or man-pages that explain memory > > usage/attributes? > > Take a look at , and particularly mem_range_attr_set(). > > *However*, since the PC architecture is strongly cache coherent, you > probably have a problem with the design or implementation of your > driver:adapter protocol. Marking an entire region of memory as > uncacheable is *very* inefficient; there are much better ways of > maintaining synchronisation without doing this. Mark had a good point about wiring the pages so they don't get swapped, if they are in a swappable region in another thread discussion DMA. He also pointed out that if he was talking about physical pages, that he needs to make sure that they are either contiguous, or that the DMA region doesn't span a page boundary. If the original poster follows -hackers, look for a subject with "DMA in drivers", since the topic appears to be over similar general issues. For that matter, your scatter/gather comments in that thread were also potentially relevent. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message