From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754551AbXGHSMG (ORCPT ); Sun, 8 Jul 2007 14:12:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757084AbXGHSLt (ORCPT ); Sun, 8 Jul 2007 14:11:49 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59372 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757057AbXGHSLs (ORCPT ); Sun, 8 Jul 2007 14:11:48 -0400 To: avi@qumranet.com Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH][RFC] kvm-scheduler integration References: <11838994974161-git-send-email-avi@qumranet.com> From: Andi Kleen In-Reply-To: <11838994974161-git-send-email-avi@qumranet.com> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Date: 08 Jul 2007 21:07:10 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Avi Kivity writes: > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 693f0e6..b705876 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -875,6 +875,10 @@ struct task_struct { > pid_t pid; > pid_t tgid; > > +#ifdef CONFIG_SCHED_KVM > + struct kvm_vcpu *kvm_vcpu; > +#endif You should be careful to put this into a cache line that is already touched during context switch. Otherwise if it needs an additional cache miss it might become very costly Also it's a bit worrying to expose hooks into the scheduler to any modules. How would others be stopped from abusing this? -Andi