From owner-freebsd-hackers Tue Sep 24 23:00:51 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA27549 for hackers-outgoing; Tue, 24 Sep 1996 23:00:51 -0700 (PDT) Received: from critter.tfs.com ([140.145.230.177]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id XAA27406; Tue, 24 Sep 1996 23:00:38 -0700 (PDT) Received: from critter.tfs.com (localhost.tfs.com [127.0.0.1]) by critter.tfs.com (8.7.5/8.7.3) with ESMTP id HAA01797; Wed, 25 Sep 1996 07:59:57 +0200 (MET DST) To: A JOSEPH KOSHY cc: Luigi Rizzo , hackers@freebsd.org, bde@freebsd.org, asami@freebsd.org Subject: Re: Optimizing bzero() In-reply-to: Your message of "Wed, 25 Sep 1996 08:43:52 +0500." <199609250343.AA109333032@fakir.india.hp.com> Date: Wed, 25 Sep 1996 07:59:57 +0200 Message-ID: <1795.843631197@critter.tfs.com> From: Poul-Henning Kamp Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In message <199609250343.AA109333032@fakir.india.hp.com>, A JOSEPH KOSHY writes : >>>>> "phk" == "Poul-Henning Kamp" writes > >phk> The next thing you could start to consider is when people realloc a >phk> multipage allocation to something bigger, it would be nice to be able >phk> to ask the kernel to "move these pages to this address" and then extend >phk> It there instead of copying the contents. > >Makes sense; can this be done without major surgery though? How costly >would it be for malloc(3) to invoke a system call to re-arrange the >address space compared to an memory allocation followed by a bcopy()? cheap(er). >phk> Finally, if you really want to get something done, make stdio use mmap >phk> instead of read on regular files... You save a page per FILE * you >phk> open and a bcopy of the contents of the file... I know writes are >phk> tricky, so just do it for read-only FILE *'s initially. > >If we are at this, why not move to an SFIO like framework? SFIO did support >STDIO in backward compatibility mode and in addition supported `layering' >functionality into the stream; for example; you can `push' a compression >or de-compression layer onto an open FD. Its was also supposed to be >signal-safe. > >I believe the initial implementation of SFIO that was described in the USENIX >paper did use `mmap' and reported a healthy speed up for basic file operations Well, go for it :-) -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@ref.tfs.com TRW Financial Systems, Inc. Future will arrive by its own means, progress not so.