Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752152AbcKYFhW (ORCPT ); Fri, 25 Nov 2016 00:37:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57956 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbcKYFhO (ORCPT ); Fri, 25 Nov 2016 00:37:14 -0500 Subject: Re: [PATCH net-next] virtio-net: enable multiqueue by default To: "Michael S. Tsirkin" References: <1480048646-17536-1-git-send-email-jasowang@redhat.com> <20161125064201-mutt-send-email-mst@kernel.org> Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Hannes Frederic Sowa , Neil Horman , Jeremy Eder , Marko Myllynen , Maxime Coquelin From: Jason Wang Message-ID: <8e2080e3-a299-10e5-aca3-7c9d723d313c@redhat.com> Date: Fri, 25 Nov 2016 13:36:42 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161125064201-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 25 Nov 2016 05:36:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1622 Lines: 38 On 2016年11月25日 12:43, Michael S. Tsirkin wrote: > 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? Not sure I get the point, do you mean adding get/put_online_cpus()? But is it a real bug? We don't do any cpu specific things so I believe it's not necessary (unless we want to keep #queues == #vcpus magically but I don't think so). Admin need to re-configure #queues after cpu hotplug if they wish. Thanks