Re: [PATCH] do not trace unsuccessful __alloc_pages

Mathieu Desnoyers <[email protected]> Wed, 27 Feb 2008 08:19:10 -0500
Newsgroups gmane.linux.kernel.tracing
Message-ID <20080227131910.GA4273@Krystal>
* Jan Kiszka ([email protected]) wrote:
> We may happen to return from __alloc_pages with page == NULL. As we
> neither want to trace this as successful allocation nor want to break
> the kernel due to page_to_pfn(NULL), patch below is required.
> 
> Signed-off-by: Jan Kiszka <[email protected]>
> 

Merged, thanks!

> ---
>  mm/page_alloc.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> Index: b/mm/page_alloc.c
> ===================================================================
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1640,7 +1640,9 @@ nopage:
>  		show_mem();
>  	}
>  got_pg:
> -	trace_mark(mm_page_alloc, "order %u pfn %lu", order, page_to_pfn(page));
> +	if (page)
> +		trace_mark(mm_page_alloc, "order %u pfn %lu", order,
> +			   page_to_pfn(page));
>  	return page;
>  }
>  
> _______________________________________________
> Ltt-dev mailing list
> [email protected]
> http://listserv.shafik.org/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68