From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: [PATCH 1 of 5] credit2: Add context_saved scheduler callback Date: Wed, 14 Apr 2010 11:26:19 +0100 Message-ID: <2631707c54b38d3068ea.1271240779@silas> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: george.dunlap@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 2 files changed, 3 insertions(+) xen/common/schedule.c | 2 ++ xen/include/xen/sched-if.h | 1 + Because credit2 shares a runqueue between several cpus, it needs to know when a scheduled-out process has finally been context-switched away so that it can be added to the runqueue again. (Otherwise it may be grabbed by another processor before the context has been properly saved.) Signed-off-by: George Dunlap diff -r c02cc832cb2d -r 2631707c54b3 xen/common/schedule.c --- a/xen/common/schedule.c Tue Apr 13 18:19:33 2010 +0100 +++ b/xen/common/schedule.c Wed Apr 14 11:16:58 2010 +0100 @@ -923,6 +923,8 @@ /* Check for migration request /after/ clearing running flag. */ smp_mb(); + SCHED_OP(context_saved, prev); + if ( unlikely(test_bit(_VPF_migrating, &prev->pause_flags)) ) vcpu_migrate(prev); } diff -r c02cc832cb2d -r 2631707c54b3 xen/include/xen/sched-if.h --- a/xen/include/xen/sched-if.h Tue Apr 13 18:19:33 2010 +0100 +++ b/xen/include/xen/sched-if.h Wed Apr 14 11:16:58 2010 +0100 @@ -70,6 +70,7 @@ void (*sleep) (struct vcpu *); void (*wake) (struct vcpu *); + void (*context_saved) (struct vcpu *); struct task_slice (*do_schedule) (s_time_t);