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>
This commit is contained in:
parent
ad655087c9
commit
c6021648f1
@ -58,7 +58,7 @@ depends() {
|
|||||||
_dep="$_dep znet"
|
_dep="$_dep znet"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$( find /sys/devices -name drm )" ] || [ -d /sys/module/hyperv_fb ]; then
|
if [ -n "$( ls -A /sys/class/drm 2>/dev/null )" ] || [ -d /sys/module/hyperv_fb ]; then
|
||||||
add_opt_module drm
|
add_opt_module drm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user