DragonFly BSD
DragonFly kernel List (threaded) for 2006-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: kernel address mapping question

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Feb 2006 12:22:00 -0800 (PST)

:Is there a 1:1 mapping between physical addresses and kernel virtual
:addresses? Or said a different way, can 2 kernel virtual addresses map
:to the same physical address? Does the answer differ depending on
:whether malloc(9) or bus_dmamem_alloc(9) are used? TIA.

    Two KVA addresses *CAN* map to the same physical address.  In addition,
    mappings in the user VM area can also map to the same physical address
    as mappings in KVM.  For example, if a userland mmap()'s a file and
    portions of that file might also reside in the buffer cache.

    Kernel examples include generic mappings made via the SFBUF and MSFBUF
    mapping interfaces, mappings by device drivers, mappings made to
    support 0-copy socket operations (mappings for mbufs), and so forth.  

    Another example would be when the buffer cache is used with block sizes
    which are not integral multiples of PAGE_SIZE.  For example, certain
    areas of the UFS filesystem use 6144 byte blocks.  In this case two 
    adjacent buffers will remap the physical memory page that both buffers

    On 64 bit architectures all of physical memory is mapped into a big
    contiguous section of virtual memory, in addition to all the other 
    mappings the kernel makes.

					Matthew Dillon 

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]