Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2405865rdb; Thu, 21 Sep 2023 19:02:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFS4+ZrZhuKGV4XTdWeXcrLZ+l26Zy5nCBDcSRL6iRubwCGkzGTCDLdPm0WDD7YwFVYH/t5 X-Received: by 2002:a05:6a00:1347:b0:68e:3fe6:2c82 with SMTP id k7-20020a056a00134700b0068e3fe62c82mr7310270pfu.34.1695348135028; Thu, 21 Sep 2023 19:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695348135; cv=none; d=google.com; s=arc-20160816; b=DBumVYgwOnCxSVQueaFr8XvU4GvLSvINTY8SZEoixzUNGPMYoyVcVlY+dYbkjYRC0h 4WBZardr6nft+suqi3rSBQQdwD0MG7zhbZJc+kqZzNK/mE2XHrjMxBbXyDS2iWcZs1oM bgPWS07kh61nWS41xONz21ioArpETIxH/f1anfBLpLoo/vJYGwlNfAr6bZzzkzkcUVs1 XDAkPAPOYTNhZQ70e9oGguS9pKmE7ewO5g8GPxPhoWMZtC0+naWKM4mPEEDfSfzZIEmo QTNNZ14drB5UBBoA0DBON2biMnpxui/AL/aK3G7axowyQG6Mj2jA5GXec6saWc+yxe+Z AiXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:date:message-id:in-reply-to:cc:to:from :sender:reply-to:subject:mime-version:dkim-signature:dkim-filter; bh=I8UM2dlWqwJKF2IV08T8CuxTIF9GZtJKl3Qqt09nY/I=; fh=1AIcKDtfeQD3/HJvqU9VTzxvSWsfNcwENhRDGjskmkg=; b=jGHHZMsgyDaYdZ9Gr0puywYXXkzgUz5F7b07DFvos5tk4b6rVvo9OSoxGe9YlNR1i/ xsQa15tGOb/RnyywZJ1uzZ0t13SH4zFezINeMoffE27h57A/8mK8DBxXACOju3Qsfevg Q3PENZEbXSx7BZ8t29mloezOZD/KHqBKtcO7w57dlOAfD9ixvvoxJdCBia/yb59Zx0Gh qik+KixxGyuf9ayyJ+N1+uxps2TxzKQHx7/7bDI4ew77jaulpOW+httYBTnm5rZczm99 sKJK4yslOEsMMNhJ8oxzCTBQJgqtMSTmwgW7YBsTRyu9jOR7iu2O9a2qGLBEkidf0B1/ uMxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=onAix5jU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id h28-20020a63f91c000000b005697ebac19esi2568412pgi.776.2023.09.21.19.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 19:02:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=onAix5jU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 703068322273; Thu, 21 Sep 2023 15:21:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233210AbjIUWV3 (ORCPT + 99 others); Thu, 21 Sep 2023 18:21:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233049AbjIUWUv (ORCPT ); Thu, 21 Sep 2023 18:20:51 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D305A5441 for ; Thu, 21 Sep 2023 10:58:41 -0700 (PDT) Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20230921060916epoutp0484f1bef0426235a5c8d5de374a6d152f~G1QvXnt7r2744627446epoutp04c for ; Thu, 21 Sep 2023 06:09:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20230921060916epoutp0484f1bef0426235a5c8d5de374a6d152f~G1QvXnt7r2744627446epoutp04c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1695276556; bh=I8UM2dlWqwJKF2IV08T8CuxTIF9GZtJKl3Qqt09nY/I=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=onAix5jUPMdb8CfFj2m6Y6Mjm/5GQtxT4N+q71xojyq00znsl4cFJEEK6RabXncT5 zI46GIk9qPvGbXLUOSnebF+oVW6IMv4uhvGlGzJ+g+SbH5o+VIjHZWuBWGlHmLkMTT bVPExzsXaNlUqCIYrYRr2NWwZW8vhyImmArO9hrI= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20230921060916epcas1p2d7a0acf2f0d470e9710f1913d8bf209f~G1Qu23-xt3228832288epcas1p2Q; Thu, 21 Sep 2023 06:09:16 +0000 (GMT) Received: from epsmgec1p1-new.samsung.com (unknown [182.195.36.227]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4RrlNC51KRz4x9Px; Thu, 21 Sep 2023 06:09:15 +0000 (GMT) X-AuditID: b6c32a4c-d19fe70000004a18-20-650bde0be748 Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmgec1p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id 27.92.18968.B0EDB056; Thu, 21 Sep 2023 15:09:15 +0900 (KST) Mime-Version: 1.0 Subject: RE: (2) [PATCH] vmscan: add trace events for lru_gen Reply-To: jaewon31.kim@samsung.com Sender: =?UTF-8?B?6rmA7J6s7JuQ?= From: =?UTF-8?B?6rmA7J6s7JuQ?= To: Steven Rostedt , =?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" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20230920103233.145ac387@gandalf.local.home> X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20230921060915epcms1p6a03b613816b2a99d75ddfd1e8c4a44f7@epcms1p6> Date: Thu, 21 Sep 2023 15:09:15 +0900 X-CMS-MailID: 20230921060915epcms1p6a03b613816b2a99d75ddfd1e8c4a44f7 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGJsWRmVeSWpSXmKPExsWy7bCmgS73Pe5Ug5Y2dYs569ewWaze5GvR vXkmo0Xv+1dMFk37ZrJbXN41h83i3pr/rBZH1p9lsdjX8YDJ4t36L2wWsxv7GC3eTfjC6sDj cfjNe2aPnbPusnu07LvF7rFgU6nHpk+T2D1OzPjN4tG3ZRWjx5kFR9g9Pm+SC+CMyrbJSE1M SS1SSM1Lzk/JzEu3VfIOjneONzUzMNQ1tLQwV1LIS8xNtVVy8QnQdcvMAbpYSaEsMacUKBSQ WFyspG9nU5RfWpKqkJFfXGKrlFqQklNgVqBXnJh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f4cbddf0b References: <20230920103233.145ac387@gandalf.local.home> <20230919095927.5a964094@gandalf.local.home> <20230919025216.1878-1-jaewon31.kim@samsung.com> <20230920074948epcms1p82d18c2f4d6a0b5699d50fc419b9ba9fe@epcms1p8> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Thu, 21 Sep 2023 15:21:43 -0700 (PDT) >> 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 Thank you for your comment. But I still don't know if I can move the strut scan_control into a new separate header file, mm/X.h. I guess it was meant to be located in vmscan.c only. Let me just send v2 patch with only this change, and wait for other mm guys comments regarding the moving the struct scan_control thing. Thank you very much. > >> >> >> --- 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); >> >> >> >> >