From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BABEEC7EE23 for ; Thu, 18 May 2023 12:43:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzcxq-0005dS-OP; Thu, 18 May 2023 08:42:39 -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 1pzcxo-0005cz-Pc for qemu-devel@nongnu.org; Thu, 18 May 2023 08:42:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzcxn-0006LX-9n for qemu-devel@nongnu.org; Thu, 18 May 2023 08:42:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684413754; h=from:from:reply-to: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=BH6rWW4ir19N8eu0HyYSrvHGiHIBfKhOYu2vdhgD2eo=; b=HlwiTsAxcNnJ4tu89CkTldJ7M0J5r9bsZYcXDaryTodnIHV3NFGHsq91SA7WWaDoxZXY3t Ozq8gPiGm4fGN5rlFOxXcVRlueANHOGPhuzDEeQXJGB2xO/LnRrHdXKNwW0XtP9hYtb8Nl XP+tCvi3pTOPKpVXWKjakOsa14k6+6o= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-53-eOkeg21fNBat-nTQ3fVStA-1; Thu, 18 May 2023 08:42:33 -0400 X-MC-Unique: eOkeg21fNBat-nTQ3fVStA-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f453ff4cdfso7946005e9.2 for ; Thu, 18 May 2023 05:42:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684413752; x=1687005752; h=content-transfer-encoding:mime-version:message-id:date:reply-to :user-agent:references:in-reply-to:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BH6rWW4ir19N8eu0HyYSrvHGiHIBfKhOYu2vdhgD2eo=; b=i9Cpp5ASW3VzzYYaIvtwutozQ0guKFjUpk2bcNqohbvjSah03mk1sQKGqwCVB6ct4F HBpt7MHN1zEYNKvPg2VUrZ3mfVp7L+y2gPDu/KYu8cDjwH75p4fGJrgcJJj1hVNuExfS OzxOc9nu4dKQy+qbCwYbn8DGU9wcRwdzm2PIfpReAJQf7sldzjl82xMwD9zQgrAFnuH0 hxFLoAojJnoy9g6XXWKoFPZZJxbLNuwXbCfqIzwLAbncbho+LcKlcQPAmxVaFEBhHCZ9 WaQhFAaBG+Ywzjltky+c27n0tfNLwVGjqeMKJhv7H8JG0SJ4LBusFnCqvVs1TRzTcCnY daNA== X-Gm-Message-State: AC+VfDzrzlOKrlJPrcCU+G5rkEu25k+qkBgV6/8TRtB/4jJ7IQ90loFd eznSDBmOaPtmzaGnqeVNP9sRlTJLA9EZPv+LUvAlCv/7U51YBHyCBh06TEAnGDVTbi0f1B3a5wm bsh0VjBBj3Yk/jd4= X-Received: by 2002:a05:600c:218:b0:3f4:16bc:bd1b with SMTP id 24-20020a05600c021800b003f416bcbd1bmr1298698wmi.39.1684413751909; Thu, 18 May 2023 05:42:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6IwmpeYCY8PK4LmoTHpCBKjIKWENL2O227mmBYXwItl3H6R7B5PfqL5Ohml6FXCLUGd1SBEg== X-Received: by 2002:a05:600c:218:b0:3f4:16bc:bd1b with SMTP id 24-20020a05600c021800b003f416bcbd1bmr1298685wmi.39.1684413751592; Thu, 18 May 2023 05:42:31 -0700 (PDT) Received: from redhat.com (static-92-120-85-188.ipcom.comunitel.net. [188.85.120.92]) by smtp.gmail.com with ESMTPSA id 7-20020a05600c028700b003f0ad8d1c69sm5247903wmk.25.2023.05.18.05.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 05:42:31 -0700 (PDT) From: Juan Quintela To: Daniel P. =?utf-8?Q?Berrang=C3=A9?= Cc: "Wang, Wei W" , "Wang, Lei4" , "qemu-devel@nongnu.org" , "peterx@redhat.com" , "leobras@redhat.com" Subject: Re: [PATCH] multifd: Set a higher "backlog" default value for listen() In-Reply-To: ("Daniel P. =?utf-8?Q?Berrang?= =?utf-8?Q?=C3=A9=22's?= message of "Thu, 18 May 2023 13:29:46 +0100") References: <20230518085228.172816-1-lei4.wang@intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Date: Thu, 18 May 2023 14:42:30 +0200 Message-ID: <87a5y1dd55.fsf@secure.mitica> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Reply-To: quintela@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Daniel P. Berrang=C3=A9 wrote: > On Thu, May 18, 2023 at 09:13:58AM +0000, Wang, Wei W wrote: >> On Thursday, May 18, 2023 4:52 PM, Wang, Lei4 wrote: >> > When destination VM is launched, the "backlog" parameter for listen() = is set >> > to 1 as default in socket_start_incoming_migration_internal(), which w= ill >> > lead to socket connection error (the queue of pending connections is f= ull) >> > when "multifd" and "multifd-channels" are set later on and a high numb= er of >> > channels are used. Set it to a hard-coded higher default value 512 to = fix this >> > issue. >> >=20 >> > Reported-by: Wei Wang >> > Signed-off-by: Lei Wang >> > --- >> > migration/socket.c | 2 +- >> > 1 file changed, 1 insertion(+), 1 deletion(-) >> >=20 >> > diff --git a/migration/socket.c b/migration/socket.c index >> > 1b6f5baefb..b43a66ef7e 100644 >> > --- a/migration/socket.c >> > +++ b/migration/socket.c >> > @@ -179,7 +179,7 @@ >> > socket_start_incoming_migration_internal(SocketAddress *saddr, >> > QIONetListener *listener =3D qio_net_listener_new(); >> > MigrationIncomingState *mis =3D migration_incoming_get_current(); >> > size_t i; >> > - int num =3D 1; >> > + int num =3D 512; >> >=20 >>=20 >> Probably we need a macro for it, e.g. >> #define MIGRATION_CHANNEL_MAX 512 >>=20 >> Also, I think below lines could be removed, as using a larger value of n= um (i.e. 512) >> doesn't seem to consume more resources anywhere: >> - if (migrate_use_multifd()) { >> - num =3D migrate_multifd_channels(); >> - } else if (migrate_postcopy_preempt()) { >> - num =3D RAM_CHANNEL_MAX; >> - } > > Given that this code already exists, why is it not already sufficient ? Ah, I "think" I remember now. > The commit description is saying we're setting backlog =3D=3D 1 wit > multifd, but this later code is setting it to match the multfd > channels. Why isn't that enough ? Are you using -incoming defer? No? right. With multifd, you should use -incoming defer. It is more, you should use -incoming defer always. The problem is that the way qemu starts, when we do the initial listen, the parameters migration_channels and migration_multifd hasn't yet been parsed. Can you confirm that if you start with -incoming defer, everything works as expected? Later, Juan.