• Joerg Roedel's avatar
    iommu/iova: Add flush counters to Flush-Queue implementation · fb418dab
    Joerg Roedel authored
    There are two counters:
    
    	* fq_flush_start_cnt  - Increased when a TLB flush
    	                        is started.
    
    	* fq_flush_finish_cnt - Increased when a TLB flush
    				is finished.
    
    The fq_flush_start_cnt is assigned to every Flush-Queue
    entry on its creation. When freeing entries from the
    Flush-Queue, the value in the entry is compared to the
    fq_flush_finish_cnt. The entry can only be freed when its
    value is less than the value of fq_flush_finish_cnt.
    
    The reason for these counters it to take advantage of IOMMU
    TLB flushes that happened on other CPUs. These already
    flushed the TLB for Flush-Queue entries on other CPUs so
    that they can already be freed without flushing the TLB
    again.
    
    This makes it less likely that the Flush-Queue is full and
    saves IOMMU TLB flushes.
    Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
    fb418dab
iova.c 25.8 KB