From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH 1/2] SCHED: Generic hooks for trapping task preemption Date: Thu, 12 Jul 2007 12:56:58 +1000 Message-ID: <1184209018.6005.706.camel@localhost.localdomain> References: <11841693332609-git-send-email-avi@qumranet.com> <11841693333159-git-send-email-avi@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Avi Kivity Return-path: In-Reply-To: <11841693333159-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Wed, 2007-07-11 at 18:55 +0300, Avi Kivity wrote: > +config PREEMPT_HOOKS > + bool > + depends on X86 > + default y Hmm, I would have thought that having CONFIG_KVM "select PREEMPT_HOOKS" would be a little clearer. > +static void fire_sched_in_preempt_hooks(struct task_struct *tsk) > +{ > + struct preempt_hook *hook; > + struct hlist_node *node; > + > + hlist_for_each_entry(hook, node, &tsk->preempt_hooks, link) > + hook->ops->sched_in(hook, raw_smp_processor_id()); > +} The old current/tsk conflation. You hand in "tsk" here, but since that's not handed through to the sched_in, it must be "current". It's just unfortunate that this generates better code... But patch looks good. Cheers, Rusty. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/