ANDROID: binder: Add vendor hooks to implement the feature of
binder_proc->fg_todo list
1. The implementation logic of this feature
1) In trace_android_vh_binder_list_add_work, record the sequence of work, work->android_oem_data1 = atomic64_inc_return(&binder_work_seq).
2) In the binder_proc_transaction() function, for special synchronized
binders, if a thread is not found, t->work will be added to proc->fg_todo in trace_android_vh_binder_special_task().
3) binder_thread_read() -> trace_android_vh_binder_select_special_worklist()
will select work to execute from proc->fg_todo according to a specific
algorithm, such as selecting the thread->todo first, then selecting two
proc->fg_todo works, and then one proc->todo work, while taking into account the sequence of work (work->android_oem_data1).
proc->ANDROID_OEM_DATA(1) is used to generate proc->fg_todo list, and it
was committed in the id 8a3740893d9957783493364b118282daa71695cc by other colleagues.
2. trace_android_vh_binder_list_add_work: record the sequence of work.
3. trace_android_vh_binder_has_proc_work_ilocked: Check if there is work
in proc->fg_todo list, and if so, then binder_wakeup_proc_ilocked.
4. trace_android_vh_binder_release_special_work: release the work on
proc->fg_todo list.
Bug: 334746237
Change-Id: I855618ee129fe1bb5925b169d24eb2301ad90664
Signed-off-by:
Fuchun Liao <lfc@oppo.com>
Loading
Please sign in to comment