Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-21 Thread Kevin Wolf
Am 20.09.2010 17:51, schrieb Anthony Liguori: > On 09/20/2010 10:08 AM, Kevin Wolf wrote: >> >>> If you're comfortable with a writeback cache for metadata, then you >>> should also be comfortable with a writeback cache for data in which >>> case, cache=writeback is the answer. >>> >> Well, th

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Anthony Liguori
On 09/20/2010 10:55 AM, Kevin Wolf wrote: Am 20.09.2010 17:40, schrieb Anthony Liguori: On 09/20/2010 10:08 AM, Kevin Wolf wrote: If you're comfortable with a writeback cache for metadata, then you should also be comfortable with a writeback cache for data in which case, cache=writeba

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Avi Kivity
On 09/20/2010 05:51 PM, Anthony Liguori wrote: On 09/20/2010 10:08 AM, Kevin Wolf wrote: If you're comfortable with a writeback cache for metadata, then you should also be comfortable with a writeback cache for data in which case, cache=writeback is the answer. Well, there is a difference: W

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Kevin Wolf
Am 20.09.2010 17:40, schrieb Anthony Liguori: > On 09/20/2010 10:08 AM, Kevin Wolf wrote: >>> If you're comfortable with a writeback cache for metadata, then you >>> should also be comfortable with a writeback cache for data in which >>> case, cache=writeback is the answer. >>> >> Well, there

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Anthony Liguori
On 09/20/2010 10:08 AM, Kevin Wolf wrote: If you're comfortable with a writeback cache for metadata, then you should also be comfortable with a writeback cache for data in which case, cache=writeback is the answer. Well, there is a difference: We don't pollute the host page cache with gu

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Anthony Liguori
On 09/20/2010 10:33 AM, Kevin Wolf wrote: Am 20.09.2010 16:56, schrieb Anthony Liguori: +void blkqueue_flush(BlockQueue *bq) +{ +qemu_mutex_lock(&bq->flush_lock); + +/* Process any left over requests */ +while (QTAILQ_FIRST(&bq->queue)) { +blkqueue_process_request(bq); +

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Kevin Wolf
Am 20.09.2010 17:33, schrieb Avi Kivity: > On 09/20/2010 05:08 PM, Kevin Wolf wrote: >>> >>> Let's expand it a bit more: >>> >>> 1. Update refcount table >>> 2. bdrv_flush >>> 3. Update L2 entry >>> 4. Write data to disk >>> 5. Report write complete >>> >>> I'm struggling to understand how

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Anthony Liguori
On 09/20/2010 10:08 AM, Kevin Wolf wrote: If you're comfortable with a writeback cache for metadata, then you should also be comfortable with a writeback cache for data in which case, cache=writeback is the answer. Well, there is a difference: We don't pollute the host page cache with gues

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Avi Kivity
On 09/20/2010 05:33 PM, Avi Kivity wrote: On 09/20/2010 05:08 PM, Kevin Wolf wrote: > > Let's expand it a bit more: > > 1. Update refcount table > 2. bdrv_flush > 3. Update L2 entry > 4. Write data to disk > 5. Report write complete > > I'm struggling to understand how a thread helps ou

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Avi Kivity
On 09/20/2010 05:08 PM, Kevin Wolf wrote: > > Let's expand it a bit more: > > 1. Update refcount table > 2. bdrv_flush > 3. Update L2 entry > 4. Write data to disk > 5. Report write complete > > I'm struggling to understand how a thread helps out. This sequence becomes: 1. Update refcou

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Kevin Wolf
Am 20.09.2010 16:56, schrieb Anthony Liguori: >>> +void blkqueue_flush(BlockQueue *bq) >>> +{ >>> +qemu_mutex_lock(&bq->flush_lock); >>> + >>> +/* Process any left over requests */ >>> +while (QTAILQ_FIRST(&bq->queue)) { >>> +blkqueue_process_request(bq); >>> +} >>> + >>> +

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Kevin Wolf
Am 20.09.2010 16:31, schrieb Anthony Liguori: > On 09/20/2010 08:56 AM, Kevin Wolf wrote: >> I won't get this ready until I leave for vacation on Wednesday, so I thought >> I >> could just as well post it as an RFC in this state. >> >> With this patch applied, qcow2 doesn't directly access the ima

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Anthony Liguori
On 09/20/2010 09:31 AM, Anthony Liguori wrote: If we delay the operation and get three of these sequences queued before actually executing, we end up with the following result, saving two syncs: 1. Update refcount table (req 1) 2. Update refcount table (req 2) 3. Update refcount table (req 3)

Re: [Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Anthony Liguori
On 09/20/2010 08:56 AM, Kevin Wolf wrote: I won't get this ready until I leave for vacation on Wednesday, so I thought I could just as well post it as an RFC in this state. With this patch applied, qcow2 doesn't directly access the image file any more for metadata, but rather goes through the ne

[Qemu-devel] [RFC] block-queue: Delay and batch metadata writes

2010-09-20 Thread Kevin Wolf
I won't get this ready until I leave for vacation on Wednesday, so I thought I could just as well post it as an RFC in this state. With this patch applied, qcow2 doesn't directly access the image file any more for metadata, but rather goes through the newly introduced blkqueue. Write and sync requ