binder: frozen notification
Frozen processes present a significant challenge in binder transactions. When a process is frozen, it cannot, by design, accept and/or respond to binder transactions. As a result, the sender needs to adjust its behavior, such as postponing transactions until the peer process unfreezes. However, there is currently no way to subscribe to these state change events, making it impossible to implement frozen-aware behaviors efficiently. Introduce a binder API for subscribing to frozen state change events. This allows programs to react to changes in peer process state, mitigating issues related to binder transactions sent to frozen processes. Implementation details: For a given binder_ref, the state of frozen notification can be one of the followings: 1. Userspace doesn't want a notification. binder_ref->freeze is null. 2. Userspace wants a notification but none is in flight. list_empty(&binder_ref->freeze->work.entry) = true 3. A notification is in flight and waiting to be read by userspace. binder_ref_freeze.sent is false. 4. A notification was read by userspace and kernel is waiting for an ack. binder_ref_freeze.sent is true. When a notification is in flight, new state change events are coalesced into the existing binder_ref_freeze struct. If userspace hasn't picked up the notification yet, the driver simply rewrites the state. Otherwise, the notification is flagged as requiring a resend, which will be performed once userspace acks the original notification that's inflight. See https://r.android.com/3070045 for how userspace is going to use this feature. Signed-off-by:Yu-Ting Tseng <yutingtseng@google.com> Acked-by:
Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20240709070047.4055369-4-yutingtseng@google.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
mentioned in commit 03b93dc7
-
mentioned in commit 07a43515
-
mentioned in commit eda05704
-
mentioned in commit a26cde40
-
mentioned in commit 9c6fdb6b
-
mentioned in commit 2791dfac
-
mentioned in commit 194a332e
-
mentioned in commit c5233c56
-
mentioned in commit 51bee181
-
mentioned in commit 6223e3f7
-
mentioned in commit 0ac65144
-
mentioned in commit 575892d9
-
mentioned in commit d30d3876
-
mentioned in commit 3be2f4d7
-
mentioned in commit d8638e41
-
mentioned in commit 2a754286
-
mentioned in commit ad352305
-
mentioned in commit 8b451b4c
-
mentioned in commit c9583577
-
mentioned in commit 8d9faf6b
-
mentioned in commit 61498b87
-
mentioned in commit d04d0acd
-
mentioned in commit 9924be1f
-
mentioned in commit b144ec9b
-
mentioned in commit e607672f
-
mentioned in commit 22fb9335
-
mentioned in commit df222835
-
mentioned in commit ec6e6178
-
mentioned in commit d326e0fa
-
mentioned in commit 67484342
-
mentioned in commit 44706c0a
-
mentioned in commit a151b8e9
-
mentioned in commit f453b69a
-
mentioned in commit 74ea74a8
-
mentioned in commit 21ddfcdc
-
mentioned in commit 6134b563
-
mentioned in commit f99065c1
-
mentioned in commit 4887a139
-
mentioned in commit 76ba061b
-
mentioned in commit d9ce8fbb
-
mentioned in commit 736a6eb5
-
mentioned in commit b5c23f2e
-
mentioned in commit cbc4c6b5
-
mentioned in commit 53ec0fd7
-
mentioned in commit 8a0e0562
-
mentioned in commit 763d2926
-
mentioned in commit 4938d035
-
mentioned in commit eceef430
-
mentioned in commit d9551898
-
mentioned in commit 5796882d
-
mentioned in commit a21eba81
-
mentioned in commit d76401cd
-
mentioned in commit da0d83ee
-
mentioned in commit 466046d2
-
mentioned in commit 50f2d27b
-
mentioned in commit f80dbd78
-
mentioned in commit 864a9f87
-
mentioned in commit 684f594d
-
mentioned in commit 6a4870ad
-
mentioned in commit 33e1518f
-
mentioned in commit 50c0e846
-
mentioned in commit d0bb29eb
-
mentioned in commit d0214293
-
mentioned in commit 74910cb0
-
mentioned in commit 93be4d6a
-
mentioned in commit 00a4e717
-
mentioned in commit 35dc5cca
-
mentioned in commit e5f25727
-
mentioned in commit 29f5a2bc
-
mentioned in commit 234ac5aa
-
mentioned in commit 1853fe02
-
mentioned in commit 0379cbec
-
mentioned in commit d114f080
-
mentioned in commit a440ae89
-
mentioned in commit 114d26c7
-
mentioned in commit 9b6127f2
-
mentioned in commit 2177777d
-
mentioned in commit d54870ba
-
mentioned in commit 59ebb6ed
-
mentioned in commit 7d5f29b1
-
mentioned in commit c6be0f10
-
mentioned in commit 57a83f36
-
mentioned in commit 84ce22b0
-
mentioned in commit 79af9ef7
-
mentioned in commit bbed1562
-
mentioned in commit 222cf609
-
mentioned in commit f019fd4b
-
mentioned in commit 7b892125
-
mentioned in commit af580f5d
-
mentioned in commit 0fb8dec0
-
mentioned in commit 8ab26080
-
mentioned in commit 67a47e75
-
mentioned in commit 610231f9
-
mentioned in commit 1cb3a12b
-
mentioned in commit d4b383d0
-
mentioned in commit 9974689b
-
mentioned in commit 61e00e39
-
mentioned in commit ab735cc5
-
mentioned in commit f2caf8fd
-
mentioned in commit 4fd71992
-
mentioned in commit 55b9357b
-
mentioned in commit 6252f9a2
-
mentioned in commit 3a8b1722
-
mentioned in commit ab383007
-
mentioned in commit 436c45ee
-
mentioned in commit cbb6a800
-
mentioned in commit e21892ad
-
mentioned in commit ddc1a92e
-
mentioned in commit ddc0270f
-
mentioned in commit 5381260a
-
mentioned in commit 92a40389
-
mentioned in commit 9a5ffd1c
-
mentioned in commit f66b6ef3
-
mentioned in commit b8926217
-
mentioned in commit 116264b9