qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] IO : Disk Sector Reads not aligned
@ 2013-07-09 17:04 Saptarshi Sen
  2013-07-09 18:06 ` Alex Bligh
  0 siblings, 1 reply; 2+ messages in thread
From: Saptarshi Sen @ 2013-07-09 17:04 UTC (permalink / raw)
  To: qemu-devel, qemu-discuss

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

Hi,

   I am trying to monitor the disk access pattern from the guest.

   and i am using an IDE as my virtual hard drive. My observation is that

   the sector reads are not 512 bytes aligned.

   I am gathering the stats from hw/ide/core.c in the function

   ide_dma_cb. variable :sector_num

   Should not these disk reads be 512 bytes aligned.

   Please help.

Regards

[-- Attachment #2: Type: text/html, Size: 542 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] IO : Disk Sector Reads not aligned
  2013-07-09 17:04 [Qemu-devel] IO : Disk Sector Reads not aligned Saptarshi Sen
@ 2013-07-09 18:06 ` Alex Bligh
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Bligh @ 2013-07-09 18:06 UTC (permalink / raw)
  To: Saptarshi Sen, qemu-devel, qemu-discuss; +Cc: Alex Bligh



--On 10 July 2013 01:04:35 +0800 Saptarshi Sen <saptarshi.mrg@gmail.com> 
wrote:

>    the sector reads are not 512 bytes aligned.
>
>    I am gathering the stats from hw/ide/core.c in the function
>
>    ide_dma_cb. variable :sector_num
>
>    Should not these disk reads be 512 bytes aligned.

As illustrated by the code below, sector_num is the number of the sector.
The byte offset is sector_num << 9. As sector_num is an integer, this makes
all the reads 512 byte aligned as far as I can see.

    n = s->io_buffer_size >> 9;
    sector_num = ide_get_sector(s);
    if (n > 0) {
        dma_buf_commit(s);
        sector_num += n;
        ide_set_sector(s, sector_num);
        s->nsector -= n;
    }

-- 
Alex Bligh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-09 18:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-09 17:04 [Qemu-devel] IO : Disk Sector Reads not aligned Saptarshi Sen
2013-07-09 18:06 ` Alex Bligh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).