From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rik van Riel Subject: Re: [RFC -v3 PATCH 2/3] sched: add yield_to function Date: Tue, 04 Jan 2011 11:44:16 -0500 Message-ID: <4D234E60.3010804@redhat.com> References: <20110103162637.29f23c40@annuminas.surriel.com> <20110103162918.577a9620@annuminas.surriel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Avi Kiviti , Srivatsa Vaddagiri , Peter Zijlstra , Mike Galbraith , Chris Wright To: Hillf Danton Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 01/04/2011 11:41 AM, Hillf Danton wrote: > /* !curr->sched_class->yield_to_task || */ > >> + curr->sched_class != p->sched_class) { >> + goto out; >> + } >> + > /* > * ask scheduler to compute the next for successfully kicking > @p onto its CPU > * what if p_rq is rt_class to do? > */ > next = pick_next_task(p_rq); > if (next != p) > p->se.vruntime = next->se.vruntime -1; > deactivate_task(p_rq, p, 0); > activate_task(p_rq, p, 0); > if (rq == p_rq) > schedule(); > else > resched_task(p_rq->curr); > yield = 0; Wouldn't that break for FIFO and RR tasks? There's a reason all the scheduler folks wanted a per-class yield_to_task function :) -- All rights reversed