From patchwork Thu Jul 9 18:19:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 6758221 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 21C5D9F38C for ; Thu, 9 Jul 2015 18:19:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B9DF206AC for ; Thu, 9 Jul 2015 18:19:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4322820647 for ; Thu, 9 Jul 2015 18:19:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CAA516ED03; Thu, 9 Jul 2015 11:19:41 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-f41.google.com (mail-qg0-f41.google.com [209.85.192.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 760006ED04 for ; Thu, 9 Jul 2015 11:19:40 -0700 (PDT) Received: by qgeg89 with SMTP id g89so118966740qge.3 for ; Thu, 09 Jul 2015 11:19:39 -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=gzBb3lbtX+KRW0IdbBg0TsTEANfdKCl1fnimmfpor5c=; b=ta12vUy7vX+IeP3UEDtIWoIWMMtm6p8vVSLTojZGc4WYwje5APjLkUf4wop6Kbql1w AcHyFGnH+2Lr4P4yNOp1N1HR1Szc8fcgZnr1YxCIKrwj78nHNanPPfH/YTBJTMpkYosX 5/M9ff3jF+CD+kkXAfUkS1Ch0rn7guJEaVmCH8tEZIO8/ZygT/Kw3ES9D9f50O6jdtZf J82XRMBC4HbolJhXqdRdLPNL40uyoi44wEC4sqNdnF7hC4LN/A26d3ghgszPwPCuhNq3 a4exVr/LUy0us6dKv5woItGXjmQDRXdgmzlt1eyHCK8K3RqhKBdoIAiRk/1dTYMoLEJx bcpw== X-Received: by 10.140.235.71 with SMTP id g68mr27306148qhc.41.1436465979617; Thu, 09 Jul 2015 11:19:39 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id e63sm4098813qga.39.2015.07.09.11.19.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 11:19:38 -0700 (PDT) From: j.glisse@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/ttm: fix uncached page deallocation to properly fill page pool v3. Date: Thu, 9 Jul 2015 14:19:29 -0400 Message-Id: <1436465970-7262-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 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.4 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. Changed since v1: - Move the page batching optimization to its separate patch. Changed since v2: - Do not remove code part of the batching optimization with this patch. - Better commit message. Signed-off-by: Jérôme Glisse Reviewed-by: Mario Kleiner Reviewed-and-Tested-by: Michel Dänzer Reviewed-by: Konrad Rzeszutek Wilk Cc: Thomas Hellstrom Reviewed-by: Alex Deucher --- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index 3077f15..af23080 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -963,7 +963,6 @@ 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) { npages = pool->npages_free - _manager->options.max_size; /* free at least NUM_PAGES_TO_ALLOC number of pages