lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171013063826.6likzbzmfz6fojl2@dhcp22.suse.cz>
Date:   Fri, 13 Oct 2017 08:38:26 +0200
From:   Michal Hocko <mhocko@...nel.org>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Vlastimil Babka <vbabka@...e.cz>, Mel Gorman <mgorman@...e.de>,
        Balbir Singh <balbir@...ux.vnet.ibm.com>,
        KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] tracing, memcg, vmscan: Hide trace events when not in use

On Thu 12-10-17 18:46:32, Steven Rostedt wrote:
> From: Steven Rostedt (VMware) <rostedt@...dmis.org>
> 
> When trace events are defined but not used they still create data
> structures and functions for their use, even though nothing may be
> using them.
> 
> The trace events mm_vmscan_memcg_reclaim_begin,
> mm_vmscan_memcg_softlimit_reclaim_begin, mm_vmscan_memcg_reclaim_end,
> and mm_vmscan_memcg_softlimit_reclaim_end are not used if CONFIG_MEMCG
> is not defined. Do not create these trace events unless CONFIG_MEMCG is
> defined.

I do not understand the ftrace machinery and I have to admit I was under
impression that nothing really gets defined if the code using them
doesn't exist but if this is not the case then this patch makes sense to
me

> Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>

Acked-by: Michal Hocko <mhocko@...e.com>

> ---
> Index: linux-trace.git/include/trace/events/vmscan.h
> ===================================================================
> --- linux-trace.git.orig/include/trace/events/vmscan.h
> +++ linux-trace.git/include/trace/events/vmscan.h
> @@ -133,6 +133,7 @@ DEFINE_EVENT(mm_vmscan_direct_reclaim_be
>  	TP_ARGS(order, may_writepage, gfp_flags, classzone_idx)
>  );
>  
> +#ifdef CONFIG_MEMCG
>  DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin,
>  
>  	TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx),
> @@ -146,6 +147,7 @@ DEFINE_EVENT(mm_vmscan_direct_reclaim_be
>  
>  	TP_ARGS(order, may_writepage, gfp_flags, classzone_idx)
>  );
> +#endif /* CONFIG_MEMCG */
>  
>  DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template,
>  
> @@ -171,6 +173,7 @@ DEFINE_EVENT(mm_vmscan_direct_reclaim_en
>  	TP_ARGS(nr_reclaimed)
>  );
>  
> +#ifdef CONFIG_MEMCG
>  DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end,
>  
>  	TP_PROTO(unsigned long nr_reclaimed),
> @@ -184,6 +187,7 @@ DEFINE_EVENT(mm_vmscan_direct_reclaim_en
>  
>  	TP_ARGS(nr_reclaimed)
>  );
> +#endif /* CONFIG_MEMCG */
>  
>  TRACE_EVENT(mm_shrink_slab_start,
>  	TP_PROTO(struct shrinker *shr, struct shrink_control *sc,

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