Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp454287pxb; Wed, 27 Jan 2021 11:50:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyER7pgOj5sa77mrk7xumyrLwPUic3eZt+wgBVWpSaRmZaCBVsANe1EOsD81vQLMqDO6eDP X-Received: by 2002:a17:906:fc4:: with SMTP id c4mr8290940ejk.143.1611777046615; Wed, 27 Jan 2021 11:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611777046; cv=none; d=google.com; s=arc-20160816; b=0iEcy5h06YnaIbwUWRWpaDlAbFXD6fSNWJpiRT3j1HvCkPS+M8JF7NjXjALKWeT/wa rD8dThJkDNq9inSzdgwsEi4kMTNSnriIF43gT1lcIDnaGpUrrBDDG3hKT656WP2HIdUg HJgnESZvR7UgYVU6vR1Pk30mNNYmJ61URqRb0FzQghSF6mlnVIg/vWG5ppmDvv1hpZVY NaepFpuNfUsDrjhiAXdvtUpPzrT4SnWCG1MzeigtMwzu24edhdOpPqw0fjAFLkzPesD6 E6tUSCEUvQsn7oQ4pSV2HQHE9sDZBdO4xnQKVbms1lOne9pVS8Bm03iNhfD95c3iu3rL ICfA== 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=uiRPycAa03jpv2o2ThUNr5/Mhr5adIsvRbK2JuA0ICw=; b=h7VeQKhRe56pDt34pGm7yCwNwSvyvJL3KcgN7wxE9FwLamdbdgecrPGFuEgNj3Wa4D 8z5+D/89xnx9MJ8lVzm4lwbjJL/ZeJi76aItiFQ5sg4bl1T6/cR2CRS2WKXvATXP4VlX HChR0YuMpbR1KeSH5Gjk9NwpGugzo81OKkDOzMd+oVmgJwEsxYaWhQQAWpDJnW/6BDbH P0L+ywKgFIR73rpuKIlYIl8g3Tb94r5OBsXlQE0H4DmfazsHgYY+Fqf96ByA6JOLDvwm SvRPube4TfRekBKZqBm0s9r/Akd5s0lOOLDMc2TCVtiZol485x71K+TkO7Xz4YBoWwwL th3g== 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 cc6si1787696edb.369.2021.01.27.11.50.20; Wed, 27 Jan 2021 11:50:46 -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 S2405303AbhA0BpB (ORCPT + 99 others); Tue, 26 Jan 2021 20:45:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:39006 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731992AbhAZS5u (ORCPT ); Tue, 26 Jan 2021 13:57:50 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8FDD5AC97; Tue, 26 Jan 2021 18:57:09 +0000 (UTC) Subject: Re: [PATCH v2 01/10] mm: use add_page_to_lru_list() To: Yu Zhao , Andrew Morton , Hugh Dickins , Alex Shi Cc: Michal Hocko , Johannes Weiner , Vladimir Davydov , Roman Gushchin , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210122220600.906146-1-yuzhao@google.com> <20210122220600.906146-2-yuzhao@google.com> From: Vlastimil Babka Message-ID: <5f53f969-b92e-1d86-6b90-7bd93e390a21@suse.cz> Date: Tue, 26 Jan 2021 19:57:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/22/21 11:05 PM, 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 Acked-by: Vlastimil Babka > --- > 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); >