linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Dmitry Vyukov <dvyukov@gmail.com>
Cc: catalin.marinas@arm.com, Dmitry Vyukov <dvyukov@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kmemleak: fix check for softirq context
Date: Fri, 17 May 2019 14:37:46 -0700	[thread overview]
Message-ID: <20190517143746.2157a759f65b4cbc73321124@linux-foundation.org> (raw)
In-Reply-To: <20190517171507.96046-1-dvyukov@gmail.com>

On Fri, 17 May 2019 19:15:07 +0200 Dmitry Vyukov <dvyukov@gmail.com> wrote:

> From: Dmitry Vyukov <dvyukov@google.com>
> 
> in_softirq() is a wrong predicate to check if we are in a softirq context.
> It also returns true if we have BH disabled, so objects are falsely
> stamped with "softirq" comm. The correct predicate is in_serving_softirq().
>
> ...
> 
> --- a/mm/kmemleak.c
> +++ b/mm/kmemleak.c
> @@ -588,7 +588,7 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size,
>  	if (in_irq()) {
>  		object->pid = 0;
>  		strncpy(object->comm, "hardirq", sizeof(object->comm));
> -	} else if (in_softirq()) {
> +	} else if (in_serving_softirq()) {
>  		object->pid = 0;
>  		strncpy(object->comm, "softirq", sizeof(object->comm));
>  	} else {

What are the user-visible runtime effects of this change?


  reply	other threads:[~2019-05-17 21:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 17:15 Dmitry Vyukov
2019-05-17 21:37 ` Andrew Morton [this message]
2019-05-18  7:10   ` Dmitry Vyukov
2019-05-18  9:47     ` Catalin Marinas

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=20190517143746.2157a759f65b4cbc73321124@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=dvyukov@gmail.com \
    --cc=dvyukov@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