From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvqET-00007y-AW for qemu-devel@nongnu.org; Mon, 30 Jul 2012 09:42:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvqEP-0000Ak-1Q for qemu-devel@nongnu.org; Mon, 30 Jul 2012 09:42:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvqEO-00009v-PM for qemu-devel@nongnu.org; Mon, 30 Jul 2012 09:41:56 -0400 Message-ID: <50168F20.9010000@redhat.com> Date: Mon, 30 Jul 2012 15:41:52 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1343127865-16608-1-git-send-email-pbonzini@redhat.com> <1343127865-16608-45-git-send-email-pbonzini@redhat.com> <5013ED3B.5050808@redhat.com> In-Reply-To: <5013ED3B.5050808@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 44/47] mirror: switch mirror_iteration to AIO List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com Il 28/07/2012 15:46, Eric Blake ha scritto: > On 07/24/2012 05:04 AM, Paolo Bonzini wrote: >> There is really no change in the behavior of the job here, since there >> is still a maximum of one in-flight I/O operation between the source and >> the target. However, this patch already introduces moves the copy logic > > grammar: 'already introduces moves' is awkward, but I'm not sure what > you meant. > >> from mirror_iteration to AIO callbacks; it also adds the logic to count >> in-flight operations, and only complete the job after they have finished. > > s/complete/completes/ Wow, I'm embarrassed... >> >> Some care is required in the error and cancellation cases, in order >> to avoid access to dangling pointers (and consequent corruption). >> >> Signed-off-by: Paolo Bonzini >> --- >> block/mirror.c | 161 ++++++++++++++++++++++++++++++++++++++++++-------------- >> trace-events | 2 + >> 2 files changed, 123 insertions(+), 40 deletions(-) >> >> diff --git a/block/mirror.c b/block/mirror.c >> index 81a600b..971c923 100644 >> --- a/block/mirror.c >> +++ b/block/mirror.c >> @@ -17,7 +17,7 @@ >> #include "qemu/ratelimit.h" >> #include "bitmap.h" >> >> -#define SLICE_TIME 100000000ULL /* ns */ >> +#define SLICE_TIME 100000000ULL /* ns */ > > Why the spurious respacing? This patch was split from the one that introduces MAX_IN_FLIGHT. #define SLICE_TIME 100000000ULL /* ns */ +#define MAX_IN_FLIGHT 16 so the respacing belongs there. Paolo