Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp260946rwb; Fri, 2 Sep 2022 13:45:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR4QoYb/hcdE0wSY8MvQG+IWKXjc8+SnN5UVBSpUTlI0Qj18RZsvUcaqkJUUarqWjf1wjAlQ X-Received: by 2002:a17:90b:4d07:b0:1ef:521c:f051 with SMTP id mw7-20020a17090b4d0700b001ef521cf051mr6856743pjb.164.1662151522280; Fri, 02 Sep 2022 13:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662151522; cv=none; d=google.com; s=arc-20160816; b=Ruhja1naLvXXWBg4D6QhA0iVoxET9r0HVf0fS2sYYP+G1Bgcmdh9kOqDpJ5lEwYh6o D4SZg/4qfGySlA3ZI0Lg9JR2AHMd0o0DRPFoUiR92QzzBQK4ejaDABzKD0Goh7Qotzeb VyStMjPc7UFNshyaCnju2A1M7FmGRwzRDlrS4eh9T9fXfrawkJkLH9GflTmb+bkjt9Yy ld3Uq6paH0XFqEvt24xt/Ssu7HvVr4adnwb43Ulppe81hLnwjgnR862up3iKABNdgsqQ su3pWoFubbVZaZShXmrNrp+FICIob/+OFB06I4q2TA8vkLG2izIdHNK0fKfpLhUhr7Qt aBAA== 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=xJ0Qu9XWFO4UUk4rWqs9r8O8v+oRQvUvbXP0h2FgBJE=; b=So+2+O55juXHNfCfj2NSR9Qw0P7cO+mzulNFjQsmJKTgUoZh6bqiT2WPIdcGThF5ce NKrMtGsAG3kaLnRundYHr4FkOJwNk1ca1WfSTO6bvmh3ySk1xJZFBoXFVzyVd6dY1pid HdE6K9TKxmTdsslsQoXsryRlqxgYJagU8j+/W7MIIqOQtcNDdLFZPd08GiXRUtr94/d9 8MEezABjxbga/SN+9rPspOLuqqxX2B83B1xD1zqRJhES2eNrKBV92tbq7ERZvYOqyWPO LOAawq/shMCgv83I8GjCPZKn4e5dxwqggXvo3N9eFBH3OfL299aeJ18YQkEftvwnDAPO xCxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fy32uSQt; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020a170903110800b00172f1cf5ba7si3421241plh.38.2022.09.02.13.45.10; Fri, 02 Sep 2022 13:45:22 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=fy32uSQt; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230046AbiIBUjO (ORCPT + 99 others); Fri, 2 Sep 2022 16:39:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230039AbiIBUjM (ORCPT ); Fri, 2 Sep 2022 16:39:12 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC15AFAC7B for ; Fri, 2 Sep 2022 13:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662151148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xJ0Qu9XWFO4UUk4rWqs9r8O8v+oRQvUvbXP0h2FgBJE=; b=fy32uSQtGMMe/jFzTwIBoHADAehqWGesHZ1piQgsCXRXSLywAMz4hsYplhk+xylOXgAXAu 23tacLZYw5fjh0LUpOMKajoNeeiOCneMG77PD150smqk+BAvjcZbF3G936RV4+nRWh4Ye0 rCNq3/HPw+i98JPVbnQk4KGcI7Dsn+g= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-300-OIVzxzlyNJCHqRVmYac2Vw-1; Fri, 02 Sep 2022 16:39:07 -0400 X-MC-Unique: OIVzxzlyNJCHqRVmYac2Vw-1 Received: by mail-qt1-f200.google.com with SMTP id h19-20020ac85493000000b00343408bd8e5so2392610qtq.4 for ; Fri, 02 Sep 2022 13:39:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=xJ0Qu9XWFO4UUk4rWqs9r8O8v+oRQvUvbXP0h2FgBJE=; b=2CkqVDj2KFAZFhSVKkLlSpYC7/owsVjdwfRiI/alUns8IvTVRniKR1L/xxHF8Fb7GP GgyjEwpMX/Btk9YPhZREDopJ8MvMCwcOY3Ku+x/4SDe/VGFQEUVyvvg+cB9UdUj+pzlL shWkJU7lV6sj2IEReyOW+b0nsgNSvKWaFN4wjobfb1L1IcLjiNRl/ZolnLlmPcqAQ9bY V98F7aiNyvlUAbQ0GGwaCq7d8LoCDeS7od7OWSsQoaQso3jNKNShfTWWrf5sdj5x1eV+ tTJqdlqF6+L1L3musG27Z0TTbBEhE26jmfWugkfRGLF2liE4dV4bAaTaj0PCbfrYOprH lu5A== X-Gm-Message-State: ACgBeo1OdYQagnuwWiSloz8aL3+WxQ0S2JnBncPqgv7ZB6Rv2bCqgLsI zA1UxbVlBQNpSGhEog/TtyrR4HU2yck452ahHwX1AWSsmW5i1c3oK5vADQeSmg7crT4Ebs2pjSk 0LnkPChMEx3Acfk3Z8Cc/PWF6 X-Received: by 2002:a05:6214:4005:b0:474:3c94:cdc2 with SMTP id kd5-20020a056214400500b004743c94cdc2mr30020608qvb.17.1662151147433; Fri, 02 Sep 2022 13:39:07 -0700 (PDT) X-Received: by 2002:a05:6214:4005:b0:474:3c94:cdc2 with SMTP id kd5-20020a056214400500b004743c94cdc2mr30020592qvb.17.1662151147191; Fri, 02 Sep 2022 13:39:07 -0700 (PDT) Received: from xz-m1.local (bras-base-aurron9127w-grc-35-70-27-3-10.dsl.bell.ca. [70.27.3.10]) by smtp.gmail.com with ESMTPSA id l3-20020ac80783000000b00342fcdc2d46sm1725995qth.56.2022.09.02.13.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 13:39:06 -0700 (PDT) Date: Fri, 2 Sep 2022 16:39:04 -0400 From: Peter Xu To: Alistair Popple Cc: linux-mm@kvack.org, akpm@linux-foundation.org, Nadav Amit , huang ying , LKML , "Sierra Guiza, Alejandro (Alex)" , Felix Kuehling , Jason Gunthorpe , John Hubbard , David Hildenbrand , Ralph Campbell , Matthew Wilcox , Karol Herbst , Lyude Paul , Ben Skeggs , Logan Gunthorpe , paulus@ozlabs.org, linuxppc-dev@lists.ozlabs.org, stable@vger.kernel.org Subject: Re: [PATCH v4 2/4] mm/migrate_device.c: Add missing flush_cache_page() Message-ID: References: <9f801e9d8d830408f2ca27821f606e09aa856899.1662078528.git-series.apopple@nvidia.com> <5676f30436ab71d1a587ac73f835ed8bd2113ff5.1662078528.git-series.apopple@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5676f30436ab71d1a587ac73f835ed8bd2113ff5.1662078528.git-series.apopple@nvidia.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 Fri, Sep 02, 2022 at 10:35:52AM +1000, Alistair Popple wrote: > 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. > > Signed-off-by: Alistair Popple > Fixes: 8c3328f1f36a ("mm/migrate: migrate_vma() unmap page from vma while collecting pages") > Cc: stable@vger.kernel.org This is the patch to start collide with David's. David's patch has also unified both paths with ptep_get_and_clear(), but this patch itself is also correct to me. It'll probably just become no-diff after rebase, though.. I'm not sure how the ordering would be at last, but anyway I think this patch stands as its own too.. Acked-by: Peter Xu Thanks for tolerant with my nitpickings, > > --- > > New for v4 > --- > mm/migrate_device.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/migrate_device.c b/mm/migrate_device.c > index 6a5ef9f..4cc849c 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)) { > -- > git-series 0.9.1 > -- Peter Xu