Message ID | 20240710140948.25870-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 9E377C3DA42 for <linux-mm@archiver.kernel.org>; Wed, 10 Jul 2024 14:10:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 328AD6B0096; Wed, 10 Jul 2024 10:10:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2FD606B0098; Wed, 10 Jul 2024 10:10:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 178146B0099; Wed, 10 Jul 2024 10:10:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EC6646B0096 for <linux-mm@kvack.org>; Wed, 10 Jul 2024 10:10:21 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8D088160111 for <linux-mm@kvack.org>; Wed, 10 Jul 2024 14:10:21 +0000 (UTC) X-FDA: 82324027842.06.DFCEE25 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2062.outbound.protection.outlook.com [40.107.117.62]) by imf29.hostedemail.com (Postfix) with ESMTP id AA155120015 for <linux-mm@kvack.org>; Wed, 10 Jul 2024 14:10:18 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=Slec6BHt; spf=pass (imf29.hostedemail.com: domain of liulei.rjpt@vivo.com designates 40.107.117.62 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=1720620602; a=rsa-sha256; cv=pass; b=pHt3iKYHFOb8yD5jCWr4y2cgxLJSzGWmGL30UXsVswvfRCbmEwpXIVsuYMNPX1HWAn2BWa x8x5CH6DKP+aLtx3F9QimfGlgIpK2m3EpsFj8SD+aGEsQTQgrmi2V0fKD4Jivcrr2tG8VF Z79uAbQzLBpTMPm4UcsxkHEvbVTSc5U= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=vivo.com header.s=selector2 header.b=Slec6BHt; spf=pass (imf29.hostedemail.com: domain of liulei.rjpt@vivo.com designates 40.107.117.62 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=1720620602; 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=o4S0IFLse3b/sy4QIitSEag58uOaGlMOi3pCS3i82Z7OJ7vHpl6ZF0GAFvnV2qK3Ya49rv K52jqfkmXVIeGAJoZDT3YhLLPCPI7IEaUMilbGiy6PibYdXmAvznl3HPdDjS+OphlcnptS If1YI/DpkTa9k4/CbASym6reTxKZAiI= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gYuU/+Vr/j1FBoiakqKsyeoK/KlCf820pLltB2Wj1NlQXFe/DBIpRJ7Yxko5VMAG2Orui+hMgqVRcSeg92VGTRkpjrzSki4f7FNHf0uR+Or48+jZFRHFk2ajnoGe7gSpl8y/WtoGb0RFD5ShYhwRH9up72szwfdADbnxN8+KAvikGvuyED5VppGAZLMry8cYKmFIraire6kTzU/IokrHtrr94antfe2YIZI2vQjOH181p37a64MPMyJ5QOYmRCz6PWgzbvhcCsfYHsn8Fo5z6vyjELmGMNE6HR1CtL8/9brmGF0ABw1sBwkRfb2AiBDLTuk667XGmFnoCvAc9M3Zgg== 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=LKTfRrxJQ4BHyK0cSNGSw55ABvKRAcs6LSBkZ5zuB4gOSgkCJ80g4RE0wyw2JcrugKPPIzZ1eUHsd97x99T7NtHfs3hxPni8Wc+drgWCZHGOF7TmzMJXQ4xIZ1uSiGGEfToa8mvXi51nHDTqrf+P8nRo3rt2x1DKeb++E/+HwNOjLbza+6j4F2yOs9+oN6l8YN5qBQoIjXK+lTb3sztOPMrt1HATr/zdTGs/D7czLBeIa6I9Qzjo3MP2Yk5VQY/f+XH6u0Bo40gj8VYmEgrzKthPZUcEBORhMzrcZ6sZx2MbdE6kqRW31I9+GGgrL2vOgUwajxP6CSemRYPka1fpnA== 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=Slec6BHtOm8BvZyT4FtWypfXyaH5Gj+65WWNm0+BnWXsZdxtg/2BB4R7aDkMLi5UyDexgWhEUYR2DzglnxjqJIlZ+X6H41iGr8s/FCkhqZz2sjAfWc4oWMXZbeKK/tbOFe2YR8m1nBB2uX+kMKCs279rjwZrnvtlxrdOY9kVcexG5thhKCKehsPttSLxOpQej6kFRNaRxlXllxRPFD3vEhQhIpsGkfMnFDlLXGp8V9SKUN4JsjFH0QioCeZ+eXUobnNBd0nUzZzLEMUS4095I8Qkl+qGL7qIlhbD4RCeMY9gQArwkUjJBDt9hD+/hpjx1c2kPB7qOxiOKV/pcQa1Zg== Received: from SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) by SEZPR06MB7077.apcprd06.prod.outlook.com (2603:1096:101:1f4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Wed, 10 Jul 2024 14:10:14 +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 14:10:14 +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>, Peter Xu <peterx@redhat.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 22:09:43 +0800 Message-Id: <20240710140948.25870-2-liulei.rjpt@vivo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240710140948.25870-1-liulei.rjpt@vivo.com> References: <20240710140948.25870-1-liulei.rjpt@vivo.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0031.apcprd02.prod.outlook.com (2603:1096:4:195::16) To SEZPR06MB5624.apcprd06.prod.outlook.com (2603:1096:101:c8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5624:EE_|SEZPR06MB7077:EE_ X-MS-Office365-Filtering-Correlation-Id: 3cfefde5-2dad-47c5-0a0c-08dca0ea049d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|7416014|38350700014|921020; X-Microsoft-Antispam-Message-Info: u/aGUDZfojbwWYKcNYHVDFmiCyKFIraR2sPvEsUh9bPqEMVkTm4NsMpRBgIHFJgex0cMg/Wxu7n/zIw5B7kH2zn+ICj0vidb2crEgOjpFHaC+aMwcE9khh0ieo3+fHQE7Nh0VbgGh4wOpvMtZ/FNj/thBep1lSOsl1mBiVfklxrFWNK53T0UQ4FDmgc/pfEOD7yI9FN4aujyuh6jfH/KvNEEdNEk9KXxS7KLB7Tjq8w4FZQpKxLpHWsSAlihziPJpSkAf9QpJswImGVKmD65q7/Mxn8ZdPSGjZhhY49Vpv7pC3q5zsV8XyhnudLmL6Trbe0xIkmDtUXAiFpcreBGjEpPKIjZTFrIvPlD7M+j4/yfVCRf7eRUTvduRfA2F0VmaXk2mJ2JHKvcMUBz9wRNnP91PvM+8zVNmRA0WnQFEy/4uyqxfZ52GKcHuwAnsodcEWBUVKbNsWgfHxRowaN1hkDMHMSaJdwmZkjMG2bXvAMxEYdx5B5JydD/uufvOCnrCFGltUFHv7ftWb/Rs709CX3sWvuZlDDgJCEHL3bWs0C9Uggbj75cMhgDtprCB5NQDEXiNARcl1riCHZd+2BbKkq6qEhEuVqmxpRPsuhvXdxO3og7KJCNYF4b06heKto1NQzffb2vT6qO48D/k/BCO1x5X+z6GyqnmmGexd0CMBfggZHy7Z3kk9OgHawJdINSy5l/MR3ermHAw2CgcFnfixSx2/FGk53yZ9Exxtg7pCicSgyskddeCYzoUAA95dFeXgdoh2lDLaFfeYFvagTJ8mSLp46JPGZx0JFAgexWhikL0nxrqJYZUEhtpQUbDYnNc7yhQyzSf1nXRh+BqXPZ0jQT4bWwHwg+KJG7dyybirvthLC/qNbyo6vAelTIpIGztCnF1O62R9Hhjrn2vZB2+LbWp9QhySM7ihcsGBWiTMvE+9TBc7W194Ff/oEh8zDzb78//S34TvgpI8tyTw1RbToRhi/hTCOa/Uz/hoWQmruW0OhLixvOH/8PMy9Iq92qLL08FZ0YIi+Kr6TvpbCFS61ieJEmsWUR5DytFGniOIJcXPfD0m6EGx+r34jhLElbHmDoZOhBD0dPFj0r6PbV64p4LqCa2+3eldziTYcGpu1Vk+WcCssNRnGJxHYlYUfx7PtKR0vZM/38xGhKRmnVsL3Tk3kxwfK4jgHdhEbFV7iCVE2AriEeP9zhJmpTc7al7vHyj3KdqZppvQfs0aqH61IhA3PgihCO3s0LmRCLa2CzsaV/tNwIUebXDdprCpnt/VgBgrp29JAdWZFD565IlaXfH8QSxL0sY6cY6M/n0bPMFiQSYViigNyQyv+WBQIKZM9CtSpguseQCApZaqJVsexVICWLOLsaIQ0PA3dt3WwMiVhqeUH2cMBbIXZkvd2xz9jXNs3aVEkJUol8S6MYptV4ompIz7JWr0bRXivU3hg= 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)(366016)(376014)(52116014)(7416014)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FqdvLa6Suw/HRehljZh1WxQ4ZNEJp6x5N7gjltMqknWku/y/ggrBocwzW++O7297z7sXDkQpY9xP3aApFOKP2qARr60Zp07VkmZqhEGGP8GAv557mLw3fX8eoxNSAtnhj2L2gvC/uc/xxAS4ZvitCWI/xo+UjUOhdMc1jookolYN3zuw3kgy98AejJn/vh1hk0z/tYH3oIKTwxXbZ9mH0+vMd/hSSgqdUYvNbHtUELbGS4B5qaMRIx2H3lqSCWvIoygzv06+sm27+37OMOJfcfSS1msFcXdTPgwYDMp0Qc753vZSWrdGT1Fgj1+d7vZY9vGtjl0aFrxCNJNw8FX/APDSSgRowldg4frzPsUu5QwWnMQFyQ4jx8PdcJdK3tlTbW6a2oqm3ielGuuGb/KoUl2gYbmxggX6D6zm6NPjuHBHlKHTyYEKyooH3zoEQzlfYeuZoODMeeX1McS4U6C/acJkHC9PkoAiewCocecMQr/njHlZwXH/GnWfiJctIXNQOdNppeUwsFUef77mtTH2tDd6mIVcrikg2/1taWh7Sd/rQf5ykZUFtvLtIGmrK0O3LD873kYFf9jznuRuOGs2jhRF9caG/hZl/mCJvwOKsbCQP8cacr94oC30i+rtS5wUgts4lDradb5w/BLOxFLfCmUyGVW5crZ0mWoJQS7eMOqAQgS6xV/kMLJuAuOpqk6wkXf1UfCVRIL0hPM1mNkfPsHpLaY3KgTN3m0ctQI9q1c76krVuaYv8Ti9+mCsQCAY0gQQRoS/trQR/TXbvqEyM3pmK5M56iqu1mZjlDIZVILK58rARQbbmtgBEbSJ5S/jRm96W9e60yJAE6n4QnWxqR8iFoJJ5y1wCbiyunZg5zBYJiE18al1OEfXY1MezeEXXsM1jOtLo/UWBMlVqcPtEbuldE6+PEATXxhEd+mJEyP7vqtnx01Wm+IVvzIW+34Qvk4IR0WS8lIvqdzbqs1zfYWY19DxJmVA4kG97fYv75hZq1VCv5I+MN68MY3MgLnjdEKtTX66lRjb8HtxslnI9crBnH6qKZ8xsKpzeaA2SO4+KOUvDqFFDCjPybvEgOKqK5jQNUTVCYxRRtBs0Q8XT8j/u2V/hABNB+ysbktRcX6+fGHVSx2oBK/CmsxY3Ituv4Sv79LLREPvxQMbhlClgjzyR4P6N7+VXzf4ZHr5DBwoLbXoNalHcm6qcWBF41ALKBic/gLrPZF0WH3MlblzoRmbisk/d9gHCQ7U9S2xxy2z3sRVsw4edD5J/wwoLTShXVbl2nIFG1IpIDkGltyIzMrsKPGZ9I8dJmaqjtrFWxgVrZF2aqVLMRLA76KP5N8CnYihPuj2ALx3NJquaJjrBE9TuDJoSU2XXRYfZj5IBVV87i+APu/Lzat06mX7SuvFk+KiMXGmAY4MUOG/rZhLwyARmc+3z//2fiTLHc0t0rG0IqRXhEf28Rk87YU7w6QYo0h8+gmbLk7F2ZtGWRnHf4hYbCHvhAGMtpmLmy1S5+Q9RT8ntuYHQt4+7MHrtOVQfSh33ItJC3pTJ4co89ZfczHFXNH8aRZjlNsX1xgEz6ksuBy0ey8sB9QSyhFep90G X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3cfefde5-2dad-47c5-0a0c-08dca0ea049d X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5624.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2024 14:10:14.1583 (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: QGL90Q66LYoNFkc0DM+n5/187aGLq51wvJsu2b4Za5/kfeFoyTt8x30U4YS6JqGlJ9jkH2xpfpwfxgExyoxFUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB7077 X-Stat-Signature: 7x378e6nus6wopzkh9kkunpm87u7z6aq X-Rspamd-Queue-Id: AA155120015 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1720620618-737590 X-HE-Meta: U2FsdGVkX19tg1GeOD+mdbmU1TraeoTiOkVhCOKaziKVgQgP0cjbAqLvJQFEL0yjuney/Qxu5KlsWmeFNBetTUzn014CukUcjxRPerpVLdIK4IcDsqd8KbY4ripSt9QbVF/1q9fitF/KV2JPawjfGHsJAgrDd29DoCizNvT2HOBdPi2oB+jjIT/0uLnaWtmM4L6d3EXrHpx60kwmJ78GiKQpSxu+ZKS8zhKrlnJmAiwVNdaVcjtE19+fc05qoQGzu67oEUewhChR92Z5QfoBUmcfBFulzNtS3LDPxQqO/D3x1VgYdAm4feNPg7RwFuBUDQ9yVlnMmLWIC1vBD9yLoc77GsGjI0rV1H5rozhCKDyJkSQSwZQhvLf7UXziHfQIItmQqRO9QV3VcSATyghd6dIrrRgO/0JTw+Dfcbt/DsIURXUsv+gTyO1PR5eBEE4Eyr8wuvNRCVG6K/ehRzYMvnPwX3Bf1d1i2Yc7mARoZgZOoDevSElexlX0f8k6Qkxp3sO8PwrBfuB3LhhRpO+nwAsXn2iJsEudCC4+n7NPrGuEV5HVpnj1+a8tmmVcnXt7boiPkA5i0cjSuS9tMNH3v94iK3IUFAoIpZqhHn7EVKYdyuwPk7b8Jgj2QK9tGBLriad1PPECH6uo4isy417jTBCp9W9ueovB2vxnQfbRugYU972fK/cW23AKcE5alvfMySgQKDgbjH1yYtRO154RkdPVMzhLPB4lZwu9jqz3S8kmvzhMor/Qdwth2Yolit4MzJLit3VL59nqzWIWo43rMLonzkqVrxeNdOpJWeNydhT5jrv01FdTjJE9ERo2A0Ll1ae5WZelt6bXHbhnxzBTvdIqA3b1hcxwyWMchpepYAiGg92QtCz3Dp0tHG8r6ABlHmZThZT2U/unheZQuKPzCGT/uuTQE58A0VR5qcJWrwTMYop7bjPLdX0kgCFMr1qeHi6F06LwKVf+9VcAvL8 3tCNrY3/ uQpXogFvmQ5wwXPvzRF6s8AdalvcqA4zHCSuftSIgEJBROtW842tMcjwrWq7kPZpgqu63KQccuOCb28Bc7Rx0IUU8BfAgSZdRzdcYx7cGlTF9/ityoqyM3veuwa1MWogcf9MD+euG/mozZV4zLr0SzJpCB6uyaRkiSq/+2vljGUOI3xqkKJy3OacXvKxH+dBxuU6I5bpmUBLeigPvPB6Jeeiw08id5pOR8AB2ylYhNB93QPH3LbsmEfiNWYICJ+TxFrGQo++mVnTa5NJ2ilPLY8v+5Kinv/mVBL0VRwOtBrnwJqKfytpzZxiJvgNnhsKq40RToZ+Zr4r1DE2dLahmUrepCrXm0LdBpEVL 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(-)