【负载均衡、负载计算】【propagate_entity_load_avg】

对于组调度而言,需要传播负载的变化到整个cfs列表里面。propagate_entity_load_avg就负责传播组调度负载的变化

propagate_entity_load_avg

/* Update task and its cfs_rq load average */
static inline int propagate_entity_load_avg(struct sched_entity *se)
{
	struct cfs_rq *cfs_rq;
	//只有group下面才有cfs_rq,才需要传播
	if (entity_is_task(se))
		return 0;

	if (!test_and_clear_tg_cfs_propagate(se))
		return 0;
	/* 获取se所在的cfs_rq */
	cfs_rq = cfs_rq_of(se);

	set_tg_cfs_propagate(cfs_rq);
	/* 更新group se与其所在的cfs_rq中的负载 */
	update_tg_cfs_util(cfs_rq, se);
	update_tg_cfs_load(cfs_rq, se);

	trace_sched_load_cfs_rq(cfs_rq);
	trace_sched_load_se(se);

	return 1;
}

// 将cfs_rq->propagate_avg 设置为1
static inline void set_tg_cfs_propagate(struct cfs_rq *cfs_rq)
{
	cfs_rq->propagate_avg = 1;
}

// 将cfs_rq->propagate_avg 设置为0
static inline int test_and_clear_tg_cfs_propagate(struct sched_entity *se)
{
	struct cfs_rq *cfs_rq = group_cfs_rq(se);

	if (!cfs_rq->propagate_avg)
		return 0;

	cfs_rq->propagate_avg = 0;
-exception_panic_reason:Oops - Undefined instruction: Fatal exception -exception_file_infoi:not-bugon -exception_task_id:18051 -exception_task_family:[ptz-bgd-1-IMAGE, 18051][main, 585] -exception_pc_symbol:[<ffffffc0082310f4>] propagate_entity_load_avg+0xf8/0x35c -exception_stack_info:[<ffffffc001806994>] get_exception_stack_info+0x150/0x2d8 [sysdump] [<ffffffc0018067ec>] prepare_exception_info+0x16c/0x1c4 [sysdump] [<ffffffc0018099c4>] sysdump_panic_event+0x76c/0x8ec [sysdump] [<ffffffc0082044fc>] atomic_notifier_call_chain+0x8c/0x138 [<ffffffc0081b4d64>] panic+0x1b8/0x44c [<ffffffc0081137bc>] die+0x5a0/0x67c [<ffffffc008114748>] do_el1_undef+0x68/0x98 [<ffffffc00977cd60>] el1_undef+0x34/0x54 [<ffffffc00977cc04>] el1h_64_sync_handler+0x54/0xb4 [<ffffffc008091310>] el1h_64_sync+0x7c/0x80 [<ffffffc0082310f4>] propagate_entity_load_avg+0xf8/0x35c [<ffffffc008230da4>] update_load_avg+0x1b4/0x40c [<ffffffc008231b74>] propagate_entity_cfs_rq+0x88/0x1f4 [<ffffffc0082341f8>] detach_entity_cfs_rq+0x84/0xb4 [<ffffffc0082331d4>] migrate_task_rq_fair+0x64/0x1c0 [<ffffffc0082182d8>] set_task_cpu+0xd8/0x2ac [<ffffffc0018d6c20>] lb_pull_tasks+0x1b8/0x278 [unisoc_sched] [<ffffffc0018d3028>] android_rvh_sched_newidle_balance+0x298/0x344 [unisoc_sched] [<ffffffc008238b48>] newidle_balance+0x88/0x79c [<ffffffc00823d21c>] pick_next_task_fair+0x5c/0x3dc [<ffffffc0091ef33c>] binder_wait_for_work+0x178/0x48c [<ffffffc0091ec080>] binder_thread_read+0x270/0x2bc4 [<ffffffc0091e7e98>] binder_ioctl_write_read+0x120/0x588 [<ffffffc0091e2bbc>] binder_ioctl+0x1c4/0xfd8 [<ffffffc0085eff20>] __arm64_sys_ioctl+0x184/0x20c [<ffffffc00811fb68>] invoke_syscall+0x60/0x150 [<ffffffc00811fa9c>] el0_svc_common+0x8c/0xf8 [<ffffffc00811f9a0>] do_el0_svc+0x28/0x98 [<ffffffc00977d248>] el0_svc+0x24/0x84 [<ffffffc00977d1c0>] el0t_64_sync_handler+0x88/0xec [<ffffffc00809164c>] el0t_64_sync+0x1b8/0x1bc
06-20
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值