From patchwork Mon Dec 12 11:53:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9470521 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F51760760 for ; Mon, 12 Dec 2016 11:54:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 432A8283C2 for ; Mon, 12 Dec 2016 11:54:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3753128477; Mon, 12 Dec 2016 11:54:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EDE14283C2 for ; Mon, 12 Dec 2016 11:54:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E3C26E2CC; Mon, 12 Dec 2016 11:54:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 927C56E2C5; Mon, 12 Dec 2016 11:53:58 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id g23so10768955wme.1; Mon, 12 Dec 2016 03:53:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=iWcBQqLP80diHODHe/ijV3m/o3HivDJDL1/o8mMbnRE=; b=I8eckhC/IbEe7ZnqELRKF1djqrdg3FLXgRYZwOzO+7c80t1r7w2nva6msbATJqiyEj t7RR8PeuErRm/2Dbyk4CYIJd1MVBrtJUtPfW/I9guy8x+rHid3rvYpW3VFzqtzbq19Gq VFJUmt0h93eH3nJjmVbjrRMoJ78rDQPJtG9FQo3cEJA98OLSSgPU9oxJYSUvKbj/UkBB m4LtEh95Ch6WhCcqVUoFyEK7OfPjfS7DLrzU+YiNx6WHLpGoG0K2asW1hCI9aSi6YP6Y M5nLDyIQSTt60DHKOaI6nE+MsE8th59nQqPuSNDaOw5gG864LotIn/LiOVnLLTxg3P+A U8Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=iWcBQqLP80diHODHe/ijV3m/o3HivDJDL1/o8mMbnRE=; b=CB570kIE/ZsOFSlLcBZdTmmpkB+b036unBAGUkpYKCKLOy5TKPlgC8iymWtCFaQp0G gBqjiRJmTkcpHIslR/aakl5wp2ScQ7VaUZsNv4I66VqGvsvvm06swxuGOv62uH20oOV5 1F7FUYRKdnHvK/dMntXkiNkm6tuf8AC1B43oeM05MI4qzW7BtojlPb6p2LLxKMspmNXw FOYQDr98wY3LiZVJCm8lYTO5JikEswlt2VfiRTiSZuC9SvQd7yKYQFpyzL2XfqepQz+H 9Q4gXV7Pht15eqPDbpvmwmK0PYhKfMBJxeo2Hipqx/KZX9rNtcIq4sN/OVONrCUeTTKH 3X0g== X-Gm-Message-State: AKaTC02opIzATnM2Nl+wr+tDzHXr0YU78SnYwoBs9PjuDFRdmTyOEo4wBQiTvJFOQRN23Q== X-Received: by 10.28.68.137 with SMTP id r131mr8622530wma.72.1481543636632; Mon, 12 Dec 2016 03:53:56 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id u81sm35077381wmu.10.2016.12.12.03.53.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2016 03:53:55 -0800 (PST) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH 01/34] drm/i915: Use the MRU stack search after evicting Date: Mon, 12 Dec 2016 11:53:17 +0000 Message-Id: <20161212115350.780-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161212115350.780-1-chris@chris-wilson.co.uk> References: <20161212115350.780-1-chris@chris-wilson.co.uk> Cc: intel-gfx@lists.freedesktop.org, joonas.lahtinen@linux.intel.com 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When we evict from the GTT to make room for an object, the hole we create is put onto the MRU stack inside the drm_mm range manager. On the next search pass, we can speed up a PIN_HIGH allocation by referencing that stack for the new hole. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_vma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index 37c3eebe8316..ca62a3371d94 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c @@ -442,8 +442,10 @@ i915_vma_insert(struct i915_vma *vma, u64 size, u64 alignment, u64 flags) obj->cache_level, start, end, flags); - if (ret == 0) + if (ret == 0) { + search_flag = DRM_MM_SEARCH_DEFAULT; goto search_free; + } goto err_unpin; }