Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3700771imc; Thu, 14 Mar 2019 03:20:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgW+Lz53gJ3gWMAfWARlPHevyGakbFnT/yqdJ1SpvTItH2e/qpCpu0lNcL+kagQsTfu3kX X-Received: by 2002:a62:b801:: with SMTP id p1mr48569387pfe.25.1552558855470; Thu, 14 Mar 2019 03:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552558855; cv=none; d=google.com; s=arc-20160816; b=RiYDzV9ndjRRqoPPISjQ8WoUBDhR4IYwHrV/hrPEhjjmFZuxU3S4kjyv5PUkmDVR9o PCc3xuqPXne6PD7Met9nbE3fi+UPjZf75zOjtyFIZZWZJHfll6AZSKkDj8Wt96+QSVyP dLZbiy6+8oiPXDcZFG5nySfyb5el7lzRz5BTc3DTjtzUZJk2oDUR1KJHnxyCu6NgG0L+ cgdEwrQFJS1NOBHbHVR6GAV7f9tYsSqYckhZJCvR/tdCRhqVWJQBahEEtBflrd3gLZnT aLFC3KshbgzjaD2jPtl9N8wg6zGwDrrgv66xE+R9hwQOPNdtCAySiA+qeQ57DUf4B/hq j0Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=V9svRKAki9Esony/pMi2IR3wEJF43kVgGU1+9rDlwjs=; b=bd7+SKs4h9Sp95/w7QEYlhWmgAvrP2EOe2HxoOaZvW5rEhk+Osog5u7G07/JHVXiDW LfiYJehaQUIGeMZ/YP4G43yw5JXmHKe9V0Ub6G7fqDGFj83z9LhNoJUz8Y0VRfIK4e2+ scTAJwC8r0jtSrvU/9hdWwiBoRSj2iMmU3GOASYQ8Nq9uBweMJLEWuLFJqzALXwsceIB vI4O6eeLMQmBomihd1e+zuMRnYt6Zlu6Huw6aJMeJ6EWkhwEjfwWdCvU2/uxm06Bykqi lnFvTQa4kZfQCgwzDLqiWiRsIWKfaSv/A5g0AaVP78zRxe+Q+b0BGmhF1fysU8cn4ZrP 3VvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l127si460913pfl.2.2019.03.14.03.20.40; Thu, 14 Mar 2019 03:20:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727295AbfCNKTS (ORCPT + 99 others); Thu, 14 Mar 2019 06:19:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:46162 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726629AbfCNKTS (ORCPT ); Thu, 14 Mar 2019 06:19:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5A042AFFB; Thu, 14 Mar 2019 10:19:16 +0000 (UTC) Date: Thu, 14 Mar 2019 11:19:15 +0100 From: Michal Hocko To: Yafang Shao Cc: vbabka@suse.cz, jrdr.linux@gmail.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, shaoyafang@didiglobal.com Subject: Re: [PATCH] mm: vmscan: drop may_writepage and classzone_idx from direct reclaim begin template Message-ID: <20190314101915.GI7473@dhcp22.suse.cz> References: <1551421452-5385-1-git-send-email-laoar.shao@gmail.com> <1551421452-5385-2-git-send-email-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1551421452-5385-2-git-send-email-laoar.shao@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 01-03-19 14:24:12, Yafang Shao wrote: > There are three tracepoints using this template, which are > mm_vmscan_direct_reclaim_begin, > mm_vmscan_memcg_reclaim_begin, > mm_vmscan_memcg_softlimit_reclaim_begin. > > Regarding mm_vmscan_direct_reclaim_begin, > sc.may_writepage is !laptop_mode, that's a static setting, and > reclaim_idx is derived from gfp_mask which is already show in this > tracepoint. > > Regarding mm_vmscan_memcg_reclaim_begin, > may_writepage is !laptop_mode too, and reclaim_idx is (MAX_NR_ZONES-1), > which are both static value. > > mm_vmscan_memcg_softlimit_reclaim_begin is the same with > mm_vmscan_memcg_reclaim_begin. > > So we can drop them all. I agree. Although classzone_idx is PITA to calculate nothing really prevents us to have a tool to do that. may_writepage is not all that useful anymore. > Signed-off-by: Yafang Shao From a quick glance this looks ok. I haven't really checked deeply or tried to compile it but the change makes sense. Acked-by: Michal Hocko > --- > include/trace/events/vmscan.h | 26 ++++++++++---------------- > mm/vmscan.c | 14 +++----------- > 2 files changed, 13 insertions(+), 27 deletions(-) > > diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h > index a1cb913..153d90c 100644 > --- a/include/trace/events/vmscan.h > +++ b/include/trace/events/vmscan.h > @@ -105,51 +105,45 @@ > > DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, > > - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), > + TP_PROTO(int order, gfp_t gfp_flags), > > - TP_ARGS(order, may_writepage, gfp_flags, classzone_idx), > + TP_ARGS(order, gfp_flags), > > TP_STRUCT__entry( > __field( int, order ) > - __field( int, may_writepage ) > __field( gfp_t, gfp_flags ) > - __field( int, classzone_idx ) > ), > > TP_fast_assign( > __entry->order = order; > - __entry->may_writepage = may_writepage; > __entry->gfp_flags = gfp_flags; > - __entry->classzone_idx = classzone_idx; > ), > > - TP_printk("order=%d may_writepage=%d gfp_flags=%s classzone_idx=%d", > + TP_printk("order=%d gfp_flags=%s", > __entry->order, > - __entry->may_writepage, > - show_gfp_flags(__entry->gfp_flags), > - __entry->classzone_idx) > + show_gfp_flags(__entry->gfp_flags)) > ); > > DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, > > - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), > + TP_PROTO(int order, gfp_t gfp_flags), > > - TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) > + TP_ARGS(order, gfp_flags) > ); > > #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), > + TP_PROTO(int order, gfp_t gfp_flags), > > - TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) > + TP_ARGS(order, gfp_flags) > ); > > DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, > > - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), > + TP_PROTO(int order, gfp_t gfp_flags), > > - TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) > + TP_ARGS(order, gfp_flags) > ); > #endif /* CONFIG_MEMCG */ > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index ac4806f..cdc0305 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -3304,10 +3304,7 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order, > if (throttle_direct_reclaim(sc.gfp_mask, zonelist, nodemask)) > return 1; > > - trace_mm_vmscan_direct_reclaim_begin(order, > - sc.may_writepage, > - sc.gfp_mask, > - sc.reclaim_idx); > + trace_mm_vmscan_direct_reclaim_begin(order, sc.gfp_mask); > > nr_reclaimed = do_try_to_free_pages(zonelist, &sc); > > @@ -3338,9 +3335,7 @@ unsigned long mem_cgroup_shrink_node(struct mem_cgroup *memcg, > (GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK); > > trace_mm_vmscan_memcg_softlimit_reclaim_begin(sc.order, > - sc.may_writepage, > - sc.gfp_mask, > - sc.reclaim_idx); > + sc.gfp_mask); > > /* > * NOTE: Although we can get the priority field, using it > @@ -3389,10 +3384,7 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *memcg, > > zonelist = &NODE_DATA(nid)->node_zonelists[ZONELIST_FALLBACK]; > > - trace_mm_vmscan_memcg_reclaim_begin(0, > - sc.may_writepage, > - sc.gfp_mask, > - sc.reclaim_idx); > + trace_mm_vmscan_memcg_reclaim_begin(0, sc.gfp_mask); > > psi_memstall_enter(&pflags); > noreclaim_flag = memalloc_noreclaim_save(); > -- > 1.8.3.1 > -- Michal Hocko SUSE Labs