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 1F4A4C05027 for ; Fri, 10 Feb 2023 17:21:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQX5Y-0002kV-8A; Fri, 10 Feb 2023 12:21:32 -0500 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 1pQX5W-0002k7-8h for qemu-devel@nongnu.org; Fri, 10 Feb 2023 12:21:30 -0500 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 1pQX5U-0001BT-VR for qemu-devel@nongnu.org; Fri, 10 Feb 2023 12:21:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676049688; 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: in-reply-to:in-reply-to:references:references; bh=6l8gtY4loc5Bm3SMJsBMNGTITnL1P0+vSJYEBsCyRMU=; b=A5dbmVf6dgpTbiVHoKJlqu+9+qOuYMYNSZEqO1ezqP2ov5XVVpSZI/Tfy7xeVxxK/JeqTe XpPMJVecJ46QcMsLqFMlytKaTkP/oGGY4+UA97LPnFDjOQYRjjUH6MRyAwlEO1qBKAUMRq k8S8r/63m6EvWDfZts9YB0UGJaNDESM= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-175-gjbMvutNOWaoGEjpR3DlWw-1; Fri, 10 Feb 2023 12:21:27 -0500 X-MC-Unique: gjbMvutNOWaoGEjpR3DlWw-1 Received: by mail-qk1-f197.google.com with SMTP id j10-20020a05620a288a00b0070630ecfd9bso3704173qkp.20 for ; Fri, 10 Feb 2023 09:21:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6l8gtY4loc5Bm3SMJsBMNGTITnL1P0+vSJYEBsCyRMU=; b=0A7qF3jCWosVVhbcMCgstRgJzTrNJUoezgmWh0auxunAxUn8N27uzSZodnpbHpyPc1 63b5hjvzHecZGej1kqzl5YCneiKNXWWCRrS92OoCDBsgyCtJr1GWYMdsOPPWz+mj0JuH xDTqf+YnBG33JAOO3bltXus4P5TKU5hbajgnAOg/gNxKbsDpidNSkPgTaZKC0FaK6iqD GB9VcGz5N2Y8BRWrlhylv9uutitYlRGYbmdbMKXje0Jwiqz03U0PjnHooGXCWNYRLpxA 26EfLEDDpKbQJX3D4EBlO5hqA5dyZbp7ysPJaoipWCmdgbxrRGBISKC7jxv3cjfBbH2W XiGg== X-Gm-Message-State: AO0yUKUCZMCOcKRz7C77ewq2kINLO4HRLxUVudpMNNUeBI7g2G8WviRx 8rlhzpIRrSWMImHcWP3E6Dk8xa6M8XJIcGPDzHZ/7oKMihkFsAjCRZm6WetzuNeLwB9zovWinxc HAEkIzJFWB3vWF7o= X-Received: by 2002:ac8:4e8d:0:b0:3b8:5f47:aac2 with SMTP id 13-20020ac84e8d000000b003b85f47aac2mr31403812qtp.1.1676049686574; Fri, 10 Feb 2023 09:21:26 -0800 (PST) X-Google-Smtp-Source: AK7set/Hw1T8eQQXZbG3G9Zuld92H5cPYf8Xwq9LtGZNviY0DTxPSS82/07fTtvJK9hx2CAqaxevbA== X-Received: by 2002:ac8:4e8d:0:b0:3b8:5f47:aac2 with SMTP id 13-20020ac84e8d000000b003b85f47aac2mr31403790qtp.1.1676049686358; Fri, 10 Feb 2023 09:21:26 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-56-70-30-145-63.dsl.bell.ca. [70.30.145.63]) by smtp.gmail.com with ESMTPSA id z5-20020a379705000000b00705cef9b84asm3821465qkd.131.2023.02.10.09.21.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 09:21:25 -0800 (PST) Date: Fri, 10 Feb 2023 12:21:24 -0500 From: Peter Xu To: Leonardo Bras Cc: Juan Quintela , "Dr. David Alan Gilbert" , qemu-devel@nongnu.org Subject: Re: [PATCH v1 3/4] migration/multifd: Join all multifd threads in order to avoid leaks Message-ID: References: <20230210063630.532185-1-leobras@redhat.com> <20230210063630.532185-3-leobras@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230210063630.532185-3-leobras@redhat.com> Received-SPF: pass client-ip=170.10.129.124; envelope-from=peterx@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, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Fri, Feb 10, 2023 at 03:36:30AM -0300, Leonardo Bras wrote: > Current approach will only join threads that are still running. > > For the threads not joined, resources or private memory are always kept in > the process space and never reclaimed before process end, and this risks > serious memory leaks. > > This should usually not represent a big problem, since multifd migration > is usually just ran at most a few times, and after it succeeds there is > not much to be done before exiting the process. > > Yet still, it should not hurt performance to join all of them. > > Signed-off-by: Leonardo Bras Reviewed-by: Peter Xu -- Peter Xu