Message ID | 20240730075755.10941-6-link@vivo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <dri-devel-bounces@lists.freedesktop.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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80AC3C3DA61 for <dri-devel@archiver.kernel.org>; Tue, 30 Jul 2024 07:58:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F27BF10E4EA; Tue, 30 Jul 2024 07:58:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="Lj9XAYVu"; dkim-atps=neutral Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2046.outbound.protection.outlook.com [40.107.215.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 35FE210E4EE for <dri-devel@lists.freedesktop.org>; Tue, 30 Jul 2024 07:58:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Kf7S6uYNuv6kxyx30fnD7OGu0Cs7uZvPiJVPSC+h4A6d/szezgwVLZ9+VpP5tFW2qaipegBWlLS5/Ym11vUqRTOQR7bugk6S13GhPc0JOBTZaxUdkQXwdvdfihjkVjnQM0KJkshLfxLgDbMUDlNO/6ouLxDdVCPK9taGVRRpnA+sC/bTNOfEj4Sq41bzkD52vcidgl5Yb/nY1K3+wtjvk2CKfgamUxilfCvl8jkbbPELape+X+aeakYQ3X+zMo0Ive4UYBve7rz/3OqAQ6b/BqpwihCJJ7Qdv1YsrcIYc1chQVqRHTnoI9YmhdsSwsLCiCCM2ALEBeon5nGIZO1Dpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=bMhwemUUoB/3WcjWcxAIFyG/JasZnHDkItVkTKGRmO0=; b=xgjc5uXUQXVGkYzbHX3w+50ObcgBsaEYgpuRyimwVBQWd7lM93WMqw/b6HT/wiZDlHPDm28I0jNK259Jr6OP/1DO2BrFt7htxJBI0LCS9pBGEcVTD8gFWbgUxEjJ7R3Af/poib88A7pNSO7qPJyVMU3d6f7vu96y9r7KSGH6Wp1c2SlWVsb++sq/1yvqDZkUet7duFKCndGUN7V3ShLSAj+uihjNq5VPycdZwjtOG+P+20g+LOE2oCJJ3e9eCg8hswO31P2LOyGfHyA7LKfw/M62kbKGqiZhWbU3rrzZBr/paM896MxywQ2S1Vzrvt3z3/1zFhOOrBbuIUvYR9WxMQ== 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=bMhwemUUoB/3WcjWcxAIFyG/JasZnHDkItVkTKGRmO0=; b=Lj9XAYVuZ8R6ZsK6zx5iUmEGPzgVqZztdiTqwePe0+mRi9tMrS3J/gxLYaYbNbcJpZg72WcOuYJIEfIku37IdXbVejsYfkTt8LxBdC//QpmCvG+ZVQSf6oH0OMCsU21vzZsCXP3XDDfGtrXTws2BQh3B2OucLK9oOHgFKkP98lCWqavu7cB5AtoZrBuhE+yB4MQ7ahIhG5cvhOc14EIQi2gmyGZFy/tV7kD0Dn3I9iI1c9fzF388pQQlDjDiZHJWisT6t8ZAA4BW263oU06sEF/rEcqOTbakSFt9MdXY4kU76a1ZvpFq6MeDSBoxRC4/hgbPnMttM8k49To89xVIig== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from PUZPR06MB5676.apcprd06.prod.outlook.com (2603:1096:301:f8::10) by SI2PR06MB5386.apcprd06.prod.outlook.com (2603:1096:4:1ed::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Tue, 30 Jul 2024 07:58:29 +0000 Received: from PUZPR06MB5676.apcprd06.prod.outlook.com ([fe80::a00b:f422:ac44:636f]) by PUZPR06MB5676.apcprd06.prod.outlook.com ([fe80::a00b:f422:ac44:636f%6]) with mapi id 15.20.7807.026; Tue, 30 Jul 2024 07:58:29 +0000 From: Huan Yang <link@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>, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Huan Yang <link@vivo.com> Subject: [PATCH v2 5/5] dma-buf: heaps: configurable async read gather limit Date: Tue, 30 Jul 2024 15:57:49 +0800 Message-ID: <20240730075755.10941-6-link@vivo.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240730075755.10941-1-link@vivo.com> References: <20240730075755.10941-1-link@vivo.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PUZPR06MB5676.apcprd06.prod.outlook.com (2603:1096:301:f8::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PUZPR06MB5676:EE_|SI2PR06MB5386:EE_ X-MS-Office365-Filtering-Correlation-Id: 99971946-0b0a-4192-4e2b-08dcb06d6652 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|1800799024|52116014|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: kqaTSyl0nuEklRGXrlP6kU9dvC8CrjW13PytQsT3RiGLtmBXfrTROZAvgF/8L9sMyvARcVpm25NcGgcqMnnTP87gtsuSD86DOL52pQM9V89Lx/YE9LeTdc5vw2joHuOekp9kp0VTOpKYtbclcSToLjZzG49cb35mBfflywL1pec4g1BH95tKZ31/AgwWt4H+RLnBV8ZX6VX8E4gYyTlex/waVjzS1gWZ9TG0tIFI5f7f9rkcQlxsBG/rnw8a1pDpM+ee8GpBglzZUYqu+H0edxV8WN2h0p7L821n0YzPt7bXHGxrx4rlzQ+TOL/apfoJ3Uju2SmhBrPx1wG+0YQQ2L4MEF3q8etDWAD6Pf/zX8wWtyr6LXE0TjWqUeIIeKko0BTxPNh3K6u4HIQi9CLG5QkMq7uuyQ0EIMFkwA2h4rIRo+ykxiAAbRy02jfZglpciln3coPT8UaT4q5PTj5nTDJXJdD3ckUG84Yla0Erei1MLo0Ij531Lj4elmxdQbJdxHto2C4Ii4zxyNMsJ2rVM6hcaBoZNp2MoAYSLo5T8YpDzzOIa+tX9bglA1moqDHsTpuGxJg5OWqUWxP707CQ/Ff4kWlsVZjOUA2z/vYqmiu+mLEtQjEHjzh3z9BRj6/EYK3qYQH+xIySPFUiDI/iBJd7u2JhuOSuH9xpQQHnm0vB+lVkCJxR18Tymdwqel0wTWj4giwcDWaaqtKsaLyvlVcbKgDcFjCxxXG6TDYlIF3edRK0vmiHtDk+LcYKOSvAFZd//Gyym3NghXSjciiTKj6UXN2uQTCZ6xL9H/9XnTjadTFirORAMWiVc+HZ87/yK5X5dTODH0Qqsn3lZU9P58b/4l4FyA0HYEo8TLfM/f2ytF5AtN8XRZaYldZX5J3wejSDL1PQ2/yb3Coc+qtPCqsg9p2XRY6EX0xD2zGjrxaTSZzImU+K4xt8ksGMC77Ye9f3RBqws4sVmkZWGghfe2S5Cg2H2DdkqUtpdD4LPT9koltHsthxL/lKewrJG3nXRiB8ruha+RRkT7qEXxlW/yyMr4pif/IXgFzSE7vVqiCwxkL8avxbSOZ7LgpHkk9MVTwu1UIAIlJlLGg6MliOjCXbf21wKMhV2MB+qJsxz9bi6GrtSKTsLHCCVY6OxHnHvK4jx0uZtlCJz7EUktqJEscAPhtxf57ont6sB9y7CU7TNl4Z9px5ABx7jrvsR9D+jM7p11ZMMvDlsyN6YMajIFsFT4nQgKsekfTtE0lUcNu5DYqhBD3Qnn7Crb1AR5jDkXyIG1RJvyWDTmgm/gMiSgqnuB35x8OPR+YrPgrnE201Dk++P5XaML8ytba2gmul4uVd8oStPwuD8xt/pzwzN0U5sivEzMCR+hlJ21/SqqZKm5LJ+VDo1+5JKOkqYLCpI8oc6X+o9KFtfSyGsve842q4V2A1l8R+BnypV7leHr0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PUZPR06MB5676.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(1800799024)(52116014)(366016)(38350700014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fZqK6JJojZC9m15E9DrjVKd37EPpsoTZyk8yLyqMyq0/eYI3e+qiFCKNOrJGSAEJ5jpDBp5VP1f+OXIktT/RAy2SLXdnyG+4lnrEyToiuidh/UV/3PnpZpjz8mEx0VsCEGtLOOluo7WzcB+KhpM1zO2DueJiSnXDxVXXtoCWAO6wvVg0UY7RFV2oaxt2ND1FwFoHO/+YlV4yE4LAwmm2lAwRFJ/MA9ajA1ovcaAyVQftuogc7TNsYqbnx/65zkAVno5/SKGB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QNrQasLziaS0cVyRCslJbyggYoHLkKoehpyiDV816XBvaPJsvJcwKOv1QDRR8R4vVqOsDfhHti6jLV/DUgHyeLAAxqWfXmsXHJ/ayggNdBzrVIumTUqFaDXmWnsFOgdlrIYQprS7G0t7/KzoHUc9ezlKmzR8CShWDmrw1MQMVP2y+5ZSt0MMdfPaW4lljsy2RAMBFvkMxIDhAycJ3dDjVyyVSwBzNIf9GmrlaZC4hFPOMciH2/5ni7yDn0hpI X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99971946-0b0a-4192-4e2b-08dcb06d6652 X-MS-Exchange-CrossTenant-AuthSource: PUZPR06MB5676.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 07:58:29.5867 (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: 4CWGcnBzisIgCBGkZCAx3UWENPTN3tDJ2J4o0x2JGfS16XFkaKq0LMR/hkTiO2VsN117nOGTEzKXdrodMvDOEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB5386 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> |
Series |
Introduce DMA_HEAP_ALLOC_AND_READ_FILE heap flag
|
expand
|
diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index df1b2518f126..2b69cf3ca570 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c @@ -417,6 +417,11 @@ size_t dma_heap_file_size(struct dma_heap_file *heap_file) return heap_file->fsize; } +#define DEFAULT_DMA_BUF_HEAPS_GATHER_LIMIT (128 << 20) +static int dma_buf_heaps_gather_limit = DEFAULT_DMA_BUF_HEAPS_GATHER_LIMIT; +module_param_named(gather_limit, dma_buf_heaps_gather_limit, int, 0644); +MODULE_PARM_DESC(gather_limit, "Asynchronous file reading, with a maximum limit on the amount to be gathered"); + static int init_dma_heap_file(struct dma_heap_file *heap_file, int file_fd) { struct file *file; @@ -442,9 +447,8 @@ static int init_dma_heap_file(struct dma_heap_file *heap_file, int file_fd) } heap_file->file = file; -#define DEFAULT_DMA_BUF_HEAPS_GATHER_LIMIT (128 << 20) heap_file->glimit = min_t(size_t, PAGE_ALIGN(fsz), - DEFAULT_DMA_BUF_HEAPS_GATHER_LIMIT); + PAGE_ALIGN(dma_buf_heaps_gather_limit)); heap_file->fsize = fsz; heap_file->direct = file->f_flags & O_DIRECT;
The current limit default is 128MB, which is a good experience value for I/O reading. However, system administrators should be given a considerable degree of freedom to adjust based on the system's situation. This patch exports the limit to the corresponding area of the dma-heap. Signed-off-by: Huan Yang <link@vivo.com> --- drivers/dma-buf/dma-heap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)