From owner-freebsd-hackers Tue Dec 5 12:35: 1 2000 From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 5 12:34:57 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 3701537B400; Tue, 5 Dec 2000 12:34:57 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id eB5KYvW27383; Tue, 5 Dec 2000 12:34:57 -0800 (PST) Date: Tue, 5 Dec 2000 12:34:56 -0800 From: Alfred Perlstein To: peter@freebsd.org Cc: dillon@freebsd.org, hackers@freebsd.org Subject: phys backed shm patch. Message-ID: <20001205123456.D8051@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: bright@fw.wintelcom.net Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ok, I spent quite some time trying to figure out why postgresql would "hang" when using the 'kern.ipc.shm_use_phys' sysctl. It finally came down to some spinlocks that were being corrupted in a very tiny shared memory segment. It seems like the phys_pager doesn't correctly allocate when given a non PAGE_SIZE'd 'size' so then I think odd stuff happens to the memory in the pages: Index: phys_pager.c =================================================================== RCS file: /home/ncvs/src/sys/vm/phys_pager.c,v retrieving revision 1.3.2.1 diff -u -u -r1.3.2.1 phys_pager.c --- phys_pager.c 2000/08/04 22:31:11 1.3.2.1 +++ phys_pager.c 2000/12/05 20:13:25 @@ -83,7 +83,7 @@ * Allocate object and associate it with the pager. */ object = vm_object_allocate(OBJT_PHYS, - OFF_TO_IDX(foff + size)); + OFF_TO_IDX(foff + PAGE_MASK + size)); object->handle = handle; TAILQ_INSERT_TAIL(&phys_pager_object_list, object, pager_object_list); I basically grabbed this from the swap_pager.c code and it seems to work. I'd like to commit it to both current and stable asap (afaik no one uses kern.ipc.shm_use_phys anyhow, we missed the boat on Oracle) -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message