Received: by 2002:ac2:48a3:0:0:0:0:0 with SMTP id u3csp568lfg; Thu, 10 Mar 2022 20:36:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaDXI1xPsdij6QZ2mTqfHRXa4Va1ErG+LuBFddReN5SNoZH3Jvw4PIX/DOGfkCA/dUm/Mx X-Received: by 2002:a17:902:b7c1:b0:153:5a5:fd9 with SMTP id v1-20020a170902b7c100b0015305a50fd9mr8492051plz.101.1646973374196; Thu, 10 Mar 2022 20:36:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646973374; cv=pass; d=google.com; s=arc-20160816; b=kUD9a1LXQ78FpvF7VSqieQUnqswcPyRb4jAFeq3xWcMwz18SySYh72qybqzEjVN/pA IdiXpufbvgmedrobZ6jxf1dulP2nhMlEV7rG6aA5G6NLU9xiJLLuyg/RnLju314blspj CDmzsOJyJcVcHfM6AsCFq76FtM4BobpNpmY6cWo6vGUM9qi1Xfwy0FxP0Y0Vwg85vKTw IGfZk0rcBrSJggMaX5KigXt6nSpdL6qgA3rMV4M1qF3bJX3D+cB7nVkuGXgRS2Hrc27e NvMOYUO0+HfrW7ZXjVyFTWIpqJRWOvJ55s8I/GOtl12j5S3sqFuGUIUo/O9voTo4JHTc q6KQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SnWFLTo1EmDBEkgRQX+BhCHTg4ADh4HAgu1C/JL/8HM=; b=lgWpPw428g4Xv5g+6+TTCMbLLI47lp960WnqwSJatoD4e0kdwlYWVtjAHBmKM04gqP oKv98/h3cmKxSbX/PMDD8eVQkmhlTVuw+HnFz3lAQBPD8lZIQKsN0i30N9JW2B5MfCIX 7XGIDLDXDQSR46eS4/4GSYxSMRUa/F6YRF63mYAYhVvrFGpah5sIh8d3SWErxFPp4GSL ZSPUj90rnejgXF2kh+02xx9JdzzhImBxmBWIeQcOu4H6Zly/BzqWLWZ9PaeQryP1JftE VoZ376bN61Sydf89NG+oi6UMDyKxOqTeQeI1IJod2j4B45xw2HZ8KaZkpWglCAvTMR5V PWTQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=0nBPy5oJ; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u8-20020a17090341c800b00151d046ad89si7284336ple.35.2022.03.10.20.35.58; Thu, 10 Mar 2022 20:36:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-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=@amd.com header.s=selector1 header.b=0nBPy5oJ; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243408AbiCJR2O (ORCPT + 99 others); Thu, 10 Mar 2022 12:28:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244975AbiCJR1t (ORCPT ); Thu, 10 Mar 2022 12:27:49 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2065.outbound.protection.outlook.com [40.107.92.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83C436FA2A; Thu, 10 Mar 2022 09:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=apiZ+4XrAgR3tae4N+PXK2OJFDhbCjUq+DHxAWR87ttgnq9xQgkaF47z8zb5dCSfM/JN6HS2yEjtEEWElx2JZeFgCuwIw6g3/mCAlyoFU07Jntxsz+ncI1YMIdZmvq/kr7gTjIiYTQXIFohkCf3eKBb7pPch1o+noE4f3S1S6kcERMZ4Si9GKqMWVEFSVypgdAq2c0fj4awaan5TVw09NDuAJhZ7zW4SLyaUqxW8G8khz3z+bk1jizbpLJwFmucVBzE2SmtelKduOhEOXXGMOJbppqGXAx2SgRQijHR4pNmcLWi3K9t1tWw+1UVop2Na1LtHZK9SDfQXaI2QUMkVew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SnWFLTo1EmDBEkgRQX+BhCHTg4ADh4HAgu1C/JL/8HM=; b=GPkoBmptL1yJRxkz8oVoKjktf3aYLfXQBdLZGB8Ay7+RBNNoJcsOZFT3MijC8fWuz9WqzwvYd52sWMcUDN9sLuYJQx6d3PfC0fCZH8PzYRFrmCvaXbaXcaxi6cMD9rNSJqzAlZYw80Qb6e24iIHeQlzGyrcyevEcxYDg5w4kLUms8HHYUjJhGf4NMf6v2OuJlnjLC2sjEeazASl510J8DOXStbCfJS4t5SiCnX+g6/ldHHLGDPkfE2Xi/gcolI6imjkCiQg0qwT4ybiwuCYB7021rRXShm5P4tVxNWaoFFGQ/5hzF3byZqS1sYtmTuorZPF6NgTUkW27q2PE6h6ybA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nvidia.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SnWFLTo1EmDBEkgRQX+BhCHTg4ADh4HAgu1C/JL/8HM=; b=0nBPy5oJimiB8SHrlfnjQDxEGWVieC5xDZYjR7o8dDnhDHRrJ8Zg2BrdfWhNLUFygzkYFZ4PKSBOgSYPBWU4psJ89LyOH/GQyxezHjpEFXUM7DjnwKa2dKTXiKkQ0Ajj61265MamON84OG1JlMWoJ2AHfq/TghxXA3OZiUQS0jg= Received: from DM3PR11CA0020.namprd11.prod.outlook.com (2603:10b6:0:54::30) by MN2PR12MB4470.namprd12.prod.outlook.com (2603:10b6:208:260::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Thu, 10 Mar 2022 17:26:45 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:0:54:cafe::ce) by DM3PR11CA0020.outlook.office365.com (2603:10b6:0:54::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22 via Frontend Transport; Thu, 10 Mar 2022 17:26:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT010.mail.protection.outlook.com (10.13.172.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5061.22 via Frontend Transport; Thu, 10 Mar 2022 17:26:44 +0000 Received: from alex-MS-7B09.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 10 Mar 2022 11:26:43 -0600 From: Alex Sierra To: CC: , , , , , , , , , , , , Subject: [PATCH v1 0/3] split vm_normal_pages for LRU and non-LRU handling Date: Thu, 10 Mar 2022 11:26:30 -0600 Message-ID: <20220310172633.9151-1-alex.sierra@amd.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f2c192a-dd52-4b53-2f6f-08da02bb264e X-MS-TrafficTypeDiagnostic: MN2PR12MB4470:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7MUn04bFNM3i9AG3+jW4a3U4DKxPkIJhgjzj4WVZddbPFXDHIqGTGxPO/zg/tMQP9sntTaH5B1mGZh/P9v4oyOxx1melFf3W+2rkle6f5vL1i8EMkvJCqr5mUTVBss6EA4FMt5mv3PeG1kWsQzxwC6qdAWKK5D3ZQmxj0ooc+yXnIvaqoy8Wax6CxGeHmQbQNXedoM4cWfCXmjo0BwQRmQvpfUVOwIjBNPFnA9RTleb20tR1R9qV88iCDesK1qlnVrXmRbm6bkOT+OgiW49YYiC5ji0/kd2AyCRtynMgy9pl0QgrNbid+YR6bgdsMut+Y6BArLYDahrZ60wEZtuU6APrcaS+4/NX8mQ4Mx8ULUQDQtjOGdzYwzLPB6u/zEDG71zkx7kY7QDcGhCl1sPZNVx3rVx6zA/X54Ce8JjktaMD1r6qZZnScrr7bt61NwVygVG0YRrqiLQNJhJPbxmSxcEStVDf6ILoeHlshEVgQ49pljPDLkr7h/6pObDmX95qTORi5phZt84RdJrh+iqKqjTM6e2rRFvcTKhXUbQgOgWnW0JshroiQMdi3vP+FQw29MKBao6i8UkV74ACsYL2ULOk29/HLFCbGBzWg1lI5HZeOXw76xie86z4XFr9iU9B9Dyb1NR6eWRjLiAPriO8XGP2BHCacZK3TPvRMWC2SIvzzbYgi7DglwzkzNzDpffvCD+nASdQVZDw0GAXEuVS2w== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(40460700003)(36756003)(5660300002)(7696005)(83380400001)(316002)(86362001)(8936002)(4326008)(336012)(70206006)(426003)(8676002)(54906003)(47076005)(36860700001)(6916009)(70586007)(81166007)(356005)(1076003)(508600001)(16526019)(2906002)(44832011)(26005)(82310400004)(186003)(6666004)(2616005)(7416002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2022 17:26:44.9269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f2c192a-dd52-4b53-2f6f-08da02bb264e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4470 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,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-ext4@vger.kernel.org DEVICE_COHERENT pages introduce a subtle distinction in the way "normal" pages can be used by various callers throughout the kernel. They behave like normal pages for purposes of mapping in CPU page tables, and for COW. But they do not support LRU lists, NUMA migration or THP. Therefore we split vm_normal_page into two functions vm_normal_any_page and vm_normal_lru_page. The latter will only return pages that can be put on an LRU list and that support NUMA migration, KSM and THP. HMM tests were added to selftest to excercise these changes with device coherent pages. New test called hmm_cow_in_device, will test pages marked as COW, allocated in device zone. Also, more configurations were added into hmm_gup_test to test basic get user pages and get user pages fast paths in device zone pages. Alex Sierra (3): mm: split vm_normal_pages for LRU and non-LRU handling tools: add more gup configs to hmm_gup selftests tools: add selftests to hmm for COW in device memory fs/proc/task_mmu.c | 12 +-- include/linux/mm.h | 11 +- mm/gup.c | 10 +- mm/hmm.c | 2 +- mm/huge_memory.c | 2 +- mm/khugepaged.c | 8 +- mm/ksm.c | 4 +- mm/madvise.c | 4 +- mm/memcontrol.c | 2 +- mm/memory.c | 38 ++++--- mm/mempolicy.c | 4 +- mm/migrate.c | 2 +- mm/migrate_device.c | 2 +- mm/mlock.c | 6 +- mm/mprotect.c | 2 +- tools/testing/selftests/vm/hmm-tests.c | 139 +++++++++++++++++++++---- 16 files changed, 185 insertions(+), 63 deletions(-) -- 2.32.0