From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8024C433F5 for ; Wed, 30 Mar 2022 16:23:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BE266B0072; Wed, 30 Mar 2022 12:23:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 36DBD8D0003; Wed, 30 Mar 2022 12:23:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 235C38D0002; Wed, 30 Mar 2022 12:23:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id 133CA6B0072 for ; Wed, 30 Mar 2022 12:23:34 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C75BA18290E64 for ; Wed, 30 Mar 2022 16:23:33 +0000 (UTC) X-FDA: 79301573106.31.4496A03 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf18.hostedemail.com (Postfix) with ESMTP id 2E53E1C0014 for ; Wed, 30 Mar 2022 16:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=fGiP7eNYmR9hTYgNcpuVATSk7G3qVhmnTNIbk7YKHZ8=; b=lQ7Ifzm4AfUFqmAVF4hxGCdqqx 1B/lx0Rzo6p288YDfLG5BpnykdaRUx7ONiFhybY4jjGCpACduAElPqYg//NSewCnBi+dpmIf8OGsC yWsngKf2uCewI8QsWgEhP6E+fad7r2tmrtRnj4LcTd0YCVEqe0DXRRgsY5BcohOB8h5dN7ALt6HNB k+Rc83xEGDVSdQ4s+J/pefGjBIuzdXQpu705spFQSfrjRfWvcUG+nQ9ny0OWzHUvsvrYFZM4+4/xy mXPrYy1oVhtB7eB8SNptwN41YRAOC1hE1e0gyXhs5MCj1HeknU9JjpNJVBXp+U0OFrgta4zDohz5C vU+mnN1A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZb6V-001ORE-Mq; Wed, 30 Mar 2022 16:23:27 +0000 Date: Wed, 30 Mar 2022 17:23:27 +0100 From: Matthew Wilcox To: Miaohe Lin Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/8] mm/vmscan: introduce helper function reclaim_page_list() Message-ID: References: <20220329132619.18689-1-linmiaohe@huawei.com> <20220329132619.18689-4-linmiaohe@huawei.com> <4880f7de-625c-1d93-3b65-81f6c849de7b@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4880f7de-625c-1d93-3b65-81f6c849de7b@huawei.com> X-Stat-Signature: 5fsrc3p5zxkb9thy7jhmmo3q9nx9cekt Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=lQ7Ifzm4; spf=none (imf18.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2E53E1C0014 X-HE-Tag: 1648657413-820507 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: On Wed, Mar 30, 2022 at 10:04:54AM +0800, Miaohe Lin wrote: > On 2022/3/29 21:50, Matthew Wilcox wrote: > >> + while (!list_empty(page_list)) { > >> + page = lru_to_page(page_list); > >> + list_del(&page->lru); > >> + putback_lru_page(page); > > > > Why wouldn't you use a folio here? > > > > I was just wanting to keep the code consistent with the previous one. Am I supposed to > use a folio here ? If so, will do it in V2. The distinction we're trying to make (and obviously we have a long way to go before we're finished) is between the structure that describes PAGE_SIZE bytes of memory and the structure that manages the memory allocation. This function is clearly handling the entire memory allocation, so it should be using a folio. Eventually, page->lru should disappear, but there's 180 places to figure out what we need to do instead.