BIO Pages for windows guest


#1

HI all
I am confused by a test on KVM. I set up KVM on centos6.4 and install windows xp as guest os. Then I use my own fn to take the place of make_request_fn of the block device where windows image file stay.
My own fn do nothing but print every bv_page for every bio received. When boot up the windows, many BIO use same bv_page for different sectors like below.
Jun 7 11:21:47 virt1 kernel: BIO: start: 51920464, len: 112, rw: 0x0, flag 0x2000000000000001
Jun 7 11:21:47 virt1 kernel: 0:ffffea001b768630 4096:0
Jun 7 11:21:47 virt1 kernel: 1:ffffea001b768668 4096:0
Jun 7 11:21:47 virt1 kernel: 2:ffffea001b742a00 4096:0
Jun 7 11:21:47 virt1 kernel: 3:ffffea001b742a00 4096:0
Jun 7 11:21:47 virt1 kernel: 4:ffffea001b7686a0 4096:0
Jun 7 11:21:47 virt1 kernel: 5:ffffea001b742a00 4096:0
Jun 7 11:21:47 virt1 kernel: 6:ffffea001b742a00 4096:0
Jun 7 11:21:47 virt1 kernel: 7:ffffea001b742a00 4096:0
Jun 7 11:21:47 virt1 kernel: 8:ffffea001b742a00 4096:0
Jun 7 11:21:47 virt1 kernel: 9:ffffea001b742a00 4096:0

Jun 7 11:21:47 virt1 kernel: 10:ffffea001b7686d8 4096:0
Jun 7 11:21:47 virt1 kernel: 11:ffffea001b768710 4096:0
Jun 7 11:21:47 virt1 kernel: 12:ffffea001b768748 4096:0
Jun 7 11:21:47 virt1 kernel: 13:ffffea001b767980 4096:0
Why use BIO like this? It’s cause by KVM or windows?


#2

printk(KERN_INFO"BIO: start: %ld,\tlen: %d,\trw: 0x%lx,\tflag 0x%lx\n",bio->bi_sector,to_sector(bio->bi_size),bio->bi_rw,bio->bi_flags); for(index=0;index<bio->bi_vcnt;index++){ printk(KERN_INFO" %d:%p %u:%u\n",ss,bio->bi_io_vec[index].bv_page,bio->bi_io_vec[index].bv_len,bio->bi_io_vec[index].bv_offset); }