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 A1C21217F34; Thu, 12 Dec 2024 15:51:26 +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=1734018686; cv=none; b=FYjDZXhTMUN/p8EmV9X4l/KrTI9t4WGKnf8qpbX8IvlQHoWqzc5DUm3qr+b638KVC7eyEmzXi1Yy8oVlDPsBf9U9hT7QNbx7i6KGEu83smaKCV2Tz1XypcP+3JrmbIGfT0VtVEnQIyCJiBD98kbfnE3zC26GcqRkL/G7AwRQ3Qc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734018686; c=relaxed/simple; bh=iO8/4uM+46q2yPKilqqbfFFpgj5c99YMhb+ZuM7/PPA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VQnz8+gcnFagEVUtBEfvdcon5/bcbRowIA41dD9LRmZCwjd8dd5kOK2rHp6XvYSZ0VX48npMiD3TMiJllP8RY3IeqZfJh5U7Ud9n1gMPAJTPxCkEWoGyRvBtfKiPRqbpzUVhfR5g90hJ7fZvnotobCpqIjxMlOyfcA7vXWgSdEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=L78Rn9WT; 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="L78Rn9WT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E73CC4CECE; Thu, 12 Dec 2024 15:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1734018686; bh=iO8/4uM+46q2yPKilqqbfFFpgj5c99YMhb+ZuM7/PPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L78Rn9WTj9X7f7AmZ2LC1QxZN+GUCa/lUiREFKr2OdGPy80tZWOZdeFIm19df8/NQ Lj39GVrjnnO3eJgh9DV2GnSnOD98LZo9P/ruy0MIU7mygaFT85X6FCyuJpRsoVuOTT dpHGWY94NWW1cFe6JFewAJ/6m0Nsb05zS4k9GPf0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wander Lairson Costa , "Peter Zijlstra (Intel)" , Juri Lelli , Sasha Levin Subject: [PATCH 6.6 331/356] sched/deadline: Fix warning in migrate_enable for boosted tasks Date: Thu, 12 Dec 2024 16:00:50 +0100 Message-ID: <20241212144257.639344223@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212144244.601729511@linuxfoundation.org> References: <20241212144244.601729511@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wander Lairson Costa [ Upstream commit 0664e2c311b9fa43b33e3e81429cd0c2d7f9c638 ] When running the following command: while true; do stress-ng --cyclic 30 --timeout 30s --minimize --quiet done a warning is eventually triggered: WARNING: CPU: 43 PID: 2848 at kernel/sched/deadline.c:794 setup_new_dl_entity+0x13e/0x180 ... Call Trace: ? show_trace_log_lvl+0x1c4/0x2df ? enqueue_dl_entity+0x631/0x6e0 ? setup_new_dl_entity+0x13e/0x180 ? __warn+0x7e/0xd0 ? report_bug+0x11a/0x1a0 ? handle_bug+0x3c/0x70 ? exc_invalid_op+0x14/0x70 ? asm_exc_invalid_op+0x16/0x20 enqueue_dl_entity+0x631/0x6e0 enqueue_task_dl+0x7d/0x120 __do_set_cpus_allowed+0xe3/0x280 __set_cpus_allowed_ptr_locked+0x140/0x1d0 __set_cpus_allowed_ptr+0x54/0xa0 migrate_enable+0x7e/0x150 rt_spin_unlock+0x1c/0x90 group_send_sig_info+0xf7/0x1a0 ? kill_pid_info+0x1f/0x1d0 kill_pid_info+0x78/0x1d0 kill_proc_info+0x5b/0x110 __x64_sys_kill+0x93/0xc0 do_syscall_64+0x5c/0xf0 entry_SYSCALL_64_after_hwframe+0x6e/0x76 RIP: 0033:0x7f0dab31f92b This warning occurs because set_cpus_allowed dequeues and enqueues tasks with the ENQUEUE_RESTORE flag set. If the task is boosted, the warning is triggered. A boosted task already had its parameters set by rt_mutex_setprio, and a new call to setup_new_dl_entity is unnecessary, hence the WARN_ON call. Check if we are requeueing a boosted task and avoid calling setup_new_dl_entity if that's the case. Fixes: 295d6d5e3736 ("sched/deadline: Fix switching to -deadline") Signed-off-by: Wander Lairson Costa Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20240724142253.27145-2-wander@redhat.com Signed-off-by: Sasha Levin --- kernel/sched/deadline.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index aacd3bf9fa4e7..b9e99bc3b1cf2 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -1674,6 +1674,7 @@ enqueue_dl_entity(struct sched_dl_entity *dl_se, int flags) } else if (flags & ENQUEUE_REPLENISH) { replenish_dl_entity(dl_se); } else if ((flags & ENQUEUE_RESTORE) && + !is_dl_boosted(dl_se) && dl_time_before(dl_se->deadline, rq_clock(rq_of_dl_rq(dl_rq_of_se(dl_se))))) { setup_new_dl_entity(dl_se); -- 2.43.0