Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752157AbbKPKQ1 (ORCPT ); Mon, 16 Nov 2015 05:16:27 -0500 Received: from mx2.suse.de ([195.135.220.15]:48715 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751715AbbKPKQ0 (ORCPT ); Mon, 16 Nov 2015 05:16:26 -0500 Subject: Re: [PATCH V4] mm: fix kernel crash in khugepaged thread To: yalin wang , Steven Rostedt References: <1447316462-19645-1-git-send-email-yalin.wang2010@gmail.com> <20151112092923.19ee53dd@gandalf.local.home> <5645BFAA.1070004@suse.cz> <20151113090115.1ad4235b@gandalf.local.home> <2F74FF6B-66DC-4BF9-972A-C2F5FFFA979F@gmail.com> Cc: Ingo Molnar , Andrew Morton , Ebru Akagunduz , Rik van Riel , "Kirill A. Shutemov" , jmarchan@redhat.com, mgorman@techsingularity.net, willy@linux.intel.com, linux-kernel , linux-mm@kvack.org From: Vlastimil Babka Message-ID: <5649ACF6.1000704@suse.cz> Date: Mon, 16 Nov 2015 11:16:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <2F74FF6B-66DC-4BF9-972A-C2F5FFFA979F@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1520 Lines: 46 On 11/16/2015 02:35 AM, yalin wang wrote: > >> On Nov 13, 2015, at 22:01, Steven Rostedt wrote: >> >> On Fri, 13 Nov 2015 19:54:11 +0800 >> yalin wang wrote: >> >>>>>> TP_fast_assign( >>>>>> __entry->mm = mm; >>>>>> - __entry->pfn = pfn; >>>>>> + __entry->pfn = page_to_pfn(page); >>>>> >>>>> Instead of the condition, we could have: >>>>> >>>>> __entry->pfn = page ? page_to_pfn(page) : -1; >>>> >>>> I agree. Please do it like this. >> >> hmm, pfn is defined as an unsigned long, would -1 be the best. >> Or should it be (-1UL). >> >> Then we could also have: >> >> TP_printk("mm=%p, scan_pfn=0x%lx%s, writable=%d, referenced=%d, none_or_zero=%d, status=%s, unmapped=%d", >> __entry->mm, >> __entry->pfn == (-1UL) ? 0 : __entry->pfn, >> __entry->pfn == (-1UL) ? "(null)" : "", >> >> Note the added %s after %lx I have in the print format. >> >> -- Steve > it is not easy to print for perf tools in userspace , > if you use this format , > for user space perf tool, it print the entry by look up the member in entry struct by offset , > you print a dynamic string which user space perf tool don’t know how to print this string . Does it work through trace-cmd? > Thanks > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/