Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2707452pxb; Tue, 12 Oct 2021 11:48:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7xm8f490t9E6R3QexFfAZvNFCbNslbcuSGJVKsi5fUXbRk7RIUYujYL19oW2qOYHlsodF X-Received: by 2002:a17:90a:e010:: with SMTP id u16mr7902835pjy.217.1634064515670; Tue, 12 Oct 2021 11:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634064515; cv=none; d=google.com; s=arc-20160816; b=m7LfS4y7fwHItJu6cJUBg9fcWsd+cx8pkxd0I4MzMyVH9JEJtt7Iq3ZXcpp4K5KV4T cHyjvhN4fpqcrhYjkCtSB9DYmeeaPH6tbj9hp+HEEZTYHM9KLyYi/RWNJqBWmVOZjxap z6hgKLC+fFNrSpwAf4Z8N6LGkDhz66v/QRjIaS0fp3+7DzbY+Fsq+xKN2HV9XAswEG5E BvR7MdrtOXfF+3bH62NVkzsrPjWc1tbUtqw97+rCz7mqWYAJv8zie9UZ2OLV0zTf47od KATbGlfmDnyqmJndjbEKp+7UPNxjaFvGNSIeKkHC+pbMFQOGqgxoVhpJRnAGRAcXFxgq McrQ== 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:subject:cc:to:from:date :dkim-signature; bh=W/CBr5lZwjmVl3rSdF6+hqutjsFxI5222uy79geHztE=; b=R6338VwwG3gS435/9/OAERmG0bAJ4wrP3kMV4k+6iVoLGP0IO+SXz99ffFL38uYg1+ IBiOZJV+PZbulasNnTI58bm6lJOnqfA3yORzLas6cgRqtGP+++cuYvY3fThiufp34FmX N/pngpsMZ9bT9/iRiJBAuErwvwzmN0W//nQOmM1GcjM/tuOMpcb3fM6tviUu929YpXL0 dcMu6nF5ZlJMbMnyYnN8cjj1mK0zZgXJ0rB6IWfcaP1Z2hABEiaLDsjrdClZunueT9Hb zuoILGsh8UyDCxFP13C0zvqSSg2lOfP0kF4J/hRezIAuD7mj+YYF/pyHJcTMUyGBPHGk XGRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="aLV8P7/T"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si18562894pgv.564.2021.10.12.11.47.27; Tue, 12 Oct 2021 11:48:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@linux-foundation.org header.s=korg header.b="aLV8P7/T"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234916AbhJLSmO (ORCPT + 99 others); Tue, 12 Oct 2021 14:42:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:50428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234947AbhJLSmJ (ORCPT ); Tue, 12 Oct 2021 14:42:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A60DA60EDF; Tue, 12 Oct 2021 18:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1634064001; bh=4NlzI4dFxtFWsmK4HNOLFkn2j8KfMJnWPwZWKJPEPAI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aLV8P7/TA7iQMJF0qaKt5ZKy+gE2TiiPu2nZqetOP9YyyAcsJo/jiZgNVzTU1lkT+ 2W/4JR9XszN9+PCKAd86SS6HZy4Utp+IQoI/3t8eWWfSQ4e0sZiWOtAYA0TYppiR0t YJo2Ed+MK8pToXyv2626yPlvlXLxExtGRpdF1Mv4= Date: Tue, 12 Oct 2021 11:39:57 -0700 From: Andrew Morton To: Alex Sierra Cc: , , , , , , , , , , Subject: Re: [PATCH v1 00/12] MEMORY_DEVICE_COHERENT for CPU-accessible coherent device memory Message-Id: <20211012113957.53f05928dd60f3686331fede@linux-foundation.org> In-Reply-To: <20211012171247.2861-1-alex.sierra@amd.com> References: <20211012171247.2861-1-alex.sierra@amd.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, 12 Oct 2021 12:12:35 -0500 Alex Sierra wrote: > This patch series introduces MEMORY_DEVICE_COHERENT, a type of memory > owned by a device that can be mapped into CPU page tables like > MEMORY_DEVICE_GENERIC and can also be migrated like MEMORY_DEVICE_PRIVATE. > With MEMORY_DEVICE_COHERENT, we isolate the new memory type from other > subsystems as far as possible, though there are some small changes to > other subsystems such as filesystem DAX, to handle the new memory type > appropriately. > > We use ZONE_DEVICE for this instead of NUMA so that the amdgpu > allocator can manage it without conflicting with core mm for non-unified > memory use cases. > > How it works: The system BIOS advertises the GPU device memory (aka VRAM) > as SPM (special purpose memory) in the UEFI system address map. > The amdgpu driver registers the memory with devmap as > MEMORY_DEVICE_COHERENT using devm_memremap_pages. > > The initial user for this hardware page migration capability will be > the Frontier supercomputer project. To what other uses will this infrastructure be put? Because I must ask: if this feature is for one single computer which presumably has a custom kernel, why add it to mainline Linux? > Our nodes in the lab have .5 TB of > system memory plus 256 GB of device memory split across 4 GPUs, all in > the same coherent address space. Page migration is expected to improve > application efficiency significantly. We will report empirical results > as they become available. > > This includes patches originally by Ralph Campbell to change ZONE_DEVICE > reference counting as requested in previous reviews of this patch series > (see https://patchwork.freedesktop.org/series/90706/). We extended > hmm_test to cover migration of MEMORY_DEVICE_COHERENT. This patch set > builds on HMM and our SVM memory manager already merged in 5.14. > We would like to complete review and merge this migration patchset for > 5.16.