98e193 Don't iterate the whole /sys/devices just to find drm device

Authored and Committed by liutgnu 3 years ago
    Don't iterate the whole /sys/devices just to find drm device
    
    upstream: fedora
    resolves: bz2003832
    conflict: none
    
    commit c6021648f1db52a5e2eee31ec409efe468fe5af2
    Author: Kairui Song <kasong@redhat.com>
    Date:   Fri Mar 19 18:21:11 2021 +0800
    
        Don't iterate the whole /sys/devices just to find drm device
    
        On some large systems, /sys/devices is huge and it's not a wise idea to
        iterate it. `find` may cause tremendous contention on the kernfs_mutex
        when there are already stress on /sys, and it will perform very very
        poorly.
    
        Simply check if drm class presents should be good enough.
    
        Signed-off-by: Kairui Song <kasong@redhat.com>
        Acked-by: Pingfan Liu <piliu@redhat.com>
    
    Signed-off-by: Tao Liu <ltao@redhat.com>
    
        
file modified
+1 -1