Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp494646pxb; Wed, 27 Jan 2021 12:59:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVI17BOzFaJXpg0mYdq2vzYNFsKTmpIk+W0gor9XXEn41d+Zw2U9Dzkq9piTu+yFMjEZp6 X-Received: by 2002:a05:6402:11d3:: with SMTP id j19mr10682726edw.314.1611781151078; Wed, 27 Jan 2021 12:59:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611781151; cv=none; d=google.com; s=arc-20160816; b=WAAf+3aJwSmD4UvFUHi94DfNfMTy3ysPf//AT/70AupKgXU5QiN5bysUG9iPgmNJnM 25yqtF4any5QC7qSPmGcMn8Q4Vmqh1bR2tZF0ouI6mkPn52K3PsxQflOWPjK8S1fF38y FkJ0UtQ4Hap8Iz9577/AHJWI+v2ApqGxxHSXCKy2n5HP/rbsTckkn777YsxyxK4RVBaa yEG5iJRjuyvsXAR35p2pEzMsY5aW+T2IqHotRMkVsJuAJF/r7sgi96cYLh69UdmHFtfr iuNf6B/3YdRPkxrAu7wRYSaweLPbzoB9H8fiOa9b60TiXzzEZIvRJxOPwu6QRDMRlpoF tbQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=U7x9Vc0mhBA0sUQo2YOSwgmWNes7/YsBR4cUPMZzM4c=; b=oJCov3YrYaLkdJhOjq/HVTsWwKpUnsiFwTNqgiILRy/STVGATg2RTXXIsT10y8rY6w nc00Hi8FLFAjF9BGTLzx3AO+J4XbCiJjrNasM3l9L14WQSTpxMOK3GLkiSsXkwSujsJa Ua1EclxGaTQOewk5SJ7vMoAxSjMWpXZH0DPEWPoJxhLbqLKsHiH5MqKHaOrGCs5ZNYZe UcQg1L5SybiSx4xyG4ToKlxbFeSlA1jE9Y+fHNRH/RXkGvFcN8RveXSqPKyNBXhoXGGK Pv93WHrKrWN7+GN/xr5YXjuZmL6x9VQPfN4aXDqI708rbPtEeK6tAB08F71CSX2fAYsF qrcQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y9si1017709edq.103.2021.01.27.12.58.45; Wed, 27 Jan 2021 12:59:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238169AbhA0EI1 (ORCPT + 99 others); Tue, 26 Jan 2021 23:08:27 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:11898 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236602AbhA0Dh4 (ORCPT ); Tue, 26 Jan 2021 22:37:56 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DQRt25s8tz7bbx; Wed, 27 Jan 2021 10:11:22 +0800 (CST) Received: from [10.174.179.117] (10.174.179.117) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Wed, 27 Jan 2021 10:12:31 +0800 Subject: Re: [PATCH v2 01/10] mm: use add_page_to_lru_list() To: Yu Zhao CC: Michal Hocko , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Vlastimil Babka , Matthew Wilcox , , , Andrew Morton , Hugh Dickins , Alex Shi References: <20210122220600.906146-1-yuzhao@google.com> <20210122220600.906146-2-yuzhao@google.com> From: Miaohe Lin Message-ID: <24c55266-497b-db91-2784-5621ca35ebef@huawei.com> Date: Wed, 27 Jan 2021 10:12:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210122220600.906146-2-yuzhao@google.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.117] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/1/23 6:05, Yu Zhao wrote: > 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); > Reviewed-by: Miaohe Lin