Commit 964d4bd
mm: memcg/slab: save obj_cgroup for non-root slab objects
Store the obj_cgroup pointer in the corresponding place of
page->obj_cgroups for each allocated non-root slab object. Make sure that
each allocated object holds a reference to obj_cgroup.
Objcg pointer is obtained from the memcg->objcg dereferencing in
memcg_kmem_get_cache() and passed from pre_alloc_hook to post_alloc_hook.
Then in case of successful allocation(s) it's getting stored in the
page->obj_cgroups vector.
The objcg obtaining part look a bit bulky now, but it will be simplified
by next commits in the series.
Signed-off-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/20200623174037.3951353-9-guro@fb.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 286e04b commit 964d4bd
File tree
5 files changed
+88
-21
lines changed- include/linux
- mm
5 files changed
+88
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1404 | 1404 | | |
1405 | 1405 | | |
1406 | 1406 | | |
1407 | | - | |
| 1407 | + | |
| 1408 | + | |
1408 | 1409 | | |
1409 | 1410 | | |
1410 | 1411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2973 | 2973 | | |
2974 | 2974 | | |
2975 | 2975 | | |
2976 | | - | |
| 2976 | + | |
| 2977 | + | |
2977 | 2978 | | |
2978 | 2979 | | |
2979 | 2980 | | |
| |||
3029 | 3030 | | |
3030 | 3031 | | |
3031 | 3032 | | |
3032 | | - | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
3033 | 3042 | | |
| 3043 | + | |
3034 | 3044 | | |
3035 | 3045 | | |
3036 | 3046 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3228 | 3228 | | |
3229 | 3229 | | |
3230 | 3230 | | |
| 3231 | + | |
3231 | 3232 | | |
3232 | 3233 | | |
3233 | | - | |
| 3234 | + | |
3234 | 3235 | | |
3235 | 3236 | | |
3236 | 3237 | | |
| |||
3266 | 3267 | | |
3267 | 3268 | | |
3268 | 3269 | | |
3269 | | - | |
| 3270 | + | |
3270 | 3271 | | |
3271 | 3272 | | |
3272 | 3273 | | |
| |||
3307 | 3308 | | |
3308 | 3309 | | |
3309 | 3310 | | |
| 3311 | + | |
3310 | 3312 | | |
3311 | 3313 | | |
3312 | | - | |
| 3314 | + | |
3313 | 3315 | | |
3314 | 3316 | | |
3315 | 3317 | | |
| |||
3323 | 3325 | | |
3324 | 3326 | | |
3325 | 3327 | | |
3326 | | - | |
| 3328 | + | |
3327 | 3329 | | |
3328 | 3330 | | |
3329 | 3331 | | |
| |||
3450 | 3452 | | |
3451 | 3453 | | |
3452 | 3454 | | |
| 3455 | + | |
3453 | 3456 | | |
3454 | 3457 | | |
3455 | 3458 | | |
| |||
3515 | 3518 | | |
3516 | 3519 | | |
3517 | 3520 | | |
| 3521 | + | |
3518 | 3522 | | |
3519 | | - | |
| 3523 | + | |
3520 | 3524 | | |
3521 | 3525 | | |
3522 | 3526 | | |
| |||
3539 | 3543 | | |
3540 | 3544 | | |
3541 | 3545 | | |
3542 | | - | |
| 3546 | + | |
3543 | 3547 | | |
3544 | 3548 | | |
3545 | 3549 | | |
3546 | 3550 | | |
3547 | 3551 | | |
3548 | | - | |
| 3552 | + | |
3549 | 3553 | | |
3550 | 3554 | | |
3551 | 3555 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
473 | 508 | | |
474 | 509 | | |
475 | 510 | | |
| |||
529 | 564 | | |
530 | 565 | | |
531 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
532 | 578 | | |
533 | 579 | | |
534 | 580 | | |
| |||
631 | 677 | | |
632 | 678 | | |
633 | 679 | | |
634 | | - | |
| 680 | + | |
| 681 | + | |
635 | 682 | | |
636 | 683 | | |
637 | 684 | | |
| |||
645 | 692 | | |
646 | 693 | | |
647 | 694 | | |
648 | | - | |
| 695 | + | |
649 | 696 | | |
650 | 697 | | |
651 | 698 | | |
652 | 699 | | |
653 | | - | |
654 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
655 | 703 | | |
656 | 704 | | |
657 | 705 | | |
| |||
663 | 711 | | |
664 | 712 | | |
665 | 713 | | |
666 | | - | |
667 | | - | |
| 714 | + | |
| 715 | + | |
668 | 716 | | |
669 | 717 | | |
670 | 718 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2817 | 2817 | | |
2818 | 2818 | | |
2819 | 2819 | | |
| 2820 | + | |
2820 | 2821 | | |
2821 | | - | |
| 2822 | + | |
2822 | 2823 | | |
2823 | 2824 | | |
2824 | 2825 | | |
| |||
2894 | 2895 | | |
2895 | 2896 | | |
2896 | 2897 | | |
2897 | | - | |
| 2898 | + | |
2898 | 2899 | | |
2899 | 2900 | | |
2900 | 2901 | | |
| |||
3099 | 3100 | | |
3100 | 3101 | | |
3101 | 3102 | | |
| 3103 | + | |
| 3104 | + | |
3102 | 3105 | | |
3103 | 3106 | | |
3104 | 3107 | | |
| |||
3278 | 3281 | | |
3279 | 3282 | | |
3280 | 3283 | | |
| 3284 | + | |
3281 | 3285 | | |
3282 | 3286 | | |
3283 | | - | |
| 3287 | + | |
3284 | 3288 | | |
3285 | 3289 | | |
3286 | 3290 | | |
| |||
3334 | 3338 | | |
3335 | 3339 | | |
3336 | 3340 | | |
3337 | | - | |
| 3341 | + | |
3338 | 3342 | | |
3339 | 3343 | | |
3340 | 3344 | | |
3341 | | - | |
| 3345 | + | |
3342 | 3346 | | |
3343 | 3347 | | |
3344 | 3348 | | |
| |||
0 commit comments