Skip to content

Commit b7d2fb2

Browse files
authored
Doc: Update Classifier documentation (#126)
Signed-off-by: Jagadeesh Pagadala <jpagadal@qti.qualcomm.com>
1 parent 87fdcc6 commit b7d2fb2

1 file changed

Lines changed: 69 additions & 7 deletions

File tree

docs/README.md

Lines changed: 69 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,75 @@ Userspace resource manager (uRM) contains
9797
- Extension interface provides a way to customize resource-tuner behaviour, by specifying custom resources, custom signals and features.
9898
- Resource-tuner uses YAML based config files, for fetching information relating to resources/signals and properties.
9999
## Contextual Classifier
100-
- Contextual Classifier identifies usecase type based on offline trained model
101-
- Sends signals to Resource Tuner on app opening or launching with app pid and use-case type
102-
- Extracts use-case's further details based on app pid
103-
- Moves focused active app's threads to "Focused" cgroup
104-
- Move previously focused app threads to its origional group
105-
- This is an optional module which can be enabled at compile time
100+
The Contextual Classifier is an optional module designed to identify the static context of workloads (e.g., whether an application is a game, multimedia app, or browser) based on an offline-trained model.
101+
102+
**Key functionalities include:**
103+
- **Process Event Monitoring:** Monitors process creation and termination events via Netlink.
104+
- **Process Classification:** Classifies workloads (e.g., game, multimedia) using fastText (if enabled at build time). If fastText is not built, a default inference mechanism that always classifies the workload as an application.
105+
- **Signal Generation:** Retrieves specific signal details based on classified workload types.
106+
- **Cgroup Management:** Dynamically manages cgroups by moving application threads to designated cgroups.
107+
- **Action Application:** Calls `ApplyActions` to send tuning requests and `RemoveActions` to untune for process events.
108+
- **Configurability:** Influenced by configuration files such as `fasttext_model_supervised.bin`, `classifier-blocklist.txt`, and `ignore-tokens.txt`.
109+
110+
**Flow of Events:**
111+
112+
```
113+
+---------------------------+
114+
| Process Event Listener |
115+
| (NetLinkComm) |
116+
+-------------+-------------+
117+
|
118+
| Catches process events (e.g., fork, exec, exit)
119+
V
120+
+---------------------------+
121+
| HandleProcEv() |
122+
| (Filters and queues events)|
123+
+-------------+-------------+
124+
|
125+
| Notifies worker thread
126+
V
127+
+---------------------------+
128+
| ClassifierMain() |
129+
| (Worker Thread) |
130+
+-------------+-------------+
131+
|
132+
+----(Event Type)----+
133+
| |
134+
V V
135+
+------------+ +------------+
136+
| CC_APP_OPEN| | CC_APP_CLOSE|
137+
+-----+------+ +-----+------+
138+
| |
139+
V V
140+
+-----------------------+ +---------------------------+
141+
| Is Ignored Process? |--->| Move Process to Original |
142+
| (classifier-blocklist)| | Cgroup |
143+
+----------+------------+ +---+-----------------------+
144+
| No |
145+
V V
146+
+---------------------+ +---------------------------+
147+
| ClassifyProcess() | | RemoveActions |
148+
| (MLInference model) | | (untuneSignal) |
149+
+----------+----------+ +---------------------------+
150+
|
151+
V
152+
+---------------------+
153+
| GetSignalDetailsFor |
154+
| Workload() |
155+
+----------+----------+
156+
|
157+
V
158+
+----------------------------+
159+
| MoveAppThreadsToCGroup() |
160+
| (Assign to Focused Cgroup) |
161+
+----------+-----------------+
162+
|
163+
V
164+
+---------------------+
165+
| ApplyActions |
166+
| (tuneSignal) |
167+
+---------------------+
168+
```
106169

107170
---
108171

@@ -1183,4 +1246,3 @@ For questions, suggestions, or contributions, feel free to reach out:
11831246
This project is licensed under the BSD 3-Clause Clear License.
11841247

11851248
<div style="page-break-after: always;"></div>
1186-

0 commit comments

Comments
 (0)