• Dave Jiang's avatar
    dmaengine: idxd: process user page faults for completion record · c40bd7d9
    Dave Jiang authored
    DSA supports page fault handling through PRS. However, the DMA engine
    that's processing the descriptor is blocked until the PRS response is
    received. Other workqueues sharing the engine are also blocked.
    Page fault handing by the driver with PRS disabled can be used to
    mitigate the stalling.
    
    With PRS disabled while ATS remain enabled, DSA handles page faults on
    a completion record by reporting an event in the event log. In this
    instance, the descriptor is completed and the event log contains the
    completion record address and the contents of the completion record. Add
    support to the event log handling code to fault in the completion record
    and copy the content of the completion record to user memory.
    
    A bitmap is introduced to keep track of discarded event log entries. When
    the user process initiates ->release() of the char device, it no longer is
    interested in any remaining event log entries tied to the relevant wq and
    PASID. The driver will mark the event log entry index in the bitmap. Upon
    encountering the entries during processing, the event log handler will just
    clear the bitmap bit and skip the entry rather than attempt to process the
    event log entry.
    Tested-by: default avatarTony Zhu <tony.zhu@intel.com>
    Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
    Co-developed-by: default avatarFenghua Yu <fenghua.yu@intel.com>
    Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
    Link: https://lore.kernel.org/r/20230407203143.2189681-10-fenghua.yu@intel.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    c40bd7d9
idxd.h 9.05 KB