From: Xishi Qiu <qiuxishi@huawei.com>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Vegard Nossum <vegardno@ifi.uio.no>,
Pekka Enberg <penberg@kernel.org>, Mel Gorman <mgorman@suse.de>,
the arch/x86 maintainers <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux MM <linux-mm@kvack.org>, Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH V2] mm: add a new command-line kmemcheck value
Date: Tue, 18 Feb 2014 20:38:11 +0800 [thread overview]
Message-ID: <53035433.3000405@huawei.com> (raw)
In-Reply-To: <CAOMGZ=Ht22+KuYwmGcJB4gkiu3EpFfj1EFoAF7Mtd7WvjXwJ3A@mail.gmail.com>
On 2014/2/18 18:28, Vegard Nossum wrote:
> On 17 February 2014 03:34, Xishi Qiu <qiuxishi@huawei.com> wrote:
>> If we want to debug the kernel memory, we should turn on CONFIG_KMEMCHECK
>> and rebuild the kernel. This always takes a long time and sometimes
>> impossible, e.g. users don't have the kernel source code or the code
>> is different from "www.kernel.org" (private features may be added to the
>> kernel, and usually users can not get the whole code).
>>
>> This patch adds a new command-line "kmemcheck=3", then the kernel will run
>> as the same as CONFIG_KMEMCHECK=off even CONFIG_KMEMCHECK is turn on.
>> "kmemcheck=0/1/2" is the same as originally. This means we can always turn
>> on CONFIG_KMEMCHECK, and use "kmemcheck=3" to control it on/off with out
>> rebuild the kernel.
>>
>> In another word, "kmemcheck=3" is equivalent:
>> 1) turn off CONFIG_KMEMCHECK
>> 2) rebuild the kernel
>> 3) reboot
>>
>> The different between kmemcheck=0 and 3 is the used memory and nr_cpus.
>> Also kmemcheck=0 can used in runtime, and kmemcheck=3 is only used in boot.
>> boottime: kmemcheck=0/1/2/3 (command-line)
>> runtime: kmemcheck=0/1/2 (/proc/sys/kernel/kmemcheck)
>
> This is not the right way to do what you want.
>
> The behaviour that we want is:
>
> - CONFIG_KMEMCHECK=y + kmemcheck=0 (boot parameter) should have a
> minimal runtime impact and not limit the number of CPUs
> - CONFIG_KMEMCHECK=y + kmemcheck=1 should limit the number of CPUs during boot
> - setting kmemcheck to 1 via /proc/sys/kernel/kmemcheck should
> probably return an error if more than 1 CPU is online
>
>
> Vegard
>
Hi Vegard,
Thank you for your reply. If we only use "kmemcheck=0" to control, how about
the used memory? Will it use about twice as much memory as normal?
Thanks,
Xishi Qiu
> .
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Xishi Qiu <qiuxishi@huawei.com>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
"Vegard Nossum" <vegardno@ifi.uio.no>,
Pekka Enberg <penberg@kernel.org>, Mel Gorman <mgorman@suse.de>,
the arch/x86 maintainers <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux MM <linux-mm@kvack.org>, Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH V2] mm: add a new command-line kmemcheck value
Date: Tue, 18 Feb 2014 20:38:11 +0800 [thread overview]
Message-ID: <53035433.3000405@huawei.com> (raw)
In-Reply-To: <CAOMGZ=Ht22+KuYwmGcJB4gkiu3EpFfj1EFoAF7Mtd7WvjXwJ3A@mail.gmail.com>
On 2014/2/18 18:28, Vegard Nossum wrote:
> On 17 February 2014 03:34, Xishi Qiu <qiuxishi@huawei.com> wrote:
>> If we want to debug the kernel memory, we should turn on CONFIG_KMEMCHECK
>> and rebuild the kernel. This always takes a long time and sometimes
>> impossible, e.g. users don't have the kernel source code or the code
>> is different from "www.kernel.org" (private features may be added to the
>> kernel, and usually users can not get the whole code).
>>
>> This patch adds a new command-line "kmemcheck=3", then the kernel will run
>> as the same as CONFIG_KMEMCHECK=off even CONFIG_KMEMCHECK is turn on.
>> "kmemcheck=0/1/2" is the same as originally. This means we can always turn
>> on CONFIG_KMEMCHECK, and use "kmemcheck=3" to control it on/off with out
>> rebuild the kernel.
>>
>> In another word, "kmemcheck=3" is equivalent:
>> 1) turn off CONFIG_KMEMCHECK
>> 2) rebuild the kernel
>> 3) reboot
>>
>> The different between kmemcheck=0 and 3 is the used memory and nr_cpus.
>> Also kmemcheck=0 can used in runtime, and kmemcheck=3 is only used in boot.
>> boottime: kmemcheck=0/1/2/3 (command-line)
>> runtime: kmemcheck=0/1/2 (/proc/sys/kernel/kmemcheck)
>
> This is not the right way to do what you want.
>
> The behaviour that we want is:
>
> - CONFIG_KMEMCHECK=y + kmemcheck=0 (boot parameter) should have a
> minimal runtime impact and not limit the number of CPUs
> - CONFIG_KMEMCHECK=y + kmemcheck=1 should limit the number of CPUs during boot
> - setting kmemcheck to 1 via /proc/sys/kernel/kmemcheck should
> probably return an error if more than 1 CPU is online
>
>
> Vegard
>
Hi Vegard,
Thank you for your reply. If we only use "kmemcheck=0" to control, how about
the used memory? Will it use about twice as much memory as normal?
Thanks,
Xishi Qiu
> .
>
next prev parent reply other threads:[~2014-02-18 12:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 2:34 [PATCH V2] mm: add a new command-line kmemcheck value Xishi Qiu
2014-02-17 2:34 ` Xishi Qiu
2014-02-18 10:28 ` Vegard Nossum
2014-02-18 10:28 ` Vegard Nossum
2014-02-18 12:38 ` Xishi Qiu [this message]
2014-02-18 12:38 ` Xishi Qiu
2014-02-18 21:47 ` Dave Hansen
2014-02-18 21:47 ` Dave Hansen
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=53035433.3000405@huawei.com \
--to=qiuxishi@huawei.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizefan@huawei.com \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=penberg@kernel.org \
--cc=vegard.nossum@gmail.com \
--cc=vegardno@ifi.uio.no \
--cc=x86@kernel.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 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.