From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753520AbcFMEml (ORCPT ); Mon, 13 Jun 2016 00:42:41 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:36075 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750715AbcFMEmk (ORCPT ); Mon, 13 Jun 2016 00:42:40 -0400 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.98.76 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Mon, 13 Jun 2016 13:42:37 +0900 From: Minchan Kim To: Ganesh Mahendran CC: Linux-MM , linux-kernel , Andrew Morton , Nitin Gupta , Sergey Senozhatsky , , Subject: Re: [PATCH] mm/zsmalloc: add trace events for zs_compact Message-ID: <20160613044237.GC23754@bbox> References: <1465289804-4913-1-git-send-email-opensource.ganesh@gmail.com> <20160608001625.GB27258@bbox> <20160608051352.GA28155@bbox> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB07/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/06/13 13:42:35, Serialize by Router on LGEKRMHUB07/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/06/13 13:42:36, Serialize complete at 2016/06/13 13:42:36 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 08, 2016 at 02:39:19PM +0800, Ganesh Mahendran wrote: > zsmalloc is not only used by zram, but also zswap. Maybe > others in the future. > > I tried to use function_graph. It seems there are too much log > printed: > ------ > root@leo-test:/sys/kernel/debug/tracing# cat trace > # tracer: function_graph > # > # CPU DURATION FUNCTION CALLS > # | | | | | | | > 2) | zs_compact [zsmalloc]() { > 2) | /* zsmalloc_compact_start: pool zram0 */ > 2) 0.889 us | _raw_spin_lock(); > 2) 0.896 us | isolate_zspage [zsmalloc](); > 2) 0.938 us | _raw_spin_lock(); > 2) 0.875 us | isolate_zspage [zsmalloc](); > 2) 0.942 us | _raw_spin_lock(); > 2) 0.962 us | isolate_zspage [zsmalloc](); > ... > 2) 0.879 us | insert_zspage [zsmalloc](); > 2) 4.520 us | } > 2) 0.975 us | _raw_spin_lock(); > 2) 0.890 us | isolate_zspage [zsmalloc](); > 2) 0.882 us | _raw_spin_lock(); > 2) 0.894 us | isolate_zspage [zsmalloc](); > 2) | /* zsmalloc_compact_end: pool zram0: 0 pages > compacted(total 0) */ > 2) # 1351.241 us | } > ------ > => 1351.241 us used > > And it seems the overhead of function_graph is bigger than trace event. > > bash-3682 [002] .... 1439.180646: zsmalloc_compact_start: pool zram0 > bash-3682 [002] .... 1439.180659: zsmalloc_compact_end: pool zram0: > 0 pages compacted(total 0) > => 13 us > 1351.241 us You could use set_ftrace_filter to cut out. To introduce new event trace to get a elasped time, it's pointless, I think. It should have more like pool name you mentioned. Like saying other thread, It would be better to show [pool name, compact size_class, the number of object moved, the number of freed page], IMO. Thanks.