Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2153949imu; Wed, 28 Nov 2018 23:45:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/UUxgWPNV5AVuyisZYDFYcvkwDC8K6FwHpJbOLYp/ILn/WkVHEkN10CnEl+WemnVKtLcMxY X-Received: by 2002:a63:db02:: with SMTP id e2mr341768pgg.419.1543477534116; Wed, 28 Nov 2018 23:45:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543477534; cv=none; d=google.com; s=arc-20160816; b=dtRSTCO0Rq2yNBsie96BDF5klQgM+dLD4izCE3EUxIk/wPjvRTlKQjoVz1UkGGrPol ptf0y5w+0tvVoDAesFa+O6swt0mECDTZU/5+N/9mw2820nBBUzLgrvT4uuKkhGpoGmCy bl5SygcVQ28HiOHw7bc2QloZhzXu5pYoayPC0jVw6hjRStrSCAEjnT1FBcWckxdwtrDZ WzRinX/YckggKVqc3ILgpneTvL/YrN2R1R/xZSjiaUm5OQFTOnEQ/Fnw/dTqJu28HDLK mkLfbLuoStGRilK9uLqfSriyzuJ0KBjST2L8uVu8bh+dKD0rFgE4VtBTNf5ptw0osSQ2 5ZDw== 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=2gIDQ2x2sup55aSGjiE+3alTAEuSd/m1WdiByqzHpj4=; b=RXs6az66V8DoHT+TdohiEXWqk1eF2Ee36FHw4B239bWs4vL4a5nCT7nNARG8dKBmxq 1NbM9eCDl1qL+5CWEiUcBhIMyOauvD3tbmqDxJb/750hQCJTkrU9IXJv4S/cevhZEdyv Z++m+RinLcx+JDLIh18SI9ZKtTdqXO0YgNsSXDwJrrlrNVriWxemoqWpnj1a3I9NwgIS tuFQPd0MV074Qf9G/vfG35eGKBIQYV31Vx3nfO2fTjHtukPs4hyFw0ACB3jKh0hyXk7A 9BpctvgmejkkMwu4HT5xJkO0XTaqRs2IIbVYBsQhQbLSmPZMXsFPCRfc+3HjKOA0j6KH 4Kuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OIgY7meO; 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 d3si1246292pgu.437.2018.11.28.23.45.18; Wed, 28 Nov 2018 23:45:34 -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=OIgY7meO; 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 S1726841AbeK2StF (ORCPT + 99 others); Thu, 29 Nov 2018 13:49:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:53316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbeK2StE (ORCPT ); Thu, 29 Nov 2018 13:49:04 -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 42E17206B6; Thu, 29 Nov 2018 07:44:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543477477; bh=unDgugLrARl6GVyd39VaDd0XC9myoOTL4e1ztJWYp5k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OIgY7meOjMVPofwUGgYjSvmMyqJA5H3qeGzrXbPf2NyAA+5nWVpZRKZ1OASDa0eXz i5bCE2TFvD1bXC66bvDiydPRa6KX1VgkK/CyGL7CExo5ebc85rp+KAHym94m1og+OD gyRCzgj4WntSnh3dbNnd5VL6qtA6reGcEaRkYsH4= Date: Thu, 29 Nov 2018 08:44:35 +0100 From: "gregkh@linuxfoundation.org" To: Dexuan Cui Cc: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "apw@canonical.com" , vkuznets , "olaf@aepfle.de" , "jasowang@redhat.com" , Michael Kelley Subject: Re: [PATCH] [repost] Drivers: hv: vmbus: Offload the handling of channels to two workqueues Message-ID: <20181129074435.GA12347@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.0 (2018-11-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 04:36:43AM +0000, Dexuan Cui wrote: > > 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-rc4. > > So, actually the patch should be applied to all the existing kernels, > not only the kernels that have 8195b1396ec8. > > 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 > --- > > There is no change in this repost. I just rebased this patch to today's > char-misc's char-misc-next branch. Previously KY posted the patch with his > Signed-off-by (which is kept in this repost), but there was a conflict issue. > > Note: the patch can't be cleanly applied to char-misc's char-misc-linus branch -- > to do that, we need to cherry-pick the supporting patch first: > 4d3c5c69191f ("Drivers: hv: vmbus: Remove the useless API vmbus_get_outgoing_channel()") That is not going to work for the obvious reason that this dependant patch is not going to be merged into 4.20-final. So, what do you expect us to do here? The only way this can be accepted is to have it go into my -next branch, which means it will show up in 4.21-rc1, is that ok? But then, if that happens, it will fail to apply to any stable tree for 4.20 and older, like you are asking it to be done for. So what do you expect me to do here with this? totally confused, greg k-h