From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 883C7C433FE for ; Wed, 13 Oct 2021 13:34:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2D1AC610E8 for ; Wed, 13 Oct 2021 13:34:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2D1AC610E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id A08D36B006C; Wed, 13 Oct 2021 09:34:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9915C6B0071; Wed, 13 Oct 2021 09:34:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 832986B0072; Wed, 13 Oct 2021 09:34:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id 726DC6B006C for ; Wed, 13 Oct 2021 09:34:50 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 392DD27DD0 for ; Wed, 13 Oct 2021 13:34:50 +0000 (UTC) X-FDA: 78691509540.11.0DD71B3 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by imf24.hostedemail.com (Postfix) with ESMTP id EC97EB000099 for ; Wed, 13 Oct 2021 13:34:48 +0000 (UTC) Received: by mail-wr1-f42.google.com with SMTP id y3so8574785wrl.1 for ; Wed, 13 Oct 2021 06:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=miQRTp5hbRC1OCVn4QsRcT9kmnoc0mnhrgOilHbNn1g=; b=F0E4EuXR+3flbL7Xzl8XisBhT8qIwH7MG0zDDrByvsqJ7u0MvCbJ+Jdk27g1cp2SlZ 9eUPMq4/iImU+0GtvR6R8lhPuCXmipsVTsAD3q7rkP21TldlzL8k+m7OPM4caW0UvsC2 7EcztkwWSBS0RIOzrl5QE35wqRU+YUSNac2QE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=miQRTp5hbRC1OCVn4QsRcT9kmnoc0mnhrgOilHbNn1g=; b=D73TKy/3oiQHeetmBVue3cKI+gBx9MNWkoS/+YI/7ENc6ZqvQnBZjPs898e7vZjb8K H2I1aJgd3a3Rn4QSC8xRJLqN20mpbU1kLDs8Sg3CnRviOLx5mupvLvg9isnxVQJL7t8g uOvttVPAvMhy3plSKYAvmzq+rWQVdDPij7o5UKLb6WSsPdetPK2re8Yswf5K/XV5RNRA v7/Vnz32iGhoBX3MlO/M5AS67i4O0tHSBMK7BuvkkjeyG/a//WrcG4ZM7i6S1vpp0q/B rHTpaiEeE6x+weIep6OjhO90soAeTTrcnRQR4hWhCIrib4DMwEqhoyzyjHVv3gSMYFEn xCbg== X-Gm-Message-State: AOAM530S64yrcBMe8nZp0DJYBetOLsIER5PvJ247aMhlQ3X74ce5Me/f WethzbX8oaT1t2//fT98K41qkg== X-Google-Smtp-Source: ABdhPJyPnoPCgju2Szs7ixA3PwCFFi3lyPyAvuULHAdCBT2PI9V1y8J8yrCa0Gufzb/wqCsDI8QXUQ== X-Received: by 2002:a05:600c:4ecb:: with SMTP id g11mr12644285wmq.67.1634132087950; Wed, 13 Oct 2021 06:34:47 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id w1sm5376300wmc.19.2021.10.13.06.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 06:34:47 -0700 (PDT) Date: Wed, 13 Oct 2021 15:34:45 +0200 From: Daniel Vetter To: Jason Gunthorpe Cc: Andrew Morton , Alex Sierra , Felix.Kuehling@amd.com, linux-mm@kvack.org, rcampbell@nvidia.com, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hch@lst.de, jglisse@redhat.com, apopple@nvidia.com Subject: Re: [PATCH v1 00/12] MEMORY_DEVICE_COHERENT for CPU-accessible coherent device memory Message-ID: Mail-Followup-To: Jason Gunthorpe , Andrew Morton , Alex Sierra , Felix.Kuehling@amd.com, linux-mm@kvack.org, rcampbell@nvidia.com, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hch@lst.de, jglisse@redhat.com, apopple@nvidia.com References: <20211012171247.2861-1-alex.sierra@amd.com> <20211012113957.53f05928dd60f3686331fede@linux-foundation.org> <20211012185629.GZ2744544@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211012185629.GZ2744544@nvidia.com> X-Operating-System: Linux phenom 5.10.0-8-amd64 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: EC97EB000099 X-Stat-Signature: duhfq6jygf1e6owzz7j3o9zgwg3m9ssc Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=ffwll.ch header.s=google header.b=F0E4EuXR; spf=none (imf24.hostedemail.com: domain of daniel@ffwll.ch has no SPF policy when checking 209.85.221.42) smtp.mailfrom=daniel@ffwll.ch; dmarc=none X-HE-Tag: 1634132088-918855 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Oct 12, 2021 at 03:56:29PM -0300, Jason Gunthorpe wrote: > On Tue, Oct 12, 2021 at 11:39:57AM -0700, Andrew Morton wrote: > > 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? > > Well, it certainly isn't just "one single computer". Overall I know of > about, hmm, ~10 *datacenters* worth of installations that are using > similar technology underpinnings. > > "Frontier" is the code name for a specific installation but as the > technology is proven out there will be many copies made of that same > approach. > > The previous program "Summit" was done with NVIDIA GPUs and PowerPC > CPUs and also included a very similar capability. I think this is a > good sign that this coherently attached accelerator will continue to > be a theme in computing going foward. IIRC this was done using out of > tree kernel patches and NUMA localities. > > Specifically with CXL now being standardized and on a path to ubiquity > I think we will see an explosion in deployments of coherently attached > accelerator memory. This is the high end trickling down to wider > usage. > > I strongly think many CXL accelerators are going to want to manage > their on-accelerator memory in this way as it makes universal sense to > want to carefully manage memory access locality to optimize for > performance. Yeah with CXL this will be used by a lot more drivers/devices, not even including nvidia's blob. I guess if you want make sure get an ack on this from CXL folks, so that we don't end up with a mess. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch