Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp3674528rwj; Mon, 19 Dec 2022 23:45:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXsW/yyR5+b7HN5gwvsJydb1v75Kzw97fP3gB7RflS+DDXVmNKt5iV61VZhdYDjEqbmIf+R2 X-Received: by 2002:a05:6a21:3a43:b0:b0:275d:3036 with SMTP id zu3-20020a056a213a4300b000b0275d3036mr11543454pzb.24.1671522324909; Mon, 19 Dec 2022 23:45:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671522324; cv=none; d=google.com; s=arc-20160816; b=Pgs0+8XvZ91uw5R9C3FChFclnRXV2WP/Df/bgfnCHbaMqH7yp7oDWw9T2CcANDCoSO ZHU36Ter9LetKtbBpn3g1FCphtw7wu59eX3oDf/zLdHBiMNiERvpbx/3cRBp4sjwqthg FVv/U7KJ5H7qS92T4ShFBSDpSZ6fp/nDRqEaU2g/Oo1/IBilqQ1ez1TNcMVVGxbQFPUD Q/iumF4ll6IclJyPYdM5DqEiaJAqJ1KBeGM3hmuQ8uUT0DMObv7T0bRMl+abk7nNPIB5 1ycbzY1skIynbCEduqbedtV8zyyLNBGX0qr9dRY+Jhkdp+OFGe+zMKGKBC9n02NSY5ue HJWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bwVOI/UUu1ABuS2KCRqzKXC5K7Q/+T6ANJVcDug2ZfE=; b=pmIaJSUexhOED0zIP1ZhCQMd3yjrnpfBSE10ZUG8iRZKLuojb5sDEqX4adlMW3bkrt Nc5hS5wsMmnmEVo29SyfxCM30HLzPXW7N/Q96Sp7ncp1A1Ksg2uJcGcrZqc8SrN42kwI hVgKSxMP1mUqxnPxMt4TEd5IFc2qIzrlrMccJlRnVsA453DMrP8So/rB/v0lUy+E64ib gmBIMlzGYUOF9KkIg/qhCt6d7as85T4wPyiOxJ4ilX0ifCpsh+uHcJOl6Z+VV4ruwSt4 zFqhXRhZdOrhitlupamfVZkxesP9Onu0REs3pYhs/4odbcYovSb5ZWgWXyKcrt+1OlIM rQYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BrhX07zr; 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 e6-20020a630f06000000b00477ffa1aaf7si12886380pgl.50.2022.12.19.23.45.15; Mon, 19 Dec 2022 23:45:24 -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=BrhX07zr; 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 S233735AbiLTH1v (ORCPT + 70 others); Tue, 20 Dec 2022 02:27:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233795AbiLTH1I (ORCPT ); Tue, 20 Dec 2022 02:27:08 -0500 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4FCA175BD for ; Mon, 19 Dec 2022 23:26:38 -0800 (PST) Received: by mail-pg1-x529.google.com with SMTP id e190so3335492pgc.9 for ; Mon, 19 Dec 2022 23:26:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bwVOI/UUu1ABuS2KCRqzKXC5K7Q/+T6ANJVcDug2ZfE=; b=BrhX07zrzIpvGLJX0fQwCopam6mGHXBowlolWZ0TNNwJxoVszhbWaofdn/qtuBfm/c OlW0Dl05bnhzU2G9MaRprfM6XJ1G41VZB7EZmJuTs/Qff+kX2r5AGV2rV8O04MXC9Fbz u1gsRw5xqriQjCIKIwyk3uyFEFIh4qY8bmnDuQikfTU/5eBgAA+wJVelu3IMIr/d73ya nRFL6I3cmj1aAjNAsAHd2zJm8NXgJHG7Aq6ltHfeEruRr1lmX74hfCu+3wBFF1fVwxlp yeISuWe9bh9Uh8PpP8bB5ff/C9et2/ft7OTjy0w5wUF48dg9LnjeFtP8dK9MlTSBidIH NrJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bwVOI/UUu1ABuS2KCRqzKXC5K7Q/+T6ANJVcDug2ZfE=; b=HwMlmDh9qLzqX4Q+3g5I+MGOV7mQOzA+DdSx4CezeSEcLOOYzPmfNAT2F6zBBc7uoI 3cRA1BvJ8xbD3tNEhSwKGvTYV4fvaO2T0XOxG08iV7kv/Fb7qVQU8TcrGFHvYdFKjAhY DyFoZww6CzsPq0o7ob6kcJiKxaKkNax6a752XF4CdKVn9O1Jblnu0w/ENxVYkF/Fr6PZ gtk9dEOK3QXo00WZuGJcliEl39USU3PAzzjfhdUDow80oUNuFlvnH7g5C401OJbItNM4 OlynlyFmLfFDeDm/I4e5IfshEvjuwhHCjk+yV3NZZcIhXag205xG5TmYmUgDDfUpN1mk YeYg== X-Gm-Message-State: ANoB5plt3txPASL9h8BzbiC+OYp1XZL+L40h5ia6+JW9hhWCUy834GRH Fxxr0a4rvc9ah8II1NcA4N0= X-Received: by 2002:a05:6a00:1e:b0:576:e704:d8c3 with SMTP id h30-20020a056a00001e00b00576e704d8c3mr43783857pfk.23.1671521198441; Mon, 19 Dec 2022 23:26:38 -0800 (PST) Received: from archlinux.localdomain ([140.121.198.213]) by smtp.googlemail.com with ESMTPSA id q15-20020aa7982f000000b00576f9773c80sm7865544pfl.206.2022.12.19.23.26.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 23:26:37 -0800 (PST) From: Chih-En Lin To: Andrew Morton , Qi Zheng , David Hildenbrand , Matthew Wilcox , Christophe Leroy , John Hubbard , Nadav Amit Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Steven Rostedt , Masami Hiramatsu , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Yang Shi , Peter Xu , Zach O'Keefe , "Liam R . Howlett" , Alex Sierra , Xianting Tian , Colin Cross , Suren Baghdasaryan , Barry Song , Pasha Tatashin , Suleiman Souhlal , Brian Geffon , Yu Zhao , Tong Tiangen , Liu Shixin , Li kunyu , Anshuman Khandual , Vlastimil Babka , Hugh Dickins , Minchan Kim , Miaohe Lin , Gautam Menghani , Catalin Marinas , Mark Brown , Will Deacon , "Eric W . Biederman" , Thomas Gleixner , Sebastian Andrzej Siewior , Andy Lutomirski , Fenghua Yu , Barret Rhoden , Davidlohr Bueso , "Jason A . Donenfeld" , Dinglan Peng , Pedro Fonseca , Jim Huang , Huichun Feng , Chih-En Lin Subject: [PATCH v3 11/14] mm/migrate_device: Support COW PTE Date: Tue, 20 Dec 2022 15:27:40 +0800 Message-Id: <20221220072743.3039060-12-shiyn.lin@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221220072743.3039060-1-shiyn.lin@gmail.com> References: <20221220072743.3039060-1-shiyn.lin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Break COW PTE before collecting the pages in COW-ed PTE. Signed-off-by: Chih-En Lin --- mm/migrate_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/migrate_device.c b/mm/migrate_device.c index 721b2365dbca9..f6d67bd9629f5 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -106,6 +106,8 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, } } + if (!break_cow_pte_range(vma, pmdp, start, end)) + return migrate_vma_collect_skip(start, end, walk); if (unlikely(pmd_bad(*pmdp))) return migrate_vma_collect_skip(start, end, walk); -- 2.37.3