Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753465AbdHIQuQ (ORCPT ); Wed, 9 Aug 2017 12:50:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33046 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125AbdHIQuN (ORCPT ); Wed, 9 Aug 2017 12:50:13 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 29A56E1241 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com Subject: Re: Increased memory usage with scsi-mq To: Christoph Hellwig Cc: "Richard W.M. Jones" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, "Martin K. Petersen" References: <20170804210035.GA10017@redhat.com> <20170805084436.GA14264@lst.de> <20170805092704.GD20914@redhat.com> <20170805133954.GA17694@lst.de> <20170805155103.GE20914@redhat.com> <20170807122701.GH20914@redhat.com> <20170809160111.GC3141@lst.de> From: Paolo Bonzini Message-ID: <3b96a6c9-c5af-c50d-ba02-59863d1ee5f2@redhat.com> Date: Wed, 9 Aug 2017 18:50:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170809160111.GC3141@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 09 Aug 2017 16:50:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 660 Lines: 14 On 09/08/2017 18:01, Christoph Hellwig wrote: > On Mon, Aug 07, 2017 at 03:07:48PM +0200, Paolo Bonzini wrote: >> can_queue should depend on the virtqueue size, which unfortunately can >> vary for each virtio-scsi device in theory. The virtqueue size is >> retrieved by drivers/virtio prior to calling vring_create_virtqueue, and >> in QEMU it is the second argument to virtio_add_queue. > > Why is that unfortunate? We don't even have to set can_queue in > the host template, we can dynamically set it on per-host basis. Ah, cool, I thought allocations based on can_queue happened already in scsi_host_alloc, but they happen at scsi_add_host time. Paolo