From patchwork Wed Jan 13 13:13:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12016781 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8867C433DB for ; Wed, 13 Jan 2021 13:13:50 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 84FFE23433 for ; Wed, 13 Jan 2021 13:13:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84FFE23433 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B1E456E983; Wed, 13 Jan 2021 13:13:49 +0000 (UTC) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by gabe.freedesktop.org (Postfix) with ESMTPS id 160236E983 for ; Wed, 13 Jan 2021 13:13:48 +0000 (UTC) Received: by mail-ej1-x629.google.com with SMTP id f4so2985186ejx.7 for ; Wed, 13 Jan 2021 05:13:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=zF3FdhzcKSer6OnbfatcnskPpVi9oPNG63TdEi7Fl2E=; b=TwUvmP5cflH8nLVRF6QzYKkcY2ALHZmZT5StBStxoRX5Wc4XmAGhT472MZ0jlAP369 BdRwtc/zwp34iG0elOTY4/AjU/mLOhJUht3U8fEpZscxN8poQGsCOaC2PzTn4EtEj4rH lf2CJM/vveVeq1Ass/Q6rU3P8EnupcaxZ6mfFbeGIxDDV433L5lDFzEUVLdyILcML7zy DfIQPQlOz7fu+oJN73U4ZZDVDFgYj9eLjNILkvaumEXupVhhW7iTz5IiETaLozoQDi32 24QA9tPHJvDmMuZaRs89qDbafq32f+L5ga4SR22/BlfTd1loaloa9cDJYU/dFbIFlzJU u7Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=zF3FdhzcKSer6OnbfatcnskPpVi9oPNG63TdEi7Fl2E=; b=gN3+E73sbodp8+9H9e3r2mRbUCQ8yLSWze6a/ohDWBILWAoewMQcDlDs0GhT2h1NWA Sj/O1ebnMiZFNo1m+aiJUJeqUZ3PtFJIadwyekSw+AYpRe7YR7Zb/CL5Ji15Wz8Peydw GP/LJ1VsdyCM8CpT2iuob5oigUHrSt9rLx5Fh21NBXmASEC+HYmH2WOMyaADe8OMPggA GGXMdCxC0f9yjBhbf5P4PgjkzRXjX1Rxfpnq/KX5P7qmu/md/HN4VYrTW5tuVQ4QwotZ aMvgRdMD1L2yHTYffbqu/W36xP4xpFJ3dlJpH+rU8FtBubr/EGyhUi4S8SRzes3O5IiA QUfg== X-Gm-Message-State: AOAM532Y00zjLtV2IOMPxN/mio6DbwA3DNn3AyG3xf9ZOYYqr9giBAXE /dz3qI8r/Iq3jwHKcNLygjV5V2OQeH0= X-Google-Smtp-Source: ABdhPJzS6dSGLGHYU5v5ma+s0gaWajA5+FBpiNdPvWloRYh5jzhlZ8NolNS6GN0a7jUvtlbWTT+uJA== X-Received: by 2002:a17:906:60c3:: with SMTP id f3mr1503172ejk.65.1610543626734; Wed, 13 Jan 2021 05:13:46 -0800 (PST) Received: from laptop.fritz.box ([2a02:908:1252:fb60:be8a:bd56:1f94:86e7]) by smtp.gmail.com with ESMTPSA id x16sm698044ejo.104.2021.01.13.05.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 05:13:33 -0800 (PST) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: hdegoede@redhat.com, ray.huang@amd.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/ttm: stop using GFP_TRANSHUGE_LIGHT Date: Wed, 13 Jan 2021 14:13:25 +0100 Message-Id: <20210113131325.223511-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The only flag we really need is __GFP_NOMEMALLOC, highmem depends on dma32 and moveable/compound should never be set in the first place. Signed-off-by: Christian König Reviewed-by: Daniel Vetter --- drivers/gpu/drm/ttm/ttm_pool.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index 8cd776adc592..11e0313db0ea 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -79,12 +79,13 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags, struct page *p; void *vaddr; - if (order) { - gfp_flags |= GFP_TRANSHUGE_LIGHT | __GFP_NORETRY | + /* Don't set the __GFP_COMP flag for higher order allocations. + * Mapping pages directly into an userspace process and calling + * put_page() on a TTM allocated page is illegal. + */ + if (order) + gfp_flags |= __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_KSWAPD_RECLAIM; - gfp_flags &= ~__GFP_MOVABLE; - gfp_flags &= ~__GFP_COMP; - } if (!pool->use_dma_alloc) { p = alloc_pages(gfp_flags, order);