From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752557AbbKPOWv (ORCPT ); Mon, 16 Nov 2015 09:22:51 -0500 Received: from smtprelay0048.hostedemail.com ([216.40.44.48]:35908 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751223AbbKPOWt convert rfc822-to-8bit (ORCPT ); Mon, 16 Nov 2015 09:22:49 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::::::,RULES_HIT:41:152:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1513:1515:1516:1518:1521:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2892:3138:3139:3140:3141:3142:3353:3608:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4605:5007:6119:6261:6742:7514:7875:7903:9036:9108:10004:10400:10848:10967:11026:11232:11658:11914:12517:12519:12663:12740:13069:13311:13357:14659:21080:30046:30051:30054:30075:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: fog48_6f24524c4af2e X-Filterd-Recvd-Size: 3135 Date: Mon, 16 Nov 2015 09:22:42 -0500 From: Steven Rostedt To: yalin wang Cc: Vlastimil Babka , 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 Subject: Re: [PATCH V4] mm: fix kernel crash in khugepaged thread Message-ID: <20151116092242.26474f89@gandalf.local.home> In-Reply-To: <2F74FF6B-66DC-4BF9-972A-C2F5FFFA979F@gmail.com> 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> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Nov 2015 09:35:53 +0800 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 . Have you tried it? It should work. If not, I'll fix it. The string "null" is exported in the trace output file, and perf should have enough information to know how to handle that. If it fails to parse, I can easily fix it. Remember, I'm the author of the parsing of events in userspace. -- Steve From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) by kanga.kvack.org (Postfix) with ESMTP id A07666B0253 for ; Mon, 16 Nov 2015 09:22:49 -0500 (EST) Received: by ioir85 with SMTP id r85so120083413ioi.1 for ; Mon, 16 Nov 2015 06:22:49 -0800 (PST) Received: from smtprelay.hostedemail.com (smtprelay0177.hostedemail.com. [216.40.44.177]) by mx.google.com with ESMTP id ej8si29257928igc.1.2015.11.16.06.22.48 for ; Mon, 16 Nov 2015 06:22:48 -0800 (PST) Date: Mon, 16 Nov 2015 09:22:42 -0500 From: Steven Rostedt Subject: Re: [PATCH V4] mm: fix kernel crash in khugepaged thread Message-ID: <20151116092242.26474f89@gandalf.local.home> In-Reply-To: <2F74FF6B-66DC-4BF9-972A-C2F5FFFA979F@gmail.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: yalin wang Cc: Vlastimil Babka , 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 On Mon, 16 Nov 2015 09:35:53 +0800 yalin wang wrote: > > On Nov 13, 2015, at 22:01, Steven Rostedt wrote: > >=20 > > On Fri, 13 Nov 2015 19:54:11 +0800 > > yalin wang wrote: > > =20 > >>>>> TP_fast_assign( > >>>>> __entry->mm =3D mm; > >>>>> - __entry->pfn =3D pfn; > >>>>> + __entry->pfn =3D page_to_pfn(page); =20 > >>>>=20 > >>>> Instead of the condition, we could have: > >>>>=20 > >>>> __entry->pfn =3D page ? page_to_pfn(page) : -1; =20 > >>>=20 > >>> I agree. Please do it like this. =20 > >=20 > > hmm, pfn is defined as an unsigned long, would -1 be the best. > > Or should it be (-1UL). > >=20 > > Then we could also have: > >=20 > > TP_printk("mm=3D%p, scan_pfn=3D0x%lx%s, writable=3D%d, reference= d=3D%d, none_or_zero=3D%d, status=3D%s, unmapped=3D%d", > > __entry->mm, > > __entry->pfn =3D=3D (-1UL) ? 0 : __entry->pfn, > > __entry->pfn =3D=3D (-1UL) ? "(null)" : "", > >=20 > > Note the added %s after %lx I have in the print format. > >=20 > > -- Steve =20 > 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 ent= ry struct by offset , > you print a dynamic string which user space perf tool don=E2=80=99t know = how to print this string . Have you tried it? It should work. If not, I'll fix it. The string "null" is exported in the trace output file, and perf should have enough information to know how to handle that. If it fails to parse, I can easily fix it. Remember, I'm the author of the parsing of events in userspace. -- Steve -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org