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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5191BC54EE9 for ; Fri, 2 Sep 2022 06:51:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E294D800C5; Fri, 2 Sep 2022 02:51:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DD8E28008D; Fri, 2 Sep 2022 02:51:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C8360800C5; Fri, 2 Sep 2022 02:51:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B5A888008D for ; Fri, 2 Sep 2022 02:51:40 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8B8044096E for ; Fri, 2 Sep 2022 06:51:40 +0000 (UTC) X-FDA: 79866224760.02.AEB3561 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 18DD240056 for ; Fri, 2 Sep 2022 06:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662101499; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CzecCuEjT8bsZhw/7187r3Lof871WwEw17oDlg4yQ4A=; b=LSOdTCIm0Pp5vLo/pUKYONOScResI8d5KzAe3/HWNJmi1iNnFJQKBHnbFTHDhKjyJKKhwJ Qwv2H1iJOlB6n1y+sR0I7U/b+4rSLeNGy2oe14LU3p6pzejm4YTohMfvGZRnKh2bOz6YSK BmaBje1cZIPLJvvYd/XxheMAz8Pv2og= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-581-_mfiWGuPMbONutkSw7ersg-1; Fri, 02 Sep 2022 02:51:38 -0400 X-MC-Unique: _mfiWGuPMbONutkSw7ersg-1 Received: by mail-wm1-f72.google.com with SMTP id v21-20020a05600c215500b003a83c910d83so285195wml.3 for ; Thu, 01 Sep 2022 23:51:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=CzecCuEjT8bsZhw/7187r3Lof871WwEw17oDlg4yQ4A=; b=R0AK3HwPPAZ9ewev36v2BFdAIal1+vqRj+XXSxbxEn/SX9PciY1sk6V9V2tyTBW8p2 aI7u84762Xaz9SkUWKDwRpex6PikKfzBWXWRGjJTJ3eruIOuaMJKxVkDQ8Ie4rZe5Vmb eXO9uqVCWrEuFxQjWLxZKoDbOEFVo/dBU30hE/E/r+vOok6QJD6Ea99z0vuFyPzICgZv 9vGg9H89sRwZWrlnuHY1sJajN3jd5VgBG5jXm0KY1VcYXeuwhbeGBKOypTnTyrJsaOy7 oDxiY0f1wF14urwKMTGQGTccsHDD3JUW2eeL3YetZ0SMKfZ0SrA3DY6cnWv2J6Wt5s/1 gJig== X-Gm-Message-State: ACgBeo1fzrW6Li1umo5em2QMssZFpK70nkd94R/P7XVso1CIdCb3Tl/a oNioUVpV30HIQbG3h664y9d9RCMNqfRcOV5Y/2wC32MzWvVER4YDlikrppK+/smreEyppugMiAs beKr6cYlS/uE= X-Received: by 2002:a5d:5a82:0:b0:224:f744:1799 with SMTP id bp2-20020a5d5a82000000b00224f7441799mr16343597wrb.582.1662101497175; Thu, 01 Sep 2022 23:51:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR6iZBZuSEIjazOLEKCa9lgC4RY/uchGV2EbWYG93tx8iwY/c8Hx5sRdwdAfHdsyv+pj+sX/bA== X-Received: by 2002:a5d:5a82:0:b0:224:f744:1799 with SMTP id bp2-20020a5d5a82000000b00224f7441799mr16343574wrb.582.1662101496869; Thu, 01 Sep 2022 23:51:36 -0700 (PDT) Received: from ?IPV6:2003:cb:c714:4800:2077:1bf6:40e7:2833? (p200300cbc714480020771bf640e72833.dip0.t-ipconnect.de. [2003:cb:c714:4800:2077:1bf6:40e7:2833]) by smtp.gmail.com with ESMTPSA id x1-20020a5d6b41000000b002250c35826dsm727061wrw.104.2022.09.01.23.51.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Sep 2022 23:51:36 -0700 (PDT) Message-ID: Date: Fri, 2 Sep 2022 08:51:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v4 2/4] mm/migrate_device.c: Add missing flush_cache_page() To: Alistair Popple , linux-mm@kvack.org, akpm@linux-foundation.org Cc: Peter Xu , Nadav Amit , huang ying , LKML , "Sierra Guiza, Alejandro (Alex)" , Felix Kuehling , Jason Gunthorpe , John Hubbard , Ralph Campbell , Matthew Wilcox , Karol Herbst , Lyude Paul , Ben Skeggs , Logan Gunthorpe , paulus@ozlabs.org, linuxppc-dev@lists.ozlabs.org, stable@vger.kernel.org References: <9f801e9d8d830408f2ca27821f606e09aa856899.1662078528.git-series.apopple@nvidia.com> <5676f30436ab71d1a587ac73f835ed8bd2113ff5.1662078528.git-series.apopple@nvidia.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <5676f30436ab71d1a587ac73f835ed8bd2113ff5.1662078528.git-series.apopple@nvidia.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662101500; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=CzecCuEjT8bsZhw/7187r3Lof871WwEw17oDlg4yQ4A=; b=prDJl698ZQ5I2ZqQzb776rys5QyzrAuRkqBfTtHXVVELPMHn9pdEdxpYl/zKT87o47bdr/ umFIs+wrc6Jq9mI6V4Czsm3ZD3EBlePA65DiadQdW9y1QNnTo8XiIxV9LKnx4f84LkLePx BMnEF+544NjyfmKC/gh7Mh7izK/ENvg= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LSOdTCIm; spf=pass (imf01.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662101500; a=rsa-sha256; cv=none; b=d6OR8kzVEh5GVuKgYtxGoglrSemuugMI+K4m/0Krp8l+RKzjsg+KVvUnW6l4njmUrOzsTN gCx8Qxr0p3zTDOEWG1IMintipO8j6nj17gm7zJr9miMsb0YOXaSvMwSEwfw7dllQZxKw23 BTZHw1/bbi4THxwZmk5C0xceWsn0AM0= X-Stat-Signature: yjhc5geb9d5eoxis6dekbi1m3kxt8bnq X-Rspamd-Queue-Id: 18DD240056 Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LSOdTCIm; spf=pass (imf01.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam12 X-Rspam-User: X-HE-Tag: 1662101499-344218 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 02.09.22 02:35, 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 > > --- > > 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)) { Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb