Commit 850675c
committed
fast-get: fix partition leak for multi-thread usage
Each thread that calls fast_get() on a large buffer gets a partition
added to its memory domain. Previously, fast_put() only removed the
partition from the allocating thread's domain (entry->thread), leaking
partitions for any additional threads that were granted access.
Fix by having each thread remove its OWN partition on fast_put() using
k_current_get() instead of entry->thread. The partition removal now
happens unconditionally (not just on last reference), ensuring each
thread cleans up after itself.
Order of operations:
1. Free buffer if last reference (while partition still grants access)
2. Remove current thread's partition (prevents leaks)
3. Clear entry if last reference
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>1 parent a32d983 commit 850675c
1 file changed
Lines changed: 22 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| 280 | + | |
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
304 | 287 | | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
311 | 305 | | |
| 306 | + | |
312 | 307 | | |
313 | | - | |
314 | 308 | | |
315 | 309 | | |
316 | 310 | | |
| |||
0 commit comments