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 F3BADC83F03 for ; Thu, 3 Jul 2025 17:48:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7BAF06B0252; Thu, 3 Jul 2025 13:48:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 793266B026B; Thu, 3 Jul 2025 13:48:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A8F16B026E; Thu, 3 Jul 2025 13:48:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 57EB26B0252 for ; Thu, 3 Jul 2025 13:48:44 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C1235105AFE for ; Thu, 3 Jul 2025 17:48:43 +0000 (UTC) X-FDA: 83623688526.12.E1CEC28 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf08.hostedemail.com (Postfix) with ESMTP id 1DC3A160005 for ; Thu, 3 Jul 2025 17:48:42 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=sLkpcLaA; spf=pass (imf08.hostedemail.com: domain of rppt@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751564922; 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:dkim-signature; bh=3s6OnfYwPyDThR8emZHD+RAwzyHcNfDj9zonxSHDKo0=; b=KBvUFFUx87Zzyb/b9gW4i/ber+lSwuGimODE4u8mKorgHEcDNXUG/KLcYmgFNh8oWHPwqs us7U7EROZ+n16fnb7/vqwUXhST2s7id5NFqPF/CTiDcwxE0gCoVCrACfZLMGx/MU1d/sAS gYjSVdNtkn4eYHGrtHW7ZAkdDcQmHAo= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=sLkpcLaA; spf=pass (imf08.hostedemail.com: domain of rppt@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751564922; a=rsa-sha256; cv=none; b=0X9NYWnfuHrxLvgBxbGK0RAWkjCof/7ogKkWsD/vwoh7Uf7VCb1/A23CtDTKa/ZYeD/j4j z79YSGabfD1C36YNvHkqbxc045zWAJEzVvS4et2o2G+asxs765L/SsHCpZjk6SiQdm0qkC +5/rAXcF5tMNRq5oAYHRNxwE/17IHCQ= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id E7663A5379D; Thu, 3 Jul 2025 17:48:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABBF4C4CEED; Thu, 3 Jul 2025 17:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751564919; bh=JkBwRtm5noTWKFgY9qCFMaDWn6VtteefAZGCIVvvmJs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sLkpcLaA46r+A0bNmHQIJTX9W4LlLmMvVDUYG0hfyaNiZxcbC3A6sItOJyoMPZXNP J4j4D1lGD126CZmRZvn3dj0oT9gRxiUyEmfzpCA4JQM4secstpb9EZiu6/6oe6MiAa 3TxxrdXiPAgSsld3cvHV8+mDDVC7qHbMEZoWK7qi7xOgY1KMFQN8XAseBpuO8NCddj iTN9eTEHP3YsIEk3m6qVemRkFPGDCiVftgHfPQ2y8tJVqjJN2Gs15PFuObVNLjRD4r Rxc8lgdwXg24mUboC3R4H4q9OvrlecLuBYVXbPfgqe4Cs8uKM83WQ/LVexpbagLgWG RN8cinogO9Jhg== Date: Thu, 3 Jul 2025 20:48:29 +0300 From: Mike Rapoport To: Peter Xu Cc: Nikita Kalyazin , Lorenzo Stoakes , Suren Baghdasaryan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vlastimil Babka , Muchun Song , Hugh Dickins , Andrew Morton , James Houghton , "Liam R . Howlett" , Michal Hocko , David Hildenbrand , Andrea Arcangeli , Oscar Salvador , Axel Rasmussen , Ujwal Kundur Subject: Re: [PATCH v2 1/4] mm: Introduce vm_uffd_ops API Message-ID: References: <20250627154655.2085903-1-peterx@redhat.com> <20250627154655.2085903-2-peterx@redhat.com> <982f4f94-f0bf-45dd-9003-081b76e57027@lucifer.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1DC3A160005 X-Stat-Signature: yq396sa7nf1j9mzmux7yot6pqf3rqm14 X-HE-Tag: 1751564922-264174 X-HE-Meta: U2FsdGVkX1/BuqO7iwN0+h0vWk5Uf08ykKfy5Ahl4UDxvfnEyaJxk0sGVY30dVXD8oV5vUOxUti3DaxdbJnvbgaRRVBMmSZoNbmVQ+fcs92Ls221Zj2+jU8GWprWfVVFiYSkwgRKgUq0TosWNyfu/U/xCe7qCyK9q2yPVaMp7nQZA5Fytql88evuantu9ESNGucZfh0yYdj2hZixDY3MiLJ077wWyEZRgxJw3A0GhAAo/Q8YKbIdQrCKnAKpT123/33RYNtszzZRArG130rRBeThb5lwGHN3gTa0Bm48oHaK0U/iP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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, Jul 02, 2025 at 03:46:57PM -0400, Peter Xu wrote: > On Wed, Jul 02, 2025 at 08:39:32PM +0300, Mike Rapoport wrote: > > [...] > > > > The main target of this change is the implementation of UFFD for > > > KVM/guest_memfd (examples: [1], [2]) to avoid bringing KVM-specific code > > > into the mm codebase. We usually mean KVM by the "drivers" in this context, > > > and it is already somewhat "knowledgeable" of the mm. I don't think there > > > are existing use cases for other drivers to implement this at the moment. > > > > > > Although I can't see new exports in this series, there is now a way to limit > > > exports to particular modules [3]. Would it help if we only do it for KVM > > > initially (if/when actually needed)? > > > > There were talks about pulling out guest_memfd core into mm, but I don't > > remember patches about it. If parts of guest_memfd were already in mm/ that > > would make easier to export uffd ops to it. > > Do we have a link to such discussion? I'm also curious whether that idea > was acknowledged by KVM maintainers. AFAIR it was discussed at one of David's guest_memfd calls > Having an abstraction layer for userfaultfd memtypes within mm always makes > some sense on its own to me, so as to remove separate random checks over > either shmem or hugetlb. E.g. after the series applied, we can drop the > shmem header in userfaultfd code, which should also be a step forward. > > Thanks, > > > > > > [1] > > > https://lore.kernel.org/all/114133f5-0282-463d-9d65-3143aa658806@amazon.com/ > > > [2] > > > https://lore.kernel.org/all/7666ee96-6f09-4dc1-8cb2-002a2d2a29cf@amazon.com/ > > > [3] https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/commit/?h=kbuild&id=707f853d7fa3ce323a6875487890c213e34d81a0 > > -- > Peter Xu > -- Sincerely yours, Mike.