From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 7 10:11:53 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B25F216A418 for ; Fri, 7 Dec 2007 10:11:53 +0000 (UTC) (envelope-from gheinig@marvell.com) Received: from maili.marvell.com (host2.marvell.com [65.219.4.2]) by mx1.freebsd.org (Postfix) with ESMTP id 9E6CD13C455 for ; Fri, 7 Dec 2007 10:11:53 +0000 (UTC) (envelope-from gheinig@marvell.com) Received: from MSI-MTA.marvell.com (msi-mta.marvell.com [10.68.76.91]) by maili.marvell.com (Postfix) with ESMTP id D44432C146; Fri, 7 Dec 2007 01:43:02 -0800 (PST) Received: from SKGExch01.marvell.com ([10.9.116.16]) by MSI-MTA.marvell.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Dec 2007 01:43:02 -0800 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Fri, 7 Dec 2007 10:43:00 +0100 Message-ID: <4D634BCFD1A2144ABECC75FF512D7A9001DF60BE@SKGExch01.marvell.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Large array in KVM Thread-Index: Acg4PiSHHFvyYEr+QAax8QDwIyI0FAAdhiMw From: "Gerald Heinig" To: "Sonja Milicic" , X-OriginalArrivalTime: 07 Dec 2007 09:43:02.0662 (UTC) FILETIME=[8F6D9A60:01C838B5] Cc: Subject: RE: Large array in KVM X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2007 10:11:53 -0000 Hi Sonja, > Hi everyone. >=20 > I'm working on a kernel module that needs to maintain a large structure > in memory. As this structure could grow too big to be stored in memory, > it would be good to offload parts of it to the disk. What would be the > best way to do this? Could using a memory-mapped file help? How about implementing your code as a system call, which is called from a process that maps a large file into memory, as you suggested above. I presume you'd have to handle the question of whether or not your pages are in memory yourself, ie. pretty much like any other system call. Interesting question. Cheers, Gerald