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 DACADC433F5 for ; Tue, 19 Oct 2021 17:37:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5FA5060C51 for ; Tue, 19 Oct 2021 17:37:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5FA5060C51 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id EA2F76B008A; Tue, 19 Oct 2021 13:37:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E529E6B008C; Tue, 19 Oct 2021 13:37:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1B376B0093; Tue, 19 Oct 2021 13:37:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id C35F86B008A for ; Tue, 19 Oct 2021 13:37:12 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 77C83181CCB14 for ; Tue, 19 Oct 2021 17:37:12 +0000 (UTC) X-FDA: 78713893104.18.FEF45E2 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) by imf12.hostedemail.com (Postfix) with ESMTP id 1FBA710000AA for ; Tue, 19 Oct 2021 17:37:11 +0000 (UTC) Received: by mail-qv1-f41.google.com with SMTP id n12so454469qvk.3 for ; Tue, 19 Oct 2021 10:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=DDNcSaWi4PeJUv65MFP/RIGeIRJgEuWKda7nGMDceGo=; b=k6DqTzZMVb56PMbP6dhTEzv807yXtBKtSHK9voYdsh/iNyU+p6graFaSzdYI7M8qrV vUb9prw7dddQ+FJS/PWGSXmQTWNP//pI6Gn+F+s118xKRmSgT8TWSJCyww49K6/6rh4k 4H8KeeCy0d/vl4WDKueyBIQyF8CbffACXmR2txHvBuhM9nhOhxnN2pB1XnsGUvZJqRWy Wq30s1RgF9g77GoilJOAZOZiok4vS+qmQ/Hl0nat1UfB46ddipvi2uhtRXKsJc4YCySL x0bYYzoWIYjQyCinEf5MI7/ujz6SBRWlt2yEujel/8jKqtlcszL1XUxIPh/OZUndZaTh SrtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=DDNcSaWi4PeJUv65MFP/RIGeIRJgEuWKda7nGMDceGo=; b=sf6zxog8Vbt9JlBrCwjvgGogprY2Ue0gSqpF5wVV7SwL+PYMAVYsMYpZgAwdtOxc4h SO2P7OahADIUQuQCZlfod3Xs3kzz2twnu/88c2Lw7s2p3uJIl5W6DxsTfEclnOFPwLBl 1cYqb4iUs7zQj4UYCWK+74YIrOM7m0wltod/00/VDB7rto7LyWgLSxBwVyRJtVI+9hij gmU/2HqoB9EdAQJWlj4LPsJKD6dF1F8VXtfobdQNIp4eucNu9pI56yjjHRZQ5ORfshYk HaAGtQhgXdlnUyFs6hjIaFsbMGGJilV6+c2/iJOB7l0D+bekXaCI3usxGVwxGJBOB1iz nVMg== X-Gm-Message-State: AOAM531K0fS0v4BXT2osPFb2P/hfQQGU6GBoufwrAgBCbUbp/LDuUM5Z 8n2VVz7KQzC6Bg+++nGEiYBnJQ== X-Google-Smtp-Source: ABdhPJyqJwDw6epqpXpG73lSY7+KwBLvn+msGtZ7q+PCo3+V0I8r/sjIIYZ4fJS6nEEZ+4BY3ExJQg== X-Received: by 2002:a0c:ffa9:: with SMTP id d9mr1231035qvv.53.1634665031269; Tue, 19 Oct 2021 10:37:11 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id t26sm7975721qkg.40.2021.10.19.10.37.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 10:37:10 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mct30-00GtVo-A1; Tue, 19 Oct 2021 14:37:10 -0300 Date: Tue, 19 Oct 2021 14:37:10 -0300 From: Jason Gunthorpe To: Kent Overstreet Cc: Johannes Weiner , Matthew Wilcox , Linus Torvalds , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , "Darrick J. Wong" , Christoph Hellwig , David Howells Subject: Re: Splitting struct page into multiple types - Was: re: Folio discussion recap - Message-ID: <20211019173710.GI3686969@ziepe.ca> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 1FBA710000AA X-Stat-Signature: ctke6mdikbf1sn9s1cu6qqwomuxm73r6 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=ziepe.ca header.s=google header.b=k6DqTzZM; dmarc=none; spf=pass (imf12.hostedemail.com: domain of jgg@ziepe.ca designates 209.85.219.41 as permitted sender) smtp.mailfrom=jgg@ziepe.ca X-HE-Tag: 1634665031-407156 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 Tue, Oct 19, 2021 at 12:11:35PM -0400, Kent Overstreet wrote: > I have no idea if this approach works for network pool pages or how those would > be used, I haven't gotten that far - if someone can chime in about those that Generally the driver goal is to create a shared memory buffer between kernel and user space. The broadly two common patterns are to have userspace call mmap() and the kernel side returns the kernel pages from there - getting them from some kernel allocator. Or, userspace allocates the buffer and the kernel driver does pin_user_pages() to import them to its address space. I think it is quite feasible to provide some simple library API to manage the shared buffer through mmap approach, and if that library wants to allocate inodes, folios and what not it should be possible. It would help this idea to see Christoph's cleanup series go forward: https://lore.kernel.org/all/20200508153634.249933-1-hch@lst.de/ As it makes it alot easier for drivers to get inodes in the first place. > would be great. But, the end goal I'm envisioning is a world where _only_ bog > standard file & anonymous pages are mapped to userspace - then _mapcount can be > deleted from struct page and only needs to live in struct folio. There is a lot of work in the past years on ZONE_DEVICE pages into userspace. Today FSDAX is kind of a mashup of a file and device page, but other stuff is less obvious, especially DEVICE_COHERENT. Jason