Commit 64b5a749 authored by qiziyu's avatar qiziyu Committed by Treehugger Robot
Browse files

ANDROID: vendor_hooks: add hooks to move certain scenarios' work to a fixed binder thread



Add hooks to support oem's binder feature of improving certain
scenarios sched priority by moving these scenarios' work to
a fixed binder thread.

Add the following new vendor hooks to drivers/android/binder.c:
1 trace_android_vh_binder_spawn_new_thread
	in our os, some binder_transaction will be marked as vip flag,
	it can be named vip transaction, the binder_work within the vip
	transaction can be named vip work.
	here will force a thread (named vip thread) to be spawned and
	skip the normal conditions to spawn a thread. vip thread will
	just select vip transaction to process.
2 trace_android_vh_binder_ioctl_end
	in our os, in binder_proc, about binder threads,special thread
	(called vip thread) will work for special binder_transaction
	(called vip transaction).
	In this hook, We will mark process which need to set up vip
	thread and set the maximum number of VIP threads. So we need
	to expand one ioctl cmd for binder driver, this is the
	internal logic of the hook.
3 trace_android_vh_binder_looper_exited
	while BC_REGISTER_LOOPER cmd, will set special thread as vip
	thread. the flag saved in binder_thread:looper
	here will unset the vip flag saved in binder_thread,
	while BC_EXIT_LOOPER cmd,  if the thread is vip thread(reference
	above about vip thread)
4 trace_android_vh_binder_has_special_work_ilocked
	for special binder thread(called vip thread), it will deal with
	special binder_work (called vip work) within special transaction
	(call vip transaction),
	here, if the thread is vip thread, it will check the vip work if
	exist or not.
5 trace_android_vh_binder_select_special_worklist
	for special binder thread(called vip thread), it will select the
	worklist for special binder_work(called vip work) within special
	binder_transaction(called vip transaction)
	here, it will make sure the selected worklist, the head of it is
	vip work within vip transaction

Bug: 329740751
Bug: 318782978

Change-Id: I8e544d9be2644a6144a9cfbd477e087d46b0073f
Signed-off-by: default avatarsongfeng <songfeng@oppo.com>
Signed-off-by: default avatarqiziyu <qiziyu@oppo.com>
parent 2e22559d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment