Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Query on StorPortGetUncachedExtension ??

sachindranath_p_vsachindranath_p_v Member - All Emails Posts: 13
Will StorPortGetUncachedExtension allocate contiguous DMA memory when the value of NumberOfPhysicalBreaks parameter is more than 1

Comments

  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,016
    Yes, StorPortGetUncachedExtension always allocates contiguous memory.

    -scott
    OSR
    @OSRDrivers

    -scott
    OSR

  • Derin_JoseDerin_Jose Member - All Emails Posts: 3
    1. So if the storportgetuncachedextension always allocate continious DMA able memory(either in cpu physical address space or the enddevice's IO virtual address space), I assume the NumberOfPhysicalBreaks parameter is unused within the function ?

    2. So if the system's physical memory becomes too much fragmented, this function is more likely to fail for larger allocations, if no address remapping hardware(IOMMU) is present between the enddevice and memory subsystem?

    3. Any particular reason for not using the NumberOfPhysicalBreaks parameter within this function?
  • sachindranath_p_vsachindranath_p_v Member - All Emails Posts: 13
    Thanks scott.

    The implementation is better explained in its SCSI equivalent. "
    https://msdn.microsoft.com/en-us/library/windows/hardware/ff564639(v=vs.85).aspx
    ".



    On Wed, Nov 29, 2017 at 10:51 PM, xxxxx@gmail.com
    wrote:

    > 1. So if the storportgetuncachedextension always allocate continious DMA
    > able memory(either in cpu physical address space or the enddevice's IO
    > virtual address space), I assume the NumberOfPhysicalBreaks parameter is
    > unused within the function ?
    >
    > 2. So if the system's physical memory becomes too much fragmented, this
    > function is more likely to fail for larger allocations, if no address
    > remapping hardware(IOMMU) is present between the enddevice and memory
    > subsystem?
    >
    > 3. Any particular reason for not using the NumberOfPhysicalBreaks
    > parameter within this function?
    >
    > ---
    > NTDEV is sponsored by OSR
    >
    > Visit the list online at: showlists.cfm?list=ntdev>
    >
    > MONTHLY seminars on crash dump analysis, WDF, Windows internals and
    > software drivers!
    > Details at
    >
    > To unsubscribe, visit the List Server section of OSR Online at <
    > http://www.osronline.com/page.cfm?name=ListServer>;
    >



    --
    Regards
    Sachindranath
  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,016
    <QUOTE>
    1. So if the storportgetuncachedextension always allocate continious DMA
    able memory(either in cpu physical address space or the enddevice's IO
    virtual address space), I assume the NumberOfPhysicalBreaks parameter is
    unused within the function ?
    </

    Correct. NumberOfPhysicalBreaks just indicates how many S/G elements the
    storage adapter can support per-transfer.

    <QUOTE>
    2. So if the system's physical memory becomes too much fragmented, this
    function is more likely to fail for larger allocations, if no address
    remapping hardware(IOMMU) is present between the enddevice and memory
    subsystem?
    </QUOTE>

    Correct.

    <QUOTE>
    3. Any particular reason for not using the NumberOfPhysicalBreaks parameter
    within this function?
    </QUOTE>

    StorPortGetUncachedExtension allocates a common buffer.
    NumberOfPhysicalBreaks relates to I/O buffers.

    -scott
    OSR
    @OSRDrivers

    -scott
    OSR

  • Alex_GrigAlex_Grig Member Posts: 3,238
    Note that modern Windows makes an effort to rearrange assignment of physical page to free up a contiguous range, when necessary.
  • Derin_JoseDerin_Jose Member - All Emails Posts: 3
    Thanks scott.

    <QUOTE>
    Note that modern Windows makes an effort to rearrange assignment of physical
    page to free up a contiguous range, when necessary.
    <QUOTE>

    Does that mean windows is capable to simultaneously modify
    Virtual address -> CPU physical address mappings
    and
    IO virtual address -> CPU physical address mappings, for the common buffer DMA pages allocated for a device, while the device is using those pages(may be by blocking the page table entries during the modification, invalidating ATC cache within the end device etc.), to avoid the memory fragmentation?.
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 12,663
    xxxxx@gmail.com wrote:
    > <QUOTE>
    > Note that modern Windows makes an effort to rearrange assignment of physical
    > page to free up a contiguous range, when necessary.
    > <QUOTE>
    >
    > Does that mean windows is capable to simultaneously modify
    > Virtual address -> CPU physical address mappings
    > and
    > IO virtual address -> CPU physical address mappings, for the common buffer DMA pages allocated for a device, while the device is using those pages(may be by blocking the page table entries during the modification, invalidating ATC cache within the end device etc.), to avoid the memory fragmentation?.

    No.  Common buffers, locked buffers, and mapped IO buffers cannot
    change.  Their physical addresses are sacred.

    However, all the pages in the working set for a process that is not
    currently in a CPU can easily be changed without affecting anyone, at
    the cost of some copies.  That includes, for example, all of your
    executable code.

    --
    Tim Roberts, xxxxx@probo.com
    Providenza & Boekelheide, Inc.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!