mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Li Zefan <lizefan@huawei.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH v2 1/3] kmemleak: allow freeing internal objects after kmemleak was disabled
Date: Thu, 27 Mar 2014 10:29:18 +0800	[thread overview]
Message-ID: <53338CFE.3060705@huawei.com> (raw)
In-Reply-To: <F7314A69-24BE-42B9-8E99-8F9292B397C4@arm.com>

(Just came back from travelling)

On 2014/3/22 7:37, Catalin Marinas wrote:
> Hi Li,
> 
> On 17 Mar 2014, at 04:07, Li Zefan <lizefan@huawei.com> wrote:
>> Currently if kmemleak is disabled, the kmemleak objects can never be freed,
>> no matter if it's disabled by a user or due to fatal errors.
>>
>> Those objects can be a big waste of memory.
>>
>>  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME
>> 1200264 1197433  99%    0.30K  46164       26    369312K kmemleak_object
>>
>> With this patch, internal objects will be freed immediately if kmemleak is
>> disabled explicitly by a user. If it's disabled due to a kmemleak error,
>> The user will be informed, and then he/she can reclaim memory with:
>>
>> 	# echo off > /sys/kernel/debug/kmemleak
>>
>> v2: use "off" handler instead of "clear" handler to do this, suggested
>>    by Catalin.
> 
> I think there was a slight misunderstanding. My point was about "echo
> scan=off” before “echo off”, they can just be squashed into the
> same action of the latter.
> 

I'm not sure if I understand correctly, so you want the "off" handler to
stop the scan thread but it will never free kmemleak objects until the 
user explicitly trigger the "clear" action, right?

> I would keep the “clear” part separately as per your first patch. I
> recall people asked in the past to still be able to analyse the reports
> even though kmemleak failed or was disabled.
> 


  reply	other threads:[~2014-03-27  2:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17  4:07 Li Zefan
2014-03-17  4:08 ` [PATCH v2 2/3] kmemleak: remove redundant code Li Zefan
2014-03-21 23:40   ` Catalin Marinas
2014-03-17  4:09 ` [PATCH v2 3/3] kmemleak: change some global variables to int Li Zefan
2014-03-21 23:44   ` Catalin Marinas
2014-03-21 23:37 ` [PATCH v2 1/3] kmemleak: allow freeing internal objects after kmemleak was disabled Catalin Marinas
2014-03-27  2:29   ` Li Zefan [this message]
2014-03-27 12:21     ` 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=53338CFE.3060705@huawei.com \
    --to=lizefan@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.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

Powered by JetHome