From patchwork Tue Jan 17 08:25:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaewon Kim X-Patchwork-Id: 13104305 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 472C7C63797 for ; Tue, 17 Jan 2023 08:25:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ADAEC6B0071; Tue, 17 Jan 2023 03:25:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A8AF76B0074; Tue, 17 Jan 2023 03:25:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 95F1A6B0071; Tue, 17 Jan 2023 03:25:29 -0500 (EST) 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 872636B0071 for ; Tue, 17 Jan 2023 03:25:29 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 563A71603B7 for ; Tue, 17 Jan 2023 08:25:29 +0000 (UTC) X-FDA: 80363606778.11.B7A1FEE Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by imf05.hostedemail.com (Postfix) with ESMTP id 9A223100002 for ; Tue, 17 Jan 2023 08:25:25 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=WLWLceJJ; spf=pass (imf05.hostedemail.com: domain of jaewon31.kim@samsung.com designates 203.254.224.33 as permitted sender) smtp.mailfrom=jaewon31.kim@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673943926; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:references:dkim-signature; bh=8NAQJBZpr5N/v+b0k3lefIIF8pKLozgny3VDnBKSN3E=; b=YsACsxNpDPJRJzWkq9w6iYse0sCVgHAE8ENbplSMNO5PdXyAfMYmg1/Borqo4N1zavVm9Y vjuf/NBvITuyPmHJxTsFCnJyYzosB5xuz4MwNqoGzp7S+oecpzzfj1BF0PIf/T2jmrMgzQ 0kd01L2LHtv20vbYMTv4hgWHpz0inJs= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=WLWLceJJ; spf=pass (imf05.hostedemail.com: domain of jaewon31.kim@samsung.com designates 203.254.224.33 as permitted sender) smtp.mailfrom=jaewon31.kim@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673943926; a=rsa-sha256; cv=none; b=qtsTR2/XyaGIiTfNkdxccVVirFnrj7FaO9F0fqOOWO5lw4Pvm2/rMNI1a6CZ+eqwXXa5Ja Yro2nrr0zqTxgLk6v/T7QfgfnkVaC2hwmJHMZ6c2Q1KKP5GuDmVfzyQjLlQx5Cw+tpQyOW TAfgjN2P8LBeaV35q6OLnRiXuGn6UWA= Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20230117082522epoutp03e71f03f8ed120ef7dd70f549d0625f9f~7CyDVyQ7v2079820798epoutp03M for ; Tue, 17 Jan 2023 08:25:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20230117082522epoutp03e71f03f8ed120ef7dd70f549d0625f9f~7CyDVyQ7v2079820798epoutp03M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1673943922; bh=8NAQJBZpr5N/v+b0k3lefIIF8pKLozgny3VDnBKSN3E=; h=From:To:Cc:Subject:Date:References:From; b=WLWLceJJne/xaDrIO6VRxWUYp2k0BY7+Y7QaMkOlIrFPhyhy2AJU49avimv5FWdCc 08WKltCuIsnmVwxByUMQZ2nmB14dt1IeQor5cfwO6GzH6kYwmQOuumny0rXCEO0kRi deYgPfo3t2cPFfPBtOY0uLoyZchS0evRwwR4DfN4= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20230117082521epcas1p4b6ed10bf4e8b211c80f512fc2dfce74e~7CyDBzAc00969309693epcas1p49; Tue, 17 Jan 2023 08:25:21 +0000 (GMT) Received: from epsmges1p1.samsung.com (unknown [182.195.38.241]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Nx25F57N3z4x9Py; Tue, 17 Jan 2023 08:25:21 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 20.E4.19973.17B56C36; Tue, 17 Jan 2023 17:25:21 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230117082521epcas1p22a709521a9e6d2346d06ac220786560d~7CyCnJgtd1754817548epcas1p2F; Tue, 17 Jan 2023 08:25:21 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230117082521epsmtrp1fdb2f962ef9dbf01c6c4b84c45052f13~7CyCmV1v62182621826epsmtrp1h; Tue, 17 Jan 2023 08:25:21 +0000 (GMT) X-AuditID: b6c32a35-21ffd70000014e05-cc-63c65b7186fb Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 75.90.02211.17B56C36; Tue, 17 Jan 2023 17:25:21 +0900 (KST) Received: from jaewon-linux.10.32.193.11 (unknown [10.253.100.104]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230117082521epsmtip170e7972f03d43bb85bc10272625ef386~7CyCaUakw1543715437epsmtip1G; Tue, 17 Jan 2023 08:25:21 +0000 (GMT) From: Jaewon Kim To: john.stultz@linaro.org, sumit.semwal@linaro.org, daniel.vetter@ffwll.ch, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com, Jaewon Kim Subject: [PATCH] dma-buf: system_heap: avoid reclaim for order 4 Date: Tue, 17 Jan 2023 17:25:08 +0900 Message-Id: <20230117082508.8953-1-jaewon31.kim@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrIKsWRmVeSWpSXmKPExsWy7bCmvm5h9LFkg+83NSzmrF/DZrHw4V1m i9WbfC26N89ktOh9/4rJ4sxvXYvLu+awWdxb85/V4vW3ZcwWp+5+Znfg8jj85j2zx95vC1g8 ds66y+6xaVUnm8emT5PYPe5c28PmcWLGbxaPvi2rGD0+b5IL4IzKtslITUxJLVJIzUvOT8nM S7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLxCdB1y8wBulNJoSwxpxQoFJBYXKykb2dTlF9a kqqQkV9cYquUWpCSU2BWoFecmFtcmpeul5daYmVoYGBkClSYkJ2xausmloKJ3BUPvnxhbmBc wdnFyMkhIWAicWBhA2sXIxeHkMAORom7b49AOZ8YJT7e+8sE4XxjlPgy+zAjTMvC/9+hqvYy SrxZ/wqq6gejxPQ/u1lAqtgEtCXeL5gEViUi0M8o8eLLNiaQBLNAqcTbNyeYQWxhAQeJKZ9P AxVxcLAIqEp0PigFCfMK2Ehc2rOAFWKbvMTqDQeYQeZICNxjl+javZoNIuEisXLlBWYIW1ji 1fEt7BC2lMTL/jYou1yi8fI0qJoKid4th6CGGkv09oD0cgDdoymxfpc+RFhRYufvuYwQZ/JJ vPvaA3aahACvREebEESJm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pTgYFYS4fXbdThZiDclsbIqtSg/vqg0J7X4 EKM0B4uSOO+FrpPxQgLpiSWp2ampBalFMFkmDk6pBiavhbn/5i5QvM73LkfN233y2lQhvpTX 2XFOFxXKpwbf1wqa7sb49t6jhomfDgn7q65Icv7y9W217HHHQg3dFpvEOa228yJ3/Yu7Kmx+ gWOTzYknbKWrewW+irzZFbfu8dvzTOl/6oI3u1av8crcJSxXZCP8UJNpketjV6NzQauc7jIY rFs5LWvW1SyDnXU+fCxZ/0IS/ba42BiEK6foS0lO+d5SpL1JOExv++3ieWx19i9ePpvplPJo rr4C58YFX6Y2sB2TO7dxqqLoXRVTuT8a+RrHbpUVRtZ/mf8x+VjL9jkBiyzsVNPCBAw2+Fqo Cgi+ONmv5TePKy/A4eGJh4+Odwo8/3R51ib5JQX6UkosxRmJhlrMRcWJAANtHBeyAgAA X-CMS-MailID: 20230117082521epcas1p22a709521a9e6d2346d06ac220786560d X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230117082521epcas1p22a709521a9e6d2346d06ac220786560d References: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 9A223100002 X-Stat-Signature: gft55xigxtm7s77pnz6wqisn4saejmd5 X-Rspam-User: X-HE-Tag: 1673943925-315470 X-HE-Meta: U2FsdGVkX1/BzZFTBPjNaCkYixEH6PUj1C9fklCrK/+B2TUG5X9fpqC+XOYh9U7ozMDPyx8+YyvKm4heNNYM/jIvX/7LdgWBzOGNymWVrOr7S82LuQ2bRFkEMxrp7sy9Oh602T6xYZi2lZ6mysQHh4aPJJWPYqd8vSg3HvbDGJVrkfO7yqCKP+/Zepdpj8wbh4nom1hGZFTUPzIVGVYOfsjuamoJGzZs3L8v+KLFGfQ3EYdBul92a1C//il32mifgkjx5AGxC7jLFKENdX5MSDBYpnCHhYG9bUAOrnqgidc9H1BDCvay+1g+MGo+zMv4ppQdYVz2oKM7Vas0sKqUX8oTh9ShsrW8jo28kv3DOBEsONtY6EMFk7gfrJIw9PFCbYyoYzYBXj60Rgc42BQWTQTHYkGCwqbbCpm0nPwuAkC8bGkzDzM79W2iYZTdKK3/nh8B0c3mZ+c3al8MNIW7AystLTle9irCXOP/9rR7yNTeWml34niXPW7xHUsztjlBmMoRxaXJYwTBokzNusZ2iPvJYXC831i2bWdqPKT88oHGIHd+UZO0mJE3iDKvdTjVenro3hSn0aHdjCyafpw0TLtt4mJtYkYaB2mjRvB52a/3TWW9Kw930q9rsa7HsL98yTGgYcGwU8iYXgzQKrWX6AdvBFqs6ZGmCalcMJIEO2RvciAXazT0rQ1evyh/2q5o3aEaZPbDPc/5CWIuQddxsvooqAAgzj8aJ8mumFLgXfEQX7CpVK/Kxsk2jwHepxpUR0HKd9rpLYvCR4gvcidd4t0h1jklR+gSflMs6zrFO95roFVxvHftv1q+DJLplrfRVTT8JWOqoDROxdUsFRDotNdaWBxDSr2a7g9vy0nlWsKpSzHthw9sYGE6jw0vMdVg8Q7wXR3B0iLfCSwridgLbcy165jfqUmz+czWQYw5Qy/Bm+7igUhCvzMiElHR+845IrwpLRXXQ7+l+2lOF+H b+yY2czj uFRw8NKjvpVot0baCYCeZWiDondzRPwjs6N7Cr9PkMK/gwst9IAlWJQGS+um+9AgxX2kqCvjqqc8mdyi4SwQoD5exgdvuS8FyXlm3hURD0hOAXMsPF9DkAvmdv2lcKY+Ym0rwIT3jsozZT+ZwoOM8oUnaBFw8MkHRsGYteq8j7c6/0hE= 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: Using order 4 pages would be helpful for many IOMMUs, but it could spend quite much time in page allocation perspective. The order 4 allocation with __GFP_RECLAIM may spend much time in reclaim and compation logic. __GFP_NORETRY also may affect. These cause unpredictable delay. To get reasonable allocation speed from dma-buf system heap, use HIGH_ORDER_GFP for order 4 to avoid reclaim. Signed-off-by: Jaewon Kim --- drivers/dma-buf/heaps/system_heap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index e8bd10e60998..5a405e99ef1e 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -42,11 +42,10 @@ struct dma_heap_attachment { }; #define LOW_ORDER_GFP (GFP_HIGHUSER | __GFP_ZERO | __GFP_COMP) -#define MID_ORDER_GFP (LOW_ORDER_GFP | __GFP_NOWARN) #define HIGH_ORDER_GFP (((GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN \ | __GFP_NORETRY) & ~__GFP_RECLAIM) \ | __GFP_COMP) -static gfp_t order_flags[] = {HIGH_ORDER_GFP, MID_ORDER_GFP, LOW_ORDER_GFP}; +static gfp_t order_flags[] = {HIGH_ORDER_GFP, HIGH_ORDER_GFP, LOW_ORDER_GFP}; /* * The selection of the orders used for allocation (1MB, 64K, 4K) is designed * to match with the sizes often found in IOMMUs. Using order 4 pages instead