From owner-freebsd-current Wed Aug 18 9:41:44 1999 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (Postfix) with ESMTP id 53FB014FBA for ; Wed, 18 Aug 1999 09:41:41 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id JAA47947; Wed, 18 Aug 1999 09:42:07 -0700 (PDT) (envelope-from dillon) Date: Wed, 18 Aug 1999 09:42:07 -0700 (PDT) From: Matthew Dillon Message-Id: <199908181642.JAA47947@apollo.backplane.com> To: Luigi Rizzo Cc: current@FreeBSD.ORG Subject: Re: is pageable memory available in kernel (or will it be ?) References: <199908181350.PAA12671@labinfo.iet.unipi.it> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :Hi, : :i wonder if some form of pageable memory is available (or will be, or :can be done with relatively little effort) to pieces of the lower half :of the kernel. The reason is, the PGM implementation i am working on :might need to work with really huge windows (megabytes) and on the :sender side it is not unlikely to have to store a whole file whatever :its size is. : :I suppose sendfile() might have to deal with a similar problem ? : : cheers : luigi :-----------------------------------+------------------------------------- : Luigi RIZZO, luigi@iet.unipi.it . Dip. di Ing. dell'Informazione The kernel supports the notion of 'managed' pages in KVM, but does not support the notion of actually taking and processing a page fault from supervisor mode. sendfile() pre-reserves a block of KVM and stores the reservation in sf->kva. Essentially, a number of pte entries are being reserved. The memory area is initially unmapped. sendfile() then wires the VM pages associated with the file into this reserved space using pmap_qenter(). It initiates I/O and waits for it to complete when necessary when pages are not already in the VM cache, and unwires them when it is through. DG did a wonderful job writing sendfile, it is very clean code. The only issue with doing this sort of thing in general is that you need to reserve a significant amount of KVM. Fortunately we recently bumped up the amount of KVM in the system so you should be able to safely reserve a significant amount without any potential problems - 5 to 20MB depending. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message