Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933271AbcK1QjL (ORCPT ); Mon, 28 Nov 2016 11:39:11 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:36640 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933087AbcK1QjC (ORCPT ); Mon, 28 Nov 2016 11:39:02 -0500 Subject: Re: [PATCH net-next] virtio-net: enable multiqueue by default To: David Miller , mst@redhat.com References: <1480048646-17536-1-git-send-email-jasowang@redhat.com> <20161125064201-mutt-send-email-mst@kernel.org> <20161128.112823.2263657283777032168.davem@davemloft.net> Cc: jasowang@redhat.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, hannes@redhat.com, nhorman@redhat.com, jeder@redhat.com, myllynen@redhat.com, maxime.coquelin@redhat.com From: John Fastabend Message-ID: <583C5D8A.2030307@gmail.com> Date: Mon, 28 Nov 2016 08:38:34 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20161128.112823.2263657283777032168.davem@davemloft.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2096 Lines: 51 On 16-11-28 08:28 AM, David Miller wrote: > From: "Michael S. Tsirkin" > Date: Fri, 25 Nov 2016 06:43:08 +0200 > >> On Fri, Nov 25, 2016 at 12:37:26PM +0800, Jason Wang wrote: >>> We use single queue even if multiqueue is enabled and let admin to >>> enable it through ethtool later. This is used to avoid possible >>> regression (small packet TCP stream transmission). But looks like an >>> overkill since: >>> >>> - single queue user can disable multiqueue when launching qemu >>> - brings extra troubles for the management since it needs extra admin >>> tool in guest to enable multiqueue >>> - multiqueue performs much better than single queue in most of the >>> cases >>> >>> So this patch enables multiqueue by default: if #queues is less than or >>> equal to #vcpu, enable as much as queue pairs; if #queues is greater >>> than #vcpu, enable #vcpu queue pairs. >>> >>> Cc: Hannes Frederic Sowa >>> Cc: Michael S. Tsirkin >>> Cc: Neil Horman >>> Cc: Jeremy Eder >>> Cc: Marko Myllynen >>> Cc: Maxime Coquelin >>> Signed-off-by: Jason Wang >> >> OK at some level but all uses of num_online_cpus() >> like this are racy versus hotplug. >> I know we already have this bug but shouldn't we fix it >> before we add more? > > This is more being used like a heuristic in this scenerio, and in > fact I would say one would keep the code this way even once proper > hotplug handlers are installed to adjust the queued dynamically if > there is a desired (which is also not necessarily the case). > > I really don't think this change should be held on up on this issue. > So can we please make some forward progress here? > > Thanks. > Also it might be worth noting all the other multiqueue capable ethernet devices I checked use some variation of this heuristic. Typically related to what other features are enables RSS, DCB, etc. So it at least should be familiar to folks who do hotplug cpus on bare metal boxes. .John