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 1CDB3C433EF for ; Wed, 17 Nov 2021 09:51:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CE6B261BD2 for ; Wed, 17 Nov 2021 09:51:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CE6B261BD2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6D4456B006C; Wed, 17 Nov 2021 04:50:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6837B6B0073; Wed, 17 Nov 2021 04:50:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 598A56B0074; Wed, 17 Nov 2021 04:50:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0116.hostedemail.com [216.40.44.116]) by kanga.kvack.org (Postfix) with ESMTP id 4EC9C6B006C for ; Wed, 17 Nov 2021 04:50:55 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0466F86E62 for ; Wed, 17 Nov 2021 09:50:45 +0000 (UTC) X-FDA: 78817952808.17.B30FD9D Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf28.hostedemail.com (Postfix) with ESMTP id 9417D90000B0 for ; Wed, 17 Nov 2021 09:50:44 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 1EABF68AFE; Wed, 17 Nov 2021 10:50:42 +0100 (CET) Date: Wed, 17 Nov 2021 10:50:41 +0100 From: Christoph Hellwig To: Alex Sierra Cc: akpm@linux-foundation.org, 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, jgg@nvidia.com, jglisse@redhat.com, apopple@nvidia.com, willy@infradead.org Subject: Re: [PATCH v1 1/9] mm: add zone device coherent type memory support Message-ID: <20211117095041.GA9730@lst.de> References: <20211115193026.27568-1-alex.sierra@amd.com> <20211115193026.27568-2-alex.sierra@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211115193026.27568-2-alex.sierra@amd.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9417D90000B0 X-Stat-Signature: bdwpb3ht33abjq954jjhxuj9bi1aczuo Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=none; spf=none (imf28.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de X-HE-Tag: 1637142644-737635 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 Mon, Nov 15, 2021 at 01:30:18PM -0600, Alex Sierra wrote: > @@ -5695,8 +5695,8 @@ static int mem_cgroup_move_account(struct page *page, > * 2(MC_TARGET_SWAP): if the swap entry corresponding to this pte is a > * target for charge migration. if @target is not NULL, the entry is stored > * in target->ent. > - * 3(MC_TARGET_DEVICE): like MC_TARGET_PAGE but page is MEMORY_DEVICE_PRIVATE > - * (so ZONE_DEVICE page and thus not on the lru). > + * 3(MC_TARGET_DEVICE): like MC_TARGET_PAGE but page is MEMORY_DEVICE_COHERENT > + * or MEMORY_DEVICE_PRIVATE (so ZONE_DEVICE page and thus not on the lru). Please avoid the overly long line. But I don't think we we need to mention the exact enum, but rather do something like: * 3(MC_TARGET_DEVICE): like MC_TARGET_PAGE but page is device memory and * thus not on the lru. > + switch (pgmap->type) { > + case MEMORY_DEVICE_PRIVATE: > + case MEMORY_DEVICE_COHERENT: > /* > * TODO: Handle HMM pages which may need coordination > * with device-side memory. This might be a good opportunity for doing a s/HMM/device/ here.