Re: mmap() vs. character special file




Hello!

On Sat, 24 Jun 2006, Stanislav Sedov wrote:
I'm curious about mmap()ing devices (particularly, HDD slices). The manpage
mentions character special files only once:

You cannot mmap ata devices (as well as scsi ones), since mmap functions
was not implemented. Actually, only few devices have such support
(e.g. drm, bktr).

mmap requires device to return pointer to contigues memory range -
drm, for example, returns pointer to physical memory of the graphical
adapter.

Implementing mmap for disk devices involves complicated VM intercations,
since you cannot simply return pointer to "physical" memory. Actually,
implementing mmap, IMHO, doesn't worth efforts to do this.

Thank you for the clarification. Actually I won't say that I can't
live w/o mmap() support for disks ;) I consider mmap() to be handy when
process should modify several bytes of the disk contents and write
them back (e.g., disklabel edition). Of course, those tasks are very
specific, so implementing mmap() just for them is an overkill.

Stanislav Sedov MBSD labs, Inc. <ssedov@xxxxxxxxxxx>
Россия, Москва http://mbsd.msk.ru

Sincerely, Dmitry
--
Atlantis ISP, System Administrator
e-mail: dmitry@xxxxxxxxxxxxxx
nic-hdl: LYNX-RIPE
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: zetabyte-fs already implemented in build 51?
    ... mmap() file ... > disk is full. ... write zeros into every byte of a giant file. ...
    (comp.unix.solaris)
  • Re: Reading via mmap stinks (Re: weird bugs with mmap-ing via NFS)
    ... :is about 96% busy whilst loading the cache. ... In the cache case, mmap ... the disk would not be running at near 100%. ... the data set multiple times using grep and grep --mmap. ...
    (freebsd-stable)
  • Re: Is Greenspun enough?
    ... > George Neuner wrote: ... >> Seriously, you need to read up on MMUs, virtual memory and demand ... > that they cache everything from disk, ... The caching sometimes happens at first access, and not at mmap time. ...
    (comp.lang.lisp)
  • Re: file access via read/write vs mmap() interface
    ... function and i have a bit of understanding of its use and purpose. ... and it can support files of any size. ... Memory] can't support any file access with mmap() whose size is more ...
    (comp.unix.programmer)
  • Re: file access via read/write vs mmap() interface
    ... function and i have a bit of understanding of its use and purpose. ... and it can support files of any size. ... Memory] can't support any file access with mmap() whose size is more ...
    (comp.unix.programmer)