Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751998AbdIALPq (ORCPT ); Fri, 1 Sep 2017 07:15:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:54026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751811AbdIALPo (ORCPT ); Fri, 1 Sep 2017 07:15:44 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F13121AC7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Fri, 1 Sep 2017 07:15:41 -0400 From: Steven Rostedt To: Vlastimil Babka Cc: Arnaldo Carvalho de Melo , Ingo Molnar , linux-kernel@vger.kernel.org, Namhyung Kim , David Ahern , Jiri Olsa , Minchan Kim , Peter Zijlstra , linux-mm@kvack.org Subject: Re: [PATCH 1/5] tracing, mm: Record pfn instead of pointer to struct page Message-ID: <20170901071541.30293b95@gandalf.local.home> In-Reply-To: <50a3640a-df45-c164-e89a-6e306b4c3937@suse.cz> References: <1428963302-31538-1-git-send-email-acme@kernel.org> <1428963302-31538-2-git-send-email-acme@kernel.org> <897eb045-d63c-b9e3-c6e7-0f6b94536c0f@suse.cz> <20170831094306.0fb655a5@gandalf.local.home> <20170831104410.09777356@gandalf.local.home> <50a3640a-df45-c164-e89a-6e306b4c3937@suse.cz> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1376 Lines: 34 On Fri, 1 Sep 2017 10:16:21 +0200 Vlastimil Babka wrote: > > Right, but that should work with the latest trace-cmd. Does it? > > Hmm, by "sparse memory model without vmemmap" I don't mean there's a > number instead of "vmemmap_base". I mean CONFIG_SPARSEMEM=y > > Then __pfn_to_page() looks like this: > > #define __page_to_pfn(pg) \ > ({ const struct page *__pg = (pg); \ > int __sec = page_to_section(__pg); \ > (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \ > }) > > Then the part of format file looks like this: > > REC->pfn != -1UL ? ({ unsigned long __pfn = (REC->pfn); struct mem_section *__sec = __pfn_to_section(__pfn); __section_mem_map_addr(__sec) + __pfn; }) : ((void *)0) Ouch. > > The section things involve some array lookups, so I don't see how we > could pass it to tracing userspace. Would we want to special-case > this config to store both pfn and struct page in the trace frame? And > make sure the simpler ones work despite all the exsisting gotchas? > I'd rather say we should either store both pfn and page pointer, or > just throw away the page pointer as the pfn is enough to e.g. match > alloc and free, and also much more deterministic. Write up a patch and we'll take a look. -- Steve