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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 77B30C4363D for ; Wed, 30 Sep 2020 22:18: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 2A617206F7 for ; Wed, 30 Sep 2020 22:18:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="SUmoFk35" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A617206F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C28516E833; Wed, 30 Sep 2020 22:18:49 +0000 (UTC) Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D7496E832; Wed, 30 Sep 2020 22:18:48 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 30 Sep 2020 15:17:56 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 30 Sep 2020 22:18:43 +0000 Received: from agoins-ThinkPad-P50.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Wed, 30 Sep 2020 22:18:42 +0000 From: Alex Goins To: =?UTF-8?q?Christian=20K=C3=B6nig?= Subject: [PATCH RFC 1/1] drm-ttm: Allocate transparent huge pages without clearing __GFP_COMP Date: Wed, 30 Sep 2020 17:18:21 -0500 Message-ID: <20200930221821.13719-2-agoins@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200930221821.13719-1-agoins@nvidia.com> References: <20200930221821.13719-1-agoins@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601504276; bh=5Tu6aSNA8HBdBowm9V8TF6LzLVpYCNdFVrzjEC+8uyI=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:X-NVConfidentiality: Content-Transfer-Encoding:Content-Type; b=SUmoFk353ArZEs2TTynjnuKaSUsMThqArnBLh/fr0z8TAddfcyRrJC4Y/WlLpm/ny NfHXFw6OKfaa0lECmiEOmicENmjmgV0puIe07CVrmcPaW7oJL6k5boAj86FWagJ91L JMp9c3DtpNEHTmRh9ALUfD3GEYpt+Wpm1Sla98bsH3F9yEKBfJ0KwbkIYAV/fGOOrf qI9xvYRbXxd81DE/Gbi7XM10LoKMDCvc4b6mUZXQ/QA/Y4Ljn5+n5Br5sft0I8xvs4 dtKBWSQcyL63VvGJEaNMRCiky5Z5IVxWF1uPnJ8/Qo8gKHQMt7BR0vEAjrr+j+vWa+ GALhFdvsQvCIg== X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Goins , John Hubbard , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, amd-gfx@lists.freedesktop.org, Zi Yan Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" TTM currently supports allocating pages with GFP_TRANSHUGE_LIGHT, but with the __GFP_COMP flag cleared. Instead of being normal transparent huge pages, these are multiorder non-compound pages that have the same order as THPs. This interferes with drivers that import DMA-BUFs / SGTs backed by pages from TTM, as they don't have the TTM-specific context to know how the pages were allocated. Change the TTM allocator so that it no longer clears the __GFP_COMP flag when allocating THPs. Signed-off-by: Alex Goins --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 5c8883d7f74a..e72789184398 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -920,7 +920,6 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, huge_flags |= GFP_TRANSHUGE_LIGHT | __GFP_NORETRY | __GFP_KSWAPD_RECLAIM; huge_flags &= ~__GFP_MOVABLE; - huge_flags &= ~__GFP_COMP; p = alloc_pages(huge_flags, HPAGE_PMD_ORDER); if (!p) break; @@ -1057,13 +1056,13 @@ int ttm_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages) ttm_page_pool_init_locked(&_manager->wc_pool_huge, (GFP_TRANSHUGE_LIGHT | __GFP_NORETRY | __GFP_KSWAPD_RECLAIM) & - ~(__GFP_MOVABLE | __GFP_COMP), + ~(__GFP_MOVABLE), "wc huge", order); ttm_page_pool_init_locked(&_manager->uc_pool_huge, (GFP_TRANSHUGE_LIGHT | __GFP_NORETRY | __GFP_KSWAPD_RECLAIM) & - ~(__GFP_MOVABLE | __GFP_COMP) + ~(__GFP_MOVABLE) , "uc huge", order); _manager->options.max_size = max_pages; -- 2.25.1 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx