Skip to contentSkip to conversation

Question about posixaio thread number.

Qemu-devel Gui Jianfeng 2 participants 3 messages Aug 3, 2011

lore
Share & tools
lore
#1 lore raw
In reply to Gui Jianfeng

Hi Anthony,

I started a guest with cache=none and aio=threads

When i did some io tests in Guest say dd like
dd if=/dev/zero oflag=direct of=/mnt/sdb1/date.img bs=4k count=262114

qemu will start one or several threads to perform IO requests.

It seems qemu makes use of its own posixaio. I'm wondering how qemu decides how many threads should be created to perform io operation?

Thanks,
Gui

#0 lore raw

Hi Anthony,

I started a guest with cache=none and aio=threads

When i did some io tests in Guest say dd like
dd if=/dev/zero oflag=direct of=/mnt/sdb1/date.img bs=4k count=262114

qemu will start one or several threads to perform IO requests.

It seems qemu makes use of its own posixaio. I'm wondering how qemu decides how many threads should be created to perform io operation?

Thanks,
Gui

#2 lore raw
Quoted 7 lines · Gui Jianfeng

When i did some io tests in Guest say dd like
dd if=/dev/zero oflag=direct of=/mnt/sdb1/date.img bs=4k count=262114

qemu will start one or several threads to perform IO requests.

It seems qemu makes use of its own posixaio. I'm wondering how qemu decides how many threads should be created to perform io operation?

Look at posix-aio-compat.c.

If a new request comes in and there is no idle thread around, a new thread will be spawned up to a maximum limit.

When you run a synchronous I/O workload like dd(1), expect to see only 1 or 2 aio worker threads. If the workload is multithreaded, expect to see many (depending on the guest's queue depth).

Stefan