All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Chen Jun <chenjun102@huawei.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	akpm@linux-foundation.org, rui.xiang@huawei.com,
	weiyongjun1@huawei.com
Subject: Re: [PATCH -next 2/5] mm/kmemleak: skip update_checksum for OBJECT_NO_SCAN objects
Date: Tue, 22 Sep 2020 10:03:48 +0100	[thread overview]
Message-ID: <20200922090346.GA15643@gaia> (raw)
In-Reply-To: <20200921020007.35803-3-chenjun102@huawei.com>

On Mon, Sep 21, 2020 at 02:00:04AM +0000, Chen Jun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Objects marked with OBJECT_NO_SCAN are never scanned.
> So there is no need to update checksum for them.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> Signed-off-by: Chen Jun <chenjun102@huawei.com>
> ---
>  mm/kmemleak.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index b3f603fd9fc3..c09c6b59eda6 100644
> --- a/mm/kmemleak.c
> +++ b/mm/kmemleak.c
> @@ -1166,6 +1166,10 @@ static bool update_checksum(struct kmemleak_object *object)
>  {
>  	u32 old_csum = object->checksum;
>  
> +	/* always return false for not scan object */
> +	if (object->flags & OBJECT_NO_SCAN)
> +		return false;

The reason for OBJECT_NO_SCAN is to avoid introducing more false
negatives. The point of the checksum is to reduce the false positives -
i.e. an object that is being modified between scans won't be considered
a (transient) leak even if kmemleak couldn't find a reference pointer to
it.

So please drop this patch.

-- 
Catalin

  reply	other threads:[~2020-09-22  9:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21  2:00 [PATCH -next 0/5] mm/kmemleak:support for percpu memory leak detect Chen Jun
2020-09-21  2:00 ` [PATCH -next 1/5] mm/kmemleak: make create_object return void Chen Jun
2020-09-22  9:57   ` Catalin Marinas
2020-09-21  2:00 ` [PATCH -next 2/5] mm/kmemleak: skip update_checksum for OBJECT_NO_SCAN objects Chen Jun
2020-09-22  9:03   ` Catalin Marinas [this message]
2020-09-21  2:00 ` [PATCH -next 3/5] mm/kmemleak: Add support for percpu memory leak detect Chen Jun
2020-09-22  9:57   ` Catalin Marinas
2020-09-28 14:08     ` chenjun (AM)
2020-09-28 14:16       ` Catalin Marinas
2020-09-21  2:00 ` [PATCH -next 4/5] mm/kmemleak-test: use %px instead of %p in print Chen Jun
2020-09-22  9:58   ` Catalin Marinas
2020-09-21  2:00 ` [PATCH -next 5/5] mm/kmemleak-test: Add a test case for alloc_percpu Chen Jun

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=20200922090346.GA15643@gaia \
    --to=catalin.marinas@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=chenjun102@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rui.xiang@huawei.com \
    --cc=weiyongjun1@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.