Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-28 Thread Kevin Wolf
Am 27.02.2013 um 16:38 hat Dietmar Maurer geschrieben: > > > Adding and IO queue and implement a scheduler is likely not what we want > > > to > > do. > > > > The starting point for something smarter than just no policy or > > rate-limiting is > > BlockDriverState->tracked_requests. block.c kee

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-27 Thread Dietmar Maurer
> > Adding and IO queue and implement a scheduler is likely not what we want to > do. > > The starting point for something smarter than just no policy or rate-limiting > is > BlockDriverState->tracked_requests. block.c keeps track of active requests > using this list. > > The simplest policy us

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-27 Thread Stefan Hajnoczi
On Tue, Feb 26, 2013 at 05:02:19PM +, Dietmar Maurer wrote: > > If you want to implement an alternative to rate-limiting, please do it in a > > separate patch series and make it work for all block job types. > > Well, I hoped you can see how to fix that. I guess the same applies for other > t

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-26 Thread Dietmar Maurer
> I just reread the code and noticed the delay is 1 microsecond, not 1 > millisecond. Yes, It does not really add a delay. > The problem is that this is a magic value. It worked on your machine with > your > workload, but there's no guarantee it works on anyone else's machine or > workload. W

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-26 Thread Stefan Hajnoczi
On Mon, Feb 25, 2013 at 03:49:11PM +, Dietmar Maurer wrote: > > > We previously used LVM and run backup with 'idle' IO priority (CFQ) to > > > avoid > > such behavior. > > > > > > But qemu does not provide an IO queue where we can set scheduling > > priorities? > > > > QEMU block jobs support

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-26 Thread Dietmar Maurer
> QEMU is not in a position to implement global scheduling (priorities). > The QEMU process only knows about one guest. If you have multiple guests on > the host an I/O "priority" inside QEMU process A will not take into account > QEMU process B. I only want priorities inside the guest. The backu

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-26 Thread Stefan Hajnoczi
On Mon, Feb 25, 2013 at 03:49:11PM +, Dietmar Maurer wrote: > > > We previously used LVM and run backup with 'idle' IO priority (CFQ) to > > > avoid > > such behavior. > > > > > > But qemu does not provide an IO queue where we can set scheduling > > priorities? > > > > QEMU block jobs support

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-25 Thread Dietmar Maurer
> > We previously used LVM and run backup with 'idle' IO priority (CFQ) to avoid > such behavior. > > > > But qemu does not provide an IO queue where we can set scheduling > priorities? > > QEMU block jobs support rate-limiting. Set it to 10-20% of the disk's > throughput > and the slowness shou

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-25 Thread Stefan Hajnoczi
On Mon, Feb 25, 2013 at 06:48:39AM +, Dietmar Maurer wrote: > > > > > +for (; start < end; start++) { > > > > > +if (block_job_is_cancelled(&job->common)) { > > > > > +ret = -1; > > > > > +break; > > > > > +} > > > > > + > > > > > +/* we need

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-24 Thread Dietmar Maurer
> > > > +for (; start < end; start++) { > > > > +if (block_job_is_cancelled(&job->common)) { > > > > +ret = -1; > > > > +break; > > > > +} > > > > + > > > > +/* we need to yield so that qemu_aio_flush() returns. > > > > + * (without, VM do

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-21 Thread Stefan Hajnoczi
On Thu, Feb 21, 2013 at 05:23:30AM +, Dietmar Maurer wrote: > > > +static void coroutine_fn backup_run(void *opaque) { > > > +BackupBlockJob *job = opaque; > > > +BlockDriverState *bs = job->common.bs; > > > +assert(bs); > > > + > > > +int64_t start, end; > > > + > > > +star

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-20 Thread Dietmar Maurer
> > +bit = cluster_num % BITS_PER_LONG; > > +val = job->bitmap[idx]; > > +if (dirty) { > > +if (!(val & (1UL << bit))) { > > +val |= 1UL << bit; > > +} > > +} else { > > +if (val & (1UL << bit)) { > > +val &= ~(1UL << bit); > > +

Re: [Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-20 Thread Stefan Hajnoczi
On Wed, Feb 20, 2013 at 10:31:59AM +0100, Dietmar Maurer wrote: > +typedef struct BackupBlockJob { > +BlockJob common; > +RateLimit limit; > +uint64_t sectors_read; > +unsigned long *bitmap; > +int bitmap_size; > +BackupDumpFunc *backup_dump_cb; > +BlockDriverCompletionF

[Qemu-devel] [PATCH v4 2/6] add basic backup support to block driver

2013-02-20 Thread Dietmar Maurer
Function backup_job_create() creates a block job to backup a block device. The coroutine is started with backup_job_start(). We call backup_do_cow() for each write during backup. That function reads the original data and pass it to backup_dump_cb(). The tracked_request infrastructure is used to s