Skip to contentSkip to conversation

VMware and ACPI

DISCUSSION Jan Rychter 4 participants 7 messages Sep 15, 2003 – Sep 23, 2003 4 messages not in the archive ACPI

lore
Share & tools
lore
#0 lore raw

Hmm... just wondering: what happened to the VMware/ACPI interaction issues that some people were reporting here?

There were some discussions and it seemed that ACPI idling the processor while VMware really wanted to use it was the cuplrit. Any resulting changes?

I'm running 2.4.22-pre10 now and my WindowsXP inside VMware runs horribly slow. It gets considerably better if I leave an USB device plugged in (which causes ACPI to use C2 only and never go into C3), but it still isn't full speed.

--J.

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#2 lore raw
In reply to a message not in the archive
Quoted 11 lines · Jan Rychter

Hmm... just wondering: what happened to the VMware/ACPI interaction issues that some people were reporting here?

There were some discussions and it seemed that ACPI idling the processor while VMware really wanted to use it was the cuplrit. Any resulting changes?

I'm running 2.4.22-pre10 now and my WindowsXP inside VMware runs horribly slow. It gets considerably better if I leave an USB device plugged in (which causes ACPI to use C2 only and never go into C3), but it still isn't full speed.

Yes, there is still a problem. I use the appending patch since ages. Before starting VMware, I do

echo -n "0" > /proc/acpi/processor/CPU/power

and after VMware has terminated I do

echo -n "1" > /proc/acpi/processor/CPU/power

This prevents ACPI from going into C2 while VMware is active. This solves at least my problems (slow, bad response) with Windows NT on VMware. I'm using Linux-2.4.22.

Frank

Signature · 2 lines
## Dept. of Computer Science, Dresden University of Technology, Germany ##
## http://os.inf.tu-dresden.de/~fm3                                     ##
drivers/acpi/processor.c +32 -0
@@ -1677,6 +1677,37 @@
 
 
 static int
+acpi_processor_write_power (
+        struct file		*file,
+        const char		*buffer,
+        unsigned long		count,
+        void			*data)
+{
+	struct acpi_processor	*pr = (struct acpi_processor *) data;
+	char			state_string[2] = {'\0'};
+
+	if (!pr || (count > sizeof(state_string) - 1))
+		return_VALUE(-EINVAL);
+	
+	if (copy_from_user(state_string, buffer, count))
+		return_VALUE(-EFAULT);
+	
+	state_string[count] = '\0';
+
+	if (state_string[0] == '1') {
+	    printk(KERN_INFO PREFIX "enabling acpi idle\n");
+	    pm_idle = acpi_processor_idle;
+	} else {
+	    printk(KERN_INFO PREFIX "disabling acpi idle\n");
+	    pm_idle = pm_idle_save;
+	    acpi_processor_power_activate(pr, ACPI_STATE_C1);
+	}
+
+	return_VALUE(count);
+}
+
+
+static int
 acpi_processor_read_performance (
 	char			*page,
 	char			**start,
@@ -1982,6 +2013,7 @@
 			ACPI_PROCESSOR_FILE_POWER));
 	else {
 		entry->read_proc = acpi_processor_read_power;
+		entry->write_proc = acpi_processor_write_power;
 		entry->data = acpi_driver_data(device);
 	}
 
#4 lore raw
In reply to a message not in the archive
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Frank" == Frank Mehnert <fm3-IG//[email protected]> writes:

Quoted 11 lines · Jan Rychter
Quoted 11 lines

Hmm... just wondering: what happened to the VMware/ACPI interaction issues that some people were reporting here?

There were some discussions and it seemed that ACPI idling the processor while VMware really wanted to use it was the cuplrit. Any resulting changes?

I'm running 2.4.22-pre10 now and my WindowsXP inside VMware runs horribly slow. It gets considerably better if I leave an USB device plugged in (which causes ACPI to use C2 only and never go into C3), but it still isn't full speed.

Frank> Yes, there is still a problem. I use the appending patch since Frank> ages. Before starting VMware, I do

Frank> echo -n "0" > /proc/acpi/processor/CPU/power
[...]

Thanks. I'll apply this patch.

Is there any chance that this kind of patch could make it into the mainline? It is really needed for some of us (everybody running VMware, for one).

BTW, if I do the above echo to a "standard" ACPI (2.4.22), my shell segfaults. This is probably a bug.

--J.

#5 lore raw
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Jan" == Jan Rychter <[email protected]> writes:
"Frank" == Frank Mehnert <fm3-IG//[email protected]> writes:

Quoted 11 lines · Jan Rychter

Hmm... just wondering: what happened to the VMware/ACPI interaction issues that some people were reporting here?

There were some discussions and it seemed that ACPI idling the processor while VMware really wanted to use it was the cuplrit. Any resulting changes?

I'm running 2.4.22-pre10 now and my WindowsXP inside VMware runs horribly slow. It gets considerably better if I leave an USB device plugged in (which causes ACPI to use C2 only and never go into C3), but it still isn't full speed.

Frank> Yes, there is still a problem. I use the appending patch since Frank> ages. Before starting VMware, I do

Frank> echo -n "0" > /proc/acpi/processor/CPU/power Jan> [...]

Jan> Thanks. I'll apply this patch.

Jan> Is there any chance that this kind of patch could make it into the Jan> mainline? It is really needed for some of us (everybody running Jan> VMware, for one).

Here is the patch slightly fixed for the ACPI in 2.4.22 (the old one did not compile).

Could we please make it go in as a temporary workaround, so that people can actually use VMware on Linux?

--J.

acpi/processor.c renamed from acpi/processor.c.orig +34 -0
@@ -1677,6 +1677,39 @@
 
 
 static int
