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 616C315C0 for ; Thu, 2 Jan 2025 22:33:08 +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=1735857188; cv=none; b=rZd52SpwgQP4x2WLOP/Flv91cy2pVxe+/bnf/xWPf8SzukXhgd4GA3GNyWP91OJvZKZT/0fLm8FrimbdFTE+ZnzI5wZ7/uir5J1eyXQoQEH3YvYpGXzlTUejBc3NkyBM/PSUKXLfEpxE7VodbnTik+FMkmFjpV9MJmySL1faxl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735857188; c=relaxed/simple; bh=odpyzopQO4acXvpWay35l0YQWbidMEkIP4d7U9jczUM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cuKMbtojnfEsEHkIsQzZNQsp3Y76CHBGN+/hhekTwmb1cUgRNwEGTNP2kIC66y62y9/q0B+NsA5FC1JPVHq7fpotkUnveoWaTO0ORALYiE2lKgehc8j8cfC/YsUQLYhd8MTUn32CHeFHqnwOHTNT+3ziil9iBVPryX/upFtb8/Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=klhIQz3K; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="klhIQz3K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C230DC4CED7; Thu, 2 Jan 2025 22:33:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735857187; bh=odpyzopQO4acXvpWay35l0YQWbidMEkIP4d7U9jczUM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=klhIQz3KX3PmQxIz4FSdDNDG0eJK+Q9YN6M4AdodhQ6LrHW8QOwacVwdRXVAwKTNo jL86xfxCccxeHNDAhJAzoBDFnrx0eddMwE6vvDHPE+DU9TYZi9KjUog7Z7Krduy75l X7y148ovQIAcB2zIFl1u2tFAfhUCJ0BRd+d+xVwZkdApap/Soyzv+0DtnBQOuoSIYv J6zWl/W3UnqboHhthFIkTMqnwo8DIbJk/EXCzr5SuQM78N4gomp2kEBeWGR+tY9yu5 RYgKzw4nEGAWDJFa18JWHlbfS+ofUEaGkByLnZMwW9vT3hZxBwFDoLnVRQi5acqQwF +r4gAZHlKplNA== Date: Thu, 2 Jan 2025 12:33:06 -1000 From: Tejun Heo To: Andrea Righi Cc: David Vernet , Changwoo Min , linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched_ext: Refresh idle state when kicking CPUs Message-ID: References: <20250101182449.21517-1-arighi@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250101182449.21517-1-arighi@nvidia.com> Hello, On Wed, Jan 01, 2025 at 07:24:49PM +0100, Andrea Righi wrote: ... > @@ -6104,6 +6117,7 @@ static bool kick_one_cpu(s32 cpu, struct rq *this_rq, unsigned long *pseqs) > should_wait = true; > } > > + refresh_idle_state_on_kick(rq); > resched_curr(rq); I'm not sure this is quite correct. e.g. This can cause multiple back-to-back busy->busy transitions and can incorrectly assert idle when the CPU ends up running non-idle tasks afterwards. When the put_prev/set_next paths were reorganized, we lost the signal on the CPU re-entering idle from idle. However, that signal is still available if we hook into idle_class->pick_task(), right? So, if we move update_idle(true) call there and make sure that we don't generate an event on busy->busy transitions, we should be able to restore the previous behavior? Thanks. -- tejun