Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1020071ybt; Fri, 19 Jun 2020 21:51:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfgDjO6kZt/hFTeAq4AFzvdFaDh2Co4Qk/6ex63mAkwVc5YLv6vdlyJGr8biwTlCzmFAUd X-Received: by 2002:a17:906:328d:: with SMTP id 13mr6773748ejw.71.1592628662990; Fri, 19 Jun 2020 21:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592628662; cv=none; d=google.com; s=arc-20160816; b=ffFNwdV/H0iwl3sJ6NJurAatq43Iskc6ICjferpawmtyB89bgRcAxoQvbvJOF7fRLD HKt1jr0qC6zx8GuVCF1l7R37uB4o3cO6wBlGKMc2nyet5FrYwGddvsdO4au2eBUx29EZ BFEwwIMO6zzxE9odE8KZJWPUuNAzBkSME7HCluUlkAAsEdMq6+voecibOq/qWtBVajUE GaecS9wmLzL3X/G91EBOlah5ymumdKQFQ5Cr8Q80OMPOmpHNgS21yQppIL2O1TTezg5J ExXDNjI9v4Edj+Okpi5suQG8+MqRGn+W55DY4EHZe8LXFTMX25KWRoRgWTUtyIWCKNmP qqug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=EbpELtDXWlOEn9/sFlHWHjNEWWHM8Fygh7aHygxJvkw=; b=Wxk41xpy02zXQs97Kcn/+3/KaUfReT040HaDFSN3SiGVHh6M5QlWRkIG65+kODsi8U lzXKN/+z0wGfNl6GKppglFtPvt2ossBKAMEUNcP/yzHAzPz0tVOr/VsxJPu+xl/icYf6 YIE2Z9HPevcDPRgvpV4TB9pbx3jedPKIrWI1D0uQc70oqwbH6VkLilXFxOqrxJ+b4lte jYmi/C3uWy0zf1VRlYAYf7KsTExgvE1L52XgXLwey9a0IJ7nxSfVVMu/En5qA+TiWRR9 8jXpG4QnrbI4sIyP8SwdUNV4DsTicQkxan/Wlf8keh4f3prc8oYI2rKXmgTjShqm0ibl aH6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="D/2Q+9VH"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 89si5697434edo.459.2020.06.19.21.50.41; Fri, 19 Jun 2020 21:51:02 -0700 (PDT) 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=@nvidia.com header.s=n1 header.b="D/2Q+9VH"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728745AbgFSV6q (ORCPT + 99 others); Fri, 19 Jun 2020 17:58:46 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:4422 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728248AbgFSV5H (ORCPT ); Fri, 19 Jun 2020 17:57:07 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 19 Jun 2020 14:56:16 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 19 Jun 2020 14:57:07 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 19 Jun 2020 14:57:07 -0700 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 19 Jun 2020 21:56:59 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 19 Jun 2020 21:56:59 +0000 Received: from rcampbell-dev.nvidia.com (Not Verified[10.110.48.66]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Fri, 19 Jun 2020 14:56:59 -0700 From: Ralph Campbell To: , , , , CC: Jerome Glisse , John Hubbard , Christoph Hellwig , Jason Gunthorpe , "Ben Skeggs" , Andrew Morton , Shuah Khan , Ralph Campbell Subject: [PATCH 01/16] mm: fix migrate_vma_setup() src_owner and normal pages Date: Fri, 19 Jun 2020 14:56:34 -0700 Message-ID: <20200619215649.32297-2-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200619215649.32297-1-rcampbell@nvidia.com> References: <20200619215649.32297-1-rcampbell@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public Content-Transfer-Encoding: quoted-printable Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1592603776; bh=EbpELtDXWlOEn9/sFlHWHjNEWWHM8Fygh7aHygxJvkw=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:X-NVConfidentiality: Content-Transfer-Encoding:Content-Type; b=D/2Q+9VH10ijip8uh5ig1/Pde+tcbxEtyrD9/PvgmuKGrUMIfCvSeajbMAK63TJpf pC/uc5FZ7WcJZ2Plsfa48iIKb30crq0KTrAO8Ei1gV79oo1Xp2DDlku4zIXqFslsaO Il6IZPPwEwDAWZ2np9JTdF91zoJ+bnIRfwWyRU3PJgFXXzcM4eKJkBvli0wGaj6AyM VXFStKX741Xc66ppZBzdLG0vp12KiZS0m3PajP7lycAQUCWk7bmn1LU3tC2rwFmmgA SdlzdTQuduSSB6g1XdaGlN4AVaNGAbgXQJyZsMuunUYid7pC+Qec6LJ8nku1iC9uXT xy9sWxKi89Zpw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The caller of migrate_vma_setup() does not know what type of page is stored in the CPU's page tables. Pages within the specified range are free to be swapped out, migrated, or freed until after migrate_vma_setup() returns. The caller needs to set struct migrate_vma.src_owner in case a page is a ZONE device private page that the device owns and might want to migrate. However, the current code skips normal anonymous pages if src_owner is set, thus preventing those pages from being migrated. Remove the src_owner check for normal pages since src_owner only applies to device private pages and allow a range of normal and device private pages to be migrated. Fixes: 800bb1c8dc80 ("mm: handle multiple owners of device private pages in= migrate_vma") Signed-off-by: Ralph Campbell --- mm/migrate.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index f37729673558..24535281cea3 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2295,8 +2295,6 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, if (is_write_device_private_entry(entry)) mpfn |=3D MIGRATE_PFN_WRITE; } else { - if (migrate->src_owner) - goto next; pfn =3D pte_pfn(pte); if (is_zero_pfn(pfn)) { mpfn =3D MIGRATE_PFN_MIGRATE; --=20 2.20.1