Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4040276pxb; Fri, 11 Feb 2022 13:42:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6NheWSnAhEgEiosHBTUTOM+9JRKSw5IgzlmYszdWjIEsXMbsC9NWgR1kYtZ12DsNa3W2v X-Received: by 2002:a05:6402:50d4:: with SMTP id h20mr4088115edb.90.1644615768414; Fri, 11 Feb 2022 13:42:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644615768; cv=pass; d=google.com; s=arc-20160816; b=EnlCIdc7N/nRN+fOD0y7j6hQwnTKJ7PS60J9ZD9+fQQFMhKQUXwXoxIIDqnegxUfKH qDq7E7J/VyagVpbokKFrRt5Jw16PmzZLm7HiIZdWNjlfsCEWYjKv8Y46nePl/BxeuLcw r0tTQbcy0bBhtgJ90ar+RKz4yfVB3RNk65PSS3yglheFjM3lI270cClGPSqcN4NnoLUf k0P1LLqiJLvixM3+y8qebgQbatrIFKVOuK8eQwQ/CHIvNlgx1lI7hkgxFk2w2c6+Qc/B kxJXbzmoiVNqaKvmYtOr8KYEOBIIZzwJFgIkrg9EmGC6D4Kq25ncUSPjj6oLpvGFMrue poMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=ZH9j1MVJ4M9avwtaAH+KtuO8LNSN19ucO1LiCqNbBSg=; b=XvFheYYO6aETp9R7Ip1Lbwg4u+IEZMmFVGdpTA/YbSwJkCEmuKyO5oB2wIxAAiJIio XlcLEZPL3rEdCmIsQYs6oO6a6Is2yOQcciH3rr5hwfCufhuMdqnpu1YkCM26qXNuKj5n 3SNnF3aDvcX4gNWVOhCnm4kgv7cnU/ZzeX507F5jKANpKZ0MJPoQqDeVOVPr8Js/s0pY M8eGUKRqcBZYraPENdJq/FDsPz0p+3y2OtCPowzzvZflWimS7vrpE6QVwA7sEWHgrdyp +1egRWXvshLX8tilLKwSTDYssX/DHlZG3LfBmbj3/CF1R20wwygRbch/w+FEgZRIsvY4 dMQQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=sFYWsnpv; arc=pass (i=1); 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=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 fj1si18435149ejc.948.2022.02.11.13.42.24; Fri, 11 Feb 2022 13:42:48 -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=@amd.com header.s=selector1 header.b=sFYWsnpv; arc=pass (i=1); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245147AbiBJRge (ORCPT + 99 others); Thu, 10 Feb 2022 12:36:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241663AbiBJRgc (ORCPT ); Thu, 10 Feb 2022 12:36:32 -0500 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2074.outbound.protection.outlook.com [40.107.212.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15097F03 for ; Thu, 10 Feb 2022 09:36:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J7cyu7xiqAHvjwPW+45RKl69DP6PtrbT3WzMshDxfGlj0YpMeJrkPmYBXQArn6rEVcXSa65DU7yiJGUe3LeUUTELwU9/rdH36kaP/Omz6JeZbOaz4l+pYG8M3yF6s5HE+a7sWgm2XCWuc0se5fSAZ/TZa0IN4jTR/VHaIGmAiW/tm0eO7Gvld4m0PMPUhkY0bSAHZIuzvqAah1ZMfKs49Qx6IzOJARzTpRTYzkwMgMIWw1ckBApq2uXxA1nyhz8tHR40MAO5D/SoN5JFoYlmt8l5IZSryAmrWqQElmtTQ3QWawhPrtsdEbTuYTUokoqI0RHA57E5EK9ll7M9IIn0rg== 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=ZH9j1MVJ4M9avwtaAH+KtuO8LNSN19ucO1LiCqNbBSg=; b=QSwHm4CMXvhgnJ6r49cK20rim8WUGcDjyPUbVkZbNtgbSodvI6dm2uieqTRh2z5EbbnczAowFsWyPgnDdBblJ2YP3DM7SipdYpXxCe8xBb/KNEUvY0k0mwSYZfCr18cqKGRp3IGhwke6Hxdynjb6UiDOvFjGT413GPh1f+PdOODfh0akMyMqTUZk4o3VdtSddPyxO7ISR0YaRTkfWSnj4/L9fPiINYUhOXydgDlL9SAQ3sB4OBIvLSLZPIOn8ouB2V0fC3QNJTBGsIPHW/anbZ7bD5QDn+Xmk69Taki6b/NLwHmuakOQEaZgZSNNHq5sYgD6Mj0cVb6XvVmPGSohkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=ZH9j1MVJ4M9avwtaAH+KtuO8LNSN19ucO1LiCqNbBSg=; b=sFYWsnpvVaIeWB3xCgbJfFK7ptog8lIf+0D/OFi6CVJrBCqQtrfBNUO2uKwkWw5NK1e6GDyoEXCPMWBVdXHh4N+kvDyDJqJ9WqxniFyVDKcUj3NNbOaBK0C/JrkIbNCte4u+zGjaiGrAK/5P6pIYCzK5ShQWIo40i26arG2Royg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2717.namprd12.prod.outlook.com (2603:10b6:805:68::29) by DM5PR12MB1706.namprd12.prod.outlook.com (2603:10b6:3:10f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.12; Thu, 10 Feb 2022 17:36:29 +0000 Received: from SN6PR12MB2717.namprd12.prod.outlook.com ([fe80::c819:2722:b002:d75a]) by SN6PR12MB2717.namprd12.prod.outlook.com ([fe80::c819:2722:b002:d75a%3]) with mapi id 15.20.4975.014; Thu, 10 Feb 2022 17:36:28 +0000 Message-ID: <955957ed-7201-71da-7a88-659da592fdb6@amd.com> Date: Thu, 10 Feb 2022 11:36:23 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: start sorting out the ZONE_DEVICE refcount mess v2 Content-Language: en-US To: Christoph Hellwig , Andrew Morton , Dan Williams Cc: nvdimm@lists.linux.dev, Ralph Campbell , Alistair Popple , dri-devel@lists.freedesktop.org, Karol Herbst , linux-mm@kvack.org, nouveau@lists.freedesktop.org, Felix Kuehling , "Pan, Xinhui" , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, Jason Gunthorpe , Ben Skeggs , Alex Deucher , Logan Gunthorpe , =?UTF-8?Q?Christian_K=c3=b6nig?= References: <20220210072828.2930359-1-hch@lst.de> From: "Sierra Guiza, Alejandro (Alex)" In-Reply-To: <20220210072828.2930359-1-hch@lst.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MN2PR05CA0021.namprd05.prod.outlook.com (2603:10b6:208:c0::34) To SN6PR12MB2717.namprd12.prod.outlook.com (2603:10b6:805:68::29) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 195c0eed-55f4-43fd-3e28-08d9ecbbde7c X-MS-TrafficTypeDiagnostic: DM5PR12MB1706:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TNTkbsxGbifTk+FoC/4lRzpDa85fQv7x8saayjeUozrPF8VZDXRP7r6AILt66fFYzofLwMSn59GhMOQSQmohAnLjyhPL+5CetY7UNhchoWrO+3z8WJJT8o+nBme6mQKuiM+zYCv2vna/tQSMBNMnYxoVgMa6/uBCEAxhZC5H1BZhWfkntFonYOA6fbzjdE2+kkHRame5HgHd5o1g32nA9xExNPsp2cteDkPXc5w2AOezpkq8MqER+cqXjdslwO0wpUgjnu4LCf0AfRcRYCGCX3qmQeF0+JWDVjwf7x4sq4HlIGy37bhJqSvavIDyFtaOiz76cvl73CCyvYFCAEfRNptVNC0yyti4oI4EOWtgI/h7fjkymVAGliajVdvz8V3IQ63JWc0IbwoZ1wJax7H+UNs8dPvprWmkAJjyNhzGG6W+KD7Yp2RgiKWAyTk2W1+O8Ho3HLy0uRqpSOGsUfBwPo8jQUPww8PgjnCTioyBGZoHv7YkZ/FVvSEaWGwsDGmEJLGChN1q/5W7P6Bo7MqnV9KcyMTOqQEtQ9r61pep7DKNxlRxyBcwxjfxkIeRAD27x57z4SGCT9msylXNWHK+c3uZ4nBgWbTGrl7CfXLJUkmkkPmCmI+GfXLxJtrPbb4uLiU+a1kE0R2XrERM2YDp2tKSXAOzBodUEkV6knNZihhldmvEig7vXPFgDI2eDZd/ygtV/lNEdQGrrVY2J5qxWdD0GyGhhwMVlGodGVapHJpcU/UNJf1V2i4DnvYEE5DLBWzGtkFQ3eZ5YKoFxxV9YPUWJMUqEZlWz0gL7BOJ1C00DyGVhNWjHWo1wz2qrzJW X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2717.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(31686004)(186003)(36756003)(83380400001)(2616005)(2906002)(26005)(53546011)(6512007)(38100700002)(508600001)(6666004)(110136005)(6486002)(966005)(316002)(54906003)(7416002)(6506007)(66476007)(5660300002)(66946007)(66556008)(86362001)(4326008)(8936002)(8676002)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MDVFOFdnekhzMXNwQURpbHl6NndTcllGUnBuSjBOeVk4RWx1OXdCeUdYL24y?= =?utf-8?B?TXNxMzVrcEgyRXVTTThyc0hFbWcwR09XeTBZcWNrRFliUnB3a0g0Rnp0eVlD?= =?utf-8?B?Q0haZ3FUTGY1ODM3WVUwMGpHV0pMRDEzcG5oV0FPakJnZzZ2NEZmUThXSkZQ?= =?utf-8?B?NVpPZkkvaThHV0U5QllIRHYzcWYxSklyenJELzRvMzNYeUxhcC9xbU91bUZr?= =?utf-8?B?dXdPbG9WRENYb01KSWg3bkgwWmtReC81Ukl1NmlpWGprRVY2YlBqSldlRXUw?= =?utf-8?B?VENpQ201N3l1WTJJS1E4dFIyLzN5R3JLQjdCNnBhUmk4c2IvbTVDVHlOZmxE?= =?utf-8?B?Q2VzR21LMEl6TGlDS2tlTTZsQWVEcjN1Y0JRUnJxMWNPdngrQkRWemtWb2xE?= =?utf-8?B?UmNrMURCRUovcU10UnJMUSs5RFpLS1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enant-Network-Message-Id: 195c0eed-55f4-43fd-3e28-08d9ecbbde7c X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2717.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 17:36:28.8171 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8WJ9ThEeLYiV9uVA2LtvY6tBQL/gPxmBYxfRzjvhN6Ed8vaxQGR9uM8BLrSlc977cY/4LKewtjbmEcQXzslvLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1706 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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-kernel@vger.kernel.org Christoph, Thanks a lot for rebase our patches. I just ran our amdgpu hmm-tests with this series and all passed. Regards, Alex Sierra On 2/10/2022 1:28 AM, Christoph Hellwig wrote: > Hi all, > > this series removes the offset by one refcount for ZONE_DEVICE pages > that are freed back to the driver owning them, which is just device > private ones for now, but also the planned device coherent pages > and the ehanced p2p ones pending. > > It does not address the fsdax pages yet, which will be attacked in a > follow on series. > > Note that if we want to get the p2p series rebased on top of this > we'll need a git branch for this series. I could offer to host one. > > A git tree is available here: > > git://git.infradead.org/users/hch/misc.git pgmap-refcount > > Gitweb: > > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/pgmap-refcount > > Changes since v1: > - add a missing memremap.h include in memcontrol.c > - include rebased versions of the device coherent support and > device coherent migration support series as well as additional > cleanup patches > > Diffstt: > arch/arm64/mm/mmu.c | 1 > arch/powerpc/kvm/book3s_hv_uvmem.c | 1 > drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 35 - > drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 1 > drivers/gpu/drm/drm_cache.c | 2 > drivers/gpu/drm/nouveau/nouveau_dmem.c | 3 > drivers/gpu/drm/nouveau/nouveau_svm.c | 1 > drivers/infiniband/core/rw.c | 1 > drivers/nvdimm/pmem.h | 1 > drivers/nvme/host/pci.c | 1 > drivers/nvme/target/io-cmd-bdev.c | 1 > fs/Kconfig | 2 > fs/fuse/virtio_fs.c | 1 > include/linux/hmm.h | 9 > include/linux/memremap.h | 36 + > include/linux/migrate.h | 1 > include/linux/mm.h | 59 -- > lib/test_hmm.c | 353 ++++++++++--- > lib/test_hmm_uapi.h | 22 > mm/Kconfig | 7 > mm/Makefile | 1 > mm/gup.c | 127 +++- > mm/internal.h | 3 > mm/memcontrol.c | 19 > mm/memory-failure.c | 8 > mm/memremap.c | 75 +- > mm/migrate.c | 763 ---------------------------- > mm/migrate_device.c | 822 +++++++++++++++++++++++++++++++ > mm/rmap.c | 5 > mm/swap.c | 49 - > tools/testing/selftests/vm/Makefile | 2 > tools/testing/selftests/vm/hmm-tests.c | 204 ++++++- > tools/testing/selftests/vm/test_hmm.sh | 24 > 33 files changed, 1552 insertions(+), 1088 deletions(-)