Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp129801rwb; Wed, 7 Dec 2022 15:33:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf4lAnqiXE29E//ZiDZndfNVoBAF9mwmb2uIQTtbByliqUimxriMugksAPrr48492Qks+PSq X-Received: by 2002:a63:4908:0:b0:477:e0b4:3f5 with SMTP id w8-20020a634908000000b00477e0b403f5mr53346012pga.265.1670456022468; Wed, 07 Dec 2022 15:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670456022; cv=none; d=google.com; s=arc-20160816; b=lDkRa+3yyKFP9X4LfZB1D6imqTZCPoFQ75kJ6G8L82mKUyzfUTTsoO0dfztSGCc9yF jgUxsqmmRQX34H9Mi2A7z3AnI1KozPTrP0qoP7UpkF3KJnqK14dBrJc8RexuB+cDsKxi 8eYuh5OBtLrRl7aFu8PwJonvWaipO3Pqe0Ox48CaBL/lVoLDjE/EtX9kbMDePVjjo+Lj dk/vqgbb5D1R9i/58fHAmSTJH7iKamfO7PsWeKH/16NVxNFzLrlFfxa56gMuD+zUd5Lr IhIEfDWnCpaDPMxcCF1KApB8UqDxCcC44VEQbVecbE8/UThTLXaj5OGsv4RKA1OHz3e6 p+ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xqHiRihBJ8iX0F/IkBiJScs1HhKDLwhRskwhnIf3MT8=; b=0GeoGYcZ6g9t1nnvl/QJQOchOjMrsyQLE+KkMkWc6bDLrBUoOBbEntF7zZY72NU4AS MLvxRe9BoB81wCY/FbimOam1X2DjVIpDP3A+MHoNuKYfZ0LqJze7k01WRB2ByTMw+9Nc bQnhtzifQTgbU3CZMMmeXP2XxpednFysg82dX6Gqg3Kmz+kb/7HR8rzqGUwwoycXafOA XgIhRbg5LapCEXgJo6bNjoA7DbMzS1NOi2KfwtbBPUmlNwwSWfPciqBnshF1yL8N+b+K PPKp7j1WiRDxzx4chbiES8271VvY0qtFmorYsEzNupAZNj630XJI0mC2yYFUhknICbtk tUrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Z2+ynanT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f1-20020a056a00228100b0056ba98afe0dsi23312788pfe.75.2022.12.07.15.33.32; Wed, 07 Dec 2022 15:33:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Z2+ynanT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbiLGXKE (ORCPT + 74 others); Wed, 7 Dec 2022 18:10:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbiLGXKD (ORCPT ); Wed, 7 Dec 2022 18:10:03 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36EA77F882 for ; Wed, 7 Dec 2022 15:10:02 -0800 (PST) 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=xqHiRihBJ8iX0F/IkBiJScs1HhKDLwhRskwhnIf3MT8=; b=Z2+ynanTTY8D9mWJ9eqW9lYfd5 Xwe0VmlCYl+gVh/rHRHIuDPnWB2VRRrvl9FJ05OxNsb2YI1exSW+EYKuNiji4yv1pr7+xiJeQ/XzK N79p6UQhttIVKpVjUJjuC2HCHkFpcwHzx7ky9ym0f8+cONc512UwqHcHtMkuFzgMJpfpoaW4lqYwF +6wr3GhOMPcFQRg4QMhzpXbWCiAj/LmzOC/Gh2l3i9eTVHDF2OLB8UbHvY7BuBVYDgUEMIJiCAXnr OzS4OTYhnzcVKOBDp/YE0jTGezZFOZ8GWUcdwvY9ovgQob+KHkwDkqpsUiXApDOPq4WEBQShgAwle 1Aa32cVQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p33Y7-006IRG-Nb; Wed, 07 Dec 2022 23:09:59 +0000 Date: Wed, 7 Dec 2022 23:09:59 +0000 From: Matthew Wilcox To: "Vishal Moola (Oracle)" Cc: linux-mm@kvack.org, damon@lists.linux.dev, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, sj@kernel.org Subject: Re: [PATCH v2 1/3] madvise: Convert madvise_cold_or_pageout_pte_range() to use folios Message-ID: References: <20221207230152.22938-1-vishal.moola@gmail.com> <20221207230152.22938-2-vishal.moola@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221207230152.22938-2-vishal.moola@gmail.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 07, 2022 at 03:01:50PM -0800, Vishal Moola (Oracle) wrote: > @@ -424,28 +425,29 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd, > page = vm_normal_page(vma, addr, ptent); > if (!page || is_zone_device_page(page)) > continue; > + folio = page_folio(page); Maybe we should add a vm_normal_folio() first? That way we could get rid of the 'struct page' in this function entirely. > @@ -453,13 +455,13 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd, > } > > /* > - * Do not interfere with other mappings of this page and > - * non-LRU page. > + * Do not interfere with other mappings of this folio and > + * non-LRU folio. > */ > - if (!PageLRU(page) || page_mapcount(page) != 1) > + if (!folio_test_lru(folio)) Why has the test for folio_mapcount() disappeared?