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 E535BC433EF for ; Mon, 11 Jul 2022 16:05:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE09A8E0008; Mon, 11 Jul 2022 12:05:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C8F9C8E0002; Mon, 11 Jul 2022 12:05:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7E888E0008; Mon, 11 Jul 2022 12:05:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A7F3D8E0002 for ; Mon, 11 Jul 2022 12:05:23 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 53421205C9 for ; Mon, 11 Jul 2022 16:05:23 +0000 (UTC) X-FDA: 79675293726.11.FB62139 Received: from sender4-op-o14.zoho.com (sender4-op-o14.zoho.com [136.143.188.14]) by imf04.hostedemail.com (Postfix) with ESMTP id 14B3340030 for ; Mon, 11 Jul 2022 16:05:21 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1657555508; cv=none; d=zohomail.com; s=zohoarc; b=fi/+0YUi0Z1XGGnmtEao17Apcl4A+D+M7Eydzr4zaECKEJpQisd0+9aIOOqN7QU9cgZ+4JJnonhLQ1uWoUA24kHLwvbAYRisRW913fRC0ILnPkyxiI/f1OS9Vv1pcOp7AXAZscu/2OKxI91+xIDx1oLRk0c1g9O1UrK+yjHspNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657555508; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=CKrQS05Osf0cYASc3hvSa3UVP4bEQHmeALMpF7CZxQQ=; b=VxOl3mihwIOWQFhQgGR1N14Wbdji7wa8FeJH688fxsDk4bgVbjDXfLoi9QOKA07EgiYioaMOlYTQNWDVDhN/ILDfvBVu/55Q+bnAzUSSVtjSLEBAwtkpWOaJw5Z9qWEykZkQPXj3r8cpYSMx1JTzvTmcxomPa+Ly6FWs2U1DiwE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1657555508; s=zmail; d=linux.beauty; i=me@linux.beauty; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=CKrQS05Osf0cYASc3hvSa3UVP4bEQHmeALMpF7CZxQQ=; b=cmkffHp2Jh79+rcjxrfdlnvQjipTWcShDP8ygrMzX5Y5vmgS0aKnnVbgEN4OUHEP TYOm3RmqiBT4bTZGNLuOnh+zxR5rdt8uEQcNiZOsx53X3qwHPq2hRXtMwK88SKK37ta ZTK2YCVpDjf29+laj3cRJsILx51wi7HmFZgELlRg= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1657555506079247.95644078579937; Mon, 11 Jul 2022 09:05:06 -0700 (PDT) Date: Tue, 12 Jul 2022 00:05:06 +0800 From: Li Chen To: "Christoph Hellwig" Cc: "Catalin Marinas" , "Will Deacon" , "Rob Herring" , "Frank Rowand" , "Andrew Morton" , "linux-arm-kernel" , "linux-kernel" , "devicetree" , "linux-mm" Message-ID: <181ee01d384.b809bd01412268.496620746959082770@linux.beauty> In-Reply-To: References: <20220711122459.13773-1-me@linux.beauty> Subject: Re: [PATCH 0/4] add struct page and Direct I/O support to reserved memory MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1657555522; a=rsa-sha256; cv=pass; b=4SCC1tlDICxbx1G42uS6VOqQ4fc3WzwX4/jxV9+kGumxLoAGIayU8Ab6ppODvQYrktEtM6 EBpiW8tKd3pQwbvw8yz1q0jLp+hVIAM/Rb7RF9rE1Naezj0OxRyGiaLymyugjIFTzQmWSb QO/yBRxfR8Y9sWa/d8CisuzlzcMlqco= ARC-Authentication-Results: i=2; imf04.hostedemail.com; dkim=pass header.d=linux.beauty header.s=zmail header.b=cmkffHp2; dmarc=none; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf04.hostedemail.com: domain of me@linux.beauty designates 136.143.188.14 as permitted sender) smtp.mailfrom=me@linux.beauty ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657555522; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=CKrQS05Osf0cYASc3hvSa3UVP4bEQHmeALMpF7CZxQQ=; b=ScG3GllW9+Uemh6n8ZN8pujt8PSBtiMmrQArDax/FW6EL+xeUzebN6yERLDhS7JeiKEcoB 6NfEIhW8Xff0Ccngt5fWfg0jvtCd3jDann0QvTQnaVs10vJKXKj6+BmbA/26mZutINkaKQ zDKyeJlV4aFnRo2U0KXdb2LFeLQiKFo= X-Stat-Signature: 5kp1yy8ssum1mbe1t1ssobk5y8b7kjwu Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux.beauty header.s=zmail header.b=cmkffHp2; dmarc=none; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf04.hostedemail.com: domain of me@linux.beauty designates 136.143.188.14 as permitted sender) smtp.mailfrom=me@linux.beauty X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 14B3340030 X-Rspam-User: X-HE-Tag: 1657555521-891475 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: Hi Christoph, ---- On Mon, 11 Jul 2022 23:01:32 +0800 Christoph Hellwig wrote --- > Who is going to use it and how? Because normally the reserved memory > is used through the DMA allocator, and you can't just do direct I/O > to that. > My use case has been stated in the cover letter, but our driver is not ready for upstream yet. With DMA allocator, we can access buffer in kernel space, not userspace, however, this patch series servers for userspace direct I/O, so that you can mmap device file as src buffer from userspace, and dio to file on disk. There are some mmap + rmem cases in the kernel source tree which don't use the DMA allocator already. I also found some users have asked for a solution of supporting direct I/O on file_operation->mmap like: https://stackoverflow.com/questions/44820740/using-o-direct-with-io-memory https://www.mail-archive.com/support-list@support.elphel.com/msg02314.html I believe there are some other potential users who didn't post questions on the internet. If the upstream kernel has this feature, these users can mmap their reserved memory to userspace and get direct i/o support. Regards, Li