Re: [PATCH 02/14] kmemleak: Add documentation on the memory leakdetector

From: Randy Dunlap
Date: Fri Dec 19 2008 - 13:31:24 EST


Catalin Marinas wrote:
> This patch adds the Documentation/kmemleak.txt file with some
> information about how kmemleak works.
>
> Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx>
> ---
> Documentation/kernel-parameters.txt | 4 +
> Documentation/kmemleak.txt | 142 +++++++++++++++++++++++++++++++++++
> 2 files changed, 146 insertions(+), 0 deletions(-)
> create mode 100644 Documentation/kmemleak.txt
>
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index e0f346d..7f5f642 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -1042,6 +1042,10 @@ and is between 256 and 4096 characters. It is defined in the file
> Configure the RouterBoard 532 series on-chip
> Ethernet adapter MAC address.
>
> + kmemleak= [KNL] Boot-time kmemleak enable/disable
> + Valid arguments: on, off
> + Default: on
> +
> l2cr= [PPC]
>
> l3cr= [PPC]
> diff --git a/Documentation/kmemleak.txt b/Documentation/kmemleak.txt
> new file mode 100644
> index 0000000..c84d91b
> --- /dev/null
> +++ b/Documentation/kmemleak.txt
> @@ -0,0 +1,142 @@
> +Kernel Memory Leak Detector
> +===========================
> +
> +Introduction
> +------------
> +
> +Kmemleak provides a way of detecting possible kernel memory leaks in a
> +way similar to a tracing garbage collector
> +(http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29#Tracing_garbage_collectors),
> +with the difference that the orphan objects are not freed but only
> +reported via /sys/kernel/debug/kmemleak. A similar method is used by the
> +Valgrind tool (memcheck --leak-check) to detect the memory leaks in
> +user-space applications.
> +
> +Usage
> +-----
> +
> +CONFIG_DEBUG_KMEMLEAK in "Kernel hacking" has to be enabled. A kernel
> +thread scans the memory every 10 min (by default) and prints any new

minutes

> +unreferenced objects found. To trigger an intermediate scan and display
> +all the possible memory leaks:

Looks good otherwise. Thanks.

--
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/