Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1374432pxb; Fri, 22 Jan 2021 14:12:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRIH5oyGXafbCwJuGhZSpVJLjAobQLvZv5O7e7TrsrmEug00f/9md+VTlHmHkSF//SFgoI X-Received: by 2002:a17:906:f759:: with SMTP id jp25mr4199394ejb.207.1611353543717; Fri, 22 Jan 2021 14:12:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611353543; cv=none; d=google.com; s=arc-20160816; b=sajBHWXHsTk5mbe2IaELLl1kCjR8uH2B8mK3taSi2qnCji9x6tDN+/uEDsQrcw+5zy m9YuFKD5yRUdUBEhwXLtPNblhvUs5HXE+MKgnWiPLSkziiG5yo+/DXCktLW6Ny481i1C tQjHqK5SLXl4bsDFUCz0QdeoDBI9VJ6LJA5UZFnfl03KHwdDjAEKRD5gissqufIMAcFo 2hwKPPwV7qf0y6ZmwheRt4itBgSps8y3DS4eiEZhj+YZ++NqYbpQBROQB6GSVPRpjfJw zK0ot5rFlrbdltT6DY5yV5kbQF+J3L+EtT3sOLZbS6enNrxyNrhkgsmZZk8/BTezCLXC C4Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=c4ouleZZAXyP3qydY74TQhV9ZSx17hh5bTzcAWO3/yk=; b=KTHrXOMELPbnAcFWgUPUp4LMRih0AeFyki4BxqNDpbC8ecDkvMVEqLH3cJHoiECf0N AKbQEfE7W9gTS068R0KAkiJrtfiJB2Kdi6iI2xHbKbK/F+9CZbKEFiBbxZycxQvS1bxO t1hiwD7wMaFtiSshP/Pc4IigKvcq+WlhKXOky0+PkHEde+WAV0CNpDNy3ykYt2xY6F16 dkRVVYbj4lNr2GWNrwkbHRUN2wdTc3aHAiw79Dnfk1DJ+c6GQCwQr8zTv/m1g3EUZm3h CMQB5TErTjp6GZfUCryJLJmIRrbClAu8ugA0LQIGYYYVmnV6N+N7fpEV4RiweP6mtGpi VYdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LJ4Yix2V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l5si3461342ejd.408.2021.01.22.14.12.00; Fri, 22 Jan 2021 14:12:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LJ4Yix2V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730836AbhAVWH4 (ORCPT + 99 others); Fri, 22 Jan 2021 17:07:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730259AbhAVWGp (ORCPT ); Fri, 22 Jan 2021 17:06:45 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7E6CC0613D6 for ; Fri, 22 Jan 2021 14:06:04 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id y1so6887149ybe.11 for ; Fri, 22 Jan 2021 14:06:04 -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=c4ouleZZAXyP3qydY74TQhV9ZSx17hh5bTzcAWO3/yk=; b=LJ4Yix2VskMpUEhAiL78cfZDxjzB/3aVHbtqNdaziJ2e9O7HzLZEr38cde4kZMqjhI w5XeiPekl7yVlhUlraMHTPWWN1AhSAlrfyqaspcro3faG4B9iIiZSJAbJtILO+ygDVwB giQmTZR1OqfJlHyBot2M7xj9v71DHuqhkqYlnNLt4fffp/BqeSiCeVM6CMTV+pWmWncS 8qjn3JbHZ3vs2mIgq/AcGnsHz6iyYQBB3vU2s+mMiiAxK46mNO0mCRKTDQLDeJqLi32L TVdotZnoY2YRgunsmJDQi3x2Ez0bRd5w7HwtJo8NG7waS5Tetq/8a1vUnArVT0kqXfRE eb0Q== 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=c4ouleZZAXyP3qydY74TQhV9ZSx17hh5bTzcAWO3/yk=; b=bSoLlJgWhNj8LMTIwrAwV0joY2UwkW0AobEp97rfyr2WW0/Ivw6Vxh4Qbm0KN9J50N mrxq+rj3FPKI7yBK8Y/+61SlC5iiJTpsm+Fv8A7u4PwgJHTzUnLdu6xt2uoQKCuH+Yc/ tAVpr3mNkeIyOvLwredMQyg5aTNgGhdsUF0ya+QPwyE+KrRQml2wYP2MJnhKQLecrGHd lVO73afd1oyM4y3GGKMl1RK1IYKJRcZZAbN57aYluYBsZozbvFBuImqcw4ldvY42wfU8 iprzmcHeR/maCvnXWvjcu3Gmn0TtPxY6AFHaIcMa01uwiWrmLq4M/oXp8HEenfuGztAx Ex1A== X-Gm-Message-State: AOAM531peWcRFND2ZVBN8CvKwTVsEhJQmoAR2QbqF28GnzEqIZNRmN2S FjbzTBdNaT1HGSGQ3noxygBSd694JMg= Sender: "yuzhao via sendgmr" X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:5129:9a91:ef0e:c1a9]) (user=yuzhao job=sendgmr) by 2002:a25:ac5a:: with SMTP id r26mr9406387ybd.336.1611353164151; Fri, 22 Jan 2021 14:06:04 -0800 (PST) Date: Fri, 22 Jan 2021 15:05:51 -0700 In-Reply-To: <20210122220600.906146-1-yuzhao@google.com> Message-Id: <20210122220600.906146-2-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 01/10] mm: use add_page_to_lru_list() 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is add_page_to_lru_list(), and move_pages_to_lru() should reuse it, not duplicate it. Link: https://lore.kernel.org/linux-mm/20201207220949.830352-2-yuzhao@google.com/ Signed-off-by: Yu Zhao Reviewed-by: Alex Shi --- mm/vmscan.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 04509994aed4..19875660e8f8 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1823,7 +1823,6 @@ static unsigned noinline_for_stack move_pages_to_lru(struct lruvec *lruvec, int nr_pages, nr_moved = 0; LIST_HEAD(pages_to_free); struct page *page; - enum lru_list lru; while (!list_empty(list)) { page = lru_to_page(list); @@ -1868,11 +1867,8 @@ static unsigned noinline_for_stack move_pages_to_lru(struct lruvec *lruvec, * inhibits memcg migration). */ VM_BUG_ON_PAGE(!lruvec_holds_page_lru_lock(page, lruvec), page); - lru = page_lru(page); + add_page_to_lru_list(page, lruvec, page_lru(page)); nr_pages = thp_nr_pages(page); - - update_lru_size(lruvec, lru, page_zonenum(page), nr_pages); - list_add(&page->lru, &lruvec->lists[lru]); nr_moved += nr_pages; if (PageActive(page)) workingset_age_nonresident(lruvec, nr_pages); -- 2.30.0.280.ga3ce27912f-goog