From patchwork Fri Jan 22 22:05:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 12040727 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5E6DC433DB for ; Fri, 22 Jan 2021 22:06:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4BF1723B1A for ; Fri, 22 Jan 2021 22:06:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BF1723B1A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 10ED26B000E; Fri, 22 Jan 2021 17:06:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 047F26B0012; Fri, 22 Jan 2021 17:06:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA0816B0022; Fri, 22 Jan 2021 17:06:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0091.hostedemail.com [216.40.44.91]) by kanga.kvack.org (Postfix) with ESMTP id CF77D6B000E for ; Fri, 22 Jan 2021 17:06:09 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8C48280D388A for ; Fri, 22 Jan 2021 22:06:09 +0000 (UTC) X-FDA: 77734794858.01.bomb11_040ba7a2756f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 725E2100D2CE6 for ; Fri, 22 Jan 2021 22:06:09 +0000 (UTC) X-HE-Tag: bomb11_040ba7a2756f X-Filterd-Recvd-Size: 5332 Received: from mail-qt1-f202.google.com (mail-qt1-f202.google.com [209.85.160.202]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 Jan 2021 22:06:08 +0000 (UTC) Received: by mail-qt1-f202.google.com with SMTP id r18so889609qta.19 for ; Fri, 22 Jan 2021 14:06:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=Cnppx+CVBWio8kiSnapIqmyvLMG7ttWaX8+dG0VcN8Y=; b=npAvqpOHZYHenjgtdugR1VSi14cpzy+ZIkNex0ST5ae5o3EmcZKLBncTqAn37cV9Ha 7suIKcduY/L+fjLpB6nnt8XblQGuXPWrFssRY2sgQ2xaPX7NFiI5Vn9WRODqIdOd4YBr zKdwgpBX0f2M2PAg8q9FwnZUpbcyfeyXx16cvqEjDcbRp9IMPR09K8CJZgk4B5MH+zBD HV6OqJTVBhI9mfxd9igc9A5veHUAQ4X2rZLqI/8+JWTSCCjEQyOmbSO7xGUyRi6YCqHt uWd+XgAKkb2lbf2PflaT0Rn/g0y2edCLy5BGaN/CHAQBxRCilsuaqZuXLF2Za4UXg6XA 5ANw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Cnppx+CVBWio8kiSnapIqmyvLMG7ttWaX8+dG0VcN8Y=; b=sFvSV9E8MktQ19qXVFo1FMT+EGxD8hRR9nAZjOZ+RjKDkO7wxz6M27pHvuNRcaVBVU cuUjTAnfKGBLWJs5kFoQs1vZ2Q5ImPITM8TRv3I3e/AkS/sdyKcnqHa+FhFoSf08YieB ZqkEu0UHITL1r96tqnRga0bFRVn+WNhNaorsn/O31+n833GL4omxXpBpW1W7QzvyS5od V9eF/cQnlYxJRLNN4oYX8NI1o/os2hPdpoiJ3I6DUob/xAYc4fyBF0mYl0ha3C+nwkWi 6SjTG7Fu8C2mKOk9kFfFST2EGmlB0ulBHDIYUqfvAse+SGYMpU4sdSatceXlN9kDGWQg ZL7g== X-Gm-Message-State: AOAM531DkbdPqdw8Ry8IdiBbtGUiPwfd4nzVQtxJkJNLIzTBrTL9v05G ATeccv2TDgYX4CY8g6s7qal1VZ7yBq0= X-Google-Smtp-Source: ABdhPJzH2ptmbGlJJ4A0Eip3F7crD9fwrpLPZvwjmm+gGrcj39Bh07beIr4B9mEPXyRX5H/9ms4FexJiycw= X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:5129:9a91:ef0e:c1a9]) (user=yuzhao job=sendgmr) by 2002:ad4:4108:: with SMTP id i8mr6324900qvp.49.1611353167796; Fri, 22 Jan 2021 14:06:07 -0800 (PST) Date: Fri, 22 Jan 2021 15:05:54 -0700 In-Reply-To: <20210122220600.906146-1-yuzhao@google.com> Message-Id: <20210122220600.906146-5-yuzhao@google.com> Mime-Version: 1.0 References: <20210122220600.906146-1-yuzhao@google.com> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH v2 04/10] mm: don't pass "enum lru_list" to trace_mm_lru_insertion() From: Yu Zhao To: Andrew Morton , Hugh Dickins , Alex Shi Cc: Michal Hocko , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Vlastimil Babka , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yu Zhao X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The parameter is redundant in the sense that it can be extracted from the "struct page" parameter by page_lru() correctly. Link: https://lore.kernel.org/linux-mm/20201207220949.830352-5-yuzhao@google.com/ Signed-off-by: Yu Zhao Reviewed-by: Alex Shi --- include/trace/events/pagemap.h | 11 ++++------- mm/swap.c | 5 +---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/include/trace/events/pagemap.h b/include/trace/events/pagemap.h index 8fd1babae761..e1735fe7c76a 100644 --- a/include/trace/events/pagemap.h +++ b/include/trace/events/pagemap.h @@ -27,24 +27,21 @@ TRACE_EVENT(mm_lru_insertion, - TP_PROTO( - struct page *page, - int lru - ), + TP_PROTO(struct page *page), - TP_ARGS(page, lru), + TP_ARGS(page), TP_STRUCT__entry( __field(struct page *, page ) __field(unsigned long, pfn ) - __field(int, lru ) + __field(enum lru_list, lru ) __field(unsigned long, flags ) ), TP_fast_assign( __entry->page = page; __entry->pfn = page_to_pfn(page); - __entry->lru = lru; + __entry->lru = page_lru(page); __entry->flags = trace_pagemap_flags(page); ), diff --git a/mm/swap.c b/mm/swap.c index 4b058ef37add..56682c002db7 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -957,7 +957,6 @@ EXPORT_SYMBOL(__pagevec_release); static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec) { - enum lru_list lru; int was_unevictable = TestClearPageUnevictable(page); int nr_pages = thp_nr_pages(page); @@ -993,11 +992,9 @@ static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec) smp_mb__after_atomic(); if (page_evictable(page)) { - lru = page_lru(page); if (was_unevictable) __count_vm_events(UNEVICTABLE_PGRESCUED, nr_pages); } else { - lru = LRU_UNEVICTABLE; ClearPageActive(page); SetPageUnevictable(page); if (!was_unevictable) @@ -1005,7 +1002,7 @@ static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec) } add_page_to_lru_list(page, lruvec); - trace_mm_lru_insertion(page, lru); + trace_mm_lru_insertion(page); } /*