From owner-freebsd-hackers Thu Dec 7 10: 7: 6 2000 From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 7 10:07:02 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (placeholder-dcat-1076843399.broadbandoffice.net [64.47.83.135]) by hub.freebsd.org (Postfix) with ESMTP id 7762337B401 for ; Thu, 7 Dec 2000 10:07:02 -0800 (PST) Received: (from dillon@localhost) by earth.backplane.com (8.11.1/8.9.3) id eB7I6h410456; Thu, 7 Dec 2000 10:06:43 -0800 (PST) (envelope-from dillon) Date: Thu, 7 Dec 2000 10:06:43 -0800 (PST) From: Matt Dillon Message-Id: <200012071806.eB7I6h410456@earth.backplane.com> To: "Daniel C. Sobral" Cc: News History File User , hackers@FreeBSD.ORG, usenet@tdk.net Subject: Re: vm_pageout_scan badness References: <200012011918.eB1JIol53670@earth.backplane.com> <200012020525.eB25PPQ92768@newsmangler.inet.tele.dk> <200012021904.eB2J4An63970@earth.backplane.com> <200012030700.eB370XJ22476@newsmangler.inet.tele.dk> <200012040053.eB40rnm69425@earth.backplane.com> <200012050545.eB55jL453889@crotchety.newsbastards.org> <200012060519.eB65JS910042@crotchety.newsbastards.org> <200012060713.eB67D8I91529@earth.backplane.com> <3A2F4F57.A7EDEAEC@newsguy.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG : :Matt Dillon wrote: :> :> You may be able to achieve an effect very similar to mlock(), but :> runnable by the 'news' user without hacking the kernel, by :> writing a quick little C program to mmap() the two smaller history :> files and then madvise() the map using MADV_WILLNEED in a loop :> with a sleep(15). Keeping in mind that expire may recreate those :> files, the program should unmap, close(), and re-open()/mmap/madvise the :> descriptors every so often (like once a minute). You shouldn't have :> to access the underlying pages but that would also have a similar :> effect. If you do, use a volatile pointer so GCC doesn't optimize :> the access out of the loop. e.g. : :Err... wouldn't it be better to write a quick little C program that :mlocked the files? It would need suid, sure, but as a small program :without user input it wouldn't have security problems. : :-- :Daniel C. Sobral (8-DCS) :dcs@newsguy.com :dcs@freebsd.org mlock()ing is dangerous when used on a cyclic file. If you aren't careful you can run your system out of memory. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message