From nobody Sun Nov 24 09:54:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1725453940; cv=none; d=zohomail.com; s=zohoarc; b=JhaIq9AdOEXrmi2PImfX/yMrW70HpkbSGCMvkU37C+dhQFBpSmU68dXuggE/BzgUlQWEpAZjr+mbmWJFWjJPS/RPJsBYtQV8oPEn9Qd1pQhEytELtedKkcZVZbw7mGXGIn8xdWKZOxTqcHJ+RbXhpG/R5Lb5yk0s2w+6tOIKOYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725453940; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1ZzH6tbwU1tnRJepeYyskBXA12nUW4vAOqU+UVM33TM=; b=AzcxfuXv6FQXQaVVZf93mImFBQzCQv+4n0l5ihrp/Bnv98uUtCdvFOjeeoJXBh56R6ntito4z4XfopzFo/etRlIiYwVECfvH+PzVvEtu0Ax/7DU7tEiiBV2H7/+j9cPTWqt6m2HvC93G04DbRLQX2I1ag2OX9XZOtALz27QNpMs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1725453940826341.75264076957285; Wed, 4 Sep 2024 05:45:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slpNf-0005OF-Ur; Wed, 04 Sep 2024 08:45:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slpNe-0005Gq-2f for qemu-devel@nongnu.org; Wed, 04 Sep 2024 08:45:02 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slpNc-0005di-8f for qemu-devel@nongnu.org; Wed, 04 Sep 2024 08:45:01 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id ECEB22119F; Wed, 4 Sep 2024 12:44:58 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C5E7B139D2; Wed, 4 Sep 2024 12:44:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id iJu+IklW2GZuVQAAD6G6ig (envelope-from ); Wed, 04 Sep 2024 12:44:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1725453899; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1ZzH6tbwU1tnRJepeYyskBXA12nUW4vAOqU+UVM33TM=; b=n3NXldXhNy96FKLhscpqiE2RdS7GaHb2jcVwvjFs4MbXpcXOzIsvj7EyX9gNk9+QMGs0cB iXOO6wNo1aW9GpgsQD5vj6YZw6JZo8iV6j14omM0TK6W1CmakjZ7EAx5oJGlav/Jnshb3P v15/0M+Ay04dOyPQBOq2dzL9K2skQRc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1725453899; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1ZzH6tbwU1tnRJepeYyskBXA12nUW4vAOqU+UVM33TM=; b=wO1HleKLn6DR7DdmAx7WrKw74XOY/D7+FCpAhP4NbTEjrt4jcILBhk/+iNnyg9A6zktA8X j/PBH0rii4cKlcAw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=hq401+jX; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="5m+yPv/l" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1725453898; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1ZzH6tbwU1tnRJepeYyskBXA12nUW4vAOqU+UVM33TM=; b=hq401+jXL5innj9TSdHJqde3tmUF+nPyXcS/Tt3mn23dTdRkbajJLSN8y3QB/l+AMEGkmp W9C/K3mqahaH83lZoLO5VjcPK0UjHqfr8DgoVLpalDX5Ry9bkhqXy4wgRPDBvwVwnbBc0Z AsK1J7vUqg/upUJE5urur7oDn1KUX9w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1725453898; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1ZzH6tbwU1tnRJepeYyskBXA12nUW4vAOqU+UVM33TM=; b=5m+yPv/lWsi+egcq3Em7jcgcgYbpRnbmxv96eRAtEJNj+2QaoLtYcyOSZvb/vFQmfREgrA w6av9j2S1RdqbLDQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Richard Henderson Subject: [PULL 22/34] migration/multifd: Don't send ram data during SYNC Date: Wed, 4 Sep 2024 09:44:05 -0300 Message-Id: <20240904124417.14565-23-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240904124417.14565-1-farosas@suse.de> References: <20240904124417.14565-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: ECEB22119F X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCPT_COUNT_THREE(0.00)[3]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:mid,suse.de:email] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1725453942383116600 Content-Type: text/plain; charset="utf-8" Skip saving and loading any ram data in the packet in the case of a SYNC. This fixes a shortcoming of the current code which requires a reset of the MultiFDPages_t fields right after the previous pending_job finishes, otherwise the very next job might be a SYNC and multifd_send_fill_packet() will put the stale values in the packet. By not calling multifd_ram_fill_packet(), we can stop resetting MultiFDPages_t in the multifd core and leave that to the client code. Actually moving the reset function is not yet done because pages->num=3D=3D0 is used by the client code to determine whether the MultiFDPages_t needs to be flushed. The subsequent patches will replace that with a generic flag that is not dependent on MultiFDPages_t. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/multifd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index d64fcdf4ac..3a164c124d 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -452,6 +452,7 @@ void multifd_send_fill_packet(MultiFDSendParams *p) { MultiFDPacket_t *packet =3D p->packet; uint64_t packet_num; + bool sync_packet =3D p->flags & MULTIFD_FLAG_SYNC; =20 memset(packet, 0, p->packet_len); =20 @@ -466,7 +467,9 @@ void multifd_send_fill_packet(MultiFDSendParams *p) =20 p->packets_sent++; =20 - multifd_ram_fill_packet(p); + if (!sync_packet) { + multifd_ram_fill_packet(p); + } =20 trace_multifd_send_fill(p->id, packet_num, p->flags, p->next_packet_size); @@ -574,7 +577,9 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams= *p, Error **errp) p->packet_num =3D be64_to_cpu(packet->packet_num); p->packets_recved++; =20 - ret =3D multifd_ram_unfill_packet(p, errp); + if (!(p->flags & MULTIFD_FLAG_SYNC)) { + ret =3D multifd_ram_unfill_packet(p, errp); + } =20 trace_multifd_recv_unfill(p->id, p->packet_num, p->flags, p->next_packet_size); @@ -1536,7 +1541,9 @@ static void *multifd_recv_thread(void *opaque) flags =3D p->flags; /* recv methods don't know how to handle the SYNC flag */ p->flags &=3D ~MULTIFD_FLAG_SYNC; - has_data =3D p->normal_num || p->zero_num; + if (!(flags & MULTIFD_FLAG_SYNC)) { + has_data =3D p->normal_num || p->zero_num; + } qemu_mutex_unlock(&p->mutex); } else { /* --=20 2.35.3