Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp338000imu; Mon, 26 Nov 2018 11:36:06 -0800 (PST) X-Google-Smtp-Source: AJdET5fz44Q6mAn0AkYdzF1tSHe9IHAt7fW1sCXV5x5ewYGc+p/BvNgaLDQQ0RIifDk153KjUiEb X-Received: by 2002:a62:8c11:: with SMTP id m17mr29529521pfd.224.1543260966901; Mon, 26 Nov 2018 11:36:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543260966; cv=none; d=google.com; s=arc-20160816; b=DTDxhfwjTjuvDYcNeNOkOh4gFU4ua6QAIXC1Aq04OMMpgczWChBQBfaDB5enBENUB4 fUgI51GpaoyPC5B3WHlCH40VJ/RTEAbPum5TVEwL9I0KO2mB8dE/FmI8+QrsyaiTrSmx RwaLH0Q75TNFAVrsNjmFn27/yopTvtErn3Z53lVQGSE60zjBYHhCUjkFPEgkLuo9+tE1 1+0u80Uaz7NsSFleIE5DgANzyu7Xt92g2JBY6MBacMbbgjhW8vFbWjpbD3eog5QZ72Ty Ad/ReFvgCrddo+tDet2KoXNGKWuUM4xH4HtcN3PFaJxAcFfIo7H0RmCUWsAVNPhyrJ1m Zu+w== 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=IQ1zqeih/i0NJtPy9Jm0U96oVfA2Bf/pZMHF2r+NXXw=; b=kia1og06nebpUxi/hrjGAz0cjixXJh8ENbu6inLv2ptCYD/hCF1jgbJppUQ8OzC5BP n6hpD+mLZ7k3xsSFSK1OQpvZYzDzmfaTMT3RlF7e7yxb3lDQQzLVoCt0b1B4/kwS+lK3 TpwdImUlb/7Xcnf7ZzhlVTtMODujp2cTCCv9QXYeymc6zY9WSxrmPKDKx7NaZ1GvPbeG 799HhYaCv49siLocjXISKyWBHUqzAfA6wTKY2IT+bgYwYhi99T2xnEeRUg8DnRl8cUqu 4eF7+EH1XMIfoSVM6931/Svl7oSH/utrrpTSRLUgFt2x/mTlVFF/Jr7xUBwnHyGlirmy pYZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AX1JRh3h; 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 20si1001560pgt.469.2018.11.26.11.35.41; Mon, 26 Nov 2018 11:36: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=@kernel.org header.s=default header.b=AX1JRh3h; 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 S1726665AbeK0GaO (ORCPT + 99 others); Tue, 27 Nov 2018 01:30:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:51472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbeK0GaO (ORCPT ); Tue, 27 Nov 2018 01:30:14 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 555B9205C9; Mon, 26 Nov 2018 19:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543260905; bh=igG4ljGHCeXB0Sb4i3toRXbFFJ4AVTRXUDJ6Jjt8esQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AX1JRh3hANqNu+XKGfFHaXe5l/ZxmhqgKCHX6rQ4ZJj8p3sSSfSdHI6Cq491MMjRp m82HckI2I5VMUl67RgZmo3cJbtQJS7IOlXdWhCOaqVuy5FgZfv+wb17pmqpAF92WuM Hlqn9KhyWQMowhZcA/K+L61IvkpX3Y8KQpMmZY5w= Date: Mon, 26 Nov 2018 20:35:03 +0100 From: Greg KH To: kys@microsoft.com Cc: 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, Haiyang Zhang , stable@vger.kernel.org Subject: Re: [PATCH 2/2] Drivers: hv: vmbus: offload the handling of channels to two workqueues Message-ID: <20181126193503.GA25649@kroah.com> 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 Content-Disposition: inline In-Reply-To: <20181126022958.11320-2-kys@linuxonhyperv.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 > --- > drivers/hv/channel_mgmt.c | 188 +++++++++++++++++++++++++------------- > drivers/hv/connection.c | 24 ++++- > drivers/hv/hyperv_vmbus.h | 7 ++ > include/linux/hyperv.h | 7 ++ > 4 files changed, 161 insertions(+), 65 deletions(-) As Sasha pointed out, this patch does not even apply :(