Commit ff8d523
committed
debugobjects: Track object usage to avoid premature freeing of objects
The freelist is freed at a constant rate independent of the actual usage
requirements. That's bad in scenarios where usage comes in bursts. The end
of a burst puts the objects on the free list and freeing proceeds even when
the next burst which requires objects started again.
Keep track of the usage with a exponentially wheighted moving average and
take that into account in the worker function which frees objects from the
free list.
This further reduces the kmem_cache allocation/free rate for a full kernel
compile:
kmem_cache_alloc() kmem_cache_free()
Baseline: 225k 173k
Usage: 170k 117k
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Zhen Lei <[email protected]>
Link: https://lore.kernel.org/all/87bjznhme2.ffs@tglx1 parent 13f9ca7 commit ff8d523
1 file changed
+40
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| |||
427 | 429 | | |
428 | 430 | | |
429 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
430 | 450 | | |
431 | 451 | | |
432 | 452 | | |
433 | 453 | | |
434 | 454 | | |
| 455 | + | |
| 456 | + | |
435 | 457 | | |
436 | 458 | | |
437 | 459 | | |
| |||
450 | 472 | | |
451 | 473 | | |
452 | 474 | | |
453 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
454 | 478 | | |
455 | 479 | | |
456 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
457 | 486 | | |
458 | 487 | | |
459 | 488 | | |
460 | | - | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
461 | 495 | | |
462 | 496 | | |
463 | 497 | | |
| |||
468 | 502 | | |
469 | 503 | | |
470 | 504 | | |
471 | | - | |
472 | | - | |
| 505 | + | |
| 506 | + | |
473 | 507 | | |
| 508 | + | |
474 | 509 | | |
475 | 510 | | |
476 | 511 | | |
| |||
1110 | 1145 | | |
1111 | 1146 | | |
1112 | 1147 | | |
1113 | | - | |
| 1148 | + | |
1114 | 1149 | | |
1115 | 1150 | | |
1116 | 1151 | | |
| |||
0 commit comments