From patchwork Thu Sep 9 02:37:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 508329 Delivered-To: patches@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp1149979jai; Wed, 8 Sep 2021 19:37:45 -0700 (PDT) X-Received: by 2002:a62:ea0a:0:b0:412:444e:f602 with SMTP id t10-20020a62ea0a000000b00412444ef602mr799736pfh.85.1631155065394; Wed, 08 Sep 2021 19:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631155065; cv=none; d=google.com; s=arc-20160816; b=MlZUyM4CSGehnPK+yaszwtYBMZ7ZsrvXDi7VLwSm2SlSIcFl9NKZRGsRifK9gxl37M iMDonqh4k0ClkhmbvOIyTT1uX5CKFiac3y+4/k1S06sbbhSysK7h40E6VMBCXKk3wJNB 54JZAi24m7FSTakdPOq1dFl3IbrEPezv62ow9bsGZM2kUNL88q02QwMQIi32kRs7xBI5 sroyV2RRwJkiFDlKE+rgbNUFjjtVTsd4Fk+b9FhQ1+/YuQXHDzeiAQEiesB5ZwscYrrz RfaarX6csGiKPYLEl8Ty71WBgCMYWF3O1wyJyQbr2hUL50FqG9nXVa/F0kAC1pYRxm9R d5vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=K5YCXnOiX361RXst/Dj0kh5mfTvHw/XbbmDLBua51kU=; b=BseflHD17cCZ/8wxrb3wIBJTzczCI20VUdsVjpvb9Ou2iVSUDwWxvjGb1tMWLAUo07 6eUap6eLv8/TWr1l9Z8sTBA7FF/RiJ8ju7PsN9iauXxyJTDP7mqDGmiZYXv6g4+eu/TW bOZCLGl6OSUGg5HmeHLnHU/TGE0L0uDB/i6fqOwoqIuM1BlqrelsztOFmA5TF+xe20Jg CaXublhzdXIXRT461iiUhBH3A5EoTzjimiAYUiS0+z6+YdE2wF7WF9R6RsMG8VhjqH1c 8Djw/2icAAbX8xToxDZsZOv4khRnVlzM1SyuK+Es988mU6cYDHTD4nyGFJGRY9he9p9n rM8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JMMW46p0; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id l25sor304947pgt.24.2021.09.08.19.37.45 for (Google Transport Security); Wed, 08 Sep 2021 19:37:45 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JMMW46p0; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K5YCXnOiX361RXst/Dj0kh5mfTvHw/XbbmDLBua51kU=; b=JMMW46p0Yi2eqXRdlDn8FwI1MOm7uFUW6DSImYerI9dX1tYK2SO0GcNmaRQ/JHcFkM b4Y7d154QEgiSHzOAM7rZY2wU3AuhjqyMlwtAr/NZ8EY+dZTJjS0Wl5xZ6wwsLcYU6fL mOUWek4y0GmDzIoZQ1BkQZ6z+u8oVXLtki2zeYR+9MuN18RVqJV8svPagaL+AYahrAUL ebhFkHhRLKdSRvCU62zBFnd+gb/kDCrRgq4z04bZ4hIytA1HWjeomOnJoa02m1B7s3US D3pZB6XlvYPl1qdxlc+Tey4M1odRhMUJPct1zF42zOVcmGmnIOs+ESgnST2WcB0Cuewq GLZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K5YCXnOiX361RXst/Dj0kh5mfTvHw/XbbmDLBua51kU=; b=MysLWuqVAxXpQC9Nqnpsa0L3ZR10YLLJtcF1dkwj9OCNFqQogijkRw/QDeyQSsLBTF el0hA11i2KJ8myLcM8eOIBOxMMYytkn90RH05QA6OeVBIdQIkk15AD/Cye0RLCKoiWSx rUUbxD5lKIMv7qDX0kJWNvnLqLCsxGF0hND2BOJDfx5q87oFVUMRsDqv0czS9XL3dPPH hzHNrHPKew4CTx6O6S69djbjaY5qCDWn2L6k03RSyf/9FXBOtUGchncKur9X4CFSdyVu lrSQagsr00GN5/AQleF59Sa6WIAmQx+CpyJdfxgrRqXaHqid8j7dy/e74LAL3n0OKHoT /RSQ== X-Gm-Message-State: AOAM531I5olYGSjZEU7o/gKTZTTk7IqxsgazN0emP1f56Bnfi39HE1BO 2jSLP1cXjRUa3u1Q5A6kNQNTtQ8z X-Google-Smtp-Source: ABdhPJx67ZfUJQOS7EFxj4RJBf9z5uJTsHC3qufEA08FU6XaEQgSBIopVskMt5axXYtC+B/dT4IGZQ== X-Received: by 2002:a63:77cc:: with SMTP id s195mr528941pgc.147.1631155065095; Wed, 08 Sep 2021 19:37:45 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id n1sm206832pfv.209.2021.09.08.19.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 19:37:44 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Daniel Vetter , Christian Koenig , Sumit Semwal , Liam Mark , Chris Goldsworthy , Laura Abbott , Brian Starkey , Hridya Valsaraju , Suren Baghdasaryan , Sandeep Patil , Daniel Mentz , =?utf-8?q?=C3=98rjan_Eide?= , Robin Murphy , Simon Ser , James Jones , Leo Yan , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH] dma-buf: system_heap: Avoid warning on mid-order allocations Date: Thu, 9 Sep 2021 02:37:41 +0000 Message-Id: <20210909023741.2592429-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 When trying to do mid-order allocations, set __GFP_NOWARN to avoid warning messages if the allocation fails, as we will still fall back to single page allocatitions in that case. This is the similar to what we already do for large order allocations. Cc: Daniel Vetter Cc: Christian Koenig Cc: Sumit Semwal Cc: Liam Mark Cc: Chris Goldsworthy Cc: Laura Abbott Cc: Brian Starkey Cc: Hridya Valsaraju Cc: Suren Baghdasaryan Cc: Sandeep Patil Cc: Daniel Mentz Cc: Ørjan Eide Cc: Robin Murphy Cc: Simon Ser Cc: James Jones Cc: Leo Yan Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz --- drivers/dma-buf/heaps/system_heap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index 23a7e74ef966..f57a39ddd063 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -40,11 +40,12 @@ struct dma_heap_attachment { bool mapped; }; +#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) -#define LOW_ORDER_GFP (GFP_HIGHUSER | __GFP_ZERO | __GFP_COMP) -static gfp_t order_flags[] = {HIGH_ORDER_GFP, LOW_ORDER_GFP, LOW_ORDER_GFP}; +static gfp_t order_flags[] = {HIGH_ORDER_GFP, MID_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