android_kernel_xiaomi_sm7250/include/uapi
Li Li f189d960e4 BACKPORT: FROMGIT: Binder: add TF_UPDATE_TXN to replace outdated txn
When the target process is busy, incoming oneway transactions are
queued in the async_todo list. If the clients continue sending extra
oneway transactions while the target process is frozen, this queue can
become too large to accommodate new transactions. That's why binder
driver introduced ONEWAY_SPAM_DETECTION to detect this situation. It's
helpful to debug the async binder buffer exhausting issue, but the
issue itself isn't solved directly.

In real cases applications are designed to send oneway transactions
repeatedly, delivering updated inforamtion to the target process.
Typical examples are Wi-Fi signal strength and some real time sensor
data. Even if the apps might only care about the lastet information,
all outdated oneway transactions are still accumulated there until the
frozen process is thawed later. For this kind of situations, there's
no existing method to skip those outdated transactions and deliver the
latest one only.

This patch introduces a new transaction flag TF_UPDATE_TXN. To use it,
use apps can set this new flag along with TF_ONE_WAY. When such an
oneway transaction is to be queued into the async_todo list of a frozen
process, binder driver will check if any previous pending transactions
can be superseded by comparing their code, flags and target node. If
such an outdated pending transaction is found, the latest transaction
will supersede that outdated one. This effectively prevents the async
binder buffer running out and saves unnecessary binder read workloads.

Acked-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Li Li <dualli@google.com>
Link: https://lore.kernel.org/r/20220526220018.3334775-2-dualli@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 231624308
Test: manually check async binder buffer size of frozen apps
Test: stress test with kernel 4.14/4.19/5.10/5.15
(cherry picked from commit 9864bb4801331daa48514face9d0f4861e4d485b
 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
  char-misc-next)
Change-Id: I1c4bff1eda1ca15aaaad5bf696c8fc00be743176
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2022-11-12 11:23:12 +00:00
..
asm-generic BACKPORT: mm/madvise: introduce process_madvise() syscall: an external memory hinting API 2022-11-12 11:23:10 +00:00
drm uapi: sde_drm: Define FOD_PRESSED_LAYER_ZORDER 2022-11-12 11:19:46 +00:00
linux BACKPORT: FROMGIT: Binder: add TF_UPDATE_TXN to replace outdated txn 2022-11-12 11:23:12 +00:00
media msm: camera: Increase the total number of camera ID's supported 2022-09-13 12:25:42 +05:30
misc wigig_sensing: change change_mode ioctl signature 2020-01-02 09:20:21 +02:00
mtd ubi: expose the volume CRC check skip flag 2018-08-15 00:25:21 +02:00
rdma RDMA/vmw_pvrdma: Return the correct opcode when creating WR 2019-01-22 21:40:34 +01:00
scsi scsi: ufs: add write booster feature support 2019-10-29 11:05:58 -07:00
sound uapi: sound: add bt external sink delay parameter 2021-12-13 12:10:50 +05:30
video fbdev: msm: snapshot of mdss driver 2020-06-17 06:00:22 +05:30
xen xen/gntdev: Add initial support for dma-buf UAPI 2018-07-26 23:05:14 -04:00