mirror of
https://github.com/ARM-software/devlib.git
synced 2025-02-14 17:07:50 +00:00
module/hotplug: optimize online_all
Optimize online_all by offloading it to a shutils function which only requres a single call to the target.
This commit is contained in:
parent
d7ca39e4d1
commit
f042646792
@ -195,6 +195,19 @@ cgroups_freezer_set_state() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Hotplug
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
hotplug_online_all() {
|
||||||
|
PATHS=(/sys/devices/system/cpu/cpu[0-9]*)
|
||||||
|
for path in "${PATHS[@]}"; do
|
||||||
|
if [ $(cat $path/online) -eq 0 ]; then
|
||||||
|
echo 1 > $path/online
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Misc
|
# Misc
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -252,6 +265,9 @@ cgroups_freezer_set_state)
|
|||||||
ftrace_get_function_stats)
|
ftrace_get_function_stats)
|
||||||
ftrace_get_function_stats
|
ftrace_get_function_stats
|
||||||
;;
|
;;
|
||||||
|
hotplug_online_all)
|
||||||
|
hotplug_online_all
|
||||||
|
;;
|
||||||
read_tree_values)
|
read_tree_values)
|
||||||
read_tree_values $*
|
read_tree_values $*
|
||||||
;;
|
;;
|
||||||
|
@ -21,7 +21,8 @@ class HotplugModule(Module):
|
|||||||
return target.path.join(cls.base_path, cpu, 'online')
|
return target.path.join(cls.base_path, cpu, 'online')
|
||||||
|
|
||||||
def online_all(self):
|
def online_all(self):
|
||||||
self.online(*range(self.target.number_of_cpus))
|
self.target._execute_util('hotplug_online_all',
|
||||||
|
as_root=self.target.is_rooted)
|
||||||
|
|
||||||
def online(self, *args):
|
def online(self, *args):
|
||||||
for cpu in args:
|
for cpu in args:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user