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 854FF18C03A for ; Fri, 10 Jan 2025 21:37:09 +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=1736545029; cv=none; b=D8nujqoB5lrHOgIJsleaKfvJDI0Iw98A70kXusGM+UnLVqCHR9PmMmSKYRrh8kOTduK3rjwZuQiqfRfMFVdd9pl9dbPbuMF2CRl3ULLVpGnkoMehcULfYkSe5Fjz888zzTbGFuFwsYM614xnBvKniKx1cOwmoZwxouiGkq9nrUM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736545029; c=relaxed/simple; bh=0NAtl76HRDQQxfJd0jq24VW+Ix8diFGc/BKoLiQoo3o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=S2KYuesk96uDRkOj1IZHq54Vd7b+yyoZlsc7A0HDRow5+IehxC3d6WpxQTUDnFi/DeNAASod5j8QYOc08E3lz6SB1YqpPt+FkAbhsex6hXl/15owHJ1yMV38dZN359oPb3l+Yd2I2ya/8KMnQ+uXDzjqvBqRKZxukF090DmoKk0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ni3uph1+; 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="Ni3uph1+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBAABC4CEDD; Fri, 10 Jan 2025 21:37:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736545029; bh=0NAtl76HRDQQxfJd0jq24VW+Ix8diFGc/BKoLiQoo3o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ni3uph1+kg+1FqrqwH5knfOxg32s76aUItxujVvPUrm8K+SFLgnwBY2CjwiTXeMHC AgDsRunpp57i7PQn2MCFcnsJmssk3ZJgHMMhiTkwMC36C0nxI0dc61+7bZIMY87P5W zPe6S/089KmtzNqPoCi5nOT3/Ja7x0fHKRgFSLbWJWI8D1fvbkAxNhd/jAbilW8JkE tJkbKFldXn4MfOgaZ64U3csuBr8/7nfe2Fw9oqBwMZaJ79gDbsIrNNPFiDM/QLvWg9 k/w1mPEyjT2CEJHBdhOAaGHmxcTpSj2O1Px0vAfrSPr2Vg6VKMqgSUn4bcGIF47aQE DHNxfGLgM6qyA== Date: Fri, 10 Jan 2025 11:37:07 -1000 From: Tejun Heo To: Andrea Righi Cc: David Vernet , Changwoo Min , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , linux-kernel@vger.kernel.org Subject: Re: [PATCH v7] sched_ext: idle: Refresh idle masks during idle-to-idle transitions Message-ID: References: <20250110212321.41367-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: <20250110212321.41367-1-arighi@nvidia.com> Hello, On Fri, Jan 10, 2025 at 10:23:21PM +0100, Andrea Righi wrote: ... > + /* > + * Update the idle masks: > + * - for real idle transitions (do_notify == true) > + * - for idle-to-idle transitions (indicated by the previous task > + * being the idle thread, managed by pick_task_idle()) > + * > + * Skip updating idle masks if the previous task is not the idle > + * thread, since set_next_task_idle() has already handled it when > + * transitioning from a task to the idle thread (calling this > + * function with do_notify == true). > + * > + * In this way we can avoid updating the idle masks twice, > + * unnecessarily. > + */ > + if (do_notify || is_idle_task(rq->curr)) > + update_idle_masks(cpu, idle); Sorry about the multiple nitpicks but wouldn't it be better to have the static_key test before dynamic tests? I'd move scx_builtin_idle_enabled test out of update_idle_masks() and put that in front of other tests here. Also, maybe name the function update_builtin_idle() to stay consistent with the static_key name? Otherwise looks good to me. Thanks. -- tejun