From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHwLL-0001kw-2G for qemu-devel@nongnu.org; Tue, 19 Mar 2013 09:12:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHwLE-0003U6-1g for qemu-devel@nongnu.org; Tue, 19 Mar 2013 09:12:42 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:58085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHwLD-0003Tt-UY for qemu-devel@nongnu.org; Tue, 19 Mar 2013 09:12:35 -0400 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Mar 2013 09:12:35 -0400 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id E2FA538C801C for ; Tue, 19 Mar 2013 09:12:32 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2JDCWek61407370 for ; Tue, 19 Mar 2013 09:12:32 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2JDCVju020311 for ; Tue, 19 Mar 2013 10:12:31 -0300 Message-ID: <5148643F.2070401@linux.vnet.ibm.com> Date: Tue, 19 Mar 2013 09:12:31 -0400 From: "Michael R. Hines" MIME-Version: 1.0 References: <1363576743-6146-1-git-send-email-mrhines@linux.vnet.ibm.com> <1363576743-6146-9-git-send-email-mrhines@linux.vnet.ibm.com> <5146D9BF.3030407@redhat.com> <51477A26.8090600@linux.vnet.ibm.com> <51482D78.3010301@redhat.com> In-Reply-To: <51482D78.3010301@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH RDMA support v4: 08/10] introduce QEMUFileRDMA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aliguori@us.ibm.com, mst@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com On 03/19/2013 05:18 AM, Paolo Bonzini wrote: > Il 18/03/2013 21:33, Michael R. Hines ha scritto: >>> +int qemu_drain(QEMUFile *f) >>> +{ >>> + return f->ops->drain ? f->ops->drain(f->opaque) : 0; >>> +} >>> Hmm, this is very similar to qemu_fflush, but not quite. :/ >>> >>> Why exactly is this needed? >> Good idea - I'll replace drain with flush once I added >> the "qemu_file_ops_are(const QEMUFile *, const QEMUFileOps *) " >> that you recommended...... > If I understand correctly, the problem is that save_rdma_page is > asynchronous and you have to wait for pending operations to do the > put_buffer protocol correctly. > > Would it work to just do the "drain" in the put_buffer operation, if and > only if it was preceded by a save_rdma_page operation? Yes, the drain needs to happen in a few places already: 1. During save_rdma_page (if the current "chunk" is full of pages) 2. During the end of each iteration (now using qemu_fflush in my current patch) 3. And also during qemu_savem_state_complete(), also using qemu_fflush. >>>> /** Flushes QEMUFile buffer >>>> * >>>> */ >>>> @@ -723,6 +867,8 @@ int qemu_get_byte(QEMUFile *f) >>>> int64_t qemu_ftell(QEMUFile *f) >>>> { >>>> qemu_fflush(f); >>>> + if(migrate_use_rdma(f)) >>>> + return delta_norm_mig_bytes_transferred(); >>> Not needed, and another undesirable dependency (savevm.c -> >>> arch_init.c). Just update f->pos in save_rdma_page. >> f->pos isn't good enough because save_rdma_page does not >> go through QEMUFile directly - only non-live state goes >> through QEMUFile ....... pc.ram uses direct RDMA writes. >> >> As a result, the position pointer does not get updated >> and the accounting is missed........ > Yes, I am suggesting to modify f->pos in save_rdma_page instead. > > Paolo > Would that not confuse the other QEMUFile users? If I change that pointer (without actually putting bytes in into QEMUFile), won't the f->pos pointer be incorrectly updated?