Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5313248imu; Sun, 25 Nov 2018 21:25:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/UQ9+6/Ppv2wvollIK+F9uyynoBt6Qr0zb/Hr5haanUwhl3OBbs54dnTsZwuBbavxP9vF2b X-Received: by 2002:a63:d208:: with SMTP id a8mr22986658pgg.77.1543209952363; Sun, 25 Nov 2018 21:25:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543209952; cv=none; d=google.com; s=arc-20160816; b=cmythrDEpxqUwERbLn1o5WdYwdvdYcz1tE8Xfdg30I3rsUtN/ev/NQdtw8Snc8f8Iq XNx5DN4wmNG1Jc48Hq28ZXcU39WYWx54u4xQUuoGXGJTLmY8c52UzPHYiIp+vLyaCs1b VEcqV7OR5vQg8dl6eE6zAk80mLaUIN5/IojP/nVl8+8+ceiVtOEtFbc8ETIKWfeb/8Ez vyMcThGlpdWDpCzxJ8eDEN3eQBJKrLGQWIpXHbAYNxm4DSTa83AFVLZs4pvJbJLKA3U0 hYv5bQMDfYq2K9trEgVhQzyJ3a5VFjs5JXeDJvjuPiiEPJE+KvoOm8ZuN5xRJ/fRhwrK /Npw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pEdUQj00n0efCQaqoMlT6y/cwIbdN5NH/fB3d2bSFo0=; b=H+eMkd24a+b3saysjsnI5UwZluvVBjZpLybSdRSp6uB1lkuqOyM0hu8kDUvefafBvu fU6sV2Q0fkID7QwMlA8qtFcYK/xgDIFZjhk6eILY9vtt7FM8zbwAWe6RCFNSsJFlMDN+ iADKxEIsplASyNb6XvKSXaLTnE8Idu8BnH2I7mFxS6r6m2ZeOS6uhlmP3d67zuryNVnA pnTsvUE/8H1FRFGTMl8C3rj3dGHPUHpbRHrnv0DbO3LcXHnGh7kB0BXGxAZQYQZKXgm9 lPr9XtkE3kh3nDyb+Qhl9huP56H6eRH2CfjVLL4P7h6qNunQhPfWsaEV2GF3D6rSMH2t xtEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z4VYP4ha; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3si40562407plr.178.2018.11.25.21.25.34; Sun, 25 Nov 2018 21:25:52 -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=@kernel.org header.s=default header.b=Z4VYP4ha; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726209AbeKZQQd (ORCPT + 99 others); Mon, 26 Nov 2018 11:16:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:59286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726145AbeKZQQd (ORCPT ); Mon, 26 Nov 2018 11:16:33 -0500 Received: from localhost (unknown [37.142.5.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B54C820855; Mon, 26 Nov 2018 05:23:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543209816; bh=pEdUQj00n0efCQaqoMlT6y/cwIbdN5NH/fB3d2bSFo0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z4VYP4haTiEdZlh3YUAZIJa6o3spDQlOMBx1KZSAM8q1PoSZhC/zErQ+gBwKdpqrM ozxh0kRHIxRktFV1awwUoC0Dz8elBqidl+z5PELuDZyK7gDs+mFoBDUFHmVlNQZ1Si n/CI13xA01e7/lPz6HkPyxr4lglQHDH3iAByr0TU= Date: Mon, 26 Nov 2018 00:23:31 -0500 From: Sasha Levin To: kys@microsoft.com Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, sthemmin@microsoft.com, Michael.H.Kelley@microsoft.com, vkuznets@redhat.com, Dexuan Cui , stable@vger.kernel.org, Haiyang Zhang Subject: Re: [PATCH 2/2] Drivers: hv: vmbus: offload the handling of channels to two workqueues Message-ID: <20181126052331.GA34679@sasha-vm> References: <20181126022821.11269-1-kys@linuxonhyperv.com> <20181126022958.11320-1-kys@linuxonhyperv.com> <20181126022958.11320-2-kys@linuxonhyperv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20181126022958.11320-2-kys@linuxonhyperv.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 26, 2018 at 02:29:57AM +0000, kys@linuxonhyperv.com wrote: >From: Dexuan Cui > >vmbus_process_offer() mustn't call channel->sc_creation_callback() >directly for sub-channels, because sc_creation_callback() -> >vmbus_open() may never get the host's response to the >OPEN_CHANNEL message (the host may rescind a channel at any time, >e.g. in the case of hot removing a NIC), and vmbus_onoffer_rescind() >may not wake up the vmbus_open() as it's blocked due to a non-zero >vmbus_connection.offer_in_progress, and finally we have a deadlock. > >The above is also true for primary channels, if the related device >drivers use sync probing mode by default. > >And, usually the handling of primary channels and sub-channels can >depend on each other, so we should offload them to different >workqueues to avoid possible deadlock, e.g. in sync-probing mode, >NIC1's netvsc_subchan_work() can race with NIC2's netvsc_probe() -> >rtnl_lock(), and causes deadlock: the former gets the rtnl_lock >and waits for all the sub-channels to appear, but the latter >can't get the rtnl_lock and this blocks the handling of sub-channels. > >The patch can fix the multiple-NIC deadlock described above for >v3.x kernels (e.g. RHEL 7.x) which don't support async-probing >of devices, and v4.4, v4.9, v4.14 and v4.18 which support async-probing >but don't enable async-probing for Hyper-V drivers (yet). > >The patch can also fix the hang issue in sub-channel's handling described >above for all versions of kernels, including v4.19 and v4.20-rc3. > >So the patch should be applied to all the existing kernels. > >Fixes: 8195b1396ec8 ("hv_netvsc: fix deadlock on hotplug") >Cc: stable@vger.kernel.org >Cc: Stephen Hemminger >Cc: K. Y. Srinivasan >Cc: Haiyang Zhang >Signed-off-by: Dexuan Cui >Signed-off-by: K. Y. Srinivasan This patch doesn't apply on next/linus/char-misc; there seems to be a missing patch that touches vmbus_process_offer() which isn't a part of this series. -- Thanks, Sasha