Re: [PATCH v3 2/4] kmemleak: allow freeing internal objects after kmemleak was disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



More nitpicks ;)

On Fri, Mar 28, 2014 at 08:53:18AM +0000, Li Zefan wrote:
> diff --git a/Documentation/kmemleak.txt b/Documentation/kmemleak.txt
> index 6dc8013..a7e6a06 100644
> --- a/Documentation/kmemleak.txt
> +++ b/Documentation/kmemleak.txt
> @@ -51,7 +51,8 @@ Memory scanning parameters can be modified at run-time by writing to the
>  		  (default 600, 0 to stop the automatic scanning)
>    scan		- trigger a memory scan
>    clear		- clear list of current memory leak suspects, done by
> -		  marking all current reported unreferenced objects grey
> +		  marking all current reported unreferenced objects grey.
> +		  Or free all kmemleak objects if kmemleak has been disabled.

Comma after "unreferenced objects grey" and lower-case "or free ..."

> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index be7ecc0..6631df8 100644
[...]
> @@ -1690,17 +1711,16 @@ static const struct file_operations kmemleak_fops = {
>   */
>  static void kmemleak_do_cleanup(struct work_struct *work)
>  {
> -	struct kmemleak_object *object;
> -
>  	mutex_lock(&scan_mutex);
>  	stop_scan_thread();
>  
> -	if (!kmemleak_has_leaks) {
> -		rcu_read_lock();
> -		list_for_each_entry_rcu(object, &object_list, object_list)
> -			delete_object_full(object->pointer);
> -		rcu_read_unlock();
> -	}
> +	if (!kmemleak_has_leaks)
> +		__kmemleak_do_cleanup();
> +	else
> +		pr_info("Disable kmemleak without freeing internal objects, "
> +			"so you may still check information on memory leaks. "
> +			"You may reclaim memory by writing \"clear\" to "
> +			"/sys/kernel/debug/kmemleak\n");

Alternative text:

		pr_info("Kmemleak disabled without freeing internal data. "
			"Reclaim the memory with \"echo clear > /sys/kernel/debug/kmemleak\"\n");

(I'm wouldn't bother with long lines in printk strings)

Otherwise:

Acked-by: Catalin Marinas <catalin.marinas@xxxxxxx>

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]