Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp412815pxb; Wed, 1 Sep 2021 01:31:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdM079LZ5IF5iCFG8J6tbFUryyF/b+ijpChhKttLo13IoN3yAMkJm8F4LBDl/AGNBJp3I8 X-Received: by 2002:a50:e606:: with SMTP id y6mr33685944edm.216.1630485084676; Wed, 01 Sep 2021 01:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630485084; cv=none; d=google.com; s=arc-20160816; b=KjPLYUER7fSrKIwRyRsJZyhuWI/p1ZMI6MSEj8njdA7Qf2m3KOnMrxQpWbNXKcVrrl ea/VbsRpa7F15Ia9ijs8+BUaIZDPi//MEgN/eHGfRKTQU2VjmDRpZ4ReCau5ySW4hVob iIAlhADnHXZitsmzx6B4U+E8wBnddVMz16BHvbCZaSTKQ53Rzj09ePQ50ES216Sp6HFk PrdplbikOm73sCTs5Zc0XncMkOTB+r9WVjmg5etgi1Lj50mESUpwLHnTv5kTXzdc+t+u tSoZvOdinVc0ovMFSW+Cx37KQtFoLXzWkOuLQo0HI0PH//owP+jVPKlNWMMVU/BnVy1J vxhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=veTWLw6J9mz1Sfk+POmcvJCXJthRXHHyBVrTfFTzBuU=; b=HJ/8NILIdP4Ehu//ozDuUtID8SvMj7t/h9IgWSeMf4u7xQrpu1I0MRpaOu0EkpnQfZ QWx4N+r+CVWAKhzzfsph7IXFiCECxVo/PKPJV7ZaZhYjgyQgg4ECArDJxWBxpX2TXjN3 3s7ooNw6HIotjC/+KV4Pm0S0bTH3LUBqZOwleW8mlk0mqtEUm7dUEZPN7iZC0vZhnTS2 LgFSvQYeMoP1fCluAgnQJL+rLQo24r1h1x0k5hwz9IEPv5HDqBweVF0K/Lus/DnC8BJk gmkuGvz4CckdIPVQiHWK1nwePADU7hdlAsan8jjteE+vN4ydUdyX/YY0LWyS8+s9SB+w n62g== ARC-Authentication-Results: i=1; mx.google.com; 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 r9si20511152edb.253.2021.09.01.01.30.42; Wed, 01 Sep 2021 01:31:24 -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; 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 S243017AbhIAIaZ (ORCPT + 99 others); Wed, 1 Sep 2021 04:30:25 -0400 Received: from verein.lst.de ([213.95.11.211]:46728 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242943AbhIAIaY (ORCPT ); Wed, 1 Sep 2021 04:30:24 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 711DE68AFE; Wed, 1 Sep 2021 10:29:25 +0200 (CEST) Date: Wed, 1 Sep 2021 10:29:25 +0200 From: Christoph Hellwig To: Felix Kuehling Cc: Christoph Hellwig , "Sierra Guiza, Alejandro (Alex)" , akpm@linux-foundation.org, 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, jgg@nvidia.com, jglisse@redhat.com Subject: Re: [PATCH v1 03/14] mm: add iomem vma selection for memory migration Message-ID: <20210901082925.GA21961@lst.de> References: <20210825034828.12927-1-alex.sierra@amd.com> <20210825034828.12927-4-alex.sierra@amd.com> <20210825074602.GA29620@lst.de> <20210830082800.GA6836@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Aug 30, 2021 at 01:04:43PM -0400, Felix Kuehling wrote: > >> driver code is not really involved in updating the CPU mappings. Maybe > >> it's something we need to do in the migration helpers. > > It looks like I'm totally misunderstanding what you are adding here > > then. Why do we need any special treatment at all for memory that > > has normal struct pages and is part of the direct kernel map? > > The pages are like normal memory for purposes of mapping them in CPU > page tables and for coherent access from the CPU. That's the user page tables. What about the kernel direct map? If there is a normal kernel struct page backing there really should be no need for the pgmap. > From an application > perspective, we want file-backed and anonymous mappings to be able to > use DEVICE_PUBLIC pages with coherent CPU access. The goal is to > optimize performance for GPU heavy workloads while minimizing the need > to migrate data back-and-forth between system memory and device memory. I don't really understand that part. file backed pages are always allocated by the file system using the pagecache helpers, that is using the page allocator. Anonymouns memory also always comes from the page allocator. > The pages are special in two ways: > > 1. The memory is managed not by the Linux buddy allocator, but by the > GPU driver's TTM memory manager Why? > 2. We want to migrate data in response to GPU page faults and > application hints using the migrate_vma helpers Why?