From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B1E5C433F5 for ; Sun, 5 Sep 2021 10:19:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2760D60FBF for ; Sun, 5 Sep 2021 10:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237643AbhIEKU0 (ORCPT ); Sun, 5 Sep 2021 06:20:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:52950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237479AbhIEKUZ (ORCPT ); Sun, 5 Sep 2021 06:20:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BFD6460F6D; Sun, 5 Sep 2021 10:19:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630837162; bh=/Jh57FDF7CrbtrzmZhhQAoJJIYs9XIm6zMIp6uc03I4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LGOkSlYsfjfYCzvNWDsAXLFUTw4MXHcAbPPJaSS6T+C/zPFCmoGDJH4FSADcHgtN2 jdLnZ1ZQmAUbB7IzaPrncqKD63Rzdy38Otwwlll5450iVoie0mONxCasnXVvqAbPZJ 6wUvZCNOruamFIzSxZ8w6SMJtUM0HWNW6NjlfcDSuJAYryyutEq9sKZ6lVpeqQ5jTM 0the62IXiYWnm7XKKsPeZIUoDH+JYhVig8h+MotCgRGTE01Fh/gAcGXTEMCURvgyCE Am+FNJdz/WZd6CZaDXhs7Rx+995i+f5hVXxDDNkKJaviTTGvUdrPQg9kuMn0wY+XDa Cpgts6xLPHsCA== Date: Sun, 5 Sep 2021 13:19:18 +0300 From: Leon Romanovsky To: Max Gurtovoy Cc: Chaitanya Kulkarni , hch@infradead.org, mst@redhat.com, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, stefanha@redhat.com, israelr@nvidia.com, nitzanc@nvidia.com, oren@nvidia.com, linux-block@vger.kernel.org, axboe@kernel.dk Subject: Re: [PATCH v3 1/1] virtio-blk: add num_request_queues module parameter Message-ID: References: <20210902204622.54354-1-mgurtovoy@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Sun, Sep 05, 2021 at 12:19:09PM +0300, Max Gurtovoy wrote: > > On 9/5/2021 11:49 AM, Chaitanya Kulkarni wrote: > > > > On 9/5/2021 12:46 AM, Leon Romanovsky wrote: > > > > +static unsigned int num_request_queues; > > > > +module_param_cb(num_request_queues, &queue_count_ops, > > > > &num_request_queues, > > > > +        0644); > > > > +MODULE_PARM_DESC(num_request_queues, > > > > +         "Number of request queues to use for blk device. > > > > Should > 0"); > > > > + > > > Won't it limit all virtio block devices to the same limit? > > > > > > It is very common to see multiple virtio-blk devices on the same system > > > and they probably need different limits. > > > > > > Thanks > > > > > > Without looking into the code, that can be done adding a configfs > > > > interface and overriding a global value (module param) when it is set > > from > > > > configfs. > > > > > You have many ways to overcome this issue. > > For example: > > # ls -l /sys/block/vda/mq/ > drwxr-xr-x 18 root root 0 Sep  5 12:14 0 > drwxr-xr-x 18 root root 0 Sep  5 12:14 1 > drwxr-xr-x 18 root root 0 Sep  5 12:14 2 > drwxr-xr-x 18 root root 0 Sep  5 12:14 3 > > # echo virtio0 > /sys/bus/virtio/drivers/virtio_blk/unbind > > # echo 8 > /sys/module/virtio_blk/parameters/num_request_queues This is global to all virtio-blk devices. > > # echo virtio0 > /sys/bus/virtio/drivers/virtio_blk/bind > > # ls -l /sys/block/vda/mq/ > drwxr-xr-x 10 root root 0 Sep  5 12:17 0 > drwxr-xr-x 10 root root 0 Sep  5 12:17 1 > drwxr-xr-x 10 root root 0 Sep  5 12:17 2 > drwxr-xr-x 10 root root 0 Sep  5 12:17 3 > drwxr-xr-x 10 root root 0 Sep  5 12:17 4 > drwxr-xr-x 10 root root 0 Sep  5 12:17 5 > drwxr-xr-x 10 root root 0 Sep  5 12:17 6 > drwxr-xr-x 10 root root 0 Sep  5 12:17 7 > > -Max. > >