Skip to contentSkip to conversation

Xen paging unit test

DISCUSSION Andres Lagar-Cavilla 2 participants 3 messages Sep 10, 2012

lore
Share & tools
lore
#0 lore raw

Hi,
In the process of submitting the privcmd MMAP_BATCH_V2 patches for Linux 3.7, Konrad asked a very valid question:

"How do you test this thing?"

Turns out that you have two ways
1. You do the actual paging thing on a live domain
2. I had a unit test buried in my stash

Coincidentally, Ian C asked for demonstrable consumers of the xenpaging interface in the process of summarizing the 4.2 change log.

I've github'ed my paging unit test in the hopes it will be found useful, not only as a unit test, but also a demo/reference piece of code.

The unit test exercises the privcmd/libxc interface for creating foreign mappings of paged out pages. As a precondition, it must create a domain, enable paging on it, and act as a pager to satisfy the page-in requests generated by the foreign maps.

https://github.com/andreslagarcavilla/xenpagingtest

This might be considered useful for tools/tests in xen-unstable, and I'll be happy to resubmit in a suitable form if you ask.

Cheers
Andres

#1 lore raw
Quoted 16 lines · Andres Lagar-Cavilla

Hi,
In the process of submitting the privcmd MMAP_BATCH_V2 patches for Linux 3.7, Konrad asked a very valid question:

"How do you test this thing?"

Turns out that you have two ways
1. You do the actual paging thing on a live domain
2. I had a unit test buried in my stash

Coincidentally, Ian C asked for demonstrable consumers of the xenpaging interface in the process of summarizing the 4.2 change log.

I've github'ed my paging unit test in the hopes it will be found useful, not only as a unit test, but also a demo/reference piece of code.

Quoted 6 lines

The unit test exercises the privcmd/libxc interface for creating foreign mappings of paged out pages. As a precondition, it must create a domain, enable paging on it, and act as a pager to satisfy the page-in requests generated by the foreign maps.

https://github.com/andreslagarcavilla/xenpagingtest

I get a server error (cat holding a 500? so error code 500? nice way to obfuscate the useful info!) from this.

I stripped off a level and tried https://github.com/andreslagarcavilla
but that gets me an angry unicorn saying "Page did not respond in a timely fashion.".

:-)

Is this similar to/derived from tools/xenpaging?

Quoted 5 lines

This might be considered useful for tools/tests in xen-unstable, and I'll be happy to resubmit in a suitable form if you ask.

Cheers
Andres

#2 lore raw
Quoted 24 lines · Ian Campbell
Quoted 16 lines · Andres Lagar-Cavilla

Hi,
In the process of submitting the privcmd MMAP_BATCH_V2 patches for Linux 3.7, Konrad asked a very valid question:

"How do you test this thing?"

Turns out that you have two ways
1. You do the actual paging thing on a live domain
2. I had a unit test buried in my stash

Coincidentally, Ian C asked for demonstrable consumers of the xenpaging interface in the process of summarizing the 4.2 change log.

I've github'ed my paging unit test in the hopes it will be found useful, not only as a unit test, but also a demo/reference piece of code.

Quoted 6 lines

The unit test exercises the privcmd/libxc interface for creating foreign mappings of paged out pages. As a precondition, it must create a domain, enable paging on it, and act as a pager to satisfy the page-in requests generated by the foreign maps.

https://github.com/andreslagarcavilla/xenpagingtest

Quoted 8 lines

I get a server error (cat holding a 500? so error code 500? nice way to obfuscate the useful info!) from this.

I stripped off a level and tried https://github.com/andreslagarcavilla
but that gets me an angry unicorn saying "Page did not respond in a timely fashion.".

:-)

I think github is just having a hard time right now. Many people are getting visits from angry unicorns.

Quoted 2 lines

Is this similar to/derived from tools/xenpaging?

Not really derived. The test will set up a dummy domain, page it out, and set up a pager. In a child process it will perform a number of different foreign mapping operations and patterns and check that everything works out well.

Similar to xenpaging in that they need to do similar things for setting up paging and watching paging events. But the unit test can afford the luxury of going straight to the point without bothering about user input, xenstore, what not.

Andres

Quoted 8 lines
Quoted 6 lines

This might be considered useful for tools/tests in xen-unstable, and I'll be happy to resubmit in a suitable form if you ask.

Cheers
Andres