Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1384341rdb; Wed, 20 Sep 2023 07:47:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFL/sv5l6Zyz6TR5GZQo7WrkhMNm86kZax1EK5025DpRQDoS40FH2cifILDwdV+xLvDpnYe X-Received: by 2002:a17:90a:db82:b0:26b:513a:30b0 with SMTP id h2-20020a17090adb8200b0026b513a30b0mr4206293pjv.10.1695221254139; Wed, 20 Sep 2023 07:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695221254; cv=none; d=google.com; s=arc-20160816; b=z5ogqO2j61POdoj1kRsUGB9XzLVF1S4F1FUqe+ngJ9AO5rdkmqRDDax7gxaKkEMBUk rc891a/qXoQoX2M1N0jl2S55j8jNpaqYJ+sgPgcIAlsowIfCjVsq4I2T1rDR4prD6MUc DHlFMkRuxr2luVmb4Fw7Q4mgkABfUU5nOnN8/oMFy5IPB1gNd1kGLq7ffxfbelL27aje E3bNMTdPJCSA9GNHLgnLRRRIOOPsoxwg4cnbazNZ/C/u3eUiUNceg9iDPBLd/hnbRIh0 hREUQElj9Fa5yieFG8ordx5D+aHwXiJvvTBXPt2YOgZh7tz1zztwlDh5qmP5q8IHYIQ+ DL+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=1xz9ppcU4mhFvCaT9+HhxAUz+G7F7MPjZEZl1tKpGAg=; fh=Y+Fmx8bZn6QMi2KQi4ChG//Umcazrlu06axbvz+8nJI=; b=gQqRDbk9wIX+llThen9JJbyfGNflwStY4eGmEfu2FOY94gu+MA0C8Ghqa+wGLK5C8o OCE6i9wvw5LA4SiHKVP2iojqTiRK0hgCIqGxJWzBu80qk/QK+Tb2Gm6okyUnBoSCCDOC EBFHXNlUVgED+hjtjHR3npHbSl8dgwBV8W6ML5CIc/pVrkx90aZvtKRWUTmeyOMbsgDJ Pp6LlsIjummdbe6f033be1gv44oL8e+fUPudCEQSthH2hau0t6djTdcIdXv3T+0y3GnN r4KkcjjzHhv920D95J0UkaasPg5cO1S7o0kEw4aCIHv4wqsIft374QnQ64a4nIBy7nM6 5k+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id az2-20020a17090b028200b00273fa934cc1si1635397pjb.167.2023.09.20.07.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 07:47:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 16218804A635; Wed, 20 Sep 2023 07:32:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235086AbjITOcI convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Sep 2023 10:32:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234572AbjITOcG (ORCPT ); Wed, 20 Sep 2023 10:32:06 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C7B9D3; Wed, 20 Sep 2023 07:32:00 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90317C433C7; Wed, 20 Sep 2023 14:31:58 +0000 (UTC) Date: Wed, 20 Sep 2023 10:32:33 -0400 From: Steven Rostedt To: =?UTF-8?B?6rmA7J6s7JuQ?= Cc: "yuzhao@google.com" , "tjmercier@google.com" , "kaleshsingh@google.com" , "akpm@linux-foundation.org" , "vbabka@suse.cz" , "hannes@cmpxchg.org" , "linux-kernel@vger.kernel.org" , "linux-trace-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "jaewon31.kim@gmail.com" Subject: Re: (2) [PATCH] vmscan: add trace events for lru_gen Message-ID: <20230920103233.145ac387@gandalf.local.home> In-Reply-To: <20230920074948epcms1p82d18c2f4d6a0b5699d50fc419b9ba9fe@epcms1p8> References: <20230919095927.5a964094@gandalf.local.home> <20230919025216.1878-1-jaewon31.kim@samsung.com> <20230920074948epcms1p82d18c2f4d6a0b5699d50fc419b9ba9fe@epcms1p8> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 20 Sep 2023 07:32:09 -0700 (PDT) On Wed, 20 Sep 2023 16:49:48 +0900 김재원 wrote: > Great. Thank you for your comment. > > For the putting the struct scan_control *sc inside the trace, > I couldn't do that because struct scan_control is defined in mm/vmscan.c. > I think I should not move it to a seperate header file. Well if you ever decide to do so, one thing to do is to move the trace/events/vmscan.h into mm/ as trace_vmscan.h so that it would have access to local header files. Then all you need to do is to move the struct scan_control into a local mm/X.h header file. > > As you may expect, I just made this by copying the existing > trace_mm_vmscan_lru_isolate and trace_mm_vmscan_lru_shrink_inactive > > I've tried to change like this. > Would this be good for you? The below looks fine to me. Thanks. -- Steve > > > --- a/include/trace/events/vmscan.h > +++ b/include/trace/events/vmscan.h > @@ -327,7 +327,7 @@ TRACE_EVENT(mm_vmscan_lru_isolate, > __print_symbolic(__entry->lru, LRU_NAMES)) > ); > > -TRACE_EVENT(mm_vmscan_lru_gen_scan, > +TRACE_EVENT_CONDITION(mm_vmscan_lru_gen_scan, > TP_PROTO(int highest_zoneidx, > int order, > unsigned long nr_requested, > @@ -339,6 +339,8 @@ TRACE_EVENT(mm_vmscan_lru_gen_scan, > > TP_ARGS(highest_zoneidx, order, nr_requested, nr_scanned, nr_skipped, nr_taken, isolate_mode, lru), > > + TP_CONDITION(nr_scanned), > + > TP_STRUCT__entry( > __field(int, highest_zoneidx) > __field(int, order) > @@ -494,7 +496,6 @@ TRACE_EVENT(mm_vmscan_lru_gen_evict, > TP_ARGS(nid, nr_reclaimed, stat, priority, file), > > TP_STRUCT__entry( > - __field(int, nid) > __field(unsigned long, nr_reclaimed) > __field(unsigned long, nr_dirty) > __field(unsigned long, nr_writeback) > @@ -504,6 +505,7 @@ TRACE_EVENT(mm_vmscan_lru_gen_evict, > __field(unsigned int, nr_activate1) > __field(unsigned long, nr_ref_keep) > __field(unsigned long, nr_unmap_fail) > + __field(int, nid) > __field(int, priority) > __field(int, reclaim_flags) > ), > > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -5131,10 +5131,9 @@ static int scan_folios(struct lruvec *lruvec, struct scan_control *sc, > __count_memcg_events(memcg, PGREFILL, sorted); > __count_vm_events(PGSCAN_ANON + type, isolated); > > - if (scanned) > - trace_mm_vmscan_lru_gen_scan(sc->reclaim_idx, sc->order, > - MAX_LRU_BATCH, scanned, skipped, isolated, > - sc->may_unmap ? 0 : ISOLATE_UNMAPPED, type); > + trace_mm_vmscan_lru_gen_scan(sc->reclaim_idx, sc->order, MAX_LRU_BATCH, > + scanned, skipped, isolated, > + sc->may_unmap ? 0 : ISOLATE_UNMAPPED, type); > > > > >