Re: [PATCH 0/2] drivers: android: binder: Introduce Cluster Aware Thread Selection
From: Trieu Huynh
Date: Wed Jul 15 2026 - 11:49:08 EST
On Wed, Jul 15, 2026 at 09:17:48AM +0000, Alice Ryhl wrote:
> On Wed, Jul 15, 2026 at 03:35:50AM +0900, trieu2.huynh wrote:
> > Motivation
> > ----------
> >
> > On asymmetric multi-cluster ARM64 SoCs, the default binder thread
> > selection is topology-blind. Cross-cluster thread wakeups incur severe
> > cache-coherency overhead.
> >
> > Measured performance test [1], especially with schd-dbg tiered threads [2]
> > on baseline (10K iter, 16B payload):
> >
> > Class Tier Avg Latency Count / % of txns
> > ----- ---- ----------- -----------------
> > SCHED_FIFO Same-core 0.089 ms 9,963 / 99.6%
> > (max prio) Same-cluster 0.120 ms 13 / 0.1%
> > Cross-cluster 0.140 ms 24 / 0.2%
> > -----------------------------------------------------
> > Normal Same-core 0.130 ms 4,623 / 46.2%
> > (Other) Same-cluster 0.140 ms 3,290 / 32.9%
> > Cross-cluster 0.190 ms 2,087 / 20.9%
> >
> > Key Observations:
> > (*) For SCHED_FIFO tasks, the scheduler aggressively locks the affinity,
> > keeping 99.6% of txns on the same core, establishing the hardware's
> > ideal latency ceiling (~0.089 ms).
> > (*) For normal tasks, selection is highly fragmented (only 46.2% on
> > same-core). Cross-cluster transactions are ~46% slower (0.19 vs
> > 0.13 ms) due to interconnect overhead and cache invalidation.
> > (*) CTABS aims to close this gap for normal threads by enforcing affinity.
>
> I've been told that GKI has patched wake_up_sync() to make it place the
> recipient on the same CPU if nothing else is scheduled to run there.
>
> * http://r.android.com/1362918
> * http://r.android.com/1145589
>
> Are these patches included in the tree from which you took this
> benchmark?
I am currently using QC source which is based on GKI 6.1.145 [1]
AFAICS, they've already been included while I'm doing this work:
(*) kernel/common: android14-6.1 [2]
https://android.googlesource.com/kernel/common/+/06dc94f19d2f5426a9ab761512b61c0c07c9d750
https://android.googlesource.com/kernel/common/+/3a9495889492ae5132ea995723bf5ed6b045d8fa
(*) kernel/qcom: kernel.lnx.6.1.r31-rel [3]
https://git.codelinaro.org/clo/la/kernel/qcom/-/commit/3a9495889492ae5132ea995723bf5ed6b045d8fa
https://git.codelinaro.org/clo/la/kernel/qcom/-/commit/06dc94f19d2f5426a9ab761512b61c0c07c9d750
[1] https://source.android.com/docs/core/architecture/kernel/gki-android14-6_1-release-builds?hl=vi#september-2025-releases_1
[2] https://android.googlesource.com/kernel/common/+/refs/heads/android14-6.1
[3] https://git.codelinaro.org/clo/la/kernel/qcom/-/tree/kernel.lnx.6.1.r31-rel
BRs,
>
> Alice