linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Alexander Potapenko <glider@google.com>,
	akpm@linux-foundation.org, dvyukov@google.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lib/stackdepot.c: use a non-instrumented version of memcpy()
Date: Wed, 16 May 2018 19:47:03 +0300	[thread overview]
Message-ID: <f8a737c1-8cb9-15e1-2d98-454a4cafc1ed@virtuozzo.com> (raw)
In-Reply-To: <20180516153434.24479-1-glider@google.com>

On 05/16/2018 06:34 PM, Alexander Potapenko wrote:
> stackdepot used to call memcpy(), which compiler tools normally
> instrument, therefore every lookup used to unnecessarily call instrumented
> code.  This is somewhat ok in the case of KASAN, but under KMSAN a lot of
> time was spent in the instrumentation.
> 
> (A similar change has been previously committed for memcmp())
> 
> Signed-off-by: Alexander Potapenko <glider@google.com>
> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
> Cc: Dmitry Vyukov <dvyukov@google.com>
> ---
>  lib/stackdepot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/stackdepot.c b/lib/stackdepot.c
> index e513459a5601..d48c744fa750 100644
> --- a/lib/stackdepot.c
> +++ b/lib/stackdepot.c
> @@ -140,7 +140,7 @@ static struct stack_record *depot_alloc_stack(unsigned long *entries, int size,
>  	stack->handle.slabindex = depot_index;
>  	stack->handle.offset = depot_offset >> STACK_ALLOC_ALIGN;
>  	stack->handle.valid = 1;
> -	memcpy(stack->entries, entries, size * sizeof(unsigned long));
> +	__memcpy(stack->entries, entries, size * sizeof(unsigned long));

This has no effect. Since the whole file is not instrumented memcpy automagically replaced with __memcpy.

  reply	other threads:[~2018-05-16 16:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 15:34 Alexander Potapenko
2018-05-16 16:47 ` Andrey Ryabinin [this message]
2018-05-17  8:53   ` Alexander Potapenko
2018-05-18  1:04 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8a737c1-8cb9-15e1-2d98-454a4cafc1ed@virtuozzo.com \
    --to=aryabinin@virtuozzo.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox