Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 May 2011 22:21:42 +0200
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        current@freebsd.org
Subject:   "lazy" mmap for a device driver ?
Message-ID:  <20110531202142.GA7105@onelab2.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
hi,
i have a kernel module implementing a memory mapped special device
which exports a large block of memory to the process.
I see that when the process calls mmap(), my routine foo_mmap()
is called immediately once per page, even though the process is
not actually touching the pages. I believe this happens
through dev_pager_alloc().

Right now i can live with that because all the memory is allocated
at module load time, but i might want to have a sparse memory
region which is populated dynamically, so i was wondering if
there is a way to achieve this. I see there are two other
device routines, d_mmap2 and d_mmap_single, any pointer to
documentation or comments on how they differ ?

thanks
luigi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110531202142.GA7105>