Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4757997ioo; Tue, 31 May 2022 10:53:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweNA5WrE2rOwXPwxq6QiXS6esunojHrpFCJ9VDcIrePlVvwd1KdB6+MsRP3LY+9qbXANoJ X-Received: by 2002:a17:902:cf4b:b0:163:bfed:8af1 with SMTP id e11-20020a170902cf4b00b00163bfed8af1mr14887608plg.68.1654019630732; Tue, 31 May 2022 10:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654019630; cv=none; d=google.com; s=arc-20160816; b=xGBqk5VWoCAAPYkRJoguOOhGOvR5YztocAR+zztk+WpdgKeca4X1GZQ4etDC2v07QQ 31oL4aLlyAjoWtXGN9FHR6l1cH1IW7Hq7CNmnVau5/og71ut5ERT7IP/RND0fZF7JPPQ yBXhr0vMjE0RlRWs9aPqRw9k0Fv9gRzqvIGEdKt0uoJEbaKWS/0plpZZVSongqddibUz ZjXQNv+hKUcqvicSzWvGVILDkAkZcyV4wKsGzaX8UNk9N7yCDjLntvZGiBBQWwan5JI9 9Sw4frdcw9xLb26pfdZ4Ow3khcPWctz3MF5oFyiFmhkueaF19l6hlYqYCts49JbYlITX KErQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=P69t0B2Jaz9Oq6WPSoVJEBxSVVjv0VZ1WwYPpxNmfU4=; b=ztpUn1S9vYkxfSJruhdsBJSER51dBw0oVIjVxLekyAnNFTsQU13PKj7zt5LAm9Jik/ iFw5lfSUVZ/Z29b79JvAd/bZSEYEnQuWToQG4cbku86GLdlytwoyk9E9e/tdio0cvga7 AWxF48J1tKJQB7jDbkX28u1QOkoD82xPWaoCL0KSsbr0S04HKa6bBanArXqI6QJHjYlv L1W98QTuK9c7+9NPLPfTKFu49uCD3oLyqCzpNI0V10zEoXk7o+VwG3xRzbXWawLylQ0K lblUYDhXYH2HW+V7A+0cUWY+Nnl7PWk8k5GLFc6+KKxBW9ytZceijzfeoFz62xrixeCt LTyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=uOnnMt6O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k1-20020a637b41000000b003fc19708048si9926070pgn.318.2022.05.31.10.53.38; Tue, 31 May 2022 10:53:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=uOnnMt6O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346615AbiEaRli (ORCPT + 99 others); Tue, 31 May 2022 13:41:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238878AbiEaRlh (ORCPT ); Tue, 31 May 2022 13:41:37 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 232C462BE5 for ; Tue, 31 May 2022 10:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1654018896; x=1685554896; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=P69t0B2Jaz9Oq6WPSoVJEBxSVVjv0VZ1WwYPpxNmfU4=; b=uOnnMt6OkepmgiwxZf95HL2yJ7nGg//ecPAl2KI7wSich3ehwo0Ga8X2 Ls5QWFa5smLnt9CWcnr0x5Y3q0g/yVjg/tyZlg6uKG1FQ3DsxBS86JpCI tTKFLESBzldZn81bD7XCKrBh2ee5nUoGlFKGL3L5T0+cfnrjZRKAlAoH3 M=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-02.qualcomm.com with ESMTP; 31 May 2022 10:41:35 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 10:41:35 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 31 May 2022 10:41:34 -0700 Received: from qian (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 31 May 2022 10:41:33 -0700 Date: Tue, 31 May 2022 13:41:31 -0400 From: Qian Cai To: Will Deacon CC: Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , , , Subject: Re: [PATCH] KVM: arm64: Fix memory leaks from stage2 pagetable Message-ID: References: <20220526203956.143873-1-quic_qiancai@quicinc.com> <20220531165710.GB25631@willie-the-truck> <20220531170157.GC25631@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220531170157.GC25631@willie-the-truck> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 31, 2022 at 06:01:58PM +0100, Will Deacon wrote: > Have you spotted any pattern for when the leak occurs? How are you > terminating the guest? It just to send a SIGTERM to the qemu-system-aarch64 process. Origially, right after sending the signal, it will remove_id/unbind from the vfio-pci and then bind to the original (ixgbe) driver. However, since the process might take a while to clean off itself, the bind might failed with -EBUSY. I could reproduce it a few times one day while was unable to do so some other days. Later, we changed the code to make sure the process is disappeard first and then remove_id/bind/unbind. Apparently, it make harder to reproduce if not totally eliminate it.