From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1948886AbcBSAdH (ORCPT ); Thu, 18 Feb 2016 19:33:07 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:35178 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946981AbcBSAdE (ORCPT ); Thu, 18 Feb 2016 19:33:04 -0500 Date: Fri, 19 Feb 2016 09:34:21 +0900 From: Sergey Senozhatsky To: Steven Rostedt Cc: js1304@gmail.com, Andrew Morton , Michal Nazarewicz , Minchan Kim , Mel Gorman , Vlastimil Babka , "Kirill A. Shutemov" , Sergey Senozhatsky , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Joonsoo Kim Subject: Re: [PATCH 2/2] mm/page_ref: add tracepoint to track down page reference manipulation Message-ID: <20160219003421.GA587@swordfish> References: <1455505490-12376-1-git-send-email-iamjoonsoo.kim@lge.com> <1455505490-12376-2-git-send-email-iamjoonsoo.kim@lge.com> <20160218092926.083ca007@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160218092926.083ca007@gandalf.local.home> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (02/18/16 09:29), Steven Rostedt wrote: > > diff --git a/include/linux/page_ref.h b/include/linux/page_ref.h > > index 534249c..fd6d9a5 100644 > > --- a/include/linux/page_ref.h > > +++ b/include/linux/page_ref.h > > @@ -1,6 +1,54 @@ > > #include > > #include > > #include > > +#include > > + > > +extern struct tracepoint __tracepoint_page_ref_set; > > +extern struct tracepoint __tracepoint_page_ref_mod; > > +extern struct tracepoint __tracepoint_page_ref_mod_and_test; > > +extern struct tracepoint __tracepoint_page_ref_mod_and_return; > > +extern struct tracepoint __tracepoint_page_ref_mod_unless; > > +extern struct tracepoint __tracepoint_page_ref_freeze; > > +extern struct tracepoint __tracepoint_page_ref_unfreeze; > > + > > +#ifdef CONFIG_DEBUG_PAGE_REF > > Please add a comment here. Something to the effect of: > > /* > * Ideally we would want to use the trace__enabled() helper > * functions. But due to include header file issues, that is not > * feasible. Instead we have to open code the static key functions. > * > * See trace_##name##_enabled(void) in include/linux/tracepoint.h > */ > not sure if it's worth mentioning in the comment, but the other concern here is the performance impact of an extra function call, I believe. otherwise, Joonsoo would just do: in include/linux/page_ref.h static inline void set_page_count(struct page *page, int v) { atomic_set(&page->_count, v); __page_ref_set(page, v); } ... and in mm/debug_page_ref.c void __page_ref_set(struct page *page, int v) { if (trace_page_ref_set_enabled()) trace_page_ref_set(page, v); } EXPORT_SYMBOL(__page_ref_set); EXPORT_TRACEPOINT_SYMBOL(page_ref_set); ... -ss