Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp151350rwb; Wed, 7 Dec 2022 15:57:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf4A/fzbUoL7W7bGg91qgiF5q0mPTqwgxxKtSdrbIc9n+Js0H/9qhH/ULc88Ib04HxXrvMjK X-Received: by 2002:aa7:c042:0:b0:462:2f5a:8618 with SMTP id k2-20020aa7c042000000b004622f5a8618mr83713867edo.42.1670457445166; Wed, 07 Dec 2022 15:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670457445; cv=none; d=google.com; s=arc-20160816; b=lt1Vl2EGKaqpgiduQSFD2y3UJPvJY3k7tuJFXogN3IVQClWiyl1+ojvGVYwBY1eeFj ywlsS88hGfEd4tfNuRvr4SQ+SM/LSxsAt0ruga7baoSPZ4XwqD6vGj5wWNPaNOoE388Y TdmLc/Ej8u5BnIUQbWde+9ECkXH2pFMTkgMkX5nESlwYEU8gSpDqNBkVyOUUwmwBCsU7 Y/1oVJkWhiYsn0yBy1ujizwvln8ggwWXT6YIVYDlaShGm0OIiTYV+uPqT7wrq7KOB+eh Ho+845+f8sIIyU1YKeHW29vdHtAwoCvD7ScOxBPqtL3YYWhoTtDmxOFYqGltY4AOj3rF 8szw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=mXsz6/Icjh465llNxu4s0rXYIhAO+R+B34XNkGIo6eQ=; b=tNbiqizOpGG1hsX3vmIwD/bWviJZfGxbQqswcHV1tyowTimwhonIomPBn7h/9JtwRw NQZskNB3T+U7UeGmlfJTG8hNarIr2umJZU8qvXBlLmN270BEv54u/UjpT+mMgZ4OF7iJ tcWLHKgCMX0pV5rzg5tZah33OrIkfPJbnu9nxofiJ2kpjMH3AtJvXdSctq54iO0LiXqb iCbBXcEvx/N+afUQGY3yeZbDgtA0xIXOHeeD5SGKIT2F292f1chd1MBLME+yInilo95N HxkBj2LFxLig56lasP2+mMSNo8OdPiLneVi6BBMmqUtx/NahdM9Kv+wurBktXzmFg7q3 6NUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Be1pHwvM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq19-20020a1709073f1300b007c086018a40si17575428ejc.996.2022.12.07.15.57.06; Wed, 07 Dec 2022 15:57:25 -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=@gmail.com header.s=20210112 header.b=Be1pHwvM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230205AbiLGXpj (ORCPT + 75 others); Wed, 7 Dec 2022 18:45:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbiLGXpg (ORCPT ); Wed, 7 Dec 2022 18:45:36 -0500 Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 195298AAFE for ; Wed, 7 Dec 2022 15:45:36 -0800 (PST) Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-3c090251d59so203925567b3.4 for ; Wed, 07 Dec 2022 15:45:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=mXsz6/Icjh465llNxu4s0rXYIhAO+R+B34XNkGIo6eQ=; b=Be1pHwvM4e7ouSG+ZY6N9k/NiEQ4tzzDVuXyq4CEbwd9ADrS9FJ3QaPyXtXz2d1OdS qYzdxL6v4h/5A9aQJcky67nIla75qGdrJ85MwA1KqQc3qgPS4YtS4Vut3e6qnGU82G3o lQHWwLuJtztifl8vYx5gAgBC8BNMgctCbp72zj3JslJx5k3nQosHW4HKSGteEit76fR3 Yc0mGCeHk7bo4xicAjtUfwALdzwuGnKwQvDu1x0nLwq6Qb3WzoqCxfZ4zEUbgJXsd/oH bmeiO9/QSI7+8qvg60KDx7Ti9ptHefiR2pn2ij2Gs6XWpl2Ld/c0+UgyzbpAfe7ooJHE Ca0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mXsz6/Icjh465llNxu4s0rXYIhAO+R+B34XNkGIo6eQ=; b=IeuHeVqE1GozpFrIG14dqq9xkZLIczJmxTjDsCnFWKYCEG9MKRoTG1nVMBHkh2cd3z H2/UJGIl6qvAVhja2lgu9rNC3qeB7UfZBCzYtOU8xSG12UxWoUEvpPdAEFnNc7sjC9fZ jKwCXHMf3e27mKQ1AK+t71mfRrvkSymHBQyL1Kn5vlCZD3gbE7UdA8A6l6/zlRgt45xK PawtNqCzsC1ShwZeIlYmOlSBuu8dnG+iAafaz+KEJTd6u3QBV3dhXaSYjqvfgiPg6nEs a8zgS1dku09Xky9n43n8MiUn3jP3Ca1hzmSWVsMhOAiY27mkIz1Ks3ReRq6cWU6xa1MZ 7yOQ== X-Gm-Message-State: ANoB5pmPRkj6nN/Ffu2DJXqOca6bx9qGBX9ZKpL1C4hrdPCLSED3To50 BpZM3ogRQycUIYG5MiqyfxYpkdmziaj3Jf0oU7/YW1IU17M= X-Received: by 2002:a0d:cb43:0:b0:368:e8a:3b1d with SMTP id n64-20020a0dcb43000000b003680e8a3b1dmr21578440ywd.469.1670456735268; Wed, 07 Dec 2022 15:45:35 -0800 (PST) MIME-Version: 1.0 References: <20221207230152.22938-1-vishal.moola@gmail.com> <20221207230152.22938-2-vishal.moola@gmail.com> In-Reply-To: From: Vishal Moola Date: Wed, 7 Dec 2022 15:45:24 -0800 Message-ID: Subject: Re: [PATCH v2 1/3] madvise: Convert madvise_cold_or_pageout_pte_range() to use folios To: Matthew Wilcox Cc: linux-mm@kvack.org, damon@lists.linux.dev, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, sj@kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 7, 2022 at 3:09 PM Matthew Wilcox wrote: > > 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. Yeah, I'll do that. Many other callers will benefit from it later as well. > > @@ -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? Oops, that page_mapcount() should have been replaced with a folio_mapcount(). It appears I accidentally removed it.