diff options
Diffstat (limited to 'mm/slob.c')
-rw-r--r-- | mm/slob.c | 30 |
1 files changed, 13 insertions, 17 deletions
@@ -490,9 +490,8 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node) | |||
490 | *m = size; | 490 | *m = size; |
491 | ret = (void *)m + align; | 491 | ret = (void *)m + align; |
492 | 492 | ||
493 | kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_KMALLOC, | 493 | trace_kmalloc_node(_RET_IP_, ret, |
494 | _RET_IP_, ret, | 494 | size, size + align, gfp, node); |
495 | size, size + align, gfp, node); | ||
496 | } else { | 495 | } else { |
497 | unsigned int order = get_order(size); | 496 | unsigned int order = get_order(size); |
498 | 497 | ||
@@ -503,9 +502,8 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node) | |||
503 | page->private = size; | 502 | page->private = size; |
504 | } | 503 | } |
505 | 504 | ||
506 | kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_KMALLOC, | 505 | trace_kmalloc_node(_RET_IP_, ret, |
507 | _RET_IP_, ret, | 506 | size, PAGE_SIZE << order, gfp, node); |
508 | size, PAGE_SIZE << order, gfp, node); | ||
509 | } | 507 | } |
510 | 508 | ||
511 | return ret; | 509 | return ret; |
@@ -516,6 +514,8 @@ void kfree(const void *block) | |||
516 | { | 514 | { |
517 | struct slob_page *sp; | 515 | struct slob_page *sp; |
518 | 516 | ||
517 | trace_kfree(_RET_IP_, block); | ||
518 | |||
519 | if (unlikely(ZERO_OR_NULL_PTR(block))) | 519 | if (unlikely(ZERO_OR_NULL_PTR(block))) |
520 | return; | 520 | return; |
521 | 521 | ||
@@ -526,8 +526,6 @@ void kfree(const void *block) | |||
526 | slob_free(m, *m + align); | 526 | slob_free(m, *m + align); |
527 | } else | 527 | } else |
528 | put_page(&sp->page); | 528 | put_page(&sp->page); |
529 | |||
530 | kmemtrace_mark_free(KMEMTRACE_TYPE_KMALLOC, _RET_IP_, block); | ||
531 | } | 529 | } |
532 | EXPORT_SYMBOL(kfree); | 530 | EXPORT_SYMBOL(kfree); |
533 | 531 | ||
@@ -599,16 +597,14 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node) | |||
599 | 597 | ||
600 | if (c->size < PAGE_SIZE) { | 598 | if (c->size < PAGE_SIZE) { |
601 | b = slob_alloc(c->size, flags, c->align, node); | 599 | b = slob_alloc(c->size, flags, c->align, node); |
602 | kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_CACHE, | 600 | trace_kmem_cache_alloc_node(_RET_IP_, b, c->size, |
603 | _RET_IP_, b, c->size, | 601 | SLOB_UNITS(c->size) * SLOB_UNIT, |
604 | SLOB_UNITS(c->size) * SLOB_UNIT, | 602 | flags, node); |
605 | flags, node); | ||
606 | } else { | 603 | } else { |
607 | b = slob_new_pages(flags, get_order(c->size), node); | 604 | b = slob_new_pages(flags, get_order(c->size), node); |
608 | kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_CACHE, | 605 | trace_kmem_cache_alloc_node(_RET_IP_, b, c->size, |
609 | _RET_IP_, b, c->size, | 606 | PAGE_SIZE << get_order(c->size), |
610 | PAGE_SIZE << get_order(c->size), | 607 | flags, node); |
611 | flags, node); | ||
612 | } | 608 | } |
613 | 609 | ||
614 | if (c->ctor) | 610 | if (c->ctor) |
@@ -646,7 +642,7 @@ void kmem_cache_free(struct kmem_cache *c, void *b) | |||
646 | __kmem_cache_free(b, c->size); | 642 | __kmem_cache_free(b, c->size); |
647 | } | 643 | } |
648 | 644 | ||
649 | kmemtrace_mark_free(KMEMTRACE_TYPE_CACHE, _RET_IP_, b); | 645 | trace_kmem_cache_free(_RET_IP_, b); |
650 | } | 646 | } |
651 | EXPORT_SYMBOL(kmem_cache_free); | 647 | EXPORT_SYMBOL(kmem_cache_free); |
652 | 648 | ||