Skip to contentSkip to conversation

Add KSM test

PATCH Jiri Zupka 3 participants 3 messages Sep 25, 2009 – Sep 30, 2009 1 message not in the archive KVM

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 830286859.775301253870289468.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com

Jiri Zupka

author
#1 lore raw
Quoted 37 lines · ----- "Dor Laor
Quoted 6 lines · Jiri Zupka
Quoted 3 lines · ----- "Dor Laor
Quoted 2 lines · Jiri Zupka
Quoted 2 lines

After a quick review I have the following questions:
1. Why did you implement the guest tool in 'c' and not in

python?

Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line

Python is much simpler and you can share some code with the

server.

Quoted 1 line
Quoted 1 line

This 'test protocol' would also be easier to understand this

way.

Quoted 2 lines

We need speed and the precise control of allocate memory in

pages.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

2. IMHO there is no need to use select, you can do blocking

read.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

We replace socket communication by interactive program

communication

Quoted 3 lines
Quoted 3 lines

via ssh/telnet

Quoted 2 lines
Quoted 2 lines

3. Also you can use plain malloc without the more complex ( a

bit)

Quoted 7 lines
Quoted 7 lines

mmap.

Quoted 2 lines

We need address exactly the memory pages. We can't allow shift of

the data in memory.

You can use the tmpfs+dd idea instead of the specific program as I detailed before. Maybe some other binary can be used. My intention

is

Quoted 4 lines
Quoted 3 lines

to
simplify the test/environment as much as possible.

Quoted 5 lines
Quoted 2 lines

We need compatibility with others system, like Windows etc.. We want to add support for others system in next version

KSM is a host feature and should be agnostic to the guest. Also I don't think your code will compile on windows...

Yes, I think you have true.

But because we need generate special data to pages in memory. We need use script on guest side of test. Because communication over ssh is to slow to transfer lot of GB of special data to guests.

We can use optimized C program which is 10x and more faster than python script on native system. Heavy load of virtual guest can make some performance problem.

We can use tmpfs but with python script to generate special data. We can't use dd with random because we need test some special case. (change only last 96B of page etc.. )

What do you think about it?

Quoted 13 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at

http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 39 lines · Jiri Zupka
Quoted 37 lines · ----- "Dor Laor
Quoted 6 lines · Jiri Zupka
Quoted 3 lines · ----- "Dor Laor
Quoted 2 lines · Jiri Zupka
Quoted 2 lines

After a quick review I have the following questions:
1. Why did you implement the guest tool in 'c' and not in

python?

Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line

Python is much simpler and you can share some code with the

server.

Quoted 1 line
Quoted 1 line

This 'test protocol' would also be easier to understand this

way.

Quoted 2 lines

We need speed and the precise control of allocate memory in

pages.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

2. IMHO there is no need to use select, you can do blocking

read.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

We replace socket communication by interactive program

communication

Quoted 3 lines
Quoted 3 lines

via ssh/telnet

Quoted 2 lines
Quoted 2 lines

3. Also you can use plain malloc without the more complex ( a

bit)

Quoted 7 lines
Quoted 7 lines

mmap.

Quoted 2 lines

We need address exactly the memory pages. We can't allow shift of

the data in memory.

You can use the tmpfs+dd idea instead of the specific program as I detailed before. Maybe some other binary can be used. My intention

is

Quoted 4 lines
Quoted 3 lines

to
simplify the test/environment as much as possible.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

We need compatibility with others system, like Windows etc.. We want to add support for others system in next version

KSM is a host feature and should be agnostic to the guest. Also I don't think your code will compile on windows...

Yes, I think you have true.

First of all, sorry, I am doing the best I can to review carefully all the patch queue, and as KSM is a more involved feature that I am not very familiar with, I need a bit more time to review it!

Quoted 7 lines

But because we need generate special data to pages in memory. We need use script on guest side of test. Because communication over ssh is to slow to transfer lot of GB of special data to guests.

We can use optimized C program which is 10x and more faster than python script on native system. Heavy load of virtual guest can make some performance problem.

About code compiling under windows, I guess making a native windows c or c++ program is an option, I generally agree with your reasoning, this case seems to be better covered with a c program. Will get into it in more detail ASAP...

Quoted 24 lines

We can use tmpfs but with python script to generate special data. We can't use dd with random because we need test some special case. (change only last 96B of page etc.. )

What do you think about it?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at

Quoted 6 lines

http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 56 lines · Lucas Meneghel Rodrigues
Quoted 39 lines · Jiri Zupka
Quoted 37 lines · ----- "Dor Laor
Quoted 6 lines · Jiri Zupka
Quoted 3 lines · ----- "Dor Laor
Quoted 2 lines · Jiri Zupka
Quoted 2 lines

After a quick review I have the following questions:
1. Why did you implement the guest tool in 'c' and not in

python?

Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line

Python is much simpler and you can share some code with the

server.

Quoted 1 line
Quoted 1 line

This 'test protocol' would also be easier to understand this

way.

Quoted 2 lines

We need speed and the precise control of allocate memory in

pages.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

2. IMHO there is no need to use select, you can do blocking

read.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

We replace socket communication by interactive program

communication

Quoted 3 lines
Quoted 3 lines

via ssh/telnet

Quoted 2 lines
Quoted 2 lines

3. Also you can use plain malloc without the more complex ( a

bit)

Quoted 7 lines
Quoted 7 lines

mmap.

Quoted 2 lines

We need address exactly the memory pages. We can't allow shift of

the data in memory.

You can use the tmpfs+dd idea instead of the specific program as I detailed before. Maybe some other binary can be used. My intention

is

Quoted 4 lines
Quoted 3 lines

to
simplify the test/environment as much as possible.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

We need compatibility with others system, like Windows etc.. We want to add support for others system in next version

KSM is a host feature and should be agnostic to the guest. Also I don't think your code will compile on windows...

Yes, I think you have true.

First of all, sorry, I am doing the best I can to review carefully all the patch queue, and as KSM is a more involved feature that I am not very familiar with, I need a bit more time to review it!

Quoted 4 lines

But because we need generate special data to pages in memory. We need use script on guest side of test. Because communication over ssh is to slow to transfer lot of GB of special data to guests.

Quoted 15 lines
Quoted 3 lines

We can use optimized C program which is 10x and more faster than python script on native system. Heavy load of virtual guest can make some performance problem.

About code compiling under windows, I guess making a native windows c or c++ program is an option, I generally agree with your reasoning, this case seems to be better covered with a c program. Will get into it in more detail ASAP...

Quoted 6 lines

We can use tmpfs but with python script to generate special data. We can't use dd with random because we need test some special case. (change only last 96B of page etc.. )

What do you think about it?

I think it can be done with some simple scripting and it will be fast enough and more importantly, easier to understand and to change in the future.

Here is a short example for creating lots of identical pages that contain '0' apart for the last two bytes. If you'll run it in a single guest you should expect to save lots of memory. Then you can change the last bytes to random value and see the memory consumption grow:
[Remember to cancel the guest swap to keep it in the guest ram]

dd if=/dev/zero of=template count=1 bs=4094
echo '1' >> template
cp template large_file
for ((i=0;i<10;i++)) do dd if=large_file of=large_file conv=notrunc oflag=append > /dev/null 2>&1 ; done

It creates a 4k*2^10 file with identical pages (since it's on tmpfs with no swap)

Can you try it? It should be far simpler than the original option.

Thanks,
Dor