Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2098383pxb; Wed, 9 Feb 2022 10:47:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZmd49gY9MfXu13aMwvmRwPdy+3yS9gnwyo4RUjqrCLHRtJbQNrhHFBtw6M26P6bOftmhY X-Received: by 2002:a17:90a:6903:: with SMTP id r3mr4854203pjj.73.1644432461587; Wed, 09 Feb 2022 10:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644432461; cv=none; d=google.com; s=arc-20160816; b=jhYCEMrC9CwaOKccmqwE6Q/vRkzsL5J//GpUFNGUr7HieVw4rxlJRloeCZjiWDtWve Ai6KLS74zpYnzwwyPnIrNyr+RmKb4nY6WGKJTB7tVT5CxFNiuc0kXPdyggCwL7OlNNkU S1XE6gaPFHw3jRY0oJPalloiSKvC6Bf6icWl+3DdQwZJahhul+IJYdtzjY1o7TbmAP5W PtNJhl1UNNpSw0hvYpgiQ/7BI5yvj7j3msOQYgNIYvG5SCIr8aGy9FEsL1ITqQTLS7/Q UqWSAW39nWQu0WuK09NVUoK8W9YtxHmWQWP91Co4yAm5Pkxu2GLHIsa9lDdGlkzwokAT lGYg== 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=eIF08KcMpl5r29rPiQe9+6ZkSSpvO+hinKiqWMtDBSw=; b=Fqv0vSuC+AEiFSt7kLyjz1GVuzir4WyNPFanWpkgiSbWQPloMbrfy+7RAnfXd6HdII WlQzIq7QiREpMZzGm6VcwkGP4AnZ0QEM7IdiBIfBoNCVNq8iZVLAkXjMeSG2Fq0f/sjl h7XcQa87Iq6ssDZ+IzEgUuGkMFXH2dHJMUl+7ax55JcZEp8r1VHCuzwdCruBtumez2CY 9rhlA+4bwnpdkwjbB32OgBzHfdHLZATmRvCpmxbhf2xG+DR5Rji+quSXUqDynez7hcTx BRq/E06HuwzXLl+MVSqDUM38qFsn9mkKsf/8C9DfwKr+FbrixxPdHLLrT1FNJjPfx+ET 1AmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=oj44LeKt; 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 z126si15256708pfc.324.2022.02.09.10.47.28; Wed, 09 Feb 2022 10:47:41 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=oj44LeKt; 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 S235014AbiBIO3K (ORCPT + 99 others); Wed, 9 Feb 2022 09:29:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233010AbiBIO3I (ORCPT ); Wed, 9 Feb 2022 09:29:08 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50538C06157B for ; Wed, 9 Feb 2022 06:29:12 -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=eIF08KcMpl5r29rPiQe9+6ZkSSpvO+hinKiqWMtDBSw=; b=oj44LeKt1qxycyFeTCQRMXiQqd 4VhwfEU3oOTLW+gPnSCXOuyJT4uiRmzCJo6lHaioJ88h04fktbf61OSYQeO9gafWkZNshRMa9/eSl 0ImOQoptpWW/k8aD8/4EaWgAZNUjL7ooSRDHy7vkBtjGzqLxp+cKz6paZQsNqL5Khem5GftWcXbNw EgTpQiFfeOGaJAUiNVcklqkzxhb/U/2BWNaXERwgF4cX1Yev583OCBmcZaKH0xMT/lCb5UjMTCTUp snHr5CedN/FAthzUI+5fvM+/cf3nPSR75ZWYYOD2Zo7Yq0LKYHjVL/WvVDb0SNQfz9ENetNZjUyN6 eBXAL6tA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHny1-007w0y-Cn; Wed, 09 Feb 2022 14:29:09 +0000 Date: Wed, 9 Feb 2022 14:29:09 +0000 From: Matthew Wilcox To: Mauricio Faria de Oliveira Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 51/75] mm/rmap: Convert try_to_unmap() to take a folio Message-ID: References: <20220204195852.1751729-1-willy@infradead.org> <20220204195852.1751729-52-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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,T_SCC_BODY_TEXT_LINE 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, Feb 09, 2022 at 11:24:34AM -0300, Mauricio Faria de Oliveira wrote: > Hi Andrew and Matthew, > > On Fri, Feb 4, 2022 at 5:00 PM Matthew Wilcox (Oracle) > wrote: > > > > Change both callers and the worker function try_to_unmap_one(). > ... > > diff --git a/mm/rmap.c b/mm/rmap.c > ... > > @@ -1598,8 +1602,8 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma, > > } > > > > /* MADV_FREE page check */ > > - if (!PageSwapBacked(page)) { > > - if (!PageDirty(page)) { > > + if (!folio_test_swapbacked(folio)) { > > + if (!folio_test_dirty(folio)) { > > /* Invalidate as we cleared the pte */ > > mmu_notifier_invalidate_range(mm, > > address, address + PAGE_SIZE); > > @@ -1608,11 +1612,11 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma, > > } > > > > /* > > - * If the page was redirtied, it cannot be > > + * If the folio was redirtied, it cannot be > > * discarded. Remap the page to page table. > > */ > > set_pte_at(mm, address, pvmw.pte, pteval); > > - SetPageSwapBacked(page); > > + folio_set_swapbacked(folio); > > ret = false; > > page_vma_mapped_walk_done(&pvmw); > > break; > ... > > This conflicts with patch [1], currently in mmotm, and I'll send > another version anyway. > Should that patch be on top of these folio changes, or the other way around? Andrew and I need to resolve conflicts between this series and other patches in his tree. You don't need to worry about this. > The latter would help w/ the stable backports that don't have folios > yet, but I can > send backports there as well; not a problem. > > Thanks, > > [1] https://lkml.kernel.org/r/20220131230255.789059-1-mfo@canonical.com > [PATCH v3] mm: fix race between MADV_FREE reclaim and blkdev direct IO read > > -- > Mauricio Faria de Oliveira >