Date: Tue, 5 Dec 2000 12:34:56 -0800 From: Alfred Perlstein <bright@wintelcom.net> To: peter@freebsd.org Cc: dillon@freebsd.org, hackers@freebsd.org Subject: phys backed shm patch. Message-ID: <20001205123456.D8051@fw.wintelcom.net>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001205123456.D8051>