Message ID | 20240710135757.25786-2-liulei.rjpt@vivo.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 0B446C3DA42 for <linux-mm@archiver.kernel.org>; Wed, 10 Jul 2024 13:58:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7B35C6B008A; Wed, 10 Jul 2024 09:58:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 762146B008C; Wed, 10 Jul 2024 09:58:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B4DA6B0092; Wed, 10 Jul 2024 09:58:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 3CD6D6B008A for <linux-mm@kvack.org>; Wed, 10 Jul 2024 09:58:42 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AC4991C160D for <linux-mm@kvack.org>; Wed, 10 Jul 2024 13:58:41 +0000 (UTC) X-FDA: 82323998442.18.972385A Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2073.outbound.protection.outlook.com [40.107.215.73]) by imf27.hostedemail.com (Postfix) with ESMTP id AE9C740017 for <linux-mm@kvack.org>; Wed, 10 Jul 2024 13:58:38 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=mTPUAsfr; spf=pass (imf27.hostedemail.com: domain of liulei.rjpt@vivo.com designates 40.107.215.73 as permitted sender) smtp.mailfrom=liulei.rjpt@vivo.com; dmarc=pass (policy=quarantine) header.from=vivo.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1720619902; a=rsa-sha256; cv=pass; b=LfcngQSypdfXrGszFrf/Q0YPOaqRH3cdzNLtsdHth9bTADtHDsVGW+6AFSgYa65nbqfen6 iNxrMtn5zhiE5b8q5Rt26RUocAcsesy9lea6S9BqghLrGCWQNTAQUodvgYznH6dkO7Wpee j2mY/m8UbPPMELUCLTlN2qzMze6TgAY= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=mTPUAsfr; spf=pass (imf27.hostedemail.com: domain of liulei.rjpt@vivo.com designates 40.107.215.73 as permitted sender) smtp.mailfrom=liulei.rjpt@vivo.com; dmarc=pass (policy=quarantine) header.from=vivo.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720619902; 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=ZGQLyyp4O5Uf6YpKS7Lwp4qMYi9ESWvBfGifXLA6dNc=; b=iPH3jP6gOtwjb8+rsiNnQV4glPPzL7/6tNHbXtnq9de+ODax2WSJKIhAfle2uJNqdJz78Q lok06+nlyl8juc3LwU6kII4ESNzEpxBMuOcTW/7GsuZZ7KufYGQMVMSZuiTG+nwjtkL6Ht DoJk+omFidT2s5qn6LYjv1LhxLWzNko= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GW81jQAaxrHpZi9AWeRlVApqaP/X/K1JfRDr15DCnremDir3x578v5nmdtxGtH/O/Gg1XDQp65A+hPVtObQo2rims3bqGcQMEemZsAWBr+lFf3lfh6BTqEyurvkvXONqNKLq7bnNnYnZ0w61oGQDhwrUP7f+2OF7j/KKAGOAMx/d8D39khpJ+Zd1fFW4S1ylK8tH1aa1FCvE9aEfxq5VQm43MrRQaw+vLRXb4L3r65I8Yjl7MP+t+cB58SPPF+8EpXB4fSicSJl0tkiaj86Yx8UaKl/wam3MltZASRRxwmu4/Kfxcsgua60tLZU+WXJIe5RfICl3Dkk6XeodchuZsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZGQLyyp4O5Uf6YpKS7Lwp4qMYi9ESWvBfGifXLA6dNc=; b=RlF8iuJcNWsxA8J8Vm7tdyayeqbHSIbQB6Ed+3bN1UxCAsdLq6C0JrDIk83sfgAVPzH6/k5qSdTjP6GSUyoEf4L3Hz4/oDZtLUE3xr+TwDtlb7HEq0JF0Raf8reL0TMrH6SCcedxEt7+yUUYQCq73geOz/VKPYBFV7L2rYeJrTHy1qIrxvPNREzKYY1oSWgQ2M1QOR1xafs55DsPGJiRLkiG1KvJeVq5AsUO/CfN9+tGeDffUOcHfRkCEPtVcesQQb7Mvjggq5QEC/rgWkL/fOG92OmSqaifjsDMH0IBBBQuYtVmyufrSlLsCBScLJv97OC8mwxQWpRJ6FfkEoF8XQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZGQLyyp4O5Uf6YpKS7Lwp4qMYi9ESWvBfGifXLA6dNc=; b=mTPUAsfrpjgNuRQpcjRx8U79YuHfpxnQDUdTEq5l1NSlVoau9/j33NbT0+KZMgwSDQZuZ8PDMqyic/bEDuxF0ONl2T4J9d3qcXQ5OAoxJI5m/W3GUPFBOp1XuAOfiweY5wx8I+ItnA6hzswKMlP7eFlBsfW1q6NBPQHEV6tkTzlGPKHIPii8BjYV0CtI3Z8dI5tE/MnkSLo7jGRABWLk736qtMQt/0DCltu0oaaSsjBa5PGp2OECcyZZHq1ZDyp0DgtGKuEah5NsMdtbmW1V0U5KKqixPsJKfO/5c6VQdQZAmMU3e3KWDsAWaztpAEV7OO5Xg8vFvH8Borp3dr4YPA== Received: from SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) by SEZPR06MB6383.apcprd06.prod.outlook.com (2603:1096:101:12c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Wed, 10 Jul 2024 13:58:23 +0000 Received: from SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd]) by SEZPR06MB5624.apcprd06.prod.outlook.com ([fe80::e837:10e3:818e:bdfd%5]) with mapi id 15.20.7741.033; Wed, 10 Jul 2024 13:58:23 +0000 From: Lei Liu <liulei.rjpt@vivo.com> To: Sumit Semwal <sumit.semwal@linaro.org>, Benjamin Gaignard <benjamin.gaignard@collabora.com>, Brian Starkey <Brian.Starkey@arm.com>, John Stultz <jstultz@google.com>, "T.J. Mercier" <tjmercier@google.com>, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, Andrew Morton <akpm@linux-foundation.org>, David Hildenbrand <david@redhat.com>, Matthew Wilcox <willy@infradead.org>, Muhammad Usama Anjum <usama.anjum@collabora.com>, Andrei Vagin <avagin@google.com>, Ryan Roberts <ryan.roberts@arm.com>, Hugh Dickins <hughd@google.com>, Kefeng Wang <wangkefeng.wang@huawei.com>, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: opensource.kernel@vivo.com, Lei Liu <liulei.rjpt@vivo.com> Subject: [PATCH 1/2] mm: dmabuf_direct_io: Support direct_io for memory allocated by dmabuf Date: Wed, 10 Jul 2024 21:57:53 +0800 Message-Id: <20240710135757.25786-2-liulei.rjpt@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240710135757.25786-1-liulei.rjpt@vivo.com> References: <20240710135757.25786-1-liulei.rjpt@vivo.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYCP286CA0073.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31a::18) To SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5624:EE_|SEZPR06MB6383:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d991f1c-b3fa-4f8e-f298-08dca0e85d2d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|52116014|366016|376014|38350700014|921020; X-Microsoft-Antispam-Message-Info: CUiL/vFOpudpD205Hnjevd9c/PA5ALvPChPV4Y2ZEzJUXPPABS5S6UJxvYo7S6tcFjDLWHn8P8iv/F512jv/W5QDmsYyAw86NNqxi6jY7MpZTo/z0YZWHrhzVJQwoqMlLXqBTQlJc0iOLj4tfqkatx1hGuVq6NZPQso8A/SIfhgMJ566R//8BwJNWtN0Q7AopCPQOs9sYjCvClALJkC2fZ3CTWmLX8NGp0JNvuJ8m9WrVFfQgCQwYQCQnMYjDXkc8QxbH4xKrOxsXORizWEhWivEcsmUtyODNSFDALvgYJCXlOjdXtDqMg8hxxmj/5/QY3lo+sxD2o3kTdNJA4tN1pS4IANPPrSHzDB4dMUNhDKs8MxlPbZqm0n7p37EGEs95a+m/6uaUnzKqHuL0kzLdSdGWrencZaLpJjCDW5KgDOkWKUNgodcDFGsgI0XdpERItK0trH3Bo816TiYPgc2JJ2dkXdpCYMPCeo+nbvZAB1oG/i82/6AEAuwA+cUgHN+GL8iGXnRu3kuNelQrkdtTakpefbN3X/cj8gx1CF1XAOHN212RxyEB11uyHQKvZpBq7b56CAvuNmRzCt1XBXBLj+qJMcZm5rECvpqlOrVYqVHglxBcFMRPrPZioIScMxz0jp96bd8u2aaguwDyLvnpQGdMBuDrDlJ2kIa8t7xnVJratLRxq4AsgK4JGS2pbVQk11d0IbJT3F9mcC5/Uy4Uun83UoPLynhdkLOQ+xQTvoml04QAJxBGKQyl6AuOhzrizWy7wAL4cChKQrM+mcp/ddKfWPvvb9G/XjvaZMcMT0yLXdm4jym2P+cL31d5hPIHMoEFCHPQTVwY+eFWF+bouEvSN+i6oeCUbt7K1/Zua1g/ZQArHvv2kVLJsw1eUP9WKBOsWuRm/GAivzOVjWF/4kJORka9720Cbc0mvB6wFmsuJopFgbuKPA46GlK6YGWFip+xUnnWysJzHsE3/CjTrVISugQdxyR5CJFWfes88R+doTvO2QnX3aYGtabLdtnpljQBzA62aJF0SktT2ql0Vw7xAGJvjjKWAGZzpxoiUp7WS4DbENr7sOSIAXAuo3q3U+PjujZw7HsE+WlJSRY/JuVFgEjwc3BkjxUebVEWEmBPUbpnZU1m0E6XyimDQRa1xLnrKibOL//kqdOmPS5mLoAE0+PQ0fRzo8niuZiviz/i6LNQj/pG0VqY2CZv1PKWnt159ERZDvPwC6bKatJyluxq8uFNCvudogbh1VTj8UmxAnaQB+yUxoJOS6vXid9WWTtaJ6MUSdUb7EPF0RZFWfYOZpJt4iNBEAJBFHSSH+msTnL7ajbmCz7Ie0hfyi1LepGi9l61XvlqoTPzJkq9NQPHoIZg76CmrjTd+Cwlo9Iuz9OQP4cnORp4uztIXtNeUdw6NLwPu1C2PT4s8eWRupZviuhIvOpFyxYlFXIadg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5624.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(52116014)(366016)(376014)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9PmS7ysRt6U9jzWZhSSeeW9cvf//T3WN7hdKNmv93cbUxX/bR5BGXn2UCZjM+3o2AElqgibYVPWoCT8Ib66KSEwUhwlaZzwFcnZ8YM74ldGcuLsaNedpchSoqizryGfFPjwCR9wE7Xdn1X91yn/E3dWeNiy/UW0qv+0EbHzOwwBt86bQsUaKswmz+MjN5vOdvPacXEDauTD7myauGJrSME2MzJBkAZfhlx335+urxYbv58+7UXqYxpofLKWaO2DsSJDr7nu3FrmbX0fqo3kgvllJhsxzE9OlyhyttHwGWOARxDgmTSbhH+htgQPcPK9LTRUlmMNPZNhRk4GRWjLM7eRZOLwZGz3jo2Z6QoPaadh8ss6yQuuXPn58H/K2YNgoxuHbNGBXwCzjP/91TnveilXd+fCcH4ixfBTjw2TccwB+n1amgX0u4pdqo1+JPr3Znn7cp9zxhguiz6zn1dU0mVkwbpZJN6XzwMohqEaz3TdlNN42UtSc3HVyzGAwa4H52Ez7Mz1t9LmBxpnRcIX45Uva6SXNw/CNZXgae7K6PFZ5zDgJgPew1980L1sMmdG8pXvhVdrpNY5asmX6Q/5iE6/C16JXp9QoyMLppstkHhljRrOREkhRXlkMGkk2PPKnFnI6g4a8tqAnbcU7gWN6QjVoxpjcYwAJZoy8HkVWbffP9G01zhBh35OQ6gpnuKH5Jh6NtAezvgqXLSUdGDWd9TgfIcq0F9QChhJsshUGsNsg4M8TLilP80KuDePay52CBV8H1DXdQ+dnfbGpuDmbIQY/LTA8tj6rJ2oh7geLazpKPtpXnjzJnVcgGX1h0HwvNkJ2y17+7+OQD5FG4iJeiVo1PbVDwILvim2CY8W4jyryuZdFiDWLudGDpEZd8be6hWbzHrrENiCF7KJTetGwpD72kfpCnwCHG4VeLAOY+fyrqTMB/HSCHE8F+1rXwWNDoM779w3Xd4C3FnivuXqaHTkMWKqgxtEDXv0r1TW9VnlDwQmJ0ONwdzwVpnZAoYcrysVNcyuzhtNjii0MW22j6MQozaXkK06233v7p06EgdvGv/GemYd44tRh/XVDTSRUy528unREjcivg6857U2FkJlDgxEpi6sUtVfe8lzm/LVDn0Zr/O7o7FTuYPb5K4DHdaPRLot7cKkt9BniVJGcWelcTdUf/c1AJjPc2KBD0e065A1JuyvfqG77dokInBklXZdyl72/KdnGcF4qQLng/wnrJTgKvCcgAmyrFjf9Y2aSuEJBotg91g+EGbKIF18pnWKoM3T6XIfvnFIh7197iB1WpPEmGGodoLuXUSAbHw4QalB8vypnq+O0twLpv++i0HZLYALLS5RS/h0wEwAIBkXeKQ2K15bmvqOzC+FiuNTP0v34eU3f+CSCL4To99DTBSYNeOd9ny+0PF73f3T80CRGLCXx/4w1eOtV6kVrzPVUlGn2oW8P/5/0AgltK7MjzMhuI90hxaE3gXzXCWMiagWmCM+wKPx4YSOuPW7OySFS0TW7PPK87JSECrHOwgaLd7YA6h9BiCQSwf+Gaq9SoYp/2VNbwq5AVq9tyTQF2s1B2F8J/mYf75YNm1depmVi X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d991f1c-b3fa-4f8e-f298-08dca0e85d2d X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5624.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2024 13:58:23.7854 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hQqWO4aQiglqE1OPHqkc2Rf9bjADycBt9TIf7PPbDTKA97+sjaaTC+LPydZMQcsC/dhxtCy92wlcw3G/zH+s2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB6383 X-Stat-Signature: mzmoxrsqzm8cf1qi43f1gng37gibapcx X-Rspamd-Queue-Id: AE9C740017 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1720619918-359406 X-HE-Meta: U2FsdGVkX1/ULImCwLs4k7atmCZbT6zGIgD9Do4LPqfDR/YtGimiW3CoAMgPrWeHbZNHgqaghUoRYw8sVlevnocAZBrmZBtk46c6BISuwU+Hf6rHedFLCyx+rlIci5tEprxfU3Ykpd+fN0Nv0lbxcv6UQR8kk6zc8S6ZerWHXZHYLJ8AmS3mzIf24nudQ2STjz5FOllrnnhzblmKEn/oaHYat1j8b19uT6jYyonGFuxlo1C14KwR3+Mbm2VYP1CnTJh8wccg/ta5uvbszMsPlCUPZMcXZ1suKd+HSgimCa6qTE+MHlrQGHenudwSqB2XRFN7zRsSG+QMebEFbSvM8b6c/ZrYrrufuZiZZlA8ZZdfVXVYTkw5YvJVQs7U7STimPgp1HfMAKabLZcEXiW4zORIPmXKVY7hTab7g5JtHnCg7JC9Q0Csazac2Ln+oMBVYG4d2urbwrND0oDYS/GH6pg+SUjbWLx1ORj4nrQvR+3q4Xq3eAxBtlcHR3yRd+Yph231Gony2RyWFiewyljztPFvz9+Jt58970kPKmYzbAQ8hMpruYTElm7qbrUOdCTImwm4LwEhWxwi3Cu6ibo/qOP3lFUkJdmw+yoyhsHbILqqWeAj6b+Q2SPkM/2up5dveUMCQbu1tCV0ZDqV9qNrJTHI+yYRO2z5LstJyjmch8cPgIj4hsyCfCtWlZpMmmeciuUVN8QDU93R47fKb0h8tUAmaa0XH4ZF9HJaRvCkHqI2USOihcv2GOp+3s+z/hf4YPsld0wZm/rgPi2LaaWzz9pOn5o7iaK3lmz6STlTa+9URzx3xK++UyFzXyNa2K4NrsCohgW8NvbfLQjNw66rF9rpZ1DT2uPUw8rHFA0Z3N8j3htlZpq3WMcJSuzFCJbuNgTReei8aDxCkh7aiJRjpI1nh2OrJl7RVQcZ0v9OqYmLFjaXU+xw2GzgsQAq5M1n9AZloWICXUcyoR7PGdl nQjDhOqX YT6vHV3kv2HFHzbUhO+NxMZ07DlFnioMDdOiBu+A+jaHuWNg4LX4vqsqnSi1ni8qFQ4ytHyxZczQcGDhvXZWp/bkm6FteukxAWGZaF4GcrcBQgGFDV9d9A2cwtJDclFc/IMAPqqKEV86Ff8/har7+05pMhX9Ze4bNZaifbPzwmKKgptMtOXy9BH7mPw7cTfNw3l5f+WNJXog/IvEaH5kkR4BsFrbY4YCZu1kId9j2+3WIAcCikh7nPoWshcGDKLfz/H73PCSu2p2+DQX7Y7/pa666BfK3SrP7jqG72AqFqIc8PaOVWcRpIs1RPhjKwPoY6SVrRcmv7wtHTIHwpc3bL/KmA/JWpor/Os7y 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Support direct I/O read and write for memory allocated by dmabuf
|
expand
|
diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index 9076d47ed2ef..87547791f9e1 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -203,8 +203,7 @@ static int system_heap_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) for_each_sgtable_page(table, &piter, vma->vm_pgoff) { struct page *page = sg_page_iter_page(&piter); - ret = remap_pfn_range(vma, addr, page_to_pfn(page), PAGE_SIZE, - vma->vm_page_prot); + ret = vm_insert_page(vma, addr, page); if (ret) return ret; addr += PAGE_SIZE;
1.Effects and reasons for lack of support: Currently, memory allocated by dmabuf cannot be read from files using direct_io. With the increasing use of AI models in mobile applications, there is a growing need to load large model files occupying up to 3-4GB into mobile memory. Presently, the only way to read is through buffer_io, which limits performance. In low memory scenarios on 12GB RAM smartphones, buffer_io requires additional memory, leading to a 3-4 times degradation in read performance with significant fluctuations. The reason for the lack of support for direct_io reading is that the current system establishes mappings for memory allocated by dmabuf using remap_pfn_range, which includes the VM_PFN_MAP flag. When attempting direct_io reads, the get_user_page process intercepts the VM_PFN_MAP flag, preventing the page from being returned and resulting in read failures. 2.Proposed solution: (1) Establish mmap mappings for memory allocated by dmabuf using the vm_insert_page method to support direct_io read and write. 3.Advantages and benefits: (1) Faster and more stable reading speed. (2) Reduced pagecache memory usage. (3) Reduction in CPU data copying and unnecessary power consumption. 4.In a clean and stressapptest(a 16GB memory phone consumed 4GB of memory). A comparison of the time taken to read a 3.2GB large AI model file using buffer_io and direct_io. Read 3.21G AI large model file on mobilephone Memstress Rounds DIO-Time/ms BIO-Time/ms 01 1432 2034 Clean 02 1406 2225 03 1476 2097 average 1438 2118 Memstress Rounds DIO-Time/ms BIO-Time/ms 01 1585 4821 Eat 4GB 02 1560 4957 03 1519 4936 average 1554 4905 Signed-off-by: Lei Liu <liulei.rjpt@vivo.com> --- drivers/dma-buf/heaps/system_heap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)