From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F6C981AA8 for ; Wed, 10 Dec 2025 14:01:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765375291; cv=none; b=K9YcxV/pBf3yA4YfkXu/+fK1KZvIn/u1PVrX7k5HTd9cRITVRebg+2z8YVT9wJCd5pzwLoTbR0hIgcA7Eg2F2D1rKRoQ2yBR57gItAFnl0SD9+FFtbzhPYFjZuV2UBwFb0xBVFYj2GGgM8KL8e0qVua8/hnsN81oRv39uvzh3OM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765375291; c=relaxed/simple; bh=OEQJ9MEDWU02Ehjmo+XGfB4cAcD4Kxyq270IiaW0jFY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=letwIgnlMZ8MTDDNwrUsHx2vKzf9+lsPgyJ/9UIHfxKm66POSB/ONWkIc1QEtcvr+PVBHeZ0qOC9vTZaPx2OiSoQTgxrjLidotQnCxhgYAmZUI/Fz0E8RYYNBeeGnrOpn/1qaQ3fidO6LmWVVR68ydDQtoSoqxAy2O9m2GexmSQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2C64C153B; Wed, 10 Dec 2025 06:01:22 -0800 (PST) Received: from [192.168.178.6] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 320AD3F73B; Wed, 10 Dec 2025 06:01:27 -0800 (PST) Message-ID: <98454769-3b46-4e79-b503-1315408c8a9d@arm.com> Date: Wed, 10 Dec 2025 15:01:21 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/6 v8] sched/fair: Add push task mechanism for fair To: Vincent Guittot , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, pierre.gondois@arm.com, kprateek.nayak@amd.com Cc: qyousef@layalina.io, christian.loehle@arm.com References: <20251202181242.1536213-1-vincent.guittot@linaro.org> <20251202181242.1536213-5-vincent.guittot@linaro.org> Content-Language: en-GB From: Dietmar Eggemann In-Reply-To: <20251202181242.1536213-5-vincent.guittot@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit - hongyan.xia2@arm.com - luis.machado@arm.com On 02.12.25 19:12, Vincent Guittot wrote: > EAS is based on wakeup events to efficiently place tasks on the system, but > there are cases where a task doesn't have wakeup events anymore or at a far > too low pace. For such situation, we can take advantage of the task being > put back in the enqueued list to check if it should be pushed on another > CPU. > When the task is alone on the CPU, it's never put back in the enqueued > list; In this special case, we use the tick to run the check. > > Add a push task mechanism that enables fair scheduler to push runnable > tasks. EAS will be one user but other feature like filling idle CPUs > can also take advantage of it. [...] > +/* > + * See if the non running fair tasks on this rq can be sent on other CPUs > + * that fits better with their profile. > + */ > +static bool push_fair_task(struct rq *rq) > +{ > + struct task_struct *next_task; > + int prev_cpu, new_cpu; > + struct rq *new_rq; > + > + next_task = pick_next_pushable_fair_task(rq); > + if (!next_task) > + return false; > + > + if (is_migration_disabled(next_task)) > + return true; > + > + /* We might release rq lock */ > + get_task_struct(next_task); > + > + prev_cpu = rq->cpu; > + select_task_rq_fair() requires p->pi_lock to be held. I assume check_pushable_task() (push single running task) has the same issue. > + new_cpu = select_task_rq_fair(next_task, prev_cpu, 0); > + [...]