Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2006730lqb; Mon, 27 May 2024 05:07:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkNxCEzuEiZYWiGA9fwXrqmxnkEb+avJUW6TULS+LdO+r+d8r1iDR4l3pRl8lnBbJ/kusCSOF3+Idf/VOeI3oQkPeG0eUryugfu+XMnQ== X-Google-Smtp-Source: AGHT+IFaBgGIN1dUaBb7AUoKuhpZYl5grqgHjfM6Bglf68SqjC+1znSZP98tzkIQmZi0qrKN5rQ4 X-Received: by 2002:a05:6a20:2d2c:b0:1af:d240:2c14 with SMTP id adf61e73a8af0-1b212d38ff4mr10186694637.6.1716811658744; Mon, 27 May 2024 05:07:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716811658; cv=pass; d=google.com; s=arc-20160816; b=w16VmIemDM3WBo4yKaC4PRhHq8zZUM5WgYkxxl6NWDR7upaBc/V78Boyc8d7LiWeQ+ 0QIhuzVNRcC8Hm+P0rBA3+ycib60fl/7+ayRH8Qr6gS0S/RuDTiEug8GUe4ZxpNeOKqG Doa8N1um0LxFWR+40ldPyNYyTM3Ojo/OtW/SmvmztjlKfxgOndKYGPlGIkRa1H/Zkmiu udBx6rDoBt36Z7dJHb4/CiJl5/V9cT8AT02KxBxrcbTbpTe/K7fOZwGs3WKBQ+xP96mL UscQCxCoq7X59UzSYEs+fX77G0IIjhBs/eJjVfJxe0elPbafVLzUqSWZSnUoquKxFW52 JEQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=atIFGwi0PF8bS9akR1RQMpARZDtsvYN9eL8ae5WznUU=; fh=e/gYlje3ZjThb5nrK8a3RO1fdr9DW2nHLk5fYGDEYRY=; b=unYicNfpgocu3VSMg2aOaLfkoScHxRE85gYJA3Zt+bMHtVMYIP2uLUy8VJt5aP8Y5Q D/EGLPZ/j9VRLEeAAPXwlEfCBsBNm4EnO0WdsnnJj68P3Y3ORgzuWaxpns+4JnErLgpY 4Ds9JsTQXbjt4nitOZwG0SkBnKSYMfuqsVMkR0ngOiOeRmJmVUGFq4I55qXU2zCSmI7c ncBqa9eLZISEke97rKZBtQT8Zzdqo/B32waRTlL/IByFgfHq0d0VFdn+XXaX5kUTuwA6 ylAY2pgroKukDKfgbN82iPuD2xdTsJ64zuJbt4FNGGAJ8cPB8UkYZImUs8P9u8ep0FPc e/Iw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k9VnWGgW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190529-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190529-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-68221b73a7asi6195767a12.86.2024.05.27.05.07.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 05:07:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190529-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k9VnWGgW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190529-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190529-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D3109282457 for ; Mon, 27 May 2024 12:07:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4262315E5CD; Mon, 27 May 2024 12:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k9VnWGgW" 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 699A01581E2; Mon, 27 May 2024 12:07:16 +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=1716811636; cv=none; b=Vouy6UgmRii9ZLZ7zYoDCi3hczwlChdUUBRj+4sO8yTnPT/+OaMMy/auZBrS12x52mJK0kq9hTkag3dgz1T6Xauj1f/Wd3yGmagvNHY44GpOpE7fNR8LD1+b7D7qopfwecKKUncNJZrwnCuN2etEu5Rrp5Md1m1+0bWxb5OsspA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716811636; c=relaxed/simple; bh=Ookat3BufN/8SoLPN/8zjg5igMrsT1mPcTpK30q2+rI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fpwi/fbCa4O5wECNjYarBmHpw6YyqYlqTBggc6bhuDdTSAm74NLNpia36pVB6UiLPXsxYssV9X1dqLMy5DsYwQ69E1BWr0PiYBcQNPpshyjgFViLT3pqF92OYSbRAdI+X5ou27YgQ5nsf2vc2FrGO4TQVsG6eGmuY+Ryohz/TTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k9VnWGgW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7117C2BBFC; Mon, 27 May 2024 12:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716811635; bh=Ookat3BufN/8SoLPN/8zjg5igMrsT1mPcTpK30q2+rI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k9VnWGgWWTY8G+2PkawIPuyuu2UyVWibAFyKgnv8bCkkMIGA8kQ8d+xMDKmmXqZqM 82td5g7I5/mf2EdLaOuUZxoN4O0LkZDrjmiEaJrsf9msf/wXAII/ssfsyRRidDpqt1 OIImIVeDlb5hOhsJeKMO5q/1MV9j8x1MFauUK5ihbSC7dLyhUy6HGUZBR6NirDjrVF MpE+rSWLy68Ai3D7bzRu2+HWVQsUAXxfUoSR+YG3LDz+T/Q5HbL97In0d+Xgc0v2Ic HmAq89JU7UD4NCfT8TLFImTXVfpJeG1jjasueLkcs0iyMupZ1+Tv9IQjWf0D8CT8jx y2wm5BaqWFHSw== From: Daniel Bristot de Oliveira To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot Cc: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, Luca Abeni , Tommaso Cucinotta , Thomas Gleixner , Joel Fernandes , Vineeth Pillai , Shuah Khan , bristot@kernel.org, Phil Auld , Suleiman Souhlal , Youssef Esmat , stable@vger.kernel.org Subject: [PATCH V7 2/9] sched/core: Add clearing of ->dl_server in put_prev_task_balance() Date: Mon, 27 May 2024 14:06:48 +0200 Message-ID: X-Mailer: git-send-email 2.45.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Joel Fernandes (Google)" Paths using put_prev_task_balance() need to do a pick shortly after. Make sure they also clear the ->dl_server on prev as a part of that. Cc: stable@vger.kernel.org Fixes: 63ba8422f876 ("sched/deadline: Introduce deadline servers") Signed-off-by: Joel Fernandes (Google) Signed-off-by: Daniel Bristot de Oliveira --- kernel/sched/core.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index bcf2c4cc0522..08c409457152 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6006,6 +6006,14 @@ static void put_prev_task_balance(struct rq *rq, struct task_struct *prev, #endif put_prev_task(rq, prev); + + /* + * We've updated @prev and no longer need the server link, clear it. + * Must be done before ->pick_next_task() because that can (re)set + * ->dl_server. + */ + if (prev->dl_server) + prev->dl_server = NULL; } /* @@ -6049,14 +6057,6 @@ __pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) restart: put_prev_task_balance(rq, prev, rf); - /* - * We've updated @prev and no longer need the server link, clear it. - * Must be done before ->pick_next_task() because that can (re)set - * ->dl_server. - */ - if (prev->dl_server) - prev->dl_server = NULL; - for_each_class(class) { p = class->pick_next_task(rq); if (p) -- 2.45.1