+acpi_processor_write_power (
+        struct file  *file,
+        const char  *buffer,
+        unsigned long  count,
+        void   *data)
+{
+ struct acpi_processor *pr = (struct acpi_processor *) data;
+ char   state_string[2] = {'\0'};
+	
+ ACPI_FUNCTION_TRACE("acpi_processor_write_power");
+
+ if (!pr || (count > sizeof(state_string) - 1))
+  return_VALUE(-EINVAL);
+ 
+ if (copy_from_user(state_string, buffer, count))
+  return_VALUE(-EFAULT);
+ 
+ state_string[count] = '\0';
+
+ if (state_string[0] == '1') {
+     printk(KERN_INFO PREFIX "enabling acpi idle\n");
+     pm_idle = acpi_processor_idle;
+ } else {
+     printk(KERN_INFO PREFIX "disabling acpi idle\n");
+     pm_idle = pm_idle_save;
+     acpi_processor_power_activate(pr, ACPI_STATE_C1);
+ }
+
+ return_VALUE(count);
+}
+
+
+static int
 acpi_processor_read_performance (
 	char			*page,
 	char			**start,
@@ -1982,6 +2015,7 @@
 			ACPI_PROCESSOR_FILE_POWER));
 	else {
 		entry->read_proc = acpi_processor_read_power;
+		entry->write_proc = acpi_processor_write_power;
 		entry->data = acpi_driver_data(device);
 	}
 
#6 lore raw
In reply to a message not in the archive

Hi!

Quoted 11 lines

Hmm... just wondering: what happened to the VMware/ACPI interaction issues that some people were reporting here?

There were some discussions and it seemed that ACPI idling the processor while VMware really wanted to use it was the cuplrit. Any resulting changes?

I'm running 2.4.22-pre10 now and my WindowsXP inside VMware runs horribly slow. It gets considerably better if I leave an USB device plugged in (which causes ACPI to use C2 only and never go into C3), but it still isn't full speed.

What about something like

nice -n 19 while1

?

Signature · 8 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
#8 lore raw
In reply to a message not in the archive
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Pavel" == Pavel Machek <[email protected]> writes:

Hmm... just wondering: what happened to the VMware/ACPI interaction issues that some people were reporting here?

Quoted 8 lines
Quoted 8 lines

There were some discussions and it seemed that ACPI idling the processor while VMware really wanted to use it was the cuplrit. Any resulting changes?

I'm running 2.4.22-pre10 now and my WindowsXP inside VMware runs horribly slow. It gets considerably better if I leave an USB device plugged in (which causes ACPI to use C2 only and never go into C3), but it still isn't full speed.

Pavel> What about something like

Pavel> nice -n 19 while1

"something like" this doesn't do the job nearly as well, because:

1) performance is better than with an otherwise idle machine, but not as good as with the C-state handling turned off

2) it eats more power, keeping the cpu in C1 is not the same as keeping it busy

Please, can we have the patch (attached here again, for everyone's convenience) applied? It doesn't do anything harmful to people that do not use it, it just gives us the option of actually running VMware on Linux.

--J.

acpi/processor.c renamed from acpi/processor.c.orig +34 -0
@@ -1677,6 +1677,39 @@
 
 
 static int
+acpi_processor_write_power (
+        struct file  *file,
+        const char  *buffer,
+        unsigned long  count,
+        void   *data)
+{
+ struct acpi_processor *pr = (struct acpi_processor *) data;
+ char   state_string[2] = {'\0'};
+	
+ ACPI_FUNCTION_TRACE("acpi_processor_write_power");
+
+ if (!pr || (count > sizeof(state_string) - 1))
+  return_VALUE(-EINVAL);
+ 
+ if (copy_from_user(state_string, buffer, count))
+  return_VALUE(-EFAULT);
+ 
+ state_string[count] = '\0';
+
+ if (state_string[0] == '1') {
+     printk(KERN_INFO PREFIX "enabling acpi idle\n");
+     pm_idle = acpi_processor_idle;
+ } else {
+     printk(KERN_INFO PREFIX "disabling acpi idle\n");
+     pm_idle = pm_idle_save;
+     acpi_processor_power_activate(pr, ACPI_STATE_C1);
+ }
+
+ return_VALUE(count);
+}
+
+
+static int
 acpi_processor_read_performance (
 	char			*page,
 	char			**start,
@@ -1982,6 +2015,7 @@
 			ACPI_PROCESSOR_FILE_POWER));
 	else {
 		entry->read_proc = acpi_processor_read_power;
+		entry->write_proc = acpi_processor_write_power;
 		entry->data = acpi_driver_data(device);
 	}
 
#10 lore raw
In reply to a message not in the archive

Hi!

Quoted 15 lines
Quoted 8 lines
Quoted 8 lines

There were some discussions and it seemed that ACPI idling the processor while VMware really wanted to use it was the cuplrit. Any resulting changes?

I'm running 2.4.22-pre10 now and my WindowsXP inside VMware runs horribly slow. It gets considerably better if I leave an USB device plugged in (which causes ACPI to use C2 only and never go into C3), but it still isn't full speed.

Pavel> What about something like

Pavel> nice -n 19 while1

"something like" this doesn't do the job nearly as well, because:

Quoted 8 lines

1) performance is better than with an otherwise idle machine, but not as good as with the C-state handling turned off

2) it eats more power, keeping the cpu in C1 is not the same as keeping it busy

Please, can we have the patch (attached here again, for everyone's convenience) applied? It doesn't do anything harmful to people that do

Looks sane to me. Possible refinement would be saying "max Cx state you are allowed to use"; one some machines C3 is usable but is marked bad by bios, it could be reenabled by this.

Signature · 9 lines
				Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf