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 EB07D1FF1D5 for ; Wed, 8 Jan 2025 16:45:58 +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=1736354759; cv=none; b=B1NJzL8LuBQf1EWdBDmpNW9VkwPeUUK5/AQO+xYr98qifoV9eyawmzl69L2zgs9diDdAPncgevNyiPwiFgypa134f8o3m0/dS3Mg8U+9cv91mSR5/6D28xu8JezQnNQM+8151cfQ+TP2cETX7vKhI5dq280dKHI3qBbbuXHMM1k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736354759; c=relaxed/simple; bh=YBB1Rksa/UwOWnYoV2w7H/1hye7qq8BDLYut4KzQ9I0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=smwQSXDf5D+qHhNDE4MN3AJ+6YCuTU/HY1dCdxQsWY/Vez9jIzJLqDJ7Xvhu/pBAw9rqVlIn3I0RnwmxjNVxAEubUhXLP7Wg8TV/8uhHB6I3ewX1xhWltb6RG1RRqBySXj8OoSIMW2xsbEntQKyjRbofGC5EwCE/GPqr1b8l1cc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t+eYkX9m; 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="t+eYkX9m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66343C4CEDD; Wed, 8 Jan 2025 16:45:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736354758; bh=YBB1Rksa/UwOWnYoV2w7H/1hye7qq8BDLYut4KzQ9I0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t+eYkX9mHTt67mU/KY+NZYowFqIqogCGPsnWA/54Av5DLLTzGpr1yRV8VBbs04x42 Uyyj4mSpfS4hsARbZPk9awQX+OCF75zFiv3okZj1ETcbwA7OO9yN9GCkBYz7d73x/N 2VhPOoCTcSwiYOT6wwPFsk4f9GdDeIOE5iRa7eFJ0Ae/KVP37h8sWk5tyNyoZ9ewTy 9pLSTF4RB2As4X9qP4k4F8/m4I5QNOPVPXiHr+scXvBU8AbhK7b3x85TpSat9pj9JD PUK5swlCc26nDtqLZfrOSYTRdsdwCjxnJWZ3sMhCHPMaVIUeAgwKH4HAixSNCwGGh2 dQqEI4Nv5nGYQ== Date: Wed, 8 Jan 2025 06:45:57 -1000 From: Tejun Heo To: Henry Huang Cc: void@manifault.com, =?utf-8?B?6LCI6Ym06ZSL?= , "Yan Yan(cailing)" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] sched_ext: keep running prev when prev->scx.slice != 0 Message-ID: References: <20250108084710.42747-1-henry.hj@antgroup.com> <20250108084710.42747-2-henry.hj@antgroup.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: <20250108084710.42747-2-henry.hj@antgroup.com> On Wed, Jan 08, 2025 at 04:47:10PM +0800, Henry Huang wrote: > When %SCX_OPS_ENQ_LAST is set and prev->scx.slice != 0, > @prev will be dispacthed into the local DSQ in put_prev_task_scx(). > However, pick_task_scx() is executed before put_prev_task_scx(), > so it will not pick @prev. > Set %SCX_RQ_BAL_KEEP in balance_one() to ensure that pick_task_scx() > can pick @prev. > > Signed-off-by: Henry Huang Applied to sched_ext/for-6.13-fixes with a minor edit (see below). > @@ -2747,6 +2747,7 @@ static int balance_one(struct rq *rq, struct task_struct *prev) > { > struct scx_dsp_ctx *dspc = this_cpu_ptr(scx_dsp_ctx); > bool prev_on_scx = prev->sched_class == &ext_sched_class; > + bool prev_on_rq = (prev->scx.flags & SCX_TASK_QUEUED) != 0; I dropped `!= 0` as the bool assignment cast already implies boolean conversion. Thanks. -- tejun