From patchwork Tue Aug 21 09:29:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nayan Deshmukh X-Patchwork-Id: 10571279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B57C1390 for ; Tue, 21 Aug 2018 09:30:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D17229C4A for ; Tue, 21 Aug 2018 09:30:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3131D29CA0; Tue, 21 Aug 2018 09:30:36 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 E526A29C4A for ; Tue, 21 Aug 2018 09:30:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE0CF6E2ED; Tue, 21 Aug 2018 09:30:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E3316E2EB for ; Tue, 21 Aug 2018 09:30:31 +0000 (UTC) Received: by mail-pf1-x442.google.com with SMTP id d4-v6so8233373pfn.0 for ; Tue, 21 Aug 2018 02:30:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kgAgOUpqbCF/NRQDxO3nPfA1Om5cQ9f+ZV5JeI2iB28=; b=qujLdbcyNP/1HSVUHTbqPpdHwjiB9+P3q5AFHxQHvoHiqNgZfYRE/Yd8oe08GrXBeS BI9quicEs1l0WjgitpdODmr8xbrRAO5qh0gqVuGXy1JezL6Nr0dAoEZ3WelTHSFtvW6R 3SlV0of858e7SZbTmTjdbThNz7QCk/lwz7VRzIuTmePsT9aIWEd3CLkB+gTww+dvwtzF FgevgpM4n6bJNLq8Y0cjSFm/MfX5EPs4BhsWIXt9KZar0rOnrguid7jyzXV5PSyk3VUH TH75TI6qWkSvBHA1/mKKToGmjmCpP0L3Yqp9W3Hcg+PBS9sRmPcEz5wo0vgIQYqIGcCs stAg== X-Gm-Message-State: APzg51ArEWlC5fQCn7snwPTNpifKSQzC2CqzYCEHztTo2bTv7aK3e678 DQ+Fk9Dripmpbc1u2VGt8E6trznZ X-Google-Smtp-Source: ANB0VdbomTDOtvr5Va/98E9bigZ8LFfCgQ5vBhdHGk5JRWx+zOAbAMOf8jvuDXZIMrVQ5KEc9gZS9g== X-Received: by 2002:a62:2483:: with SMTP id k3-v6mr1273804pfk.195.1534843830264; Tue, 21 Aug 2018 02:30:30 -0700 (PDT) Received: from localhost.localdomain ([47.247.45.10]) by smtp.gmail.com with ESMTPSA id e202-v6sm3279739pfh.16.2018.08.21.02.30.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Aug 2018 02:30:29 -0700 (PDT) From: Nayan Deshmukh To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/scheduler: avoid redundant shifting of the entity Date: Tue, 21 Aug 2018 14:59:59 +0530 Message-Id: <20180821092959.11733-1-nayan26deshmukh@gmail.com> X-Mailer: git-send-email 2.14.3 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nayan Deshmukh , christian.koenig@amd.com MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP do not remove entity from the rq if the current rq is from the least loaded scheduler. Signed-off-by: Nayan Deshmukh --- drivers/gpu/drm/scheduler/sched_entity.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c index 1416edb2642a..5cae6661ef2f 100644 --- a/drivers/gpu/drm/scheduler/sched_entity.c +++ b/drivers/gpu/drm/scheduler/sched_entity.c @@ -472,6 +472,9 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity) return; rq = drm_sched_entity_get_free_sched(entity); + if (rq == entity->rq) + return; + spin_lock(&entity->rq_lock); drm_sched_rq_remove_entity(entity->rq, entity); entity->rq = rq;