Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4463328rwb; Tue, 17 Jan 2023 00:52:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXv6WrK6uKpyaAZ0MjfYajZgIfsgk6a/jdMVqjYhyJz7t57l4zs+fPq5VFf9Ogmktc+xkl1T X-Received: by 2002:a17:902:74c7:b0:194:6278:df6b with SMTP id f7-20020a17090274c700b001946278df6bmr1799123plt.18.1673945550461; Tue, 17 Jan 2023 00:52:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673945550; cv=none; d=google.com; s=arc-20160816; b=oLQzzcUiDftjr3rpj0n5AvC9U0X/4nm3O7tE8GcicKCGlUDC2GOIUENoBaeiblwupO uKknG7OO7K+T1u7fi0qi1/RCMW2Hyu8DF8gnwW+6U47kSjlrstf7d2rg87Qop7KosnnU r6/Sq9Kea4UlG+3OproS29ns31TLtFuxacDChGkt0oERntkK5Q7dJsoeaIoCDLl6ztFc GcWI7nSGVQO//US+0TZxx/YErd3BcXypTFIM+f0gSQ7Iowj3VtIWBjlYqu3ZxC3ZzFxg vlCYGzwbMj1tQwRQpJzBwyjJH49iOr6JPZE5wTuN0uY3XACfjrm4GIi7WcvDsysRmK7r AHKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=8NAQJBZpr5N/v+b0k3lefIIF8pKLozgny3VDnBKSN3E=; b=FPd9t8azti6wc5OIu1f0SSHk1PRLNoPDbBzf1s0LxZmPrjHoddAVVZuhYwWF7gYWZr A2ijdYULkOE50esDQzwMdL4bzMdVzrj/0gnxd3ylJjqMCHuQkVMiOUTeQ1k65SCzgMxt GPdQbqlcFAr4ZbXZVS1MRJyZzen9Z96nWRzl7zU8F15D6fEUZG3SfImJ6E7wcRPXztRp vRki2wkb87BkMsDMlQjAjLUgrIrMF1N/39swEcPK+a4ZT19qqC/VpKpX8ct4P79ewgeP P9quuwMvJM7Wzb+DGWiNSciEbo/w7JSrDCKYrVwGa4Wp2XIPbXhVhZn6QQC0sH3RmTYq I9nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=WLWLceJJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ix18-20020a170902f81200b0019471f1dee8si12370109plb.492.2023.01.17.00.52.24; Tue, 17 Jan 2023 00:52:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=WLWLceJJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236069AbjAQIZb (ORCPT + 49 others); Tue, 17 Jan 2023 03:25:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235983AbjAQIZZ (ORCPT ); Tue, 17 Jan 2023 03:25:25 -0500 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D030028877 for ; Tue, 17 Jan 2023 00:25:23 -0800 (PST) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20230117082522epoutp04e3b430851980023181a96a4d79debc70~7CyDe7yy91131511315epoutp04c for ; Tue, 17 Jan 2023 08:25:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20230117082522epoutp04e3b430851980023181a96a4d79debc70~7CyDe7yy91131511315epoutp04c 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 S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vjA3MK7g7GLk5JAQMJFY+P87axcjF4eQwG5GiY4/LSwQCRmJN+efAtkcQLaw xOHDxRA13xgl3j74yAhSwyagLfF+wSSwZhGB6YwSf2atYgVJMAtUSvy7fQvMFhZwkJjy+TQr yCAWAVWJzgelIGFeARuJS3sWsELskpdYveEA8wRGngWMDKsYJVMLinPTc4sNCwzzUsv1ihNz i0vz0vWS83M3MYLDUEtzB+P2VR/0DjEycTAeYpTgYFYS4fXbdThZiDclsbIqtSg/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 Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230117082521epcas1p22a709521a9e6d2346d06ac220786560d References: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.17.1