From patchwork Wed Jul 8 18:16:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 6750491 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 20A9FC05AC for ; Wed, 8 Jul 2015 18:16:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4DDA720613 for ; Wed, 8 Jul 2015 18:16:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 007672061D for ; Wed, 8 Jul 2015 18:16:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5757C6EBBD; Wed, 8 Jul 2015 11:16:52 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-f176.google.com (mail-qk0-f176.google.com [209.85.220.176]) by gabe.freedesktop.org (Postfix) with ESMTPS id D88266EBBD for ; Wed, 8 Jul 2015 11:16:51 -0700 (PDT) Received: by qkhu186 with SMTP id u186so169339405qkh.0 for ; Wed, 08 Jul 2015 11:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=Qd6mCRzU3+CvsD6jVmdojcf+hBwQU7DWqyHVLGCKLCU=; b=bcHUmSKzMpIvy5rAMygOAcbJ7zmUbi/fWvjKCm6EdtjtscPzv/ErJ1kXk6MWkTvo8l jRD10TJ9euIRaCglB+aEuPrvWEjwACCfc6rGLtke4zuoNI8i9mGQfEk0zVExXclpx85l wU1iYC3PZANsWsCdHVI+OKnF8Oaq13cRmCklCcqVV9CQqzHWPsi3Xosc5MdyOE8emSg8 Fr9Mwz7AJ08mCtaDGmnuzngKcSPp0VpbF8TDG6RMzMzYfD006SUAP6L6nBYBjsv1B47u 9lnJyiRA0+AEPYfDWxy5JAhadnlFLexdpHbE9JOjOJofpVhon4lgur+W+R1y4A113cr2 TFkg== X-Received: by 10.140.89.164 with SMTP id v33mr17897778qgd.97.1436379410995; Wed, 08 Jul 2015 11:16:50 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id g33sm1903400qgg.4.2015.07.08.11.16.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jul 2015 11:16:50 -0700 (PDT) From: j.glisse@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/ttm: fix object deallocation to properly fill in the page pool. Date: Wed, 8 Jul 2015 14:16:36 -0400 Message-Id: <1436379397-7897-1-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Cc: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Thomas Hellstrom , Konrad Rzeszutek Wilk X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jérôme Glisse Current code never allowed the page pool to actualy fill in anyway. This fix it, so that we only start freeing page from the pool when we go over the pool size. Signed-off-by: Jérôme Glisse Reviewed-by: Mario Kleiner Tested-by: Michel Dänzer Cc: Thomas Hellstrom Cc: Konrad Rzeszutek Wilk Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index c96db43..0194a93 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -953,14 +953,8 @@ void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev) } else { pool->npages_free += count; list_splice(&ttm_dma->pages_list, &pool->free_list); - npages = count; - if (pool->npages_free > _manager->options.max_size) { + if (pool->npages_free > _manager->options.max_size) npages = pool->npages_free - _manager->options.max_size; - /* free at least NUM_PAGES_TO_ALLOC number of pages - * to reduce calls to set_memory_wb */ - if (npages < NUM_PAGES_TO_ALLOC) - npages = NUM_PAGES_TO_ALLOC; - } } spin_unlock_irqrestore(&pool->lock, irq_flags);