From patchwork Mon Jun 8 15:15:50 2020 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: 11593641 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9016590 for ; Mon, 8 Jun 2020 16:36:45 +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 6D8B62053B for ; Mon, 8 Jun 2020 16:36:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hjTuyL/P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D8B62053B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 359B46E0A8; Mon, 8 Jun 2020 16:36:44 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by gabe.freedesktop.org (Postfix) with ESMTPS id B72136E95F; Mon, 8 Jun 2020 15:15:53 +0000 (UTC) Received: by mail-ej1-x642.google.com with SMTP id mb16so18752966ejb.4; Mon, 08 Jun 2020 08:15:53 -0700 (PDT) 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=jAc4+hPYb1yY730wa2bXInss6UylBdL9J1Kdgm1oOfk=; b=hjTuyL/PgSoZK2Url0WaKnYb6GmbIn2RIhgSS7jvChha9QNWnnXoJ0oFwSiV7NUMnx p5mjOdbHGGI/nDWLdAU0WVo0e3fH7gycwuWL3RRImSVchYPL9d6TSbAum2hkiX8k4Vyh XLIl3z4old+lLGVwzYDqZXlT4qKVolO1ua2m014BbeA0kI50gnZdmpP57zNAMc8/X3WB tdrHVl75c3xoWUgN79meoAcEPKkEXWDdGFy/aWKRwKe+tVLT/QmW+5Hn+ngPIXNGKjpt 1DGN44+UVS6OS8VOXM0P3hBDTdczSbJ3Qduc2cyaJuK/ucK+a8dJUu0wDurt0ZoU5Kjn VZdQ== 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=jAc4+hPYb1yY730wa2bXInss6UylBdL9J1Kdgm1oOfk=; b=rE8zFOvGGxt8QRVB8kR+ftIvqbKKPENFSx4Vg6/CnELKdHT1SRqChI9KftJeYNMAGz FcJcdQT8bV02tkQjatklqZUTM5achubYnZWEah37l/6nVlKatnPg4X3nkne46lBwB4r+ gZDIe3bYe0qPihxVINjUnrgvBh0f26d6L0+DVWKM+un+pEOAlifAL/86O7LzPoZ5cxKT xR/peROA+X5RGnnBAuobGgbQ2gHlaySxQLDorDFpdFvL772nL4sb1T60lHIadCzX3GK+ 3cb0qhQrqoClosKHGufBgfx2Mg1IX73IfwusEkecgZtoVteGN3CbWzypRiMhcl/AtZLv AKDg== X-Gm-Message-State: AOAM533d8H+SqzaUMnCdw8Iurdk8+cNbKXqQdx/8GtltP+3zPwYyYAcE P8z+U/F2SKBN46mDzr38E7reHHd5 X-Google-Smtp-Source: ABdhPJyMgbpLKlGyZhUI8z/ZAW3nkU1ZZ8mPJQBF2TtWEoNOt4SJ9ZnPmL4KRhcwAvfx4miWcR8ccw== X-Received: by 2002:a17:906:1088:: with SMTP id u8mr14841998eju.428.1591629352330; Mon, 08 Jun 2020 08:15:52 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:4c1d:b395:5a4b:a43d]) by smtp.gmail.com with ESMTPSA id cb6sm12713347edb.18.2020.06.08.08.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 08:15:51 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: nirmoy.das@amd.com, intel-gfx@lists.freedesktop.org, chris@chris-wilson.co.uk, dri-devel@lists.freedesktop.org Date: Mon, 8 Jun 2020 17:15:50 +0200 Message-Id: <20200608151550.1315-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 08 Jun 2020 16:36:42 +0000 Subject: [Intel-gfx] [PATCH] drm/mm: remove invalid entry based optimization X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" When the current entry is rejected as candidate for the search it does not mean that we can abort the subtree search. It is perfectly possible that only the alignment, but not the size is the reason for the rejection. Signed-off-by: Christian König Reviewed-by: Nirmoy Das --- drivers/gpu/drm/drm_mm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 60e9a9c91e9d..82d2888eb7fe 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -406,8 +406,7 @@ next_hole_high_addr(struct drm_mm_node *entry, u64 size) parent_rb_node = rb_parent(rb_node); left_node = rb_entry(left_rb_node, struct drm_mm_node, rb_hole_addr); - if ((left_node->subtree_max_hole < size || - HOLE_SIZE(entry) == entry->subtree_max_hole) && + if (left_node->subtree_max_hole < size && parent_rb_node && parent_rb_node->rb_left != rb_node) return rb_hole_addr_to_node(parent_rb_node); } @@ -446,8 +445,7 @@ next_hole_low_addr(struct drm_mm_node *entry, u64 size) parent_rb_node = rb_parent(rb_node); right_node = rb_entry(right_rb_node, struct drm_mm_node, rb_hole_addr); - if ((right_node->subtree_max_hole < size || - HOLE_SIZE(entry) == entry->subtree_max_hole) && + if (right_node->subtree_max_hole < size && parent_rb_node && parent_rb_node->rb_right != rb_node) return rb_hole_addr_to_node(parent_rb_node); }