Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4116448pxj; Tue, 25 May 2021 00:23:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqKTs7yaaTcfPGFMrCwtlV/fB1qbhQHLiTbqrYq5bzTbh6xJLC49ESNoSZyh+nlgNn6yx2 X-Received: by 2002:a92:c790:: with SMTP id c16mr39541ilk.272.1621927428051; Tue, 25 May 2021 00:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621927428; cv=none; d=google.com; s=arc-20160816; b=G5qUIn51kbmLEMBUkEC07mf80tjcrwq2BdzZ8tIm9/3z8bpnMzeQM/Lrzl9CL5Pb77 OCT/K3rAa2izFlC0QhR9/27InNSOjpNvGGitrTw97nXsj4DK5Gfa8RaglBhBHprA68Jq vPU136gfW/+NEULPhwFbBTcW69M5IcXxaGWQK/q7gHuInobccD0vp0hIB38Ae0IKXqtF vD/iCOXY3R9CskIqdnmTYS9iUsSaLaL7mTlxaXcgVjpQKy1E6BLeovc5D03ByUTzDXjg nnvZtRtYGk+asyxQjRqbrtvBT2FBZzwKHqlK08WFZ5kSwD2Uys9cg9LBKFLdjCBB4izU TE1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=h+A+HfSpXZqAH5SCxE7ycsL7iyfz3fycevoSOlmzgN8=; b=vRyjdHxSSVkv0A7JIi8RndPRGo9Pi5R3I806mtYF8LSULByBoYF3MeuwywXqFERAic 26ZYWDVWKGrp1AfXzM2q+8MSbNY/vjPSWOKBCCfx1rtolTa4ZQwzxjCSWNKBBoklyz4K BF/yHTzlKHr18juTXTcnSxaZGs7B8BdW6YhGUsg2uu0z6dV4IeuYHTeDUrIm1QLX5h// iCttVnCFR0qWeXtkOM4Gg0+0QSZBB1caOzx0RfcbtAubsdJsed1ZugkeP7Mi1f/Pk5qn wqzzWQq2uVC1MV44kS+MHaI1NDnUIbYw/MBbPIBlMAIJL0Uly/XjgfnsuNj12w0kbs9X ZFjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hPIlwJnr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i17si16679046jar.93.2021.05.25.00.23.35; Tue, 25 May 2021 00:23:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hPIlwJnr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231539AbhEYHYX (ORCPT + 99 others); Tue, 25 May 2021 03:24:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33490 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbhEYHYX (ORCPT ); Tue, 25 May 2021 03:24:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621927374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h+A+HfSpXZqAH5SCxE7ycsL7iyfz3fycevoSOlmzgN8=; b=hPIlwJnriI/zg+v9A0OywrYi2fTIyrS1r/0LoSdtabPnIjRIOLorK1RhGUIJOhw9ttQW0Q gWRklfXTN/mNO4aJT11whoguIWvZqsMwn7ZwohcAw8uE6s9Vfl1EQ/Wld6Z2DX9iv9/9zY RWvqvhPBZUAEVVp2wixIKXeMw+NydQg= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-525-AuD0aaVHNCuC-VgHv9ittA-1; Tue, 25 May 2021 03:22:51 -0400 X-MC-Unique: AuD0aaVHNCuC-VgHv9ittA-1 Received: by mail-ed1-f69.google.com with SMTP id i3-20020aa7dd030000b029038ce772ffe4so16986435edv.12 for ; Tue, 25 May 2021 00:22:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=h+A+HfSpXZqAH5SCxE7ycsL7iyfz3fycevoSOlmzgN8=; b=fZSHLP5Pq/JrO4dygrSrXaamorVUHe8M5H6NWqtDb7nlQQemR8opQI5DwjzmMBEWOl ChOzJ4N5h5Dks6swYnDFlFfXV3iSCkxDR0PeENOlQxnPVb0z9RodO/CaM5Y6MRdr+UqZ /S4QIhrIlVnSgLANKGVDR5/hy91JJFkhQHsd68Ad98hhUtO+XB7awncmrxCe6JpzOwJf YcXTaRCnnmmdtkVBOj/eDTNPGZiCMnCNb13XbxYDuIjCdnsoer6APeYZwKbF7p7jaPeJ +CUDsmExeh+BE6J2oex/EtoBKpzUpZHWOMXRgWPRaf9+eqnK0CMDZ+ygMQ9V/J0ojr+9 TjFQ== X-Gm-Message-State: AOAM533MQKynUl+9IebrXPCVk+1M3wJtTwHAxcSYcIGRQ+r5PY7X6aQd GDgqphjeb2EWGVc+AkDaGFjw5s6FHB4GZt3h6PveapzGUdQKZ3sEoeUOMevUFQM3WKk1vAL/yjS BmWPJPcWS33dCyTTzJS1i4zZK X-Received: by 2002:a50:8fe6:: with SMTP id y93mr29866813edy.224.1621927369844; Tue, 25 May 2021 00:22:49 -0700 (PDT) X-Received: by 2002:a50:8fe6:: with SMTP id y93mr29866806edy.224.1621927369711; Tue, 25 May 2021 00:22:49 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g10sm8661205ejd.109.2021.05.25.00.22.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 May 2021 00:22:49 -0700 (PDT) To: Christoph Hellwig , Stefan Hajnoczi Cc: virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Wang , Jens Axboe , slp@redhat.com, sgarzare@redhat.com, "Michael S. Tsirkin" References: <20210520141305.355961-1-stefanha@redhat.com> <20210520141305.355961-4-stefanha@redhat.com> <20210524145928.GA3873@lst.de> From: Paolo Bonzini Subject: Re: [PATCH 3/3] virtio_blk: implement blk_mq_ops->poll() Message-ID: <7cc7f19b-34b3-1501-898d-3f41e047d766@redhat.com> Date: Tue, 25 May 2021 09:22:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210524145928.GA3873@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/05/21 16:59, Christoph Hellwig wrote: > On Thu, May 20, 2021 at 03:13:05PM +0100, Stefan Hajnoczi wrote: >> Possible drawbacks of this approach: >> >> - Hardware virtio_blk implementations may find virtqueue_disable_cb() >> expensive since it requires DMA. If such devices become popular then >> the virtio_blk driver could use a similar approach to NVMe when >> VIRTIO_F_ACCESS_PLATFORM is detected in the future. >> >> - If a blk_poll() thread is descheduled it not only hurts polling >> performance but also delays completion of non-REQ_HIPRI requests on >> that virtqueue since vq notifications are disabled. > > Yes, I think this is a dangerous configuration. What argument exists > again just using dedicated poll queues? There isn't an equivalent of the admin queue in virtio-blk, which would allow the guest to configure the desired number of poll queues. The number of queues is fixed. Could the blk_poll() thread use preempt notifiers to enable/disable callbacks, for example using two new .poll_start and .end_poll callbacks to struct blk_mq_ops? Paolo