lkml.org 
[lkml]   [2015]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V4] mm: fix kernel crash in khugepaged thread
From
Date

> On Nov 13, 2015, at 16:41, Hillf Danton <hillf.zj@alibaba-inc.com> wrote:
>
>>
>> Instead of the condition, we could have:
>>
>> __entry->pfn = page ? page_to_pfn(page) : -1;
>>
>>
>> But if there's no reason to do the tracepoint if page is NULL, then
>> this patch is fine. I'm just throwing out this idea.
>>
> we trace only if page is valid
>
> --- linux-next/mm/huge_memory.c Fri Nov 13 16:00:22 2015
> +++ b/mm/huge_memory.c Fri Nov 13 16:26:19 2015
> @@ -1987,7 +1987,8 @@ static int __collapse_huge_page_isolate(
>
> out:
> release_pte_pages(pte, _pte);
> - trace_mm_collapse_huge_page_isolate(page_to_pfn(page), none_or_zero,
> + if (page)
> + trace_mm_collapse_huge_page_isolate(page_to_pfn(page), none_or_zero,
> referenced, writable, result);
> return 0;
> }
> —
>
my V4 patch move if (!page) into trace function,
so that we don’t need call page_to_fn() if the trace if disabled .
more efficient .
Thanks




\
 
 \ /
  Last update: 2015-11-13 11:41    [W:0.036 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site