From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 254952AF00 for ; Mon, 7 Oct 2024 17:47:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728323235; cv=none; b=YHcUdqxdEMS+yS/FlLEQebGX7hBuyaEMsmz4awkGpxUEdbrRptIXne/8nHSSZOUwEu7wOJEuWyoEJ5d/AI+e1pEeUw9rkxi7fH/5qdM8OY8mr2re18db3bFwAic4hHztxTUqydd0E2f8hKOuCdSaow2EksIF0ibUCOP3IqxBeuk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728323235; c=relaxed/simple; bh=ehaNtvtOyGOfSl/NGgbtFN7FUWG070D/vX8XD0PmurQ=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=tvN4VRwvAVkr/nE9PMiQG9FvE+GpRd/saN8fVyAgs1Wy8rHDcDK5lUQ3lkT6l4P9fBn4QgUCb6JhUdFqqLXDlL6DDsYj/HzoWa4JwMCOjEYNKiYiIcwTPIAmCvQhCDqjdQqdWCe/+O25cGPjKryD0te6rsNIbBC9mp8hMBfTSEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kquJLh4/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kquJLh4/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8767AC4CECC; Mon, 7 Oct 2024 17:47:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728323235; bh=ehaNtvtOyGOfSl/NGgbtFN7FUWG070D/vX8XD0PmurQ=; h=Subject:To:Cc:From:Date:From; b=kquJLh4/aguCHuZ/S+vZYFzWcFv2fFVG0exsZsq9mq4HNwDzKJ5UGU6V0vMamr//3 SV2A6PCGXqYiA8Q1g/axVbIeTP2520EJOZCzMlNMNvwPSYRMqrYWfpjCuw8wik/aoC u9zHAM0lh/MFB3td9R+Aj9+JKqYi41a0KRo8UgOk= Subject: FAILED: patch "[PATCH] drm/sched: Always increment correct scheduler score" failed to apply to 5.10-stable tree To: tvrtko.ursulin@igalia.com,airlied@gmail.com,christian.koenig@amd.com,daniel@ffwll.ch,ltuikov89@gmail.com,matthew.brost@intel.com,nirmoy.das@amd.com,nirmoy.das@intel.com,stable@vger.kernel.org Cc: From: Date: Mon, 07 Oct 2024 19:46:55 +0200 Message-ID: <2024100755-unedited-smuggler-ece7@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 087913e0ba2b3b9d7ccbafb2acf5dab9e35ae1d5 # git commit -s git send-email --to '' --in-reply-to '2024100755-unedited-smuggler-ece7@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: 087913e0ba2b ("drm/sched: Always increment correct scheduler score") cbc8764e29c2 ("drm/sched: Always wake up correct scheduler in drm_sched_entity_push_job") 440d52b370b0 ("drm/sched: Fix dynamic job-flow control race") f92a39ae4707 ("drm/sched: Partial revert of "Qualify drm_sched_wakeup() by drm_sched_entity_is_ready()"") a78422e9dff3 ("drm/sched: implement dynamic job-flow control") f3123c259000 ("drm/sched: Qualify drm_sched_wakeup() by drm_sched_entity_is_ready()") bc8d6a9df990 ("drm/sched: Don't disturb the entity when in RR-mode scheduling") f12af4c461fb ("drm/sched: Drop suffix from drm_sched_wakeup_if_can_queue") 35a4279d42db ("drm/sched: Rename drm_sched_run_job_queue_if_ready and clarify kerneldoc") 67dd1d8c9f65 ("drm/sched: Rename drm_sched_free_job_queue to be more descriptive") e608d9f7ac1a ("drm/sched: Move free worker re-queuing out of the if block") 7abbbe2694b3 ("drm/sched: Rename drm_sched_get_cleanup_job to be more descriptive") f7fe64ad0f22 ("drm/sched: Split free_job into own work item") a6149f039369 ("drm/sched: Convert drm scheduler to use a work queue rather than kthread") 35963cf2cd25 ("drm/sched: Add drm_sched_wqueue_* helpers") 0da611a87021 ("dma-buf: add dma_fence_timestamp helper") 56e449603f0a ("drm/sched: Convert the GPU scheduler to variable number of run-queues") b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI") 7b05a7c0c9ca ("drm/nouveau: get vmm via nouveau_cli_vmm()") e02238990b1a ("drm/nouveau: new VM_BIND uAPI interfaces") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 087913e0ba2b3b9d7ccbafb2acf5dab9e35ae1d5 Mon Sep 17 00:00:00 2001 From: Tvrtko Ursulin Date: Tue, 24 Sep 2024 11:19:09 +0100 Subject: [PATCH] drm/sched: Always increment correct scheduler score MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Entities run queue can change during drm_sched_entity_push_job() so make sure to update the score consistently. Signed-off-by: Tvrtko Ursulin Fixes: d41a39dda140 ("drm/scheduler: improve job distribution with multiple queues") Cc: Nirmoy Das Cc: Christian König Cc: Luben Tuikov Cc: Matthew Brost Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: # v5.9+ Reviewed-by: Christian König Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20240924101914.2713-4-tursulin@igalia.com Signed-off-by: Christian König diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c index a75eede8bf8d..b2cf3e0c1838 100644 --- a/drivers/gpu/drm/scheduler/sched_entity.c +++ b/drivers/gpu/drm/scheduler/sched_entity.c @@ -586,7 +586,6 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job) ktime_t submit_ts; trace_drm_sched_job(sched_job, entity); - atomic_inc(entity->rq->sched->score); WRITE_ONCE(entity->last_user, current->group_leader); /* @@ -614,6 +613,7 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job) rq = entity->rq; sched = rq->sched; + atomic_inc(sched->score); drm_sched_rq_add_entity(rq, entity); spin_unlock(&entity->rq_lock);