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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7522C369A2 for ; Thu, 10 Apr 2025 07:42:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B4932800D7; Thu, 10 Apr 2025 03:42:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 664AA2800D6; Thu, 10 Apr 2025 03:42:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 552362800D7; Thu, 10 Apr 2025 03:42:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 370CA2800D6 for ; Thu, 10 Apr 2025 03:42:36 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9C1E7AC60F for ; Thu, 10 Apr 2025 07:42:36 +0000 (UTC) X-FDA: 83317341912.10.6C3AF09 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf19.hostedemail.com (Postfix) with ESMTP id A749C1A0004 for ; Thu, 10 Apr 2025 07:42:34 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=lst.de; spf=pass (imf19.hostedemail.com: domain of hch@lst.de designates 213.95.11.211 as permitted sender) smtp.mailfrom=hch@lst.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1744270955; a=rsa-sha256; cv=none; b=IO60/6K4xL0F4FeDpmSV+jjJhcjSkI4zy/giWZ4bkRTMWNnhvUmhAaATRd+HSsrpNwCIAV abitN87xsLYDtoixIV8OZThZ2sD5o2CKp2g9FUkHCOMJCrGx9jIT3GDH3sBHgixCX7WJQB ke2lN/+7ZYWhQMUVvD5POc7pjPg/svg= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=lst.de; spf=pass (imf19.hostedemail.com: domain of hch@lst.de designates 213.95.11.211 as permitted sender) smtp.mailfrom=hch@lst.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1744270955; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2UTR8zS9Xvr4Z3qszNQpJGKuIf8hcqXvla0KEo0xlcM=; b=Lsoi8BzKongSo/LKENIziMjikf0TKhSqfUIodZuP0J+h5b1Ymrqlqe218oIQM9a+f1ytBj GRyivEEP+RIYE6jPwPlCia/C97JEmLrbFfchpm51KdSP1a3M8jA7ZOaV/BgTd/+Oeq7iik Nu9VPmCHZzlsgGlL+vd8jJCFh2dysW8= Received: by verein.lst.de (Postfix, from userid 2407) id EE92D68B05; Thu, 10 Apr 2025 09:42:28 +0200 (CEST) Date: Thu, 10 Apr 2025 09:42:28 +0200 From: Christoph Hellwig To: Michael Kelley Cc: Christoph Hellwig , "jayalk@intworks.biz" , "simona@ffwll.ch" , "deller@gmx.de" , "haiyangz@microsoft.com" , "kys@microsoft.com" , "wei.liu@kernel.org" , "decui@microsoft.com" , "akpm@linux-foundation.org" , "weh@microsoft.com" , "tzimmermann@suse.de" , "dri-devel@lists.freedesktop.org" , "linux-fbdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH 1/3] mm: Export vmf_insert_mixed_mkwrite() Message-ID: <20250410074228.GA680@lst.de> References: <20250408183646.1410-1-mhklinux@outlook.com> <20250408183646.1410-2-mhklinux@outlook.com> <20250409104942.GA5572@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) X-Rspamd-Queue-Id: A749C1A0004 X-Stat-Signature: f4hc63xb9jyz3y3cufmtdhgerse66c77 X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1744270954-682359 X-HE-Meta: U2FsdGVkX191xCNn3cMfMzZVSCaZ3SOhcPeftlDviE/oI0+24j7t2bYF7jsYFStSMUEpSPENl+O5+KG6So9EfkEYhsU0e7RmQgjvi89zVSXHQ1IY2D5BMy/hDqdIWm5I4pEGRTam0cxnQqQt40LNGWq5nTVIAg1f8nU81ukuYrVTcYi97tHBEzZs26CLPT8eZT5JfmkL8wdG+sGifQAqG6MVrAHZY0ueFJXR4oUzu5RF4w/lLhOzUFwS9yUwBL6znCMLL7BfWgyfD47S8K7hlp5sWYGZT/XuR2CwcFjFBidfdDQvBiOjhRMScEMwAcTIQ0P0VKnVWgi5vu1KjpokP0sYI35+ZHb/3bwDMfoC4QayJsncjXHXmKCUfhCPwRK4kY1KsCGJtSLAkOiY9xWIxlyryE72nAqMEuE1iRerosb6aQuBZVdJ4bSPCWf0J4EHzm5bm3KffJnZSpem5x0ftoZfwWrBuWo4FM1N73uepugaw+X301Atm+N/se3UkZrwfPB1XGveE4tSY50vVqcsmQNj+UIEzDdt399nBBjtVIx9eS+R/anWDI/2LBrCJ0vCwsMtDhQHiJUGiFQkM1sOMhRVy7qIdAa37yxByyw9hKIN197zB5nZqe6uw1AeySRPv8PAgDKYvVe1MikTzEdRgSo7U8SoRjvXILiH071RMLHrq90tHx9Z0jeVUu70jCiwBvSDvtA0lXkQdlmcjY32pk0KhQ+b0xh/cWDJQt0mO6GNNQXV+bk2zKjLQBLHVlGkBYbtWJvHSvrHJTmws3+pyVirXzuTkmT0BtGWurp1jUnGm4F85JYr4b++2znUQ3YWN6Uz+hVmTp8aXZ6xRfQYoac7fJgQOGp45GVY+pD1nWSZcaJ7jQr83S2fsQN1LioVJmF7pqC6n5ezYqCqcBtYQ62gxRXRbLbkzZYKSx7cV/wm+tISPT2pmn6NW5c/Sy1JNYnLaAK1BR5CQwUSj5d ejgMo/6H CDuPdwQuQYDpX7lt6HSTtcl9MD1d4ZWuLT9lcu29pAE9/4JpYrU9SYTh0QBYUJicBjr59SoqaUl/QOyUhbIvZFBDodqfFG/HGIC2wZgz5ylnGpLn3B0LwzxtW23AebJdywc8RYjxp/SNcm54IuZ6YmUNeyw3AuNe0Sb6ZxnyAzmOl7d2N78ywmyC28A== 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: List-Subscribe: List-Unsubscribe: On Wed, Apr 09, 2025 at 02:10:26PM +0000, Michael Kelley wrote: > Hmmm. What's the reference to "as told last time"? I don't think I've had > this conversation before. Hmm, there was a conversation about deferred I/O, and I remember the drm folks even defending their abuse of vmalloc_to_page on dma coherent memory against the documentation in the most silly way. Maybe that was a different discussion of the same thing. > > For the hyperv_fb driver, the memory in question is allocated with a direct call > to alloc_pages(), not via dma_alloc_coherent(). There's no DMA in this scenario. > The memory is shared with the Hyper-V host and designated as the memory > for the virtual framebuffer device. It is then mapped into user space using the > mmap() system call against /dev/fb0. User space writes to the memory are > eventually (and I omit the details) picked up by the Hyper-V host and displayed. Oh, great. > Is your point that memory dma_alloc_coherent() memory must be treated as > a black box, and can't be deconstructed into individual pages? If so, that makes > sense to me. Yes. > But must the same treatment be applied to memory from > alloc_pages()? This is where I need some education. No, that's just fine.