From patchwork Tue Aug 21 13:29:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nayan Deshmukh X-Patchwork-Id: 10571627 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 5958014E1 for ; Tue, 21 Aug 2018 13:29:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C97D2A27D for ; Tue, 21 Aug 2018 13:29:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EA302A290; Tue, 21 Aug 2018 13:29:43 +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 542382A28F for ; Tue, 21 Aug 2018 13:29:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E4B86E33A; Tue, 21 Aug 2018 13:29:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 843F46E33A for ; Tue, 21 Aug 2018 13:29:38 +0000 (UTC) Received: by mail-pf1-x444.google.com with SMTP id i26-v6so8495686pfo.12 for ; Tue, 21 Aug 2018 06:29:38 -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:in-reply-to :references; bh=uhhSLq92U2v0x9iiAdcD/SGQDIpgZjC3tX94wEHRnWw=; b=YR81SRMZjpZQs3dKNZhwzzEgm/mocJMASxGMqusINXvib2K0C5/yua7n2Tvmso1gHv FWyxDCqD6bsLIEZlVPTxHSlGkBw/hs7gstE0P/mndkMkMekTuS/WK67qLuajdm5C3wrm dRd2dNYms9xRPgqfDMr8wtvgh6QrJ84SS+uEunyP0GCLCxrhUG5b1hJL41FoGxU9qnNh 0yhsDopKmR4cpPrxxKDG8U29PjMXwDmBtgq216MFnljqpmhV0DTXloV8ytZ3cx7RCj3u 7MO6iqVBhmtuDFXhvxzzxGZQfgeed8iwwocvULTArtagAFyRxyfYXy+B9kJIr6A7XzR4 y+Cw== X-Gm-Message-State: AOUpUlG/uczNTpsPJk4ql1mJaIW0VgVjTB4FrPwlDXMo7tBsdOHmQg1n oZi3ea70OXsyfgh/hFA5npkXjZS7 X-Google-Smtp-Source: AA+uWPw9BisxYD4baMDn8tXZttluSQERcZqIhUkfxm+G3Wo1hfE1pqofxeQSsQ3A7uc9ZDtmeeZE0g== X-Received: by 2002:a63:181b:: with SMTP id y27-v6mr14931338pgl.48.1534858177926; Tue, 21 Aug 2018 06:29:37 -0700 (PDT) Received: from localhost.localdomain ([47.247.15.248]) by smtp.gmail.com with ESMTPSA id z63-v6sm407594pgd.69.2018.08.21.06.29.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Aug 2018 06:29:37 -0700 (PDT) From: Nayan Deshmukh To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/scheduler: avoid redundant shifting of the entity v2 Date: Tue, 21 Aug 2018 18:59:08 +0530 Message-Id: <20180821132908.12892-1-nayan26deshmukh@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: 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..a51c7654cc78 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;