* KVM and Prempt?
@ 2007-10-22 7:01 Back, Michael (ext)
2007-10-22 18:14 ` Sven-Thorsten Dietrich
0 siblings, 1 reply; 17+ messages in thread
From: Back, Michael (ext) @ 2007-10-22 7:01 UTC (permalink / raw)
To: linux-rt-users
Hallo,
I tried to run Windows XP with KVM on Linux 2.6.31.1 on a
AMD Opteron and on a Intel Xeon, on both it works fine!
After this test I patch the kernel with the current prempt-patch and on
both it doesn't works!
-> After a very short time - I could see the windows startup screen -
the complied system froze!
Has you ever tried to do the same and it works?
Or will KVM with Windows on a prempt kernel
- never work?
- maybe work in the future?
- should now work but this .. and this ... should be done and consider?
With best regards,
Michael
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: KVM and Prempt?
2007-10-22 7:01 KVM and Prempt? Back, Michael (ext)
@ 2007-10-22 18:14 ` Sven-Thorsten Dietrich
2007-10-23 8:35 ` Jan Kiszka
2007-10-24 7:23 ` Back, Michael (ext)
0 siblings, 2 replies; 17+ messages in thread
From: Sven-Thorsten Dietrich @ 2007-10-22 18:14 UTC (permalink / raw)
To: Back, Michael (ext); +Cc: linux-rt-users
On Mon, 2007-10-22 at 09:01 +0200, Back, Michael (ext) wrote:
> Hallo,
> I tried to run Windows XP with KVM on Linux 2.6.31.1 on a
You mean .21.1 ?
> AMD Opteron and on a Intel Xeon, on both it works fine!
> After this test I patch the kernel with the current prempt-patch and on
> both it doesn't works!
Did you try against 2.6.23-rt1.
If you must stay on .21, you might have some other issues with the AMD
and NUMA.
At the very least, you will need to apply the attached patch from git
somehow, although this patch is against a new scheduler post 2.6.22, so
good luck :)
Sven
> -> After a very short time - I could see the windows startup screen -
> the complied system froze!
>
> Has you ever tried to do the same and it works?
> Or will KVM with Windows on a prempt kernel
> - never work?
> - maybe work in the future?
> - should now work but this .. and this ... should be done and consider?
>
> With best regards,
> Michael
> -
> To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
diff-tree e107be36efb2a233833e8c9899039a370e4b2318 (from b47e8608a08766ef8121cd747d3aaf6c3dc22649)
Author: Avi Kivity <avi@qumranet.com>
Date: Thu Jul 26 13:40:43 2007 +0200
[PATCH] sched: arch preempt notifier mechanism
This adds a general mechanism whereby a task can request the scheduler to
notify it whenever it is preempted or scheduled back in. This allows the
task to swap any special-purpose registers like the fpu or Intel's VT
registers.
Signed-off-by: Avi Kivity <avi@qumranet.com>
[ mingo@elte.hu: fixes, cleanups ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index d0926d6..484988e 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -8,6 +8,7 @@
#include <linux/thread_info.h>
#include <linux/linkage.h>
+#include <linux/list.h>
#ifdef CONFIG_DEBUG_PREEMPT
extern void fastcall add_preempt_count(int val);
@@ -60,4 +61,47 @@ do { \
#endif
+#ifdef CONFIG_PREEMPT_NOTIFIERS
+
+struct preempt_notifier;
+
+/**
+ * preempt_ops - notifiers called when a task is preempted and rescheduled
+ * @sched_in: we're about to be rescheduled:
+ * notifier: struct preempt_notifier for the task being scheduled
+ * cpu: cpu we're scheduled on
+ * @sched_out: we've just been preempted
+ * notifier: struct preempt_notifier for the task being preempted
+ * next: the task that's kicking us out
+ */
+struct preempt_ops {
+ void (*sched_in)(struct preempt_notifier *notifier, int cpu);
+ void (*sched_out)(struct preempt_notifier *notifier,
+ struct task_struct *next);
+};
+
+/**
+ * preempt_notifier - key for installing preemption notifiers
+ * @link: internal use
+ * @ops: defines the notifier functions to be called
+ *
+ * Usually used in conjunction with container_of().
+ */
+struct preempt_notifier {
+ struct hlist_node link;
+ struct preempt_ops *ops;
+};
+
+void preempt_notifier_register(struct preempt_notifier *notifier);
+void preempt_notifier_unregister(struct preempt_notifier *notifier);
+
+static inline void preempt_notifier_init(struct preempt_notifier *notifier,
+ struct preempt_ops *ops)
+{
+ INIT_HLIST_NODE(¬ifier->link);
+ notifier->ops = ops;
+}
+
+#endif
+
#endif /* __LINUX_PREEMPT_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 7c61b50..7a4de87 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -935,6 +935,11 @@ struct task_struct {
struct sched_class *sched_class;
struct sched_entity se;
+#ifdef CONFIG_PREEMPT_NOTIFIERS
+ /* list of struct preempt_notifier: */
+ struct hlist_head preempt_notifiers;
+#endif
+
unsigned short ioprio;
#ifdef CONFIG_BLK_DEV_IO_TRACE
unsigned int btrace_seq;
diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt
index c64ce9c..6b06663 100644
--- a/kernel/Kconfig.preempt
+++ b/kernel/Kconfig.preempt
@@ -63,3 +63,6 @@ config PREEMPT_BKL
Say Y here if you are building a kernel for a desktop system.
Say N if you are unsure.
+config PREEMPT_NOTIFIERS
+ bool
+
diff --git a/kernel/sched.c b/kernel/sched.c
index 93cf241..e901aa5 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1592,6 +1592,10 @@ static void __sched_fork(struct task_str
INIT_LIST_HEAD(&p->run_list);
p->se.on_rq = 0;
+#ifdef CONFIG_PREEMPT_NOTIFIERS
+ INIT_HLIST_HEAD(&p->preempt_notifiers);
+#endif
+
/*
* We mark the process as running here, but have not actually
* inserted it onto the runqueue yet. This guarantees that
@@ -1673,6 +1677,63 @@ void fastcall wake_up_new_task(struct ta
task_rq_unlock(rq, &flags);
}
+#ifdef CONFIG_PREEMPT_NOTIFIERS
+
+/**
+ * preempt_notifier_register - tell me when current is being being preempted
+ * and rescheduled
+ */
+void preempt_notifier_register(struct preempt_notifier *notifier)
+{
+ hlist_add_head(¬ifier->link, ¤t->preempt_notifiers);
+}
+EXPORT_SYMBOL_GPL(preempt_notifier_register);
+
+/**
+ * preempt_notifier_unregister - no longer interested in preemption notifications
+ *
+ * This is safe to call from within a preemption notifier.
+ */
+void preempt_notifier_unregister(struct preempt_notifier *notifier)
+{
+ hlist_del(¬ifier->link);
+}
+EXPORT_SYMBOL_GPL(preempt_notifier_unregister);
+
+static void fire_sched_in_preempt_notifiers(struct task_struct *curr)
+{
+ struct preempt_notifier *notifier;
+ struct hlist_node *node;
+
+ hlist_for_each_entry(notifier, node, &curr->preempt_notifiers, link)
+ notifier->ops->sched_in(notifier, raw_smp_processor_id());
+}
+
+static void
+fire_sched_out_preempt_notifiers(struct task_struct *curr,
+ struct task_struct *next)
+{
+ struct preempt_notifier *notifier;
+ struct hlist_node *node;
+
+ hlist_for_each_entry(notifier, node, &curr->preempt_notifiers, link)
+ notifier->ops->sched_out(notifier, next);
+}
+
+#else
+
+static void fire_sched_in_preempt_notifiers(struct task_struct *curr)
+{
+}
+
+static void
+fire_sched_out_preempt_notifiers(struct task_struct *curr,
+ struct task_struct *next)
+{
+}
+
+#endif
+
/**
* prepare_task_switch - prepare to switch tasks
* @rq: the runqueue preparing to switch
@@ -1685,8 +1746,11 @@ void fastcall wake_up_new_task(struct ta
* prepare_task_switch sets up locking and calls architecture specific
* hooks.
*/
-static inline void prepare_task_switch(struct rq *rq, struct task_struct *next)
+static inline void
+prepare_task_switch(struct rq *rq, struct task_struct *prev,
+ struct task_struct *next)
{
+ fire_sched_out_preempt_notifiers(prev, next);
prepare_lock_switch(rq, next);
prepare_arch_switch(next);
}
@@ -1728,6 +1792,7 @@ static inline void finish_task_switch(st
prev_state = prev->state;
finish_arch_switch(prev);
finish_lock_switch(rq, prev);
+ fire_sched_in_preempt_notifiers(current);
if (mm)
mmdrop(mm);
if (unlikely(prev_state == TASK_DEAD)) {
@@ -1768,7 +1833,7 @@ context_switch(struct rq *rq, struct tas
{
struct mm_struct *mm, *oldmm;
- prepare_task_switch(rq, next);
+ prepare_task_switch(rq, prev, next);
mm = next->mm;
oldmm = prev->active_mm;
/*
@@ -6335,6 +6400,10 @@ void __init sched_init(void)
set_load_weight(&init_task);
+#ifdef CONFIG_PREEMPT_NOTIFIERS
+ INIT_HLIST_HEAD(&init_task.preempt_notifiers);
+#endif
+
#ifdef CONFIG_SMP
nr_cpu_ids = highest_cpu + 1;
open_softirq(SCHED_SOFTIRQ, run_rebalance_domains, NULL);
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: KVM and Prempt?
2007-10-22 18:14 ` Sven-Thorsten Dietrich
@ 2007-10-23 8:35 ` Jan Kiszka
2007-10-23 12:31 ` Gregory Haskins
2007-10-24 7:31 ` AW: " Back, Michael (ext)
2007-10-24 7:23 ` Back, Michael (ext)
1 sibling, 2 replies; 17+ messages in thread
From: Jan Kiszka @ 2007-10-23 8:35 UTC (permalink / raw)
To: Sven-Thorsten Dietrich; +Cc: Back, Michael (ext), linux-rt-users
Sven-Thorsten Dietrich wrote:
> On Mon, 2007-10-22 at 09:01 +0200, Back, Michael (ext) wrote:
>> Hallo,
>> I tried to run Windows XP with KVM on Linux 2.6.31.1 on a
>
> You mean .21.1 ?
Classic typo I interestingly also did several times the last week. :)
>
>> AMD Opteron and on a Intel Xeon, on both it works fine!
>
>> After this test I patch the kernel with the current prempt-patch and on
>> both it doesn't works!
>
> Did you try against 2.6.23-rt1.
kvm in -rt1 is not usable. It's too old, lacking PREEMPT_NOTIFIER
support, thus quickly triggering lockdep.
>
> If you must stay on .21, you might have some other issues with the AMD
> and NUMA.
>
> At the very least, you will need to apply the attached patch from git
> somehow, although this patch is against a new scheduler post 2.6.22, so
> good luck :)
<--snip-->
Those patches are already mainline... :->
What you rather need are latest kvm patches, or - if building the kvm
distribution out of tree - a patch to enabled CONFIG_PREEMPT_NOTIFIERS
unconditionally:
--- linux-2.6.23.1-rt/kernel/Kconfig.preempt.orig
+++ linux-2.6.23.1-rt/kernel/Kconfig.preempt
@@ -136,6 +136,7 @@
config PREEMPT_NOTIFIERS
bool
+ default y
config PREEMPT_BKL
bool
Still, I'm seeing oopses here (more precisely, lock validator
complaints), but I need to re-test, better using kvm from git instead of
kvm-48.
Beyond this, I'm struggling to understand 300-400 us vm-exit latencies
(over Intel VMX), which appear to be independent of the underlying
system. See kvm-devel. Such latencies would limit the RT usability of
kvm - unless you spent dedicated CPUs.
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: KVM and Prempt?
2007-10-23 8:35 ` Jan Kiszka
@ 2007-10-23 12:31 ` Gregory Haskins
2007-10-24 7:31 ` AW: " Back, Michael (ext)
1 sibling, 0 replies; 17+ messages in thread
From: Gregory Haskins @ 2007-10-23 12:31 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Sven-Thorsten Dietrich, Back, Michael (ext), linux-rt-users
[-- Attachment #1: Type: text/plain, Size: 2212 bytes --]
On Tue, 2007-10-23 at 10:35 +0200, Jan Kiszka wrote:
> Sven-Thorsten Dietrich wrote:
> > On Mon, 2007-10-22 at 09:01 +0200, Back, Michael (ext) wrote:
> >> Hallo,
> >> I tried to run Windows XP with KVM on Linux 2.6.31.1 on a
> >
> > You mean .21.1 ?
>
> Classic typo I interestingly also did several times the last week. :)
>
> >
> >> AMD Opteron and on a Intel Xeon, on both it works fine!
> >
> >> After this test I patch the kernel with the current prempt-patch and on
> >> both it doesn't works!
> >
> > Did you try against 2.6.23-rt1.
>
> kvm in -rt1 is not usable. It's too old, lacking PREEMPT_NOTIFIER
> support, thus quickly triggering lockdep.
>
> >
> > If you must stay on .21, you might have some other issues with the AMD
> > and NUMA.
> >
> > At the very least, you will need to apply the attached patch from git
> > somehow, although this patch is against a new scheduler post 2.6.22, so
> > good luck :)
>
> <--snip-->
>
> Those patches are already mainline... :->
>
> What you rather need are latest kvm patches, or - if building the kvm
> distribution out of tree - a patch to enabled CONFIG_PREEMPT_NOTIFIERS
> unconditionally:
>
> --- linux-2.6.23.1-rt/kernel/Kconfig.preempt.orig
> +++ linux-2.6.23.1-rt/kernel/Kconfig.preempt
> @@ -136,6 +136,7 @@
>
> config PREEMPT_NOTIFIERS
> bool
> + default y
>
> config PREEMPT_BKL
> bool
>
>
> Still, I'm seeing oopses here (more precisely, lock validator
> complaints), but I need to re-test, better using kvm from git instead of
> kvm-48.
>
> Beyond this, I'm struggling to understand 300-400 us vm-exit latencies
> (over Intel VMX), which appear to be independent of the underlying
> system. See kvm-devel. Such latencies would limit the RT usability of
> kvm - unless you spent dedicated CPUs.
Some work is still left to be done in this area. Until then you will
see problems like you are describing.
At one point I had a patch series that allowed KVM to actually work in
-rt without crashes, and with decent latencies (both host, and guest).
Some point soon I will revive the series and port it to the latest
kvm.git.
HTH
Regards,
-Greg
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* AW: KVM and Prempt?
2007-10-23 8:35 ` Jan Kiszka
2007-10-23 12:31 ` Gregory Haskins
@ 2007-10-24 7:31 ` Back, Michael (ext)
1 sibling, 0 replies; 17+ messages in thread
From: Back, Michael (ext) @ 2007-10-24 7:31 UTC (permalink / raw)
To: Kiszka, Jan, Sven-Thorsten Dietrich; +Cc: linux-rt-users
> -----Ursprüngliche Nachricht-----
> Von: Kiszka, Jan
> Gesendet: Tuesday, October 23, 2007 10:35 AM
> An: Sven-Thorsten Dietrich
> Cc: Back, Michael (ext); linux-rt-users@vger.kernel.org
> Betreff: Re: KVM and Prempt?
>
> Sven-Thorsten Dietrich wrote:
> > On Mon, 2007-10-22 at 09:01 +0200, Back, Michael (ext) wrote:
> >> Hallo,
> >> I tried to run Windows XP with KVM on Linux 2.6.31.1 on a
> >
> > You mean .21.1 ?
>
> Classic typo I interestingly also did several times the last week. :)
>
> >
> >> AMD Opteron and on a Intel Xeon, on both it works fine!
> >
> >> After this test I patch the kernel with the current
> prempt-patch and on
> >> both it doesn't works!
> >
> > Did you try against 2.6.23-rt1.
>
> kvm in -rt1 is not usable. It's too old, lacking PREEMPT_NOTIFIER
> support, thus quickly triggering lockdep.
Thanks, the kvm-devel list told me the same and it works !!!
Michael
>
> >
> > If you must stay on .21, you might have some other issues
> with the AMD
> > and NUMA.
> >
> > At the very least, you will need to apply the attached
> patch from git
> > somehow, although this patch is against a new scheduler
> post 2.6.22, so
> > good luck :)
>
> <--snip-->
>
> Those patches are already mainline... :->
>
> What you rather need are latest kvm patches, or - if building the kvm
> distribution out of tree - a patch to enabled CONFIG_PREEMPT_NOTIFIERS
> unconditionally:
>
> --- linux-2.6.23.1-rt/kernel/Kconfig.preempt.orig
> +++ linux-2.6.23.1-rt/kernel/Kconfig.preempt
> @@ -136,6 +136,7 @@
>
> config PREEMPT_NOTIFIERS
> bool
> + default y
>
> config PREEMPT_BKL
> bool
>
>
> Still, I'm seeing oopses here (more precisely, lock validator
> complaints), but I need to re-test, better using kvm from git
> instead of
> kvm-48.
>
> Beyond this, I'm struggling to understand 300-400 us vm-exit latencies
> (over Intel VMX), which appear to be independent of the underlying
> system. See kvm-devel. Such latencies would limit the RT usability of
> kvm - unless you spent dedicated CPUs.
>
> Jan
>
> --
> Siemens AG, Corporate Technology, CT SE 2
> Corporate Competence Center Embedded Linux
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* AW: KVM and Prempt?
2007-10-22 18:14 ` Sven-Thorsten Dietrich
2007-10-23 8:35 ` Jan Kiszka
@ 2007-10-24 7:23 ` Back, Michael (ext)
1 sibling, 0 replies; 17+ messages in thread
From: Back, Michael (ext) @ 2007-10-24 7:23 UTC (permalink / raw)
To: Sven-Thorsten Dietrich; +Cc: linux-rt-users
> On Mon, 2007-10-22 at 09:01 +0200, Back, Michael (ext) wrote:
> > Hallo,
> > I tried to run Windows XP with KVM on Linux 2.6.31.1 on a
>
> You mean .21.1 ?
Sorry I mean 2.6.23.1
>
> > AMD Opteron and on a Intel Xeon, on both it works fine!
>
> > After this test I patch the kernel with the current
> prempt-patch and on
> > both it doesn't works!
>
> Did you try against 2.6.23-rt1.
Yes, now with a tip from kvm-devel (CONFIG_PREEMPT_NOTIFIERS) and the
KVM Version 48
it works on Intel!
On AMD I try it today - maybe it works :-?
>
> If you must stay on .21, you might have some other issues with the AMD
> and NUMA.
>
> At the very least, you will need to apply the attached patch from git
> somehow, although this patch is against a new scheduler post
> 2.6.22, so
> good luck :)
>
> Sven
>
Thanks for help!!
Michael
> > -> After a very short time - I could see the windows
> startup screen -
> > the complied system froze!
> >
> > Has you ever tried to do the same and it works?
> > Or will KVM with Windows on a prempt kernel
> > - never work?
> > - maybe work in the future?
> > - should now work but this .. and this ... should be done
> and consider?
> >
> > With best regards,
> > Michael
> > -
> > To unsubscribe from this list: send the line "unsubscribe
> linux-rt-users" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
>
> diff-tree e107be36efb2a233833e8c9899039a370e4b2318 (from
> b47e8608a08766ef8121cd747d3aaf6c3dc22649)
> Author: Avi Kivity <avi@qumranet.com>
> Date: Thu Jul 26 13:40:43 2007 +0200
>
> [PATCH] sched: arch preempt notifier mechanism
>
> This adds a general mechanism whereby a task can request
> the scheduler to
> notify it whenever it is preempted or scheduled back in.
> This allows the
> task to swap any special-purpose registers like the fpu
> or Intel's VT
> registers.
>
> Signed-off-by: Avi Kivity <avi@qumranet.com>
> [ mingo@elte.hu: fixes, cleanups ]
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
>
> diff --git a/include/linux/preempt.h b/include/linux/preempt.h
> index d0926d6..484988e 100644
> --- a/include/linux/preempt.h
> +++ b/include/linux/preempt.h
> @@ -8,6 +8,7 @@
>
> #include <linux/thread_info.h>
> #include <linux/linkage.h>
> +#include <linux/list.h>
>
> #ifdef CONFIG_DEBUG_PREEMPT
> extern void fastcall add_preempt_count(int val);
> @@ -60,4 +61,47 @@ do { \
>
> #endif
>
> +#ifdef CONFIG_PREEMPT_NOTIFIERS
> +
> +struct preempt_notifier;
> +
> +/**
> + * preempt_ops - notifiers called when a task is preempted
> and rescheduled
> + * @sched_in: we're about to be rescheduled:
> + * notifier: struct preempt_notifier for the task being scheduled
> + * cpu: cpu we're scheduled on
> + * @sched_out: we've just been preempted
> + * notifier: struct preempt_notifier for the task being preempted
> + * next: the task that's kicking us out
> + */
> +struct preempt_ops {
> + void (*sched_in)(struct preempt_notifier *notifier, int cpu);
> + void (*sched_out)(struct preempt_notifier *notifier,
> + struct task_struct *next);
> +};
> +
> +/**
> + * preempt_notifier - key for installing preemption notifiers
> + * @link: internal use
> + * @ops: defines the notifier functions to be called
> + *
> + * Usually used in conjunction with container_of().
> + */
> +struct preempt_notifier {
> + struct hlist_node link;
> + struct preempt_ops *ops;
> +};
> +
> +void preempt_notifier_register(struct preempt_notifier *notifier);
> +void preempt_notifier_unregister(struct preempt_notifier *notifier);
> +
> +static inline void preempt_notifier_init(struct
> preempt_notifier *notifier,
> + struct preempt_ops *ops)
> +{
> + INIT_HLIST_NODE(¬ifier->link);
> + notifier->ops = ops;
> +}
> +
> +#endif
> +
> #endif /* __LINUX_PREEMPT_H */
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 7c61b50..7a4de87 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -935,6 +935,11 @@ struct task_struct {
> struct sched_class *sched_class;
> struct sched_entity se;
>
> +#ifdef CONFIG_PREEMPT_NOTIFIERS
> + /* list of struct preempt_notifier: */
> + struct hlist_head preempt_notifiers;
> +#endif
> +
> unsigned short ioprio;
> #ifdef CONFIG_BLK_DEV_IO_TRACE
> unsigned int btrace_seq;
> diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt
> index c64ce9c..6b06663 100644
> --- a/kernel/Kconfig.preempt
> +++ b/kernel/Kconfig.preempt
> @@ -63,3 +63,6 @@ config PREEMPT_BKL
> Say Y here if you are building a kernel for a desktop system.
> Say N if you are unsure.
>
> +config PREEMPT_NOTIFIERS
> + bool
> +
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 93cf241..e901aa5 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -1592,6 +1592,10 @@ static void __sched_fork(struct task_str
> INIT_LIST_HEAD(&p->run_list);
> p->se.on_rq = 0;
>
> +#ifdef CONFIG_PREEMPT_NOTIFIERS
> + INIT_HLIST_HEAD(&p->preempt_notifiers);
> +#endif
> +
> /*
> * We mark the process as running here, but have not actually
> * inserted it onto the runqueue yet. This guarantees that
> @@ -1673,6 +1677,63 @@ void fastcall wake_up_new_task(struct ta
> task_rq_unlock(rq, &flags);
> }
>
> +#ifdef CONFIG_PREEMPT_NOTIFIERS
> +
> +/**
> + * preempt_notifier_register - tell me when current is being
> being preempted
> + * and rescheduled
> + */
> +void preempt_notifier_register(struct preempt_notifier *notifier)
> +{
> + hlist_add_head(¬ifier->link, ¤t->preempt_notifiers);
> +}
> +EXPORT_SYMBOL_GPL(preempt_notifier_register);
> +
> +/**
> + * preempt_notifier_unregister - no longer interested in
> preemption notifications
> + *
> + * This is safe to call from within a preemption notifier.
> + */
> +void preempt_notifier_unregister(struct preempt_notifier *notifier)
> +{
> + hlist_del(¬ifier->link);
> +}
> +EXPORT_SYMBOL_GPL(preempt_notifier_unregister);
> +
> +static void fire_sched_in_preempt_notifiers(struct task_struct *curr)
> +{
> + struct preempt_notifier *notifier;
> + struct hlist_node *node;
> +
> + hlist_for_each_entry(notifier, node,
> &curr->preempt_notifiers, link)
> + notifier->ops->sched_in(notifier,
> raw_smp_processor_id());
> +}
> +
> +static void
> +fire_sched_out_preempt_notifiers(struct task_struct *curr,
> + struct task_struct *next)
> +{
> + struct preempt_notifier *notifier;
> + struct hlist_node *node;
> +
> + hlist_for_each_entry(notifier, node,
> &curr->preempt_notifiers, link)
> + notifier->ops->sched_out(notifier, next);
> +}
> +
> +#else
> +
> +static void fire_sched_in_preempt_notifiers(struct task_struct *curr)
> +{
> +}
> +
> +static void
> +fire_sched_out_preempt_notifiers(struct task_struct *curr,
> + struct task_struct *next)
> +{
> +}
> +
> +#endif
> +
> /**
> * prepare_task_switch - prepare to switch tasks
> * @rq: the runqueue preparing to switch
> @@ -1685,8 +1746,11 @@ void fastcall wake_up_new_task(struct ta
> * prepare_task_switch sets up locking and calls
> architecture specific
> * hooks.
> */
> -static inline void prepare_task_switch(struct rq *rq, struct
> task_struct *next)
> +static inline void
> +prepare_task_switch(struct rq *rq, struct task_struct *prev,
> + struct task_struct *next)
> {
> + fire_sched_out_preempt_notifiers(prev, next);
> prepare_lock_switch(rq, next);
> prepare_arch_switch(next);
> }
> @@ -1728,6 +1792,7 @@ static inline void finish_task_switch(st
> prev_state = prev->state;
> finish_arch_switch(prev);
> finish_lock_switch(rq, prev);
> + fire_sched_in_preempt_notifiers(current);
> if (mm)
> mmdrop(mm);
> if (unlikely(prev_state == TASK_DEAD)) {
> @@ -1768,7 +1833,7 @@ context_switch(struct rq *rq, struct tas
> {
> struct mm_struct *mm, *oldmm;
>
> - prepare_task_switch(rq, next);
> + prepare_task_switch(rq, prev, next);
> mm = next->mm;
> oldmm = prev->active_mm;
> /*
> @@ -6335,6 +6400,10 @@ void __init sched_init(void)
>
> set_load_weight(&init_task);
>
> +#ifdef CONFIG_PREEMPT_NOTIFIERS
> + INIT_HLIST_HEAD(&init_task.preempt_notifiers);
> +#endif
> +
> #ifdef CONFIG_SMP
> nr_cpu_ids = highest_cpu + 1;
> open_softirq(SCHED_SOFTIRQ, run_rebalance_domains, NULL);
>
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: KVM and Prempt?
@ 2007-10-19 13:32 Back, Michael (ext)
[not found] ` <003F437218F04842B2A6976FA19368B1886A2F-EA/R+3GEQKtclD5KMHf1bFOnKfhBOm/VrE5yTffgRl4@public.gmane.org>
0 siblings, 1 reply; 17+ messages in thread
From: Back, Michael (ext) @ 2007-10-19 13:32 UTC (permalink / raw)
To: Back, Michael (ext), kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
[-- Attachment #1.1: Type: text/plain, Size: 2144 bytes --]
2.6.31.1 should be 2.6.23.1 - sorry
> _____________________________________________
> Von: Back, Michael (ext)
> Gesendet: Friday, October 19, 2007 3:16 PM
> An: 'kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org'
> Betreff: KVM and Prempt?
>
>
> Hallo,
> I tried to run Windows XP with KVM on Linux 2.6.31.1 on a AMD Opteron and on a Intel Xeon, on both it works fine!
>
> After this test I patch the kernel with the current prempt-patch and on both it doesn't works!
> -> After a very short time - I could see the windows startup screen - the complied system froze!
>
> Has someone ever tried to do the same and it works?
> Or will KVM with Windows on a prempt kernel
> - never work?
> - maybe work in the future?
> - should now work but this .. and this > ...> should be done and consider?
>
> With best regards,
> Michael Back
>
> #########################
> ASTRUM IT GmbH
> Michael Back
>
> Dipl.-Ing. Univ.
> software engineer
> Projectmanagement
>
> Am Wolfsmantel 46
> 91058 Erlangen, Germany
> Tel.: +49 (91 31) 94 08 - 374
> Fax: +49 (91 31) 94 08 - 108
> <mailto:HYPERLINK "mailto:Michael.Back-uO8URJBSKRghFhg+JK9F0w@public.gmane.org" Michael.Back-uO8URJBSKRghFhg+JK9F0w@public.gmane.org <mailto:HYPERLINK > >
>
> contact address by Siemens
> Siemens AG
> Medical Solutions
> MED MRZ
> Allee am Roethelheimpark 2
> 91052 Erlangen, Germany
> Tel.: +49 (9131) 84-5307
> Fax: +49 (9131) 84-8767
> <mailto:HYPERLINK "mailto:Michael.Back.ext-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org" Michael.Back.ext-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org <mailto:HYPERLINK > >
>
> Siemens Aktiengesellschaft: Chairman of the Supervisory Board: Gerhard Cromme; Managing Board: Peter Loescher, Chairman, President and Chief Executive Officer;
> Heinrich Hiesinger, Joe Kaeser, Rudi Lamprecht, Eduardo Montes, Juergen Radomski, Erich R. Reinhardt, Hermann Requardt, Uriel J. Sharef, Peter Y. Solmssen, Klaus Wucherer;
> Registered offices: Berlin and Munich; Commercial registries: Berlin Charlottenburg, HRB 12300, Munich, HRB 6684; WEEE-Reg.-No. DE 23691322
>
[-- Attachment #1.2: Type: text/html, Size: 4244 bytes --]
[-- Attachment #2: Type: text/plain, Size: 314 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- Attachment #3: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply [flat|nested] 17+ messages in thread* KVM and Prempt?
@ 2007-10-19 13:16 Back, Michael (ext)
0 siblings, 0 replies; 17+ messages in thread
From: Back, Michael (ext) @ 2007-10-19 13:16 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
[-- Attachment #1.1: Type: text/plain, Size: 1781 bytes --]
Hallo,
I tried to run Windows XP with KVM on Linux 2.6.31.1 on a AMD Opteron and on a Intel Xeon, on both it works fine!
After this test I patch the kernel with the current prempt-patch and on both it doesn't works!
-> After a very short time - I could see the windows startup screen - the complied system froze!
Has someone ever tried to do the same and it works?
Or will KVM with Windows on a prempt kernel
- never work?
- maybe work in the future?
- should now work but this .. and this ... should be done and consider?
With best regards,
Michael Back
#########################
ASTRUM IT GmbH
Michael Back
Dipl.-Ing. Univ.
software engineer
Projectmanagement
Am Wolfsmantel 46
91058 Erlangen, Germany
Tel.: +49 (91 31) 94 08 - 374
Fax: +49 (91 31) 94 08 - 108
<mailto:HYPERLINK "mailto:Michael.Back-uO8URJBSKRghFhg+JK9F0w@public.gmane.org" Michael.Back-uO8URJBSKRghFhg+JK9F0w@public.gmane.org <mailto:HYPERLINK > >
contact address by Siemens
Siemens AG
Medical Solutions
MED MRZ
Allee am Roethelheimpark 2
91052 Erlangen, Germany
Tel.: +49 (9131) 84-5307
Fax: +49 (9131) 84-8767
<mailto:HYPERLINK "mailto:Michael.Back.ext-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org" Michael.Back.ext-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org <mailto:HYPERLINK > >
Siemens Aktiengesellschaft: Chairman of the Supervisory Board: Gerhard Cromme; Managing Board: Peter Loescher, Chairman, President and Chief Executive Officer;
Heinrich Hiesinger, Joe Kaeser, Rudi Lamprecht, Eduardo Montes, Juergen Radomski, Erich R. Reinhardt, Hermann Requardt, Uriel J. Sharef, Peter Y. Solmssen, Klaus Wucherer;
Registered offices: Berlin and Munich; Commercial registries: Berlin Charlottenburg, HRB 12300, Munich, HRB 6684; WEEE-Reg.-No. DE 23691322
[-- Attachment #1.2: Type: text/html, Size: 3445 bytes --]
[-- Attachment #2: Type: text/plain, Size: 314 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- Attachment #3: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2007-10-24 14:02 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-22 7:01 KVM and Prempt? Back, Michael (ext)
2007-10-22 18:14 ` Sven-Thorsten Dietrich
2007-10-23 8:35 ` Jan Kiszka
2007-10-23 12:31 ` Gregory Haskins
2007-10-24 7:31 ` AW: " Back, Michael (ext)
2007-10-24 7:23 ` Back, Michael (ext)
-- strict thread matches above, loose matches on Subject: below --
2007-10-19 13:32 Back, Michael (ext)
[not found] ` <003F437218F04842B2A6976FA19368B1886A2F-EA/R+3GEQKtclD5KMHf1bFOnKfhBOm/VrE5yTffgRl4@public.gmane.org>
2007-10-19 13:57 ` Gregory Haskins
[not found] ` <1192802222.9564.4.camel-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-10-19 14:17 ` Back, Michael (ext)
[not found] ` <003F437218F04842B2A6976FA19368B1886A66-EA/R+3GEQKtclD5KMHf1bFOnKfhBOm/VrE5yTffgRl4@public.gmane.org>
2007-10-19 15:27 ` Gregory Haskins
[not found] ` <1192807627.9564.10.camel-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org>
2007-10-22 6:58 ` Back, Michael (ext)
[not found] ` <003F437218F04842B2A6976FA19368B1886B92-EA/R+3GEQKtclD5KMHf1bFOnKfhBOm/VrE5yTffgRl4@public.gmane.org>
2007-10-22 7:39 ` Avi Kivity
[not found] ` <471C53B7.1040208-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-22 11:37 ` Back, Michael (ext)
[not found] ` <003F437218F04842B2A6976FA19368B1886D5A-EA/R+3GEQKtclD5KMHf1bFOnKfhBOm/VrE5yTffgRl4@public.gmane.org>
2007-10-22 11:51 ` Avi Kivity
[not found] ` <471C8EC8.8060508-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-22 14:05 ` Back, Michael (ext)
2007-10-24 14:02 ` Back, Michael (ext)
2007-10-19 13:16 Back, Michael (ext)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.