From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B5A929AB13 for ; Wed, 17 Sep 2025 09:25:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758101149; cv=none; b=R2loLhYu/JMkXRGMyF5TBeXRDclzyW0KR9G5B44njp6SHTeTPvlpgGdVg54QPkAbQJCuWSMS5nhVFiiJlr5FB4Alm82yvb9v9aQf5oRWe3Ic1QEmwt2ulLeLeU7mJ+leU7CGkamwQZRT+CM06tdaJQxFnOrUm3vFEY/PJzx2png= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758101149; c=relaxed/simple; bh=mi+c+o3FWmHPaLJiT7Mnmm6sTZe4R8F+gNG7LUzeQcM=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PtxSG4eondVkk9Aoa6rzdwzY+XEgopDsiHMu9nbPr4vwAjnrhIqG8SUrKizXTAn+J4Rfm78GVbzd1i5X0pgRZ3UrO8mmegUSuSwgVLfU3k6KltH927wklv73f0TZXs6z+B0VfJ+l+5sUNc7rorXCR5mAtTvgC74dXb5qcw9JBvg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UpbyHRlj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UpbyHRlj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1A34C4CEF0; Wed, 17 Sep 2025 09:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758101147; bh=mi+c+o3FWmHPaLJiT7Mnmm6sTZe4R8F+gNG7LUzeQcM=; h=Date:From:To:Subject:References:In-Reply-To:From; b=UpbyHRlj6I92I8jYO8q8IHg9KFI/uWkocCl/yZZihL+Pu5p5cNv9/3GUZM17ZnTEL 55OySOMRo/VxAf3J394PdGoWX6PnbU604tDshBIp4JnADYGd/Pkg31p/3oS9TTje5M 7XfdTlfu+IC1/Km3+dylN2uadA4ih0TYYSHUze4cbDLE16OZqf4/SRXFT7EkFTZb4J gH3rkjwmWpvOwW12ngJ60mDM2ggbYPEiueaZ6Bn9U9mvtgUlJrFrGEpHajgaa9UoZP ZMlPKuJYultxRbn5+7KKJOHkKr9t6sXPHiG2v0BXspJrgKTFHMr7j3ktzLyJEJoz06 rPPyl6Or7FIGA== Date: Wed, 17 Sep 2025 12:25:37 +0300 From: Mike Rapoport To: "Liam R. Howlett" , Nikita Kalyazin , Lorenzo Stoakes , Peter Xu , David Hildenbrand , Suren Baghdasaryan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vlastimil Babka , Muchun Song , Hugh Dickins , Andrew Morton , James Houghton , Michal Hocko , Andrea Arcangeli , Oscar Salvador , Axel Rasmussen , Ujwal Kundur Subject: Re: [PATCH v2 1/4] mm: Introduce vm_uffd_ops API Message-ID: References: <982f4f94-f0bf-45dd-9003-081b76e57027@lucifer.local> <289eede1-d47d-49a2-b9b6-ff8050d84893@redhat.com> <930d8830-3d5d-496d-80d8-b716ea6446bb@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Liam, On Mon, Sep 08, 2025 at 12:53:37PM -0400, Liam R. Howlett wrote: > > Reading through the patches, I'm not entirely sure what you are > proposing. > > What I was hoping to see by a generalization of the memory types is a > much simpler shared code base until the code hit memory type specific > areas where a function pointer could be used to keep things from getting > complicated (or, I guess a switch statement..). > > What we don't want is non-mm code specifying values for the function > pointer and doing what they want, or a function pointer that returns a > core mm resource (in the old example this was a vma, here it is a > folio). > > From this patch set: > + * Return: zero if succeeded, negative for errors. > + */ > + int (*uffd_get_folio)(struct inode *inode, pgoff_t pgoff, > + struct folio **folio); > > This is one of the contention points in the current scenario as the > folio would be returned. I don't see a problem with it. It's not any different from vma_ops->fault(): a callback for a filesystem to get a folio that will be mapped afterwards by the mm code. -- Sincerely yours, Mike.