Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3506036imb; Tue, 5 Mar 2019 11:05:06 -0800 (PST) X-Google-Smtp-Source: APXvYqyLfX1QGe+wE7dtDK13ZJ3ZLTqWif0yi8tJg7Np+cacK4gaO5TBVNA5MNw5ZKazh0Vqalvr X-Received: by 2002:aa7:9289:: with SMTP id j9mr3387968pfa.130.1551812706467; Tue, 05 Mar 2019 11:05:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551812706; cv=none; d=google.com; s=arc-20160816; b=yeIU9B3lnxixqR2RVAJ7FYL8VJgZSXPcScado3omc47HdkCfX1xi1FU1F8zVGW1zjV Q2rvuvEMbLGzNmhAnEERVT3GzJVL2ZTg3w6jifNxdcLO0l+BZJyTFDa6C1TfoT9ujrDg nllze1/lMrKrDLtcPDm/VwGddbsZYMgVneDqS6ZWVo9sZkiFwjs/IQkYfQzxcxIjrKIM OojnPEBJOHGNOgvQhzyiuuDeM8LKrhbnvop+ua2NIKODXzNn4Iuoqd11TOF9+d5OF7Jz 77kWMmOW02e3Gk9IG9256zEJnW7hKhZ5P+e9cCWEm41948Fe6SFd7TQcvYZLpeglQjjv IEww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Xqn+Yf+5gP/Zaqja+Mz3g2jhch0LiFfd+n+wsWAt/6A=; b=mCLQpJT+KQ5ejHzm75N12kLWF6GPBshSjLBUizlKP1jvqFYPK0UwtQa87ieNwIAp2T jc3xTzvSj5ZTlHcFQsDG/h9clvgSmwgfaJKMVUDj48//gF7bnomQQA1XMQbdjQmN08O/ 8YGmr2heFgsKmlOFL1OS/K22DbYjAA3QAXduE60WIds7zmyROr4+SBELvwEvDNBsCDMA fFZHt4I84WL0ZBA9/7gwyHvqoyzIIZnhVyyi0G7/Jlg3E/5f2hY8WTf+5ZbvBfVadA+C ssVV63ZIuyFk/USBI7NWOXoilZOP3EfinZ7r5bguroZkVz8OYZT4DUJZgQHWH7KeH1pi UGCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=KGLPKqPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9si8829900pgt.73.2019.03.05.11.04.50; Tue, 05 Mar 2019 11:05:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=KGLPKqPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727089AbfCES1g (ORCPT + 99 others); Tue, 5 Mar 2019 13:27:36 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:36715 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbfCES1g (ORCPT ); Tue, 5 Mar 2019 13:27:36 -0500 Received: by mail-pf1-f194.google.com with SMTP id n22so6338072pfa.3 for ; Tue, 05 Mar 2019 10:27:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Xqn+Yf+5gP/Zaqja+Mz3g2jhch0LiFfd+n+wsWAt/6A=; b=KGLPKqPpx9wi4Hrhx6oW22RKrj95iWOfLj1SKFe/bPEgs8Bxtee/rRMVHbFhxJKiFR 25vweCDQ56eWUv1tYK34TUXim4jCfODDjCzD/dqes4fg0+7iwjn4EOHUwLCj0e9QrsT5 bPy9Thrq72xihaScYweclCNhdvZpOZBm+Cu4bbD94LRx9i86cyQkA5ZKdPL0MBfLGyrT dqHL0szhZmNjq1B0I2awgQjje6desCrJf9TWiV2de0lZu5QUKNhQjTFQFE/kjAB9O2xH 5dCPg5SA7A6u/Jm4Gtee4TFePmQsEuwEkArF37+qNBUGxV/5sTivu7ILbHlvC2BNulmA 4NPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Xqn+Yf+5gP/Zaqja+Mz3g2jhch0LiFfd+n+wsWAt/6A=; b=CnRN9w37neOJYQyy74ofnmpEpznigtwbZgJ08fNeNA7Ciam4P8carslQxByWmEKvqW myi09ePCh5ZdLQzMQsGUUHLt5jOmcgESsryFzJW+uzXxXvTLyWihEiVzBgx0MqWWN6sj 95Zy4by5Koht/qZHjagDs1to4/vh1K7sdbfBC5uLs0pX2CKnGZ8Dos2883Sy0DTQnrW1 qJuz/7aWH0wKW23EBtCOIiATc0so8vrAvciebhaRPw9w9ZA9zsXg7vTBGH8J3itJ30im OaA7e3sH/O+MOkaNsHE2jir6PpIedxDLLN+gb322CNDVkjxehK/vcmPL4EzXtJkloG4/ ljfQ== X-Gm-Message-State: APjAAAXU0HAIF9att0myjq5yDcvZgUiSFkFpv+fqKPS/gkOZhBnKNOBZ jboI5fX2P0FM2q5t4+VcHlhIGA== X-Received: by 2002:a17:902:ea06:: with SMTP id cu6mr2569398plb.187.1551810455001; Tue, 05 Mar 2019 10:27:35 -0800 (PST) Received: from shemminger-XPS-13-9360 ([167.220.56.187]) by smtp.gmail.com with ESMTPSA id 73sm16653605pga.19.2019.03.05.10.27.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Mar 2019 10:27:34 -0800 (PST) Date: Tue, 5 Mar 2019 10:27:33 -0800 From: Stephen Hemminger To: Dexuan Cui Cc: "lorenzo.pieralisi@arm.com" , "bhelgaas@google.com" , "linux-pci@vger.kernel.org" , KY Srinivasan , Stephen Hemminger , Michael Kelley , Sasha Levin , "linux-hyperv@vger.kernel.org" , Haiyang Zhang , "driverdev-devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" , "jackm@mellanox.com" , "marcelo.cerri@canonical.com" , "olaf@aepfle.de" , "apw@canonical.com" , vkuznets , "jasowang@redhat.com" Subject: Re: [PATCH 0/3] pci-hyperv: fix memory leak and add pci_destroy_slot() Message-ID: <20190305102733.30e25dae@shemminger-XPS-13-9360> In-Reply-To: <20190304213357.16652-1-decui@microsoft.com> References: <20190304213357.16652-1-decui@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 4 Mar 2019 21:34:47 +0000 Dexuan Cui wrote: > Patch #1 fixes a memory leak caused by incorrectly-maintained hpdev->refs. > > Patch #2 and #3 make sure the "slot" is removed in all the scenarios. > Without them, in the quick hot-add/hot-remove test, systemd-dev may easily > crash when trying to access a dangling sys file in /sys/bus/pci/slots/: > "BUG: unable to handle kernel paging request". > > BTW, Patch #2 was posted on Feb 7, 2019, and this is the v2: the change > to hv_eject_device_work() in v1 is removed, as the change is only needed > when we hot-remove the device and remove the pci-hyperv driver at the > same time. It looks more work is required to make this scenaro work > correctly, and since removing the driver is not really a "usual" usage, > we can address this scenario in the future. > > Please review the patchset. > > Dexuan Cui (3): > PCI: hv: Fix a memory leak in hv_eject_device_work() > PCI: hv: Add hv_pci_remove_slots() when we unload the driver > PCI: hv: Add pci_destroy_slot() in pci_devices_present_work(), if > necessary > > drivers/pci/controller/pci-hyperv.c | 23 +++++++++++++++++++++++ > 1 file changed, 23 insertions(+) Thanks for fixing this. Reviewed-by: Stephen Hemminger