Commit 448e07ca authored by Zheng Yejian's avatar Zheng Yejian Committed by Zheng Zengkai
Browse files

livepatch: Optimize list_del operation in 'arch_klp_unpatch_func'

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I53WZ9



--------------------------------

Currently when unpatch a function, we check whether 'func_stack' has only
one item then delete it:
  > if (list_is_singular(&func_node->func_stack)) {
  > 	list_del_rcu(&func->stack_node);
  > 	......
  > } else {
  > 	list_del_rcu(&func->stack_node);
  > 	next_func = list_first_or_null_rcu(&func_node->func_stack);
  > 	......
  > }

We can optimize it as delete first then check whether 'func_stack' is
empty or not.

Suggested-by: default avatarXu Kuohai <xukuohai@huawei.com>
Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
Reviewed-by: default avatarKuohai Xu <xukuohai@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent a56f1237
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment