Commit d1b2cf6
mm: memcg/slab: uncharge during kmem_cache_free_bulk()
Object cgroup charging is done for all the objects during allocation, but
during freeing, uncharging ends up happening for only one object in the
case of bulk allocation/freeing.
Fix this by having a separate call to uncharge all the objects from
kmem_cache_free_bulk() and by modifying memcg_slab_free_hook() to take
care of bulk uncharging.
Fixes: 964d4bd ("mm: memcg/slab: save obj_cgroup for non-root slab objects"
Signed-off-by: Bharata B Rao <bharata@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Roman Gushchin <guro@fb.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20201009060423.390479-1-bharata@linux.ibm.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 7a52d4d commit d1b2cf6
3 files changed
+30
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3438 | 3438 | | |
3439 | 3439 | | |
3440 | 3440 | | |
3441 | | - | |
| 3441 | + | |
3442 | 3442 | | |
3443 | 3443 | | |
3444 | 3444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
349 | | - | |
| 348 | + | |
| 349 | + | |
350 | 350 | | |
| 351 | + | |
351 | 352 | | |
| 353 | + | |
352 | 354 | | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
356 | 359 | | |
357 | | - | |
358 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
359 | 363 | | |
360 | | - | |
361 | | - | |
362 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
363 | 367 | | |
364 | | - | |
365 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
366 | 372 | | |
367 | | - | |
368 | | - | |
369 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
370 | 377 | | |
371 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
372 | 384 | | |
373 | 385 | | |
374 | 386 | | |
| |||
406 | 418 | | |
407 | 419 | | |
408 | 420 | | |
409 | | - | |
410 | | - | |
| 421 | + | |
| 422 | + | |
411 | 423 | | |
412 | 424 | | |
413 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3095 | 3095 | | |
3096 | 3096 | | |
3097 | 3097 | | |
3098 | | - | |
| 3098 | + | |
3099 | 3099 | | |
3100 | 3100 | | |
3101 | 3101 | | |
| |||
3257 | 3257 | | |
3258 | 3258 | | |
3259 | 3259 | | |
| 3260 | + | |
3260 | 3261 | | |
3261 | 3262 | | |
3262 | 3263 | | |
| |||
0 commit comments