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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46442C433FE for ; Sun, 2 Oct 2022 10:24:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229672AbiJBKY1 (ORCPT ); Sun, 2 Oct 2022 06:24:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbiJBKY0 (ORCPT ); Sun, 2 Oct 2022 06:24:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A19C303C1 for ; Sun, 2 Oct 2022 03:24:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BC5A7B80C98 for ; Sun, 2 Oct 2022 10:24:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E44AC433D6; Sun, 2 Oct 2022 10:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664706262; bh=3+fHTpyOZUyLbWcH8Fd6ovMVearMbZAxgQoxYUjS1IY=; h=Subject:To:Cc:From:Date:From; b=KK+3dFVbwswOJu76+cT6xCDNTDXVP2DFco1bL+8wgY7KY4Pf7K87kf1uFYCf0++G+ FBiW4HNMnhXUPBqmplwSUWYoaCH3Nc9iy2vdhFQxP+oK0XjXU8dFn9XTuTUCZKz4V/ BiZO0wWsyDiY5Zktz/EoO3n7yoVyybnhwFK8ncdQ= Subject: FAILED: patch "[PATCH] mm/migrate_device.c: add missing flush_cache_page()" failed to apply to 5.15-stable tree To: apopple@nvidia.com, Felix.Kuehling@amd.com, akpm@linux-foundation.org, alex.sierra@amd.com, bskeggs@redhat.com, david@redhat.com, huang.ying.caritas@gmail.com, jgg@nvidia.com, jhubbard@nvidia.com, kherbst@redhat.com, logang@deltatee.com, lyude@redhat.com, nadav.amit@gmail.com, paulus@ozlabs.org, peterx@redhat.com, rcampbell@nvidia.com, stable@vger.kernel.org, willy@infradead.org, ying.huang@intel.com Cc: From: Date: Sun, 02 Oct 2022 12:25:00 +0200 Message-ID: <16647063008361@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Possible dependencies: a3589e1d5fe3 ("mm/migrate_device.c: add missing flush_cache_page()") 6c287605fd56 ("mm: remember exclusively mapped anonymous pages with PG_anon_exclusive") 6c54dc6c7437 ("mm/rmap: use page_move_anon_rmap() when reusing a mapped PageAnon() page exclusively") 28c5209dfd5f ("mm/rmap: pass rmap flags to hugepage_add_anon_rmap()") f1e2db12e45b ("mm/rmap: remove do_page_add_anon_rmap()") 14f9135d5470 ("mm/rmap: convert RMAP flags to a proper distinct rmap_t type") fb3d824d1a46 ("mm/rmap: split page_dup_rmap() into page_dup_file_rmap() and page_try_dup_anon_rmap()") b51ad4f8679e ("mm/memory: slightly simplify copy_present_pte()") 623a1ddfeb23 ("mm/hugetlb: take src_mm->write_protect_seq in copy_hugetlb_page_range()") 3bff7e3f1f16 ("mm/huge_memory: streamline COW logic in do_huge_pmd_wp_page()") c145e0b47c77 ("mm: streamline COW logic in do_swap_page()") 84d60fdd3733 ("mm: slightly clarify KSM logic in do_swap_page()") 53a05ad9f21d ("mm: optimize do_wp_page() for exclusive pages in the swapcache") 9030fb0bb9d6 ("Merge tag 'folio-5.18c' of git://git.infradead.org/users/willy/pagecache") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From a3589e1d5fe39c3d9fdd291b111524b93d08bc32 Mon Sep 17 00:00:00 2001 From: Alistair Popple Date: Fri, 2 Sep 2022 10:35:52 +1000 Subject: [PATCH] mm/migrate_device.c: add missing flush_cache_page() Currently we only call flush_cache_page() for the anon_exclusive case, however in both cases we clear the pte so should flush the cache. Link: https://lkml.kernel.org/r/5676f30436ab71d1a587ac73f835ed8bd2113ff5.1662078528.git-series.apopple@nvidia.com Fixes: 8c3328f1f36a ("mm/migrate: migrate_vma() unmap page from vma while collecting pages") Signed-off-by: Alistair Popple Reviewed-by: David Hildenbrand Acked-by: Peter Xu Cc: Alex Sierra Cc: Ben Skeggs Cc: Felix Kuehling Cc: huang ying Cc: "Huang, Ying" Cc: Jason Gunthorpe Cc: John Hubbard Cc: Karol Herbst Cc: Logan Gunthorpe Cc: Lyude Paul Cc: Matthew Wilcox Cc: Nadav Amit Cc: Paul Mackerras Cc: Ralph Campbell Cc: Signed-off-by: Andrew Morton diff --git a/mm/migrate_device.c b/mm/migrate_device.c index 6a5ef9f0da6a..4cc849c3b54c 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -193,9 +193,9 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, bool anon_exclusive; pte_t swp_pte; + flush_cache_page(vma, addr, pte_pfn(*ptep)); anon_exclusive = PageAnon(page) && PageAnonExclusive(page); if (anon_exclusive) { - flush_cache_page(vma, addr, pte_pfn(*ptep)); ptep_clear_flush(vma, addr, ptep); if (page_try_share_anon_rmap(page)) {