• Chris Wilson's avatar
    drm/i915: Track number of pending freed objects · c9c70471
    Chris Wilson authored
    During igt, we frequently call into the driver to reset both HW and
    driver state (idling the device, waiting for it to become idle and
    freeing off old objects) to ensure that we start each test/subtest/pass
    from known state. This process incurs an RCU barrier or two to ensure
    that any such pending frees are indeed flushed before we return.
    However, unconditionally waiting on the RCU barrier adds needless delay
    to many callers, which adds up to several seconds when repeated thousands
    of times. We can skip the rcu_barrier() if by tracking how many outstanding
    frees we have, we know there are none.
    
    The same path is used along suspend, where we may be able to save the
    unconditional RCU barrier.
    
    To put it into perspective with a completely meaningless
    microbenchmark, igt/gem_sync/idle is improved from 50ms to 30us on bdw.
    
    v2: Remove the extra synchronize_rcu() inside i915_drop_caches_set()
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
    Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20180219220631.25001-1-chris@chris-wilson.co.uk
    c9c70471
i915_debugfs.c 133 KB