From nobody Sat May 4 13:10:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1631620432716757.6001328897771; Tue, 14 Sep 2021 04:53:52 -0700 (PDT) Received: from localhost ([::1]:45272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQ70Z-0007mK-JE for importer@patchew.org; Tue, 14 Sep 2021 07:53:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ6yt-00056b-5l for qemu-devel@nongnu.org; Tue, 14 Sep 2021 07:52:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ6yq-0007Il-2r for qemu-devel@nongnu.org; Tue, 14 Sep 2021 07:52:06 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-230-9WXFvubJNnuh6dtghVJjeg-1; Tue, 14 Sep 2021 07:52:01 -0400 Received: by mail-wr1-f72.google.com with SMTP id n1-20020a5d4c41000000b00159305d19baso3870627wrt.11 for ; Tue, 14 Sep 2021 04:52:01 -0700 (PDT) Received: from localhost (static-109-144-85-188.ipcom.comunitel.net. [188.85.144.109]) by smtp.gmail.com with ESMTPSA id a25sm918041wmj.34.2021.09.14.04.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 04:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631620322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XOX7nqARL3VBZUhOlMwCyMghOR6R49bsh/b43icc/og=; b=FO2jhGI6QAev+qipzc61heGHxCmr7QZyH9bh7KYtswCo4tSZpNVjL/oXRQ9NA5qAjCCnn0 Nz7pbtzq6KvdD82QmHUPYQ/MuAtSK6w4Xj8BUcSZ5L+YbH9DQvechcSqVSEHpwvWJUwt2I f23iKjFK6D/DM+NOZ33GqHUHL+A3y/c= X-MC-Unique: 9WXFvubJNnuh6dtghVJjeg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XOX7nqARL3VBZUhOlMwCyMghOR6R49bsh/b43icc/og=; b=3TDecWegOFkyDn/UUmyPNjYgIet9vh/zOf4HlNlAQHTChYt/jgYRP53iAHgvbG9xuQ Y+S1x82+TJqS/znaROsYd4xDqpYUSXeVjHvj3u9r3fClbdKBpYxHrl2HabFqRBBMexbb E1WxAJ9MyAMEgJLobpzkl+0Q7hgF3Esiv+NWIcSuIdnhwzlxxoKd2adRc8oYjPAE1BQb xZakHTRlUZI5minPCKM/xKf6KIzcDrH+biMITo64XHyDzmV7j+TMbJeCtFVgtHuKnRKT QuCyauwcgPGtpw5WMCeMdwxRJlvUkG0uqUR8zYHkZgNeNzx1Oam5FJ8QN7WZJ8ZcuHz+ qUQQ== X-Gm-Message-State: AOAM530HbdraBPeLLa0MvtpwsFdS9GySgCgbGUKoqFlR4AvAEF8vX/ca gWt78PbzOQcLoZ/s6V03cqW7ao76kDAy05J+dUowa5dQgfVuG2OwXokOeOX55o4ToS74ZgLLUJ3 KntzDrzsGKyxcgNxvtkS0o27VeOXaWy4psxR6o74HzhUZ/ZJfBv8nCpQHW15VTLoehIo= X-Received: by 2002:adf:e6c5:: with SMTP id y5mr18186011wrm.198.1631620320181; Tue, 14 Sep 2021 04:52:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyF21barUPbmILrJ+4JME+ZAp6+Upic0FLfc+kiRnIapqDXufRZzQXBxsW2Pb1Ag2Dh/DqNGg== X-Received: by 2002:adf:e6c5:: with SMTP id y5mr18185990wrm.198.1631620319943; Tue, 14 Sep 2021 04:51:59 -0700 (PDT) From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 1/5] multifd: Implement yank for multifd send side Date: Tue, 14 Sep 2021 13:51:53 +0200 Message-Id: <20210914115157.35868-2-quintela@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210914115157.35868-1-quintela@redhat.com> References: <20210914115157.35868-1-quintela@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=quintela@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.398, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lukas Straub , "Dr. David Alan Gilbert" , Leonardo Bras , Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1631620433324100004 Content-Type: text/plain; charset="utf-8" From: Lukas Straub To: qemu-devel Cc: "Dr. David Alan Gilbert" , Juan Quintela , Peter Xu , Leonardo Bras Soares Passos Date: Wed, 1 Sep 2021 17:58:57 +0200 (1 week, 15 hours, 17 minutes ago) [[PGP Signed Part:No public key for 35AB0B289C5DB258 created at 2021-09-01T= 17:58:57+0200 using RSA]] When introducing yank functionality in the migration code I forgot to cover the multifd send side. Signed-off-by: Lukas Straub Tested-by: Leonardo Bras Reviewed-by: Leonardo Bras Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/multifd.h | 2 ++ migration/multifd.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/migration/multifd.h b/migration/multifd.h index 8d6751f5ed..16c4d112d1 100644 --- a/migration/multifd.h +++ b/migration/multifd.h @@ -85,6 +85,8 @@ typedef struct { bool running; /* should this thread finish */ bool quit; + /* is the yank function registered */ + bool registered_yank; /* thread has work to do */ int pending_job; /* array of pages to sent */ diff --git a/migration/multifd.c b/migration/multifd.c index 377da78f5b..5a4f158f3c 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -546,6 +546,9 @@ void multifd_save_cleanup(void) MultiFDSendParams *p =3D &multifd_send_state->params[i]; Error *local_err =3D NULL; =20 + if (p->registered_yank) { + migration_ioc_unregister_yank(p->c); + } socket_send_channel_destroy(p->c); p->c =3D NULL; qemu_mutex_destroy(&p->mutex); @@ -813,7 +816,8 @@ static bool multifd_channel_connect(MultiFDSendParams *= p, return false; } } else { - /* update for tls qio channel */ + migration_ioc_register_yank(ioc); + p->registered_yank =3D true; p->c =3D ioc; qemu_thread_create(&p->thread, p->name, multifd_send_thread, p, QEMU_THREAD_JOINABLE); --=20 2.31.1 From nobody Sat May 4 13:10:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163162043205771.1154111401371; Tue, 14 Sep 2021 04:53:52 -0700 (PDT) Received: from localhost ([::1]:45234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQ70Y-0007l1-TM for importer@patchew.org; Tue, 14 Sep 2021 07:53:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ6yt-00056a-5M for qemu-devel@nongnu.org; Tue, 14 Sep 2021 07:52:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ6yq-0007JW-F0 for qemu-devel@nongnu.org; Tue, 14 Sep 2021 07:52:06 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-455-_oj6mBnuObeOKwg8_fs2rg-1; Tue, 14 Sep 2021 07:52:02 -0400 Received: by mail-wm1-f70.google.com with SMTP id u14-20020a7bcb0e0000b0290248831d46e4so544337wmj.6 for ; Tue, 14 Sep 2021 04:52:02 -0700 (PDT) Received: from localhost (static-109-144-85-188.ipcom.comunitel.net. [188.85.144.109]) by smtp.gmail.com with ESMTPSA id a10sm10385678wrd.51.2021.09.14.04.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 04:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631620323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=loashz0+j0OcIJRCFBlcKJzh8A8l4zO8lqCJ5F9pqk4=; b=dnLjtx1WKsvdN5AMz6P+5lUJeYnPhviqUo94Qi5DBkscMdm6Ehfciv5ydcP/BCc+Cv/4Ul 5DRQb1yNLsmSAH/azoGY6tpm/N0/dvULiFgTkUL6/knJiENT4mH0mlpGsNo3Ll2mATGzG6 JO5bcRyl43ISTXOO3flxJZqJ6b2TsQM= X-MC-Unique: _oj6mBnuObeOKwg8_fs2rg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=loashz0+j0OcIJRCFBlcKJzh8A8l4zO8lqCJ5F9pqk4=; b=eZ6m02aBWXKnKICvNbJySEb2ZQ9Sbqf17hchBPQXU+P2IfDG+0aznagUuJxmWZ9duW O2/x4GrMQBB9/8ih5360EwBgV9xwFSoxeQCc6diYrlhHOUgX/XrpLxB6R6JGi/QjkByM GKSLwmG0NkhYNl2AtEmYEEhfzrdKLJ00NptUVuEqYbGeGXj4mIHchI0gdiOJSzzicCgS lagUuvR8kQ0/QpTM54mAhPxUvqijWcQzgCbJZRXoGsXbwC2vYpfEaI5UECVxd9b9ULDy t8KAUc/T8Xz7kDzwcME0g5kh1oytUhmo5WXf6J/hLNG3G8DYwUUrd2pZYgX8xQ53gC0o HDhw== X-Gm-Message-State: AOAM531wBy7rnvhNRmQfWEHvng31ft/U+amMiHDdhHZ4a8OKgN2nKKhZ PTv465OOJ5Ro35bqpHiRw3fAK+gOy9VufB9OuIezxm92F/krZ8SoMEo0msRGrIPR/zFsmwlasiw oEp8vjSfYl4lceymsNZv5KRWanl5SDehgCK8kUEHCw2eip01uBzcIdF3YjNrcPFuNOqk= X-Received: by 2002:adf:9f4a:: with SMTP id f10mr18349087wrg.384.1631620321492; Tue, 14 Sep 2021 04:52:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzmBPLkR2hTv8AXn+fgeQRpOFBYJbAueXo2sPXQaKaxxJtzSmWijPYCoV0+SPyeJICOamPAw== X-Received: by 2002:adf:9f4a:: with SMTP id f10mr18349067wrg.384.1631620321252; Tue, 14 Sep 2021 04:52:01 -0700 (PDT) From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 2/5] multifd: Unconditionally unregister yank function Date: Tue, 14 Sep 2021 13:51:54 +0200 Message-Id: <20210914115157.35868-3-quintela@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210914115157.35868-1-quintela@redhat.com> References: <20210914115157.35868-1-quintela@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=quintela@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.398, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lukas Straub , "Dr. David Alan Gilbert" , Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1631620433317100003 Content-Type: text/plain; charset="utf-8" From: Lukas Straub To: qemu-devel Cc: "Dr. David Alan Gilbert" , Juan Quintela , Peter Xu , Leonardo Bras Soares Passos Date: Wed, 4 Aug 2021 21:26:32 +0200 (5 weeks, 11 hours, 52 minutes ago) [[PGP Signed Part:No public key for 35AB0B289C5DB258 created at 2021-08-04T= 21:26:32+0200 using RSA]] Unconditionally unregister yank function in multifd_load_cleanup(). If it is not unregistered here, it will leak and cause a crash in yank_unregister_instance(). Now if the ioc is still in use afterwards, it will only lead to qemu not being able to recover from a hang related to that ioc. After checking the code, i am pretty sure that ref is always 1 when arriving here. So all this currently does is remove the unneeded check. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/multifd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 5a4f158f3c..efd424bc97 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -991,10 +991,7 @@ int multifd_load_cleanup(Error **errp) for (i =3D 0; i < migrate_multifd_channels(); i++) { MultiFDRecvParams *p =3D &multifd_recv_state->params[i]; =20 - if (OBJECT(p->c)->ref =3D=3D 1) { - migration_ioc_unregister_yank(p->c); - } - + migration_ioc_unregister_yank(p->c); object_unref(OBJECT(p->c)); p->c =3D NULL; qemu_mutex_destroy(&p->mutex); --=20 2.31.1 From nobody Sat May 4 13:10:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1631620431943430.3189699224491; Tue, 14 Sep 2021 04:53:51 -0700 (PDT) Received: from localhost ([::1]:45254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQ70Y-0007lm-Po for importer@patchew.org; Tue, 14 Sep 2021 07:53:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ6yv-000574-78 for qemu-devel@nongnu.org; Tue, 14 Sep 2021 07:52:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49287) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ6yt-0007M0-9K for qemu-devel@nongnu.org; Tue, 14 Sep 2021 07:52:08 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-345-N5q4HjDeOymW1mOesTMX5Q-1; Tue, 14 Sep 2021 07:52:04 -0400 Received: by mail-wr1-f70.google.com with SMTP id h5-20020a5d6885000000b0015e21e37523so416344wru.10 for ; Tue, 14 Sep 2021 04:52:04 -0700 (PDT) Received: from localhost (static-109-144-85-188.ipcom.comunitel.net. [188.85.144.109]) by smtp.gmail.com with ESMTPSA id z2sm902461wma.45.2021.09.14.04.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 04:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631620326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+zeSAaNIJ8LGsRizhhQi316gUImulpKF6JrfafoodSk=; b=fUMJVt5wkGalCPpUjRX8Nu0wdKhEegfHjdrW7B0N6PX4IzB3N1u02fPxn/XBMAWCuDBd6b 4ecRmxxhrgZa8rcrGYSRhO7i9zXs1cdRX88cSePI46MewGxYHymvwT5HrlAbNIn905YrlR 2gSNjilUi/OXICrsZjdetMgbnqJ29Lo= X-MC-Unique: N5q4HjDeOymW1mOesTMX5Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+zeSAaNIJ8LGsRizhhQi316gUImulpKF6JrfafoodSk=; b=PqHMYN2UYxjClwxU7N+6gNPqbNT3XWe4ng8QELE+01Vb0RrSCsKqK0Prkd1Pk1qpTb Y5WE1gZPYpw+7is1UXBGTOYS75pHY33QnCCWoLYtCokwEabECRZk0B0BSDZpQ/CNb66m /Heih1UbNByQLjfcQvaLPBw1sNstdLC1Ih7/beQiU2mdwQEwaUjgVQt1t38yyva6rvGa uye0Cg5ebihGpT1h+HJe0s7f2vpOJGrm913ExRT6/39hLSH9r/8HJzC7YXAu261x3sQ1 N83sBAAPq7ffMD4oTyPRezUKung51gBu8NfORt5D3mI8K3RJaVXLS1mm5pBSjxLbKRKB sPLw== X-Gm-Message-State: AOAM530Cn+MQKaTO3CJ0xt80f5vuswNrLXmRG3gFuoXlcQxvITwzEU3h fZyYL4m49rl6BHMZc8+gjnqubT+AVOQGJXqrX6cRjilx+pbqxhywnddupAfRUdb8+c7SUuGTVMG sHwlN6WsM/3B6N0djOIMlC9L9XnVfKmYZ+iaI4+1cjsrm67xRVl+nW3CuVCiYlznbqhw= X-Received: by 2002:a1c:7c0f:: with SMTP id x15mr1673630wmc.149.1631620322903; Tue, 14 Sep 2021 04:52:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzl2iN+oyB0Xsywyi75coN098dXuHX29hefI/ym1SSGaTh34QpbYJsFFd2D2+tIeFPnZncIRA== X-Received: by 2002:a1c:7c0f:: with SMTP id x15mr1673589wmc.149.1631620322454; Tue, 14 Sep 2021 04:52:02 -0700 (PDT) From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 3/5] migration/rdma: Try to register On-Demand Paging memory region Date: Tue, 14 Sep 2021 13:51:55 +0200 Message-Id: <20210914115157.35868-4-quintela@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210914115157.35868-1-quintela@redhat.com> References: <20210914115157.35868-1-quintela@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=quintela@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.398, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr. David Alan Gilbert" , Li Zhijian , Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1631620433360100005 Content-Type: text/plain; charset="utf-8" From: Li Zhijian Previously, for the fsdax mem-backend-file, it will register failed with Operation not supported. In this case, we can try to register it with On-Demand Paging[1] like what rpma_mr_reg() does on rpma[2]. [1]: https://community.mellanox.com/s/article/understanding-on-demand-pagin= g--odp-x [2]: http://pmem.io/rpma/manpages/v0.9.0/rpma_mr_reg.3 CC: Marcel Apfelbaum Signed-off-by: Li Zhijian Reviewed-by: Marcel Apfelbaum Signed-off-by: Juan Quintela --- migration/rdma.c | 73 ++++++++++++++++++++++++++++++------------ migration/trace-events | 1 + 2 files changed, 54 insertions(+), 20 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 5c2d113aa9..eb80431aae 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -1117,19 +1117,47 @@ static int qemu_rdma_alloc_qp(RDMAContext *rdma) return 0; } =20 +/* Check whether On-Demand Paging is supported by RDAM device */ +static bool rdma_support_odp(struct ibv_context *dev) +{ + struct ibv_device_attr_ex attr =3D {0}; + int ret =3D ibv_query_device_ex(dev, NULL, &attr); + if (ret) { + return false; + } + + if (attr.odp_caps.general_caps & IBV_ODP_SUPPORT) { + return true; + } + + return false; +} + static int qemu_rdma_reg_whole_ram_blocks(RDMAContext *rdma) { int i; RDMALocalBlocks *local =3D &rdma->local_ram_blocks; =20 for (i =3D 0; i < local->nb_blocks; i++) { + int access =3D IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE; + local->block[i].mr =3D ibv_reg_mr(rdma->pd, local->block[i].local_host_addr, - local->block[i].length, - IBV_ACCESS_LOCAL_WRITE | - IBV_ACCESS_REMOTE_WRITE + local->block[i].length, access ); + + if (!local->block[i].mr && + errno =3D=3D ENOTSUP && rdma_support_odp(rdma->verbs)) { + access |=3D IBV_ACCESS_ON_DEMAND; + /* register ODP mr */ + local->block[i].mr =3D + ibv_reg_mr(rdma->pd, + local->block[i].local_host_addr, + local->block[i].length, access); + trace_qemu_rdma_register_odp_mr(local->block[i].block_name= ); + } + if (!local->block[i].mr) { perror("Failed to register local dest ram block!"); break; @@ -1215,28 +1243,33 @@ static int qemu_rdma_register_and_get_keys(RDMACont= ext *rdma, */ if (!block->pmr[chunk]) { uint64_t len =3D chunk_end - chunk_start; + int access =3D rkey ? IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_W= RITE : + 0; =20 trace_qemu_rdma_register_and_get_keys(len, chunk_start); =20 - block->pmr[chunk] =3D ibv_reg_mr(rdma->pd, - chunk_start, len, - (rkey ? (IBV_ACCESS_LOCAL_WRITE | - IBV_ACCESS_REMOTE_WRITE) : 0)); - - if (!block->pmr[chunk]) { - perror("Failed to register chunk!"); - fprintf(stderr, "Chunk details: block: %d chunk index %d" - " start %" PRIuPTR " end %" PRIuPTR - " host %" PRIuPTR - " local %" PRIuPTR " registrations: %d\n", - block->index, chunk, (uintptr_t)chunk_start, - (uintptr_t)chunk_end, host_addr, - (uintptr_t)block->local_host_addr, - rdma->total_registrations); - return -1; + block->pmr[chunk] =3D ibv_reg_mr(rdma->pd, chunk_start, len, acces= s); + if (!block->pmr[chunk] && + errno =3D=3D ENOTSUP && rdma_support_odp(rdma->verbs)) { + access |=3D IBV_ACCESS_ON_DEMAND; + /* register ODP mr */ + block->pmr[chunk] =3D ibv_reg_mr(rdma->pd, chunk_start, len, a= ccess); + trace_qemu_rdma_register_odp_mr(block->block_name); } - rdma->total_registrations++; } + if (!block->pmr[chunk]) { + perror("Failed to register chunk!"); + fprintf(stderr, "Chunk details: block: %d chunk index %d" + " start %" PRIuPTR " end %" PRIuPTR + " host %" PRIuPTR + " local %" PRIuPTR " registrations: %d\n", + block->index, chunk, (uintptr_t)chunk_start, + (uintptr_t)chunk_end, host_addr, + (uintptr_t)block->local_host_addr, + rdma->total_registrations); + return -1; + } + rdma->total_registrations++; =20 if (lkey) { *lkey =3D block->pmr[chunk]->lkey; diff --git a/migration/trace-events b/migration/trace-events index a1c0f034ab..5f6aa580de 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -212,6 +212,7 @@ qemu_rdma_poll_write(const char *compstr, int64_t comp,= int left, uint64_t block qemu_rdma_poll_other(const char *compstr, int64_t comp, int left) "other c= ompletion %s (%" PRId64 ") received left %d" qemu_rdma_post_send_control(const char *desc) "CONTROL: sending %s.." qemu_rdma_register_and_get_keys(uint64_t len, void *start) "Registering %"= PRIu64 " bytes @ %p" +qemu_rdma_register_odp_mr(const char *name) "Try to register On-Demand Pag= ing memory region: %s" qemu_rdma_registration_handle_compress(int64_t length, int index, int64_t = offset) "Zapping zero chunk: %" PRId64 " bytes, index %d, offset %" PRId64 qemu_rdma_registration_handle_finished(void) "" qemu_rdma_registration_handle_ram_blocks(void) "" --=20 2.31.1 From nobody Sat May 4 13:10:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1631620433684622.7635840142756; Tue, 14 Sep 2021 04:53:53 -0700 (PDT) Received: from localhost ([::1]:45400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQ70a-0007sX-JL for importer@patchew.org; Tue, 14 Sep 2021 07:53:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ6yx-0005At-OH for qemu-devel@nongnu.org; Tue, 14 Sep 2021 07:52:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ6yw-0007On-2k for qemu-devel@nongnu.org; Tue, 14 Sep 2021 07:52:11 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-195-qZkUmZ_INHif4g2JfyCzmw-1; Tue, 14 Sep 2021 07:52:05 -0400 Received: by mail-wm1-f72.google.com with SMTP id g70-20020a1c2049000000b00303d06c20b2so1105952wmg.0 for ; Tue, 14 Sep 2021 04:52:05 -0700 (PDT) Received: from localhost (static-109-144-85-188.ipcom.comunitel.net. [188.85.144.109]) by smtp.gmail.com with ESMTPSA id n4sm10605747wra.37.2021.09.14.04.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 04:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631620328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Htv2iSTGhHdXCFIgEcI1bqNZV3sh6s2QTPG+t/Ioz6Y=; b=cmRrI/UlkiNgbXbpqkFYJnev7+g+yJ51M5cqGj0yxzv7wF1QdfEXz0EKgtdRlUF2CbgOr7 D9mN0JYWEXVYL5i+7UtHbjsvYQmt1AAFP5YsOMRFElLELIcAwJgQB/X2bv9pgASGhtcme1 BdmfucN8y/lwcRqBYzrqbW0roBYhcNI= X-MC-Unique: qZkUmZ_INHif4g2JfyCzmw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Htv2iSTGhHdXCFIgEcI1bqNZV3sh6s2QTPG+t/Ioz6Y=; b=B4aXC198TsY0wXNzwvfgLwc8lZ8xlJdSTcUwRa6oO9ZhmN2aAJaoqms20JjOlxX42Q LsdsRDv1YRhSsjzyb1Z37gr67VB0cWeEW9ajCWa6v6N7qUTCnKj0O/PNbSmLO0Vy4z6i Tt1NdomdlAqHHskzUBXJHhFDUI+jxsUgAE9VviWB3/6k0nvWBV8oSxtjxZISSO4HnArz k+QzxJtfCTjvcKNNrsA5lD8Dig/d/aXFjZCV+gaPIXB9iFDz7jevYDBgETUp60DcWyj+ 3zPKFYHG1uPoBogrBDjyDRSnyIfqN83pqBga5fGFq2OyLC+pAZmRneA4piNLvZ/8lzxr eOQQ== X-Gm-Message-State: AOAM533nXyfFDBLigLD9u2hwLhlvrKHWy7wegmtxQNEA+DnE+dTi64zt ip12OHpxxbuG71o37XJQSTQw+Sqi86AptK94wH1bVC3wdzIfbfiPMsDJXYUgSX2Pk1OzM0glerd YDwxM3DkQtuNDmU9wMEyiP4kYQrikmTNVGuHxEpr1sfsdF0FQdWJyMwKT9DFj6Tu/O6M= X-Received: by 2002:a1c:22c3:: with SMTP id i186mr1728295wmi.145.1631620323946; Tue, 14 Sep 2021 04:52:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxoCf8E4bv/QqZghLsLDLRGc7Gf3qsIelpRRGLkGzq2VPIwBayfwJyURKFF171vrf16qZ7dQ== X-Received: by 2002:a1c:22c3:: with SMTP id i186mr1728271wmi.145.1631620323723; Tue, 14 Sep 2021 04:52:03 -0700 (PDT) From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 4/5] migration/rdma: advise prefetch write for ODP region Date: Tue, 14 Sep 2021 13:51:56 +0200 Message-Id: <20210914115157.35868-5-quintela@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210914115157.35868-1-quintela@redhat.com> References: <20210914115157.35868-1-quintela@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=quintela@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.398, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr. David Alan Gilbert" , Li Zhijian , Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1631620435268100009 Content-Type: text/plain; charset="utf-8" From: Li Zhijian To: , CC: , Li Zhijian , "Marcel= Apfelbaum" Date: Mon, 23 Aug 2021 11:33:58 +0800 (2 weeks, 3 days, 3 hours ago) The responder mr registering with ODP will sent RNR NAK back to the requester in the face of the page fault. Reviewed-by: Marcel Apfelbaum --------- ibv_poll_cq wc.status=3D13 RNR retry counter exceeded! ibv_poll_cq wrid=3DWRITE RDMA! --------- ibv_advise_mr(3) helps to make pages present before the actual IO is conducted so that the responder does page fault as little as possible. Signed-off-by: Li Zhijian Reviewed-by: Marcel Apfelbaum Signed-off-by: Juan Quintela --- migration/rdma.c | 40 ++++++++++++++++++++++++++++++++++++++++ migration/trace-events | 1 + 2 files changed, 41 insertions(+) diff --git a/migration/rdma.c b/migration/rdma.c index eb80431aae..6c2cc3f617 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -1133,6 +1133,30 @@ static bool rdma_support_odp(struct ibv_context *dev) return false; } =20 +/* + * ibv_advise_mr to avoid RNR NAK error as far as possible. + * The responder mr registering with ODP will sent RNR NAK back to + * the requester in the face of the page fault. + */ +static void qemu_rdma_advise_prefetch_mr(struct ibv_pd *pd, uint64_t addr, + uint32_t len, uint32_t lkey, + const char *name, bool wr) +{ + int ret; + int advice =3D wr ? IBV_ADVISE_MR_ADVICE_PREFETCH_WRITE : + IBV_ADVISE_MR_ADVICE_PREFETCH; + struct ibv_sge sg_list =3D {.lkey =3D lkey, .addr =3D addr, .length = =3D len}; + + ret =3D ibv_advise_mr(pd, advice, + IBV_ADVISE_MR_FLAG_FLUSH, &sg_list, 1); + /* ignore the error */ + if (ret) { + trace_qemu_rdma_advise_mr(name, len, addr, strerror(errno)); + } else { + trace_qemu_rdma_advise_mr(name, len, addr, "successed"); + } +} + static int qemu_rdma_reg_whole_ram_blocks(RDMAContext *rdma) { int i; @@ -1156,6 +1180,15 @@ static int qemu_rdma_reg_whole_ram_blocks(RDMAContex= t *rdma) local->block[i].local_host_addr, local->block[i].length, access); trace_qemu_rdma_register_odp_mr(local->block[i].block_name= ); + + if (local->block[i].mr) { + qemu_rdma_advise_prefetch_mr(rdma->pd, + (uintptr_t)local->block[i].local_host_= addr, + local->block[i].length, + local->block[i].mr->lkey, + local->block[i].block_name, + true); + } } =20 if (!local->block[i].mr) { @@ -1255,6 +1288,13 @@ static int qemu_rdma_register_and_get_keys(RDMAConte= xt *rdma, /* register ODP mr */ block->pmr[chunk] =3D ibv_reg_mr(rdma->pd, chunk_start, len, a= ccess); trace_qemu_rdma_register_odp_mr(block->block_name); + + if (block->pmr[chunk]) { + qemu_rdma_advise_prefetch_mr(rdma->pd, (uintptr_t)chunk_st= art, + len, block->pmr[chunk]->lkey, + block->block_name, rkey); + + } } } if (!block->pmr[chunk]) { diff --git a/migration/trace-events b/migration/trace-events index 5f6aa580de..a8ae163707 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -213,6 +213,7 @@ qemu_rdma_poll_other(const char *compstr, int64_t comp,= int left) "other complet qemu_rdma_post_send_control(const char *desc) "CONTROL: sending %s.." qemu_rdma_register_and_get_keys(uint64_t len, void *start) "Registering %"= PRIu64 " bytes @ %p" qemu_rdma_register_odp_mr(const char *name) "Try to register On-Demand Pag= ing memory region: %s" +qemu_rdma_advise_mr(const char *name, uint32_t len, uint64_t addr, const c= har *res) "Try to advise block %s prefetch at %" PRIu32 "@0x%" PRIx64 ": %s" qemu_rdma_registration_handle_compress(int64_t length, int index, int64_t = offset) "Zapping zero chunk: %" PRId64 " bytes, index %d, offset %" PRId64 qemu_rdma_registration_handle_finished(void) "" qemu_rdma_registration_handle_ram_blocks(void) "" --=20 2.31.1 From nobody Sat May 4 13:10:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1631620695209721.1310088876772; Tue, 14 Sep 2021 04:58:15 -0700 (PDT) Received: from localhost ([::1]:56260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQ74n-0006oB-St for importer@patchew.org; Tue, 14 Sep 2021 07:58:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ6z0-0005IU-Ec for qemu-devel@nongnu.org; Tue, 14 Sep 2021 07:52:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40028) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ6yu-0007Nl-AK for qemu-devel@nongnu.org; Tue, 14 Sep 2021 07:52:14 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-145-Zx1B-oW8PDiQHqn0cLjhVg-1; Tue, 14 Sep 2021 07:52:06 -0400 Received: by mail-wr1-f70.google.com with SMTP id m1-20020a056000180100b0015e1ec30ac3so576088wrh.8 for ; Tue, 14 Sep 2021 04:52:06 -0700 (PDT) Received: from localhost (static-109-144-85-188.ipcom.comunitel.net. [188.85.144.109]) by smtp.gmail.com with ESMTPSA id q11sm919335wmc.41.2021.09.14.04.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 04:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631620327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xiin61qQHRQJuFfJtZIvj/8PDAv1mtm9Lzc4rxWOruY=; b=NosT5jVJQMLuxVzxDi9SXtYvqcGgkBtNI/ETd3sTbkVGfRwZrAxD5LF6Cf+uO6k4KGSplb Iyv8+z4DaT8vnk5a9/3rkgSLfSnEdpLBbi1FBbzS6RT55oTjckRpxZNPVb8xFckL1iILN2 qTRE6aNGOX2TSNCdFOHO2wT384aZLT0= X-MC-Unique: Zx1B-oW8PDiQHqn0cLjhVg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xiin61qQHRQJuFfJtZIvj/8PDAv1mtm9Lzc4rxWOruY=; b=iMa5fyeAGytVZ1a+H73fNDNd2JMlYb8fFiSieLD7dlvuwtRmTtch9nybsQFSs5jFmi m+PmaEias4TDf4wzcoOuPEIGEXHqZzwYEPAImbeA96WTI9UFjaHqwFCjTJHj0X6VvpQ5 TmSgcWq7ZfzenkfLF2dBsEbMcgoOJn389mluncIugOC1+gF6me3j4yKe98N1FT9HcsEK Xd/4RKvQTn8RdGFfhAjARcLe+cXCRhv59lWQva/bKX/eW9UZ6KAlgmB+ZZxRSweBoLuG n4CXv90Xrbo0Y8B0Aen3gLdgZX99CmtBLcMvhcsp5lSG7ifL5pEM0kSUHdQETQWP3JqJ 8mow== X-Gm-Message-State: AOAM531cuqG87ZUEu8FIKGpYu+znJmqykIekip/MjZ9Q9xVNhuUWA/o2 WnZJZzWnd1Np3Gr1CFAJK7wZDt+fBn0f2CP+gjsGTPwam/JnEJ94OPgBfun08hGZyGFl2qqITx+ WkJQUZzKbGCJdrpdnKCjDczS3ma3iCuJsVa1Rz1Ft58FjoiOauzRFz8WsPgQX8guu3uY= X-Received: by 2002:a1c:a94a:: with SMTP id s71mr1724112wme.32.1631620325440; Tue, 14 Sep 2021 04:52:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbsN00r2NRbe2A3OFgGAMKFhWY/yMOVIr+d7cIJTwKJ8+Ca/8sBJTAKo7idmF++0iJaCBMsw== X-Received: by 2002:a1c:a94a:: with SMTP id s71mr1724071wme.32.1631620325107; Tue, 14 Sep 2021 04:52:05 -0700 (PDT) From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 5/5] migration/ram: Don't passs RAMState to migration_clear_memory_region_dirty_bitmap_*() Date: Tue, 14 Sep 2021 13:51:57 +0200 Message-Id: <20210914115157.35868-6-quintela@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210914115157.35868-1-quintela@redhat.com> References: <20210914115157.35868-1-quintela@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=quintela@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.398, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Hildenbrand , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , Peter Xu , Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1631620696516100001 From: David Hildenbrand The parameter is unused, let's drop it. Reviewed-by: Peter Xu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Juan Quintela Signed-off-by: David Hildenbrand Signed-off-by: Juan Quintela --- migration/ram.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 7a43bfd7af..bb908822d5 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -789,8 +789,7 @@ unsigned long migration_bitmap_find_dirty(RAMState *rs,= RAMBlock *rb, return find_next_bit(bitmap, size, start); } =20 -static void migration_clear_memory_region_dirty_bitmap(RAMState *rs, - RAMBlock *rb, +static void migration_clear_memory_region_dirty_bitmap(RAMBlock *rb, unsigned long page) { uint8_t shift; @@ -818,8 +817,7 @@ static void migration_clear_memory_region_dirty_bitmap(= RAMState *rs, } =20 static void -migration_clear_memory_region_dirty_bitmap_range(RAMState *rs, - RAMBlock *rb, +migration_clear_memory_region_dirty_bitmap_range(RAMBlock *rb, unsigned long start, unsigned long npages) { @@ -832,7 +830,7 @@ migration_clear_memory_region_dirty_bitmap_range(RAMSta= te *rs, * exclusive. */ for (i =3D chunk_start; i < chunk_end; i +=3D chunk_pages) { - migration_clear_memory_region_dirty_bitmap(rs, rb, i); + migration_clear_memory_region_dirty_bitmap(rb, i); } } =20 @@ -850,7 +848,7 @@ static inline bool migration_bitmap_clear_dirty(RAMStat= e *rs, * the page in the chunk we clear the remote dirty bitmap for all. * Clearing it earlier won't be a problem, but too late will. */ - migration_clear_memory_region_dirty_bitmap(rs, rb, page); + migration_clear_memory_region_dirty_bitmap(rb, page); =20 ret =3D test_and_clear_bit(page, rb->bmap); if (ret) { @@ -2777,8 +2775,7 @@ void qemu_guest_free_page_hint(void *addr, size_t len) * are initially set. Otherwise those skipped pages will be sent in * the next round after syncing from the memory region bitmap. */ - migration_clear_memory_region_dirty_bitmap_range(ram_state, block, - start, npages); + migration_clear_memory_region_dirty_bitmap_range(block, start, npa= ges); ram_state->migration_dirty_pages -=3D bitmap_count_one_with_offset(block->bmap, start, npa= ges); bitmap_clear(block->bmap, start, npages); --=20 2.31.1