From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2) Date: Wed, 01 Dec 2010 18:45:02 +0100 Message-ID: <1291225502.32004.1787.camel@laptop> References: <1290530963-3448-1-git-send-email-aliguori@us.ibm.com> <4CECCA39.4060702@redhat.com> <4CED1A23.9030607@linux.vnet.ibm.com> <4CED1FD3.1000801@redhat.com> <20101201123742.GA3780@linux.vnet.ibm.com> <4CF6460C.5070604@redhat.com> <20101201161221.GA8073@linux.vnet.ibm.com> <1291220718.32004.1696.camel@laptop> <20101201172953.GF8073@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Cc: Avi Kivity , Anthony Liguori , qemu-devel@nongnu.org, kvm@vger.kernel.org, Chris Wright , Ingo Molnar , Mike Galbraith To: vatsa@linux.vnet.ibm.com Return-path: Received: from canuck.infradead.org ([134.117.69.58]:47539 "EHLO canuck.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752886Ab0LARoy convert rfc822-to-8bit (ORCPT ); Wed, 1 Dec 2010 12:44:54 -0500 In-Reply-To: <20101201172953.GF8073@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2010-12-01 at 22:59 +0530, Srivatsa Vaddagiri wrote: > > yield_task_fair(...) > { > > + ideal_runtime = sched_slice(cfs_rq, curr); > + delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; > + rem_time_slice = ideal_runtime - delta_exec; > + > + current->donate_time += rem_time_slice > some_threshold ? > + some_threshold : rem_time_slice; > > ... > } > > > sched_slice(...) > { > slice = ... > > + slice += current->donate_time; > > } > > or something close to it. I am bit reluctant to go that route myself, unless the > fairness issue with plain yield is quite bad. That really won't do anything. You need to adjust both tasks their vruntime. Also, I really wouldn't touch the yield() implementation, nor would I expose any such time donation crap to userspace.